Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
reconfigure testbench for main with BRAM
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaKarvandi committed Apr 23, 2024
1 parent 0c4edb6 commit f22f6fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
7 changes: 6 additions & 1 deletion sim/hwdbg/DebuggerModuleTestingBRAM/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Makefile

TOPLEVEL_LANG = verilog
VERILOG_SOURCES = $(shell pwd)/../../../generated/DebuggerModuleTestingBRAM.sv
VERILOG_SOURCES += $(shell pwd)/../../../generated/DebuggerModuleTestingBRAM.sv
VERILOG_SOURCES += $(shell pwd)/../../../generated/InitRegMemFromFile.sv
VERILOG_SOURCES += $(shell pwd)/../../../generated/DebuggerMain.sv
VERILOG_SOURCES += $(shell pwd)/../../../generated/SendReceiveSynchronizer.sv
VERILOG_SOURCES += $(shell pwd)/../../../generated/DebuggerPacketReceiver.sv
VERILOG_SOURCES += $(shell pwd)/../../../generated/DebuggerPacketSender.sv
TOPLEVEL = DebuggerModuleTestingBRAM
MODULE = test_DebuggerModuleTestingBRAM

Expand Down
24 changes: 0 additions & 24 deletions src/main/scala/hwdbg/communication/send_receive_synchronizer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -386,27 +386,3 @@ object SendReceiveSynchronizer {
)
}
}

object SendReceiveSynchronizerModule extends App {

//
// Generate hwdbg verilog files
//
println(
ChiselStage.emitSystemVerilog(
new SendReceiveSynchronizer(
DebuggerConfigurations.ENABLE_DEBUG,
DebuggerConfigurations.BLOCK_RAM_ADDR_WIDTH,
DebuggerConfigurations.BLOCK_RAM_DATA_WIDTH
),
firtoolOpts = Array(
"-disable-all-randomization",
"--lowering-options=disallowLocalVariables", // because icarus doesn't support 'automatic logic', this option prevents such logics
"-strip-debug-info",
"--split-verilog", // The intention for this argument (and next argument) is to separate generated files.
"-o",
"generated/"
)
)
)
}
4 changes: 3 additions & 1 deletion src/main/scala/hwdbg/libs/mem/init_reg_mem_from_file.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ object InitRegMemFromFileTools {
width: Int
): Seq[UInt] = {

var counter: Int = 0
val buffer = new ArrayBuffer[UInt]
for (line <- Source.fromFile(path).getLines()) {
val tokens: Array[String] = line.split("(//)").map(_.trim)
Expand All @@ -38,9 +39,10 @@ object InitRegMemFromFileTools {
val i = Integer.parseInt(tokens.head, 16)

LogInfo(debug)(
f"Initialize memory with 0x${i}%x"
f"Initialize memory [${counter}%x]: 0x${i}%x"
)

counter = counter + 4
buffer.append(i.U(width.W))
}
}
Expand Down

0 comments on commit f22f6fe

Please sign in to comment.