From cd5d341e892918dcb90d8f0669808d483e5c7e69 Mon Sep 17 00:00:00 2001 From: Olof Kindgren Date: Thu, 18 Feb 2016 22:47:58 +0100 Subject: [PATCH] Add option to load alternative firmware with plusarg --- picorv32_wrapper.v | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/picorv32_wrapper.v b/picorv32_wrapper.v index ee16a14..92e77aa 100644 --- a/picorv32_wrapper.v +++ b/picorv32_wrapper.v @@ -102,7 +102,12 @@ module picorv32_wrapper #( .irq (irq ) ); - initial $readmemh("firmware/firmware.hex", mem.memory); + reg [1023:0] firmware_file; + initial begin + if(!$value$plusargs("firmware=%s", firmware_file)) + firmware_file = "firmware/firmware.hex"; + $readmemh(firmware_file, mem.memory); + end integer cycle_counter; always @(posedge clk) begin