Skip to content

Commit

Permalink
Merge pull request openhwgroup#176 from pulp-platform/fix-preloading-…
Browse files Browse the repository at this point in the history
…issue

Fix an alignment issue when preloading the memories
  • Loading branch information
zarubaf authored Feb 8, 2019
2 parents 3a59734 + 381dbb0 commit 2504c1f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tb/ariane_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,21 @@ module ariane_tb;

// while there are more sections to process
while (get_section(address, len)) begin
`uvm_info( "Core Test", $sformatf("Loading Address: %x, Length: %x", address, len), UVM_LOW)
buffer = new [len];
automatic int num_words = (len+7)/8;
`uvm_info( "Core Test", $sformatf("Loading Address: %x, Length: %x", address, len),
UVM_LOW)
buffer = new [num_words*8];
void'(read_section(address, buffer));
// preload memories
// 64-bit
for (int i = 0; i < buffer.size()/8; i++) begin
for (int i = 0; i < num_words; i++) begin
mem_row = '0;
for (int j = 0; j < 8; j++) begin
mem_row[j] = buffer[i*8 + j];
end

`MAIN_MEM((address[28:0] >> 3) + i) = mem_row;
end
end
end
end

endmodule

0 comments on commit 2504c1f

Please sign in to comment.