Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion serving/serving_ram.v
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,17 @@ module serving_ram
o_rdata <= mem[i_raddr];
end

initial
initial begin
if(|memfile) begin
$display("Preloading %m from %s", memfile);
$readmemh(memfile, mem);
end

// The last 4 bytes are the `x0` (zero) register. Zero them out
// to avoid starting the simulation with `x0` undefined.
mem[depth-4] = 8'h0;
mem[depth-3] = 8'h0;
mem[depth-2] = 8'h0;
mem[depth-1] = 8'h0;
end
endmodule