Merge branch 'graphics' of https://github.com/hansungk/rocket-chip into graphics

This commit is contained in:
Richard Yan
2023-05-02 17:40:08 -07:00
2 changed files with 13 additions and 2 deletions

View File

@@ -28,6 +28,8 @@ module SimMemTrace #(parameter FILENAME = "undefined", NUM_LANES = 4) (
input clock, input clock,
input reset, input reset,
// Chisel module needs to tell Verilog blackbox which cycle to read
input [64-1:0] trace_read_cycle,
// These have to match the IO port name of the Chisel wrapper module. // These have to match the IO port name of the Chisel wrapper module.
input trace_read_ready, input trace_read_ready,
output [NUM_LANES-1:0] trace_read_valid, output [NUM_LANES-1:0] trace_read_valid,
@@ -117,7 +119,7 @@ module SimMemTrace #(parameter FILENAME = "undefined", NUM_LANES = 4) (
// Since parsed results are latched to the output on the next // Since parsed results are latched to the output on the next
// cycle due to staging registers, we need to pass in the next cycle // cycle due to staging registers, we need to pass in the next cycle
// to sync up. // to sync up.
next_cycle_counter, trace_read_cycle, // the left replace next_cycle_counter,
tid, tid,
__in_valid[tid], __in_valid[tid],

View File

@@ -1048,10 +1048,18 @@ class TraceLine extends Bundle with HasTraceLine {
class MemTraceDriverImp(outer: MemTraceDriver, config: CoalescerConfig, traceFile: String) class MemTraceDriverImp(outer: MemTraceDriver, config: CoalescerConfig, traceFile: String)
extends LazyModuleImp(outer) extends LazyModuleImp(outer)
with UnitTestModule { with UnitTestModule {
val globalClkCounter = RegInit(0.U(64.W))
val traceReadCycle = RegInit(0.U(64.W))
globalClkCounter := globalClkCounter + 1.U
traceReadCycle := traceReadCycle + 1.U
val sim = Module(new SimMemTrace(traceFile, config.numLanes)) val sim = Module(new SimMemTrace(traceFile, config.numLanes))
sim.io.clock := clock sim.io.clock := clock
sim.io.reset := reset.asBool sim.io.reset := reset.asBool
sim.io.trace_read.ready := true.B // <FIX ME>, change ready to be base on down stream
sim.io.trace_read.ready := true.B
sim.io.trace_read.cycle := traceReadCycle
// Split output of SimMemTrace, which is flattened across all lanes, // Split output of SimMemTrace, which is flattened across all lanes,
// back to each lane's. // back to each lane's.
@@ -1194,6 +1202,7 @@ class SimMemTrace(filename: String, numLanes: Int)
// Chisel can't interface with Verilog 2D port, so flatten all lanes into // Chisel can't interface with Verilog 2D port, so flatten all lanes into
// single wide 1D array. // single wide 1D array.
// TODO: assumes 64-bit address. // TODO: assumes 64-bit address.
val cycle = Input(UInt(64.W))
val address = Output(UInt((addrW * numLanes).W)) val address = Output(UInt((addrW * numLanes).W))
val is_store = Output(UInt(numLanes.W)) val is_store = Output(UInt(numLanes.W))
val size = Output(UInt((sizeW * numLanes).W)) val size = Output(UInt((sizeW * numLanes).W))