Skip to content

Commit

Permalink
Adjusted assignment size from generated boot data to actual boot size.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosHirsl authored and fischeti committed Jul 17, 2024
1 parent f151bc7 commit df4349e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Binary file modified target/snitch_cluster/test/bootrom.elf
Binary file not shown.
4 changes: 2 additions & 2 deletions target/snitch_cluster/test/bootrom.sv
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
input logic [AddrWidth-1:0] addr_i,
output logic [DataWidth-1:0] data_o
);
localparam logic [BootromSize-1:0][7:0] rom = '{
localparam logic [65536-1:0][7:0] rom = '{
{8'h00}, /* 0xffff */
{8'h00}, /* 0xfffe */
{8'h00}, /* 0xfffd */
Expand Down Expand Up @@ -65562,7 +65562,7 @@
localparam int unsigned NumBytes = DataWidth/8;
localparam int unsigned WordOffset = $clog2(NumBytes);
logic [BootromSize/NumBytes-1:0][DataWidth-1:0] rom_word_addressed;
assign rom_word_addressed = rom;
assign rom_word_addressed = rom[65536-1:(65536-1)-BootromSize];

logic [$clog2(BootromSize)-1:WordOffset] aligned_address;

Expand Down
5 changes: 3 additions & 2 deletions target/snitch_cluster/test/gen_bootrom_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ def assign_word():
input logic [AddrWidth-1:0] addr_i,
output logic [DataWidth-1:0] data_o
);
localparam logic [BootromSize-1:0][7:0] rom = '{{
localparam logic [{gen_size}-1:0][7:0] rom = '{{
{bytes}
}};
localparam int unsigned NumBytes = DataWidth/8;
localparam int unsigned WordOffset = $clog2(NumBytes);
logic [BootromSize/NumBytes-1:0][DataWidth-1:0] rom_word_addressed;
assign rom_word_addressed = rom;
assign rom_word_addressed = rom[{gen_size}-1:({gen_size}-1)-BootromSize];
logic [$clog2(BootromSize)-1:WordOffset] aligned_address;
Expand All @@ -133,6 +133,7 @@ def assign_word():
""".strip().format(
script=os.path.basename(__file__),
module_name=args.sv_module,
gen_size=args.pad,
num_bytes=num_bytes,
bytes=bytes,
word=word,
Expand Down

0 comments on commit df4349e

Please sign in to comment.