Skip to content

Commit

Permalink
[otp_ctrl,dv] Add virtual to uncorr comp function
Browse files Browse the repository at this point in the history
Closed source can generate uncorr data with different mechanism.
Make a separate function to override in closed source environment.

Signed-off-by: Jaedon Kim <[email protected]>
  • Loading branch information
jdonjdon committed Sep 19, 2023
1 parent b35c916 commit 8ff69ef
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions hw/ip/otp_ctrl/dv/env/otp_ctrl_scoreboard.sv
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,7 @@ class otp_ctrl_scoreboard #(type CFG_T = otp_ctrl_env_cfg)
// as correctable ECC errors.
// Only check the first 16 bits because if ECC readout detects uncorrectable error, it
// won't continue read the remaining 16 bits.
`DV_CHECK_EQ(item.d_data & 16'hffff, read_out & 16'hffff,
$sformatf("mem read mismatch at TLUL addr %0h, csr_addr %0h",
csr_addr, dai_addr))
uncorr_comp(item.d_data[15:0], read_out[15:0], csr_addr, dai_addr);
end
end else if (ecc_err == OtpNoEccErr) begin
`DV_CHECK_EQ(item.d_data, otp_a[otp_addr],
Expand Down Expand Up @@ -1362,5 +1360,12 @@ class otp_ctrl_scoreboard #(type CFG_T = otp_ctrl_env_cfg)
exp_alert = alert_name == "fatal_check_error" ? OtpCheckAlert : OtpMacroAlert;
super.set_exp_alert(alert_name, is_fatal, max_delay);
endfunction

// Compare uncorrectable errored data.
// This function will be overridden by closed source environment.
virtual function void uncorr_comp(bit[15:0] rcv, bit[15:0] exp,
bit [TL_AW-1:0] csr_addr, bit [TL_AW-1:0] dai_addr);
`DV_CHECK_EQ(rcv, exp,
$sformatf("mem read mismatch at TLUL addr %0h, csr_addr %0h",
csr_addr, dai_addr))
endfunction
endclass

0 comments on commit 8ff69ef

Please sign in to comment.