From 341f1aa4b6fe2f26d3e16771842c66b5c99d20fa Mon Sep 17 00:00:00 2001 From: Hakim Filali Date: Mon, 27 Nov 2023 11:15:18 +0000 Subject: [PATCH] [csrng/dv] Add fips coverage for HW apps This commit adds fips coverage for HW apps at the cmd output of the CSRNG. Signed-off-by: Hakim Filali --- hw/ip/csrng/dv/cov/csrng_cov_if.sv | 4 ++-- hw/ip/csrng/dv/env/csrng_scoreboard.sv | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/ip/csrng/dv/cov/csrng_cov_if.sv b/hw/ip/csrng/dv/cov/csrng_cov_if.sv index dacf99643f563..0ec66af97293e 100644 --- a/hw/ip/csrng/dv/cov/csrng_cov_if.sv +++ b/hw/ip/csrng/dv/cov/csrng_cov_if.sv @@ -265,7 +265,7 @@ 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 @@ -273,7 +273,7 @@ interface csrng_cov_if ( 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, diff --git a/hw/ip/csrng/dv/env/csrng_scoreboard.sv b/hw/ip/csrng/dv/env/csrng_scoreboard.sv index e28808d359f70..c13b53558f568 100644 --- a/hw/ip/csrng/dv/env/csrng_scoreboard.sv +++ b/hw/ip/csrng/dv/env/csrng_scoreboard.sv @@ -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();