Skip to content

Commit

Permalink
[ipemu] workaround xprop for DPI
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Jul 29, 2024
1 parent 92e5311 commit 3c5a057
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ipemu/src/TestBench.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,25 @@ class TestBench(generator: SerializableModuleGenerator[T1, T1Parameter])
val writeRd: UInt = UInt(32.W)
val vxsat: UInt = UInt(32.W)
}
// X gated by didIssue
val issue = WireDefault(0.U.asTypeOf(new Issue))
val fence = RegInit(false.B)
val outstanding = RegInit(0.U(4.W))
val doIssue: Bool = dut.io.issue.ready && !fence
outstanding := outstanding + (doIssue && (issue.meta === 1.U)) - dut.io.issue.valid
// used to gate Xprop when DPI hasn't issued yet.
val didIssue = RegInit(false.B)
didIssue := doIssue || didIssue
// TODO: refactor driver to spawn 3 scoreboards for record different retirement.
val t1Probe = probe.read(dut.io.t1Probe)
fence := Mux(doIssue, issue.meta === 2.U, fence && !t1Probe.retireValid && !(outstanding === 0.U))

issue := RawClockedNonVoidFunctionCall("issue_vector_instruction", new Issue)(
clock,
doIssue
issue := Mux(didIssue,
RawClockedNonVoidFunctionCall("issue_vector_instruction", new Issue)(
clock,
doIssue,
),
0.U.asTypeOf(new Issue)
)
dut.io.issue.bits.instruction := issue.instruction
dut.io.issue.bits.rs1Data := issue.src1Data
Expand Down

0 comments on commit 3c5a057

Please sign in to comment.