Add option to load alternative firmware with plusarg

This commit is contained in:
Olof Kindgren 2016-02-18 22:47:58 +01:00
parent 9591ae9f7d
commit cd5d341e89
1 changed files with 6 additions and 1 deletions

View File

@ -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