Skip to content

Commit

Permalink
[csrng/dv] Add fips coverage for HW apps
Browse files Browse the repository at this point in the history
This commit adds fips coverage for HW apps at the cmd output of the
CSRNG.

Signed-off-by: Hakim Filali <[email protected]>
  • Loading branch information
Hakim Filali authored and vogelpi committed Jan 2, 2024
1 parent f423d4b commit 341f1aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/ip/csrng/dv/cov/csrng_cov_if.sv
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ interface csrng_cov_if (
option.name = "csrng_err_code_test_cg";
option.per_instance = 1;

err_code_test_cp: coverpoint err_test;
cp_err_code_test: coverpoint err_test;

endgroup : csrng_err_code_test_cg

covergroup csrng_recov_alert_sts_cg with function sample(recov_alert_bit_e recov_alert);
option.name = "csrng_recov_alert_sts_cg";
option.per_instance = 1;

recov_alert_sts_cp: coverpoint recov_alert;
cp_recov_alert_sts: coverpoint recov_alert;
endgroup : csrng_recov_alert_sts_cg

covergroup csrng_cmds_cg with function sample(bit [NUM_HW_APPS-1:0] app,
Expand Down
8 changes: 8 additions & 0 deletions hw/ip/csrng/dv/env/csrng_scoreboard.sv
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,14 @@ class csrng_scoreboard extends cip_base_scoreboard #(
`DV_CHECK_EQ_FATAL(cs_item[app].genbits_q[i], prd_genbits_q[app][i])
// Check if the FIPS compliance bit is set correctly.
`DV_CHECK_EQ_FATAL(cs_item[app].fips_q[i], cfg.compliance[app])
cov_vif.cg_csrng_genbits_sample(
.genbits_fips(cs_item[app].fips_q[i]),
.genbits_fips_previous(genbits_fips_previous[app]),
.app(app),
.valid(1'b1),
.record_transition(genbits_fips_received[app]));
genbits_fips_previous[SW_APP] = cs_item[app].fips_q[i];
genbits_fips_received[SW_APP] = 1'b1;
end
// Deletes the predicted genbits before the next comparison.
prd_genbits_q[app].delete();
Expand Down

0 comments on commit 341f1aa

Please sign in to comment.