|
|
|
@@ -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 |
|
|
|
} |
|
|
|
} |