Skip to content
Open
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
18 changes: 11 additions & 7 deletions src/test/obi_sim_mem.sv
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module obi_sim_mem import obi_pkg::*; #(
logic [ObiCfg.DataWidth/8-1:0] mon_be;
logic [ObiCfg.IdWidth-1:0] mon_id;

logic warning_issued;

assign mon_we = obi_req_i.a.we;
assign mon_addr = obi_req_i.a.addr;
assign mon_wdata = obi_req_i.a.wdata;
Expand Down Expand Up @@ -89,13 +91,15 @@ module obi_sim_mem import obi_pkg::*; #(
end else begin
// read response
automatic obi_r_chan_t read_rsp = 'x;
if (!mem.exists(obi_req_i.a.addr)) begin
if (WarnUninitialized) begin
$warning("%t - Access to non-initialized address at 0x%016x by ID 0x%x.",
$realtime, obi_req_i.a.addr, obi_req_i.a.aid);
end
end else begin
for (int i = 0; i < ObiCfg.DataWidth/8; i++) begin
warning_issued = 1'b0;
for (int i = 0; i < ObiCfg.DataWidth/8; i++) begin
if (!mem.exists(obi_req_i.a.addr+i)) begin
if (WarnUninitialized && !warning_issued) begin
$warning("%t - Access to not fully initialized word at 0x%016x by ID 0x%x.",
$realtime, obi_req_i.a.addr, obi_req_i.a.aid);
warning_issued = 1'b1;
end
end else begin
read_rsp.rdata[8*i+:8] = mem[obi_req_i.a.addr+i];
end
end
Expand Down