Skip to content

Commit

Permalink
[rtl] Add error port to iCache
Browse files Browse the repository at this point in the history
This commit adds the error port to the iCache which was introduced
with lowRISC/opentitan#23292.

Signed-off-by: Pascal Nasahl <[email protected]>
  • Loading branch information
nasahlpa committed May 28, 2024
1 parent 6eacc30 commit 50322d4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dv/uvm/core_ibex/ibex_dv.f
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_secded_hamming_39_32_enc.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_secded_hamming_72_64_dec.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_secded_hamming_72_64_enc.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_mubi_pkg.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_ram_1p_pkg.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_ram_1p_adv.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_ram_1p_scr.sv
Expand Down Expand Up @@ -69,7 +70,6 @@
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_onehot_check.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_onehot_enc.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_onehot_mux.sv
${LOWRISC_IP_DIR}/ip/prim/rtl/prim_mubi_pkg.sv

// ibex CORE RTL files
+incdir+${PRJ_DIR}/rtl
Expand Down
6 changes: 4 additions & 2 deletions dv/uvm/icache/dv/tb/tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ module tb #(
.rerror_o (),
.cfg_i ('0),
.wr_collision_o (),
.write_pending_o ()
.write_pending_o (),
.alert_o ()
);

// Data RAM instantiation
Expand Down Expand Up @@ -194,7 +195,8 @@ module tb #(
.rerror_o (),
.cfg_i ('0),
.wr_collision_o (),
.write_pending_o ()
.write_pending_o (),
.alert_o ()
);
end

Expand Down
23 changes: 20 additions & 3 deletions rtl/ibex_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ module ibex_top import ibex_pkg::*; #(
// Rams Instantiation //
////////////////////////

logic [IC_NUM_WAYS-1:0] icache_tag_alert;
logic [IC_NUM_WAYS-1:0] icache_data_alert;

if (ICache) begin : gen_rams

for (genvar way = 0; way < IC_NUM_WAYS; way++) begin : gen_rams_inner
Expand Down Expand Up @@ -590,7 +593,9 @@ module ibex_top import ibex_pkg::*; #(
.rerror_o (),
.cfg_i (ram_cfg_i),
.wr_collision_o (),
.write_pending_o ()
.write_pending_o (),

.alert_o (icache_tag_alert[way])
);

// Data RAM instantiation
Expand Down Expand Up @@ -625,7 +630,9 @@ module ibex_top import ibex_pkg::*; #(
.rerror_o (),
.cfg_i (ram_cfg_i),
.wr_collision_o (),
.write_pending_o ()
.write_pending_o (),

.alert_o (icache_data_alert[way])
);

`ifdef INC_ASSERT
Expand Down Expand Up @@ -698,6 +705,8 @@ module ibex_top import ibex_pkg::*; #(
.cfg_i (ram_cfg_i)
);

assign icache_tag_alert = '{default:'b0};
assign icache_data_alert = '{default:'b0};
end
end

Expand All @@ -716,6 +725,8 @@ module ibex_top import ibex_pkg::*; #(
assign ic_tag_rdata = '{default:'b0};
assign ic_data_rdata = '{default:'b0};

assign icache_tag_alert = '{default:'b0};
assign icache_data_alert = '{default:'b0};
end

assign data_wdata_o = data_wdata_core[31:0];
Expand Down Expand Up @@ -1086,9 +1097,15 @@ module ibex_top import ibex_pkg::*; #(
assign unused_scan = scan_rst_ni;
end

// Enable or disable iCache multi bit encoding checking error generation.
// If enabled and a MuBi encoding error is detected, raise a major alert.
logic icache_alert_major_internal;
assign icache_alert_major_internal = (|icache_tag_alert) | (|icache_data_alert);

assign alert_major_internal_o = core_alert_major_internal |
lockstep_alert_major_internal |
rf_alert_major_internal;
rf_alert_major_internal |
icache_alert_major_internal;
assign alert_major_bus_o = core_alert_major_bus | lockstep_alert_major_bus;
assign alert_minor_o = core_alert_minor | lockstep_alert_minor;

Expand Down

0 comments on commit 50322d4

Please sign in to comment.