diff options
author | Olof Kindgren <olof.kindgren@gmail.com> | 2017-12-27 20:32:33 +0100 |
---|---|---|
committer | Olof Kindgren <olof.kindgren@gmail.com> | 2017-12-27 20:32:33 +0100 |
commit | 0495ce8b5a4f2d6dcefae12ae3a44b7205688b5e (patch) | |
tree | d32709b08c60702939cd6becf9291f431d37980b /testbench_wb.v | |
parent | df0113218550838fd2ba1ec6cdb9f24499e83cff (diff) | |
download | picorv32-0495ce8b5a4f2d6dcefae12ae3a44b7205688b5e.tar.gz picorv32-0495ce8b5a4f2d6dcefae12ae3a44b7205688b5e.zip |
testbench_wb: Load firmware with plusarg instead of parameter
Diffstat (limited to 'testbench_wb.v')
-rw-r--r-- | testbench_wb.v | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/testbench_wb.v b/testbench_wb.v index 4af9004..3302a89 100644 --- a/testbench_wb.v +++ b/testbench_wb.v @@ -87,7 +87,6 @@ module picorv32_wrapper #( wb_ram #( .depth (16384 * 4), - .memfile ("firmware/firmware.hex"), .VERBOSE (VERBOSE) ) ram ( // Wishbone interface .wb_clk_i(wb_clk), @@ -139,6 +138,13 @@ module picorv32_wrapper #( .wbm_sel_o(wb_m2s_sel) ); + reg [1023:0] firmware_file; + initial begin + if (!$value$plusargs("firmware=%s", firmware_file)) + firmware_file = "firmware/firmware.hex"; + $readmemh(firmware_file, ram.mem); + end + integer cycle_counter; always @(posedge wb_clk) begin cycle_counter <= !wb_rst ? cycle_counter + 1 : 0; |