Skip to content

Commit

Permalink
[emulator] add probe unit
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Sep 25, 2023
1 parent fd39b62 commit e50b2ce
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions elaborator/src/PerfMonitor.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package elaborate.dpi

import chisel3._

class LoadUnitMonitor extends DPIModule {
override val isImport = true;

val clock = dpiTrigger("clock", Input(Bool()))

val statusIdle = dpiIn("LoadUnitStatusIdle", Input(Bool()))
val writeReadyForLSU = dpiIn("LoadUnitWriteReadyForLSU", Input(Bool()))

override val trigger: String = s"always @(posedge ${clock.name})";
}
9 changes: 9 additions & 0 deletions v/src/lsu/LoadUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import chisel3._
import chisel3.util._
import lsu.LSUBaseStatus
import tilelink.{TLChannelA, TLChannelD}
import chisel3.probe.{Probe, ProbeValue, define}

class cacheLineDequeueBundle(param: MSHRParam) extends Bundle {
val data: UInt = UInt((param.cacheLineSize * 8).W)
Expand Down Expand Up @@ -245,4 +246,12 @@ class LoadUnit(param: MSHRParam) extends StrideBase(param) with LSUPublic {
status.endAddress := ((lsuRequestReg.rs1Data >> param.cacheLineBits).asUInt + cacheLineNumberReg) ##
0.U(param.cacheLineBits.W)
dontTouch(status)

/**
* Probes for fetching internal signals
*/
val probeStatus: LSUBaseStatus = IO(Output(Probe(chiselTypeOf(status))))
define(probeStatus, ProbeValue(status))
val probeWriteReadyForLSU: Bool = IO(Output(Probe(chiselTypeOf(writeReadyForLsu))))
define(probeWriteReadyForLSU, ProbeValue(writeReadyForLsu))
}

0 comments on commit e50b2ce

Please sign in to comment.