ソースを参照

Change IF to use input signal as PC

sindre-ex2
コミット
75734a9c0a
2個のファイルの変更4行の追加5行の削除
  1. +1
    -1
      src/main/scala/Barriers.scala
  2. +3
    -4
      src/main/scala/IF.scala

+ 1
- 1
src/main/scala/Barriers.scala ファイルの表示

@@ -51,7 +51,7 @@ class IFBundle extends Bundle {
class IFBarrier extends Barrier(new IFBundle) {
out.instruction := barrier(in.instruction, false)
out.PC := barrier(in.PC)
out.next := Mux(freeze, RegNext(in.next), in.next)
out.next := barrier(in.next)
}




+ 3
- 4
src/main/scala/IF.scala ファイルの表示

@@ -23,8 +23,7 @@ class InstructionFetch extends MultiIOModule {
})

val IMEM = Module(new IMEM)
val PC = RegInit(UInt(32.W), 0.U)

val PC = WireInit(UInt(32.W), 0.U)

/**
* Setup. You should not change this code
@@ -32,12 +31,11 @@ class InstructionFetch extends MultiIOModule {
IMEM.testHarness.setupSignals := testHarness.IMEMsetup
testHarness.PC := IMEM.testHarness.requestedAddress


IMEM.io.instructionAddress := PC

PC := io.addr

io.PC := PC
io.PC := RegNext(PC)
io.next := PC + 4.U
io.instruction := IMEM.io.instruction.asTypeOf(new Instruction)

@@ -47,6 +45,7 @@ class InstructionFetch extends MultiIOModule {
*/
when(testHarness.IMEMsetup.setup) {
PC := 0.U
io.next := 0.U
io.instruction := Instruction.NOP
}
}

読み込み中…
キャンセル
保存