Skip to content

Commit

Permalink
Export ICCM/DCCM ECC error signals
Browse files Browse the repository at this point in the history
Internal-tag: [#52132]
Signed-off-by: Rafal Kolucki <[email protected]>
  • Loading branch information
koluckirafal committed Jan 4, 2024
1 parent ecbd18d commit b228010
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 4 deletions.
15 changes: 15 additions & 0 deletions design/el2_veer.sv
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,12 @@ import el2_pkg::*;
input logic [31:0] dmi_reg_wdata, // write data
output logic [31:0] dmi_reg_rdata,

// ICCM/DCCM ECC status
output logic iccm_ecc_single_error,
output logic iccm_ecc_double_error,
output logic dccm_ecc_single_error,
output logic dccm_ecc_double_error,

input logic [pt.PIC_TOTAL_INT:1] extintsrc_req,
input logic timer_int,
input logic soft_int,
Expand All @@ -393,7 +399,11 @@ import el2_pkg::*;

logic ifu_pmu_instr_aligned;
logic ifu_ic_error_start;
logic ifu_iccm_dma_rd_ecc_single_err;
logic ifu_iccm_rd_ecc_single_err;
logic ifu_iccm_rd_ecc_double_err;
logic lsu_dccm_rd_ecc_single_err;
logic lsu_dccm_rd_ecc_double_err;

logic lsu_axi_awready_ahb;
logic lsu_axi_wready_ahb;
Expand Down Expand Up @@ -895,6 +905,9 @@ import el2_pkg::*;
);


assign iccm_ecc_single_error = ifu_iccm_rd_ecc_single_err || ifu_iccm_dma_rd_ecc_single_err;
assign iccm_ecc_double_error = ifu_iccm_rd_ecc_double_err;

el2_dec #(.pt(pt)) dec (
.clk(active_l2clk),
.dbg_cmd_wrdata(dbg_cmd_wrdata[1:0]),
Expand Down Expand Up @@ -932,6 +945,8 @@ import el2_pkg::*;

);

assign dccm_ecc_single_error = lsu_dccm_rd_ecc_single_err;
assign dccm_ecc_double_error = lsu_dccm_rd_ecc_double_err;

el2_pic_ctrl #(.pt(pt)) pic_ctrl_inst (
.clk(free_l2clk),
Expand Down
6 changes: 6 additions & 0 deletions design/el2_veer_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ import el2_pkg::*;
input logic dbg_bus_clk_en, // Clock ratio b/w cpu core clk & AHB master interface
input logic dma_bus_clk_en, // Clock ratio b/w cpu core clk & AHB slave interface

// ICCM/DCCM ECC status
output logic iccm_ecc_single_error,
output logic iccm_ecc_double_error,
output logic dccm_ecc_single_error,
output logic dccm_ecc_double_error,

// all of these test inputs are brought to top-level; must be tied off based on usage by physical design (ie. icache or not, iccm or not, dccm or not)

input el2_ic_data_ext_in_pkt_t [pt.ICACHE_NUM_WAYS-1:0][pt.ICACHE_BANKS_WAY-1:0] ic_data_ext_in_pkt,
Expand Down
10 changes: 8 additions & 2 deletions design/ifu/el2_ifu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ import el2_pkg::*;
input logic [63:0] iccm_rd_data, // Data read from ICCM.
input logic [77:0] iccm_rd_data_ecc, // Data + ECC read from ICCM.

output logic ifu_iccm_rd_ecc_single_err, // This fetch has a single ICCM ecc error.
// ICCM ECC status
output logic ifu_iccm_dma_rd_ecc_single_err, // This fetch has a single ICCM DMA ECC error.
output logic ifu_iccm_rd_ecc_single_err, // This fetch has a single ICCM ECC error.
output logic ifu_iccm_rd_ecc_double_err, // This fetch has a double ICCM ECC error.

// Perf counter sigs
output logic ifu_pmu_ic_miss, // ic miss
Expand Down Expand Up @@ -216,7 +219,8 @@ import el2_pkg::*;
logic [1:0] ifu_fetch_val; // valids on a 2B boundary, left justified [7] implies valid fetch

Check warning on line 219 in design/ifu/el2_ifu.sv

View workflow job for this annotation

GitHub Actions / format-review

[verible-verilog-format] reported by reviewdog 🐶 Raw Output: design/ifu/el2_ifu.sv:219:- logic [1:0] ifu_fetch_val; // valids on a 2B boundary, left justified [7] implies valid fetch design/ifu/el2_ifu.sv:220:- logic [31:1] ifu_fetch_pc; // starting pc of fetch design/ifu/el2_ifu.sv:221:- design/ifu/el2_ifu.sv:222:- logic iccm_rd_ecc_single_err, iccm_dma_rd_ecc_single_err, ic_error_start; design/ifu/el2_ifu.sv:223:- assign ifu_iccm_dma_rd_ecc_single_err = iccm_dma_rd_ecc_single_err; design/ifu/el2_ifu.sv:224:- assign ifu_iccm_rd_ecc_single_err = iccm_rd_ecc_single_err; design/ifu/el2_ifu.sv:225:- assign ifu_ic_error_start = ic_error_start; design/ifu/el2_ifu.sv:226:- design/ifu/el2_ifu.sv:227:- design/ifu/el2_ifu.sv:228:- logic ic_write_stall; design/ifu/el2_ifu.sv:229:- logic ic_dma_active; design/ifu/el2_ifu.sv:230:- logic ifc_dma_access_ok; design/ifu/el2_ifu.sv:231:- logic [1:0] ic_access_fault_f; design/ifu/el2_ifu.sv:232:- logic [1:0] ic_access_fault_type_f; design/ifu/el2_ifu.sv:233:- logic ifu_ic_mb_empty; design/ifu/el2_ifu.sv:234:- design/ifu/el2_ifu.sv:235:- logic ic_hit_f; design/ifu/el2_ifu.sv:236:- design/ifu/el2_ifu.sv:237:- logic [1:0] ifu_bp_way_f; // way indication; right justified design/ifu/el2_ifu.sv:238:- logic ifu_bp_hit_taken_f; // kill next fetch; taken target found design/ifu/el2_ifu.sv:239:- logic [31:1] ifu_bp_btb_target_f; // predicted target PC design/ifu/el2_ifu.sv:240:- logic ifu_bp_inst_mask_f; // tell ic which valids to kill because of a taken branch; right justified design/ifu/el2_ifu.sv:241:- logic [1:0] ifu_bp_hist1_f; // history counters for all 4 potential branches; right justified design/ifu/el2_ifu.sv:242:- logic [1:0] ifu_bp_hist0_f; // history counters for all 4 potential branches; right justified design/ifu/el2_ifu.sv:243:- logic [11:0] ifu_bp_poffset_f; // predicted target design/ifu/el2_ifu.sv:244:- logic [1:0] ifu_bp_ret_f; // predicted ret ; right justified design/ifu/el2_ifu.sv:245:- logic [1:0] ifu_bp_pc4_f; // pc4 indication; right justified design/ifu/el2_ifu.sv:246:- logic [1:0] ifu_bp_valid_f; // branch valid, right justified design/ifu/el2_ifu.sv:247:- logic [pt.BHT_GHR_SIZE-1:0] ifu_bp_fghr_f; design/ifu/el2_ifu.sv:248:- logic [1:0] [$clog2(pt.BTB_SIZE)-1:0] ifu_bp_fa_index_f; design/ifu/el2_ifu.sv:249:- design/ifu/el2_ifu.sv:250:- design/ifu/el2_ifu.sv:251:- logic [1:0] ic_fetch_val_f; design/ifu/el2_ifu.sv:252:- logic [31:0] ic_data_f; design/ifu/el2_ifu.sv:253:- logic [31:0] ifu_fetch_data_f; design/ifu/el2_ifu.sv:254:- logic ifc_fetch_req_f; design/ifu/el2_ifu.sv:255:- logic ifc_fetch_req_f_raw; design/ifu/el2_ifu.sv:256:- logic iccm_dma_rd_ecc_double_err; design/ifu/el2_ifu.sv:257:- logic [1:0] iccm_rd_ecc_double_err; // This fetch has an iccm double error. design/ifu/el2_ifu.sv:258:- assign ifu_iccm_rd_ecc_double_err = |iccm_rd_ecc_double_err || |iccm_dma_rd_ecc_double_err; design/ifu/el2_ifu.sv:259:- design/ifu/el2_ifu.sv:260:- logic ifu_async_error_start; design/ifu/el2_ifu.sv:261:- design/ifu/el2_ifu.sv:262:- design/ifu/el2_ifu.sv:263:- assign ifu_fetch_data_f[31:0] = ic_data_f[31:0]; design/ifu/el2_ifu.sv:264:- assign ifu_fetch_val[1:0] = ic_fetch_val_f[1:0]; design/ifu/el2_ifu.sv:265:- assign ifu_fetch_pc[31:1] = ifc_fetch_addr_f[31:1]; design/ifu/el2_ifu.sv:266:- design/ifu/el2_ifu.sv:267:- logic ifc_fetch_uncacheable_bf; // The fetch request is uncacheable space. BF stage design/ifu/el2_ifu.sv:268:- logic ifc_fetch_req_bf; // Fetch request. Comes with the address. BF stage design/ifu/el2_ifu.sv:269:- logic ifc_fetch_req_bf_raw; // Fetch request without some qualifications. Used for clock-gating. BF stage design/ifu/el2_ifu.sv:270:- logic ifc_iccm_access_bf; // This request is to the ICCM. Do not generate misses to the bus. design/ifu/el2_ifu.sv:271:- logic ifc_region_acc_fau
logic [31:1] ifu_fetch_pc; // starting pc of fetch

logic iccm_rd_ecc_single_err, ic_error_start;
logic iccm_rd_ecc_single_err, iccm_dma_rd_ecc_single_err, ic_error_start;
assign ifu_iccm_dma_rd_ecc_single_err = iccm_dma_rd_ecc_single_err;
assign ifu_iccm_rd_ecc_single_err = iccm_rd_ecc_single_err;
assign ifu_ic_error_start = ic_error_start;

Expand Down Expand Up @@ -249,7 +253,9 @@ import el2_pkg::*;
logic [31:0] ifu_fetch_data_f;
logic ifc_fetch_req_f;
logic ifc_fetch_req_f_raw;
logic iccm_dma_rd_ecc_double_err;
logic [1:0] iccm_rd_ecc_double_err; // This fetch has an iccm double error.
assign ifu_iccm_rd_ecc_double_err = |iccm_rd_ecc_double_err || |iccm_dma_rd_ecc_double_err;

logic ifu_async_error_start;

Expand Down
9 changes: 7 additions & 2 deletions design/ifu/el2_ifu_mem_ctl.sv
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ import el2_pkg::*;
output logic ic_hit_f, // Hit in Icache(if Icache access) or ICCM access( ICCM always has ic_hit_f)
output logic [1:0] ic_access_fault_f, // Access fault (bus error or ICCM access in region but out of offset range).
output logic [1:0] ic_access_fault_type_f, // Access fault types
output logic iccm_rd_ecc_single_err, // This fetch has a single ICCM ecc error.
output logic [1:0] iccm_rd_ecc_double_err, // This fetch has a double ICCM ecc error.
output logic iccm_rd_ecc_single_err, // This fetch has a single ICCM ECC error.
output logic [1:0] iccm_rd_ecc_double_err, // This fetch has a double ICCM ECC error.
output logic iccm_dma_rd_ecc_single_err, // This fetch has a single ICCM DMA ECC error.
output logic iccm_dma_rd_ecc_double_err, // This fetch has a double ICCM DMA ECC error.
output logic ic_error_start, // This has any I$ errors ( data/tag/ecc/parity )

output logic ifu_async_error_start, // Or of the sb iccm, and all the icache errors sent to aligner to stop
Expand Down Expand Up @@ -1278,6 +1280,9 @@ ifc_dma_access_ok_prev,dma_iccm_req_f})
(~(ifc_dma_access_q_ok & dma_iccm_req) & iccm_correct_ecc) ? {iccm_ecc_corr_index_ff[pt.ICCM_BITS-1:2],1'b0} : ifc_fetch_addr_bf[pt.ICCM_BITS-1:1] ;


assign iccm_dma_rd_ecc_single_err = iccm_dma_sb_error;
assign iccm_dma_rd_ecc_double_err = iccm_dma_rvalid && iccm_dma_ecc_error;



/////////////////////////////////////////////////////////////////////////////////////

Check warning on line 1288 in design/ifu/el2_ifu_mem_ctl.sv

View workflow job for this annotation

GitHub Actions / format-review

[verible-verilog-format] reported by reviewdog 🐶 Raw Output: design/ifu/el2_ifu_mem_ctl.sv:1288:-///////////////////////////////////////////////////////////////////////////////////// design/ifu/el2_ifu_mem_ctl.sv:1289:-// ECC checking logic for ICCM data. // design/ifu/el2_ifu_mem_ctl.sv:1290:-///////////////////////////////////////////////////////////////////////////////////// design/ifu/el2_ifu_mem_ctl.sv:1577:+ ///////////////////////////////////////////////////////////////////////////////////// design/ifu/el2_ifu_mem_ctl.sv:1578:+ // ECC checking logic for ICCM data. // design/ifu/el2_ifu_mem_ctl.sv:1579:+ /////////////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 6 additions & 0 deletions design/lsu/el2_lsu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ import el2_pkg::*;
output logic [63:0] dccm_dma_rdata, // lsu data for DMA dccm read
output logic dccm_ready, // lsu ready for DMA access

// DCCM ECC status
output logic lsu_dccm_rd_ecc_single_err,
output logic lsu_dccm_rd_ecc_double_err,

input logic scan_mode, // scan mode
input logic clk, // Clock only while core active. Through one clock header. For flops with second clock header built in. Connected to ACTIVE_L2CLK.
input logic active_clk, // Clock only while core active. Through two clock headers. For flops without second clock header built in.
Expand Down Expand Up @@ -211,6 +215,8 @@ import el2_pkg::*;
logic lsu_single_ecc_error_r;
logic lsu_double_ecc_error_r;
logic ld_single_ecc_error_r, ld_single_ecc_error_r_ff;
assign lsu_dccm_rd_ecc_single_err = lsu_single_ecc_error_r;
assign lsu_dccm_rd_ecc_double_err = lsu_double_ecc_error_r;

logic [31:0] picm_mask_data_m;

Expand Down
5 changes: 5 additions & 0 deletions testbench/tb_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,11 @@ veer_wrapper rvtop_wrapper (
.dccm_bank_dout (el2_mem_export.dccm_bank_dout),
.dccm_bank_ecc (el2_mem_export.dccm_bank_ecc),

.iccm_ecc_single_error (),
.iccm_ecc_double_error (),
.dccm_ecc_single_error (),
.dccm_ecc_double_error (),

// remove mems DFT pins for opensource
.ic_data_ext_in_pkt ('0),
.ic_tag_ext_in_pkt ('0),
Expand Down
6 changes: 6 additions & 0 deletions testbench/veer_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ module veer_wrapper
input logic [pt.DCCM_NUM_BANKS-1:0][pt.DCCM_DATA_WIDTH-1:0] dccm_bank_dout,
input logic [pt.DCCM_NUM_BANKS-1:0][pt.DCCM_FDATA_WIDTH-pt.DCCM_DATA_WIDTH-1:0] dccm_bank_ecc,

// ICCM/DCCM ECC status
output logic iccm_ecc_single_error,
output logic iccm_ecc_double_error,
output logic dccm_ecc_single_error,
output logic dccm_ecc_double_error,

// external MPC halt/run interface
input logic mpc_debug_halt_req, // Async halt request
input logic mpc_debug_run_req, // Async run request
Expand Down

0 comments on commit b228010

Please sign in to comment.