Skip to content

Commit

Permalink
Fix bootrom
Browse files Browse the repository at this point in the history
Missing begin/end overwrites boot rom code loaded from rom_init_file in tb/veerwolf_core_tb.v. Also cleaned up indentation that possibly hid the bug.
  • Loading branch information
MikaelStrom authored Aug 19, 2024
1 parent 3ad45a9 commit 2806f48
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tb/veerwolf_core_tb.v
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,30 @@ module veerwolf_core_tb

initial begin
if (|$test$plusargs("jtag_vpi_enable"))
$display("JTAG VPI enabled. Not loading RAM");
$display("JTAG VPI enabled. Not loading RAM");
else if ($value$plusargs("ram_init_file=%s", ram_init_file)) begin
$display("Loading RAM contents from %0s", ram_init_file);
$readmemh(ram_init_file, ram.mem);
$display("Loading RAM contents from %0s", ram_init_file);
$readmemh(ram_init_file, ram.mem);
end
end

reg [1023:0] rom_init_file;

initial begin
if ($value$plusargs("rom_init_file=%s", rom_init_file)) begin
$display("Loading ROM contents from %0s", rom_init_file);
$readmemh(rom_init_file, veerwolf.bootrom.ram.mem);
end else if (!(|bootrom_file))
/*
Set mrac to 0xAAAA0000 and jump to address 0
if no bootloader is selected
0: aaaa02b7 lui t0,0xaaaa0
4: 7c029073 csrw 0x7c0,t0
8: 00000067 jr zero
*/
veerwolf.bootrom.ram.mem[0] = 64'h7c029073aaaa02b7;
veerwolf.bootrom.ram.mem[1] = 64'h0000000000000067;
$display("Loading ROM contents from %0s", rom_init_file);
$readmemh(rom_init_file, veerwolf.bootrom.ram.mem);
end else if (!(|bootrom_file)) begin
/*
Set mrac to 0xAAAA0000 and jump to address 0
if no bootloader is selected
0: aaaa02b7 lui t0,0xaaaa0
4: 7c029073 csrw 0x7c0,t0
8: 00000067 jr zero
*/
veerwolf.bootrom.ram.mem[0] = 64'h7c029073aaaa02b7;
veerwolf.bootrom.ram.mem[1] = 64'h0000000000000067;
end
end

wire [63:0] gpio_out;
Expand Down

0 comments on commit 2806f48

Please sign in to comment.