From 307955c810e8d2cdfd9b036efcb562cc20feef4a Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Tue, 13 Jul 2021 01:10:55 +0100 Subject: [PATCH] Make CPU regfile nonresettable when FPGA symbol is defined, to support BRAM inference --- hdl/hazard3_core.v | 2 ++ test/sim/debug_module_vectors/tb.f | 2 +- test/sim/debug_openocd_bitbang/tb.cpp | 11 ----------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/hdl/hazard3_core.v b/hdl/hazard3_core.v index 776795e..76f2e35 100644 --- a/hdl/hazard3_core.v +++ b/hdl/hazard3_core.v @@ -707,6 +707,8 @@ hazard3_regfile_1w2r #( .RESET_REGS(1), `elsif FORMAL .RESET_REGS(1), +`elsif FPGA + .RESET_REGS(0), `else .RESET_REGS(1), `endif diff --git a/test/sim/debug_module_vectors/tb.f b/test/sim/debug_module_vectors/tb.f index b5b9508..2a4d153 100644 --- a/test/sim/debug_module_vectors/tb.f +++ b/test/sim/debug_module_vectors/tb.f @@ -1,4 +1,4 @@ file tb.v list $HDL/hazard3.f -file $HDL/debug/dm/hazard3_dm.v +list $HDL/debug/dm/hazard3_dm.f diff --git a/test/sim/debug_openocd_bitbang/tb.cpp b/test/sim/debug_openocd_bitbang/tb.cpp index af5ee85..367a42f 100644 --- a/test/sim/debug_openocd_bitbang/tb.cpp +++ b/test/sim/debug_openocd_bitbang/tb.cpp @@ -38,14 +38,6 @@ void exit_help(std::string errtext = "") { exit(-1); } -enum cmdstate { - S_IDLE = 0, - S_WRITE_SETUP, - S_WRITE_ACCESS, - S_READ_SETUP, - S_READ_ACCESS -}; - int main(int argc, char **argv) { if (argc < 2) @@ -179,9 +171,6 @@ int main(int argc, char **argv) { top.p_rst__n.set(true); top.step(); - cmdstate state = S_IDLE; - int idle_counter = 0; - for (int64_t cycle = 0; cycle < max_cycles; ++cycle) { top.p_clk.set(false); top.step();