mirror of https://github.com/YosysHQ/picorv32.git
testbench_wb: Load firmware with plusarg instead of parameter
This commit is contained in:
parent
df01132185
commit
0495ce8b5a
|
@ -87,7 +87,6 @@ module picorv32_wrapper #(
|
||||||
|
|
||||||
wb_ram #(
|
wb_ram #(
|
||||||
.depth (16384 * 4),
|
.depth (16384 * 4),
|
||||||
.memfile ("firmware/firmware.hex"),
|
|
||||||
.VERBOSE (VERBOSE)
|
.VERBOSE (VERBOSE)
|
||||||
) ram ( // Wishbone interface
|
) ram ( // Wishbone interface
|
||||||
.wb_clk_i(wb_clk),
|
.wb_clk_i(wb_clk),
|
||||||
|
@ -139,6 +138,13 @@ module picorv32_wrapper #(
|
||||||
.wbm_sel_o(wb_m2s_sel)
|
.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;
|
integer cycle_counter;
|
||||||
always @(posedge wb_clk) begin
|
always @(posedge wb_clk) begin
|
||||||
cycle_counter <= !wb_rst ? cycle_counter + 1 : 0;
|
cycle_counter <= !wb_rst ? cycle_counter + 1 : 0;
|
||||||
|
|
Loading…
Reference in New Issue