Skip to content

Conversation

@glaserf
Copy link
Contributor

@glaserf glaserf commented Nov 2, 2025

Follow-up of #28428; removes three more FIFOs which together measure about 13kGE. Apart from everything mentioned in #28428, removal of the affected FIFOs required the following changes:

  • Rework the state db cycle-alternating "arbitration". As there never is a need where both the ctr_drbg_cmd and _gen units want to write to the state db at the same time, the actual arbitration logic can be kept very simple.
  • Introduce a small FSM to ctr_drbg_cmd that handles the bifurcation of the data stream and waits on commands that require the ctr_drbg_upd unit for both it and the cmd_rsp channel being ready before signaling the cmd_req as ready.

Part of #28153.

@glaserf
Copy link
Contributor Author

glaserf commented Nov 2, 2025

Regression results:

CSRNG Simulation Results

Tuesday November 04 2025 09:55:03 UTC

GitHub Revision: d16ce56753

Branch: csrng_sfifo_pr

Testplan

Simulator: XCELIUM

Test Results

Stage Name Tests Max Job Runtime Simulated Time Passing Total Pass Rate
V1 smoke csrng_smoke 9.000s 246.853us 50 50 100.00 %
V1 csr_hw_reset csrng_csr_hw_reset 2.000s 233.282us 5 5 100.00 %
V1 csr_rw csrng_csr_rw 1.000s 13.902us 20 20 100.00 %
V1 csr_bit_bash csrng_csr_bit_bash 11.000s 1.385ms 5 5 100.00 %
V1 csr_aliasing csrng_csr_aliasing 3.000s 273.440us 5 5 100.00 %
V1 csr_mem_rw_with_rand_reset csrng_csr_mem_rw_with_rand_reset 2.000s 294.328us 20 20 100.00 %
V1 regwen_csr_and_corresponding_lockable_csr csrng_csr_rw 1.000s 13.902us 20 20 100.00 %
csrng_csr_aliasing 3.000s 273.440us 5 5 100.00 %
V1 TOTAL 105 105 100.00 %
V2 interrupts csrng_intr 10.000s 313.847us 200 200 100.00 %
V2 alerts csrng_alert 18.000s 2.210ms 500 500 100.00 %
V2 err csrng_err 8.000s 24.949us 500 500 100.00 %
V2 cmds csrng_cmds 3.167m 37.836ms 50 50 100.00 %
V2 life cycle csrng_cmds 3.167m 37.836ms 50 50 100.00 %
V2 stress_all csrng_stress_all 8.217m 84.965ms 49 50 98.00 %
V2 intr_test csrng_intr_test 1.000s 14.493us 50 50 100.00 %
V2 alert_test csrng_alert_test 8.000s 15.735us 50 50 100.00 %
V2 tl_d_oob_addr_access csrng_tl_errors 4.000s 175.366us 20 20 100.00 %
V2 tl_d_illegal_access csrng_tl_errors 4.000s 175.366us 20 20 100.00 %
V2 tl_d_outstanding_access csrng_csr_hw_reset 2.000s 233.282us 5 5 100.00 %
csrng_csr_rw 1.000s 13.902us 20 20 100.00 %
csrng_csr_aliasing 3.000s 273.440us 5 5 100.00 %
csrng_same_csr_outstanding 2.000s 104.462us 20 20 100.00 %
V2 tl_d_partial_access csrng_csr_hw_reset 2.000s 233.282us 5 5 100.00 %
csrng_csr_rw 1.000s 13.902us 20 20 100.00 %
csrng_csr_aliasing 3.000s 273.440us 5 5 100.00 %
csrng_same_csr_outstanding 2.000s 104.462us 20 20 100.00 %
V2 TOTAL 1439 1440 99.93 %
V2S tl_intg_err csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
csrng_tl_intg_err 5.000s 815.392us 20 20 100.00 %
V2S sec_cm_config_regwen csrng_regwen 8.000s 60.852us 50 50 100.00 %
csrng_csr_rw 1.000s 13.902us 20 20 100.00 %
V2S sec_cm_config_mubi csrng_alert 18.000s 2.210ms 500 500 100.00 %
V2S sec_cm_intersig_mubi csrng_stress_all 8.217m 84.965ms 49 50 98.00 %
V2S sec_cm_main_sm_fsm_sparse csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_updrsp_fsm_sparse csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_update_fsm_sparse csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_blk_enc_fsm_sparse csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_outblk_fsm_sparse csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_gen_cmd_ctr_redun csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_drbg_upd_ctr_redun csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_drbg_gen_ctr_redun csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_ctrl_mubi csrng_alert 18.000s 2.210ms 500 500 100.00 %
V2S sec_cm_main_sm_ctr_local_esc csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
V2S sec_cm_constants_lc_gated csrng_stress_all 8.217m 84.965ms 49 50 98.00 %
V2S sec_cm_sw_genbits_bus_consistency csrng_alert 18.000s 2.210ms 500 500 100.00 %
V2S sec_cm_tile_link_bus_integrity csrng_tl_intg_err 5.000s 815.392us 20 20 100.00 %
V2S sec_cm_aes_cipher_fsm_sparse csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_aes_cipher_fsm_redun csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
V2S sec_cm_aes_cipher_ctrl_sparse csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
V2S sec_cm_aes_cipher_fsm_local_esc csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
V2S sec_cm_aes_cipher_ctr_redun csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
csrng_sec_cm 9.000s 179.763us 5 5 100.00 %
V2S sec_cm_aes_cipher_data_reg_local_esc csrng_intr 10.000s 313.847us 200 200 100.00 %
csrng_err 8.000s 24.949us 500 500 100.00 %
V2S TOTAL 75 75 100.00 %
V3 stress_all_with_rand_reset csrng_stress_all_with_rand_reset 2.583m 12.978ms 10 10 100.00 %
V3 TOTAL 10 10 100.00 %
TOTAL 1629 1630 99.94 %

Coverage Results

Coverage Dashboard

Score Block Branch Statement Expression Toggle Fsm Assertion CoverGroup
97.59 % 98.76 % 96.96 % 99.85 % 96.77 % 92.08 % 100.00 % 95.53 % 90.12 %

Failure Buckets

  • UVM_ERROR (csrng_scoreboard.sv:166) [scoreboard] Check failed intr_pins[i] === (intr_en[i] & item.d_data[i]) (* [*] vs * [*]) Interrupt_pin: EntropyReq has 1 failures:
    • Test csrng_stress_all has 1 failures.
      • 42.csrng_stress_all.7201815913989753525406440744181533782652175777971277456600672816489512363970
        Line 146, in log /scratch/glaserf/opentitan/scratch/csrng_sfifo_pr/csrng-sim-xcelium/42.csrng_stress_all/latest/run.log

          UVM_ERROR @ 5722333422 ps: (csrng_scoreboard.sv:166) [uvm_test_top.env.scoreboard] Check failed intr_pins[i] === (intr_en[i] & item.d_data[i]) (0x1 [1] vs 0x0 [0]) Interrupt_pin: EntropyReq
          UVM_INFO @ 5722333422 ps: (uvm_report_catcher.svh:705) [UVM/REPORT/CATCHER]
          --- UVM Report catcher Summary ---
        

INFO: [FlowCfg] [scratch_path]: [csrng] [/scratch/glaserf/opentitan/scratch/csrng_sfifo_pr/csrng-sim-xcelium]
ERROR: [dvsim] Errors were encountered in this run.

          [   legend    ]: [Q: queued, D: dispatched, P: passed, F: failed, K: killed, T: total]                                                                                                                                                             
00:01:04  [    build    ]: [Q: 0, D: 0, P: 2, F: 0, K: 0, T: 2] 100%                                                                                                                                                                                         
00:17:11  [     run     ]: [Q: 0, D: 0, P: 1629, F: 1, K: 0, T: 1630] 100%                                                                                                                                                                                   
00:17:41  [  cov_merge  ]: [Q: 0, D: 0, P: 1, F: 0, K: 0, T: 1] 100%                                                                                                                                                                                         
00:17:45  [ cov_report  ]: [Q: 0, D: 0, P: 1, F: 0, K: 0, T: 1] 100%

@glaserf glaserf marked this pull request as ready for review November 3, 2025 07:20
@glaserf glaserf requested review from a team as code owners November 3, 2025 07:20
@glaserf glaserf requested review from Razer6, andreaskurth, marnovandermaas, meisnere, moidx, pamaury, rswarbrick and vogelpi and removed request for a team, marnovandermaas and pamaury November 3, 2025 07:20
Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a nontrivial comment on the first commit, but the later commits basically have comments asking whether you can make it easier for me to review :-) I claim that it's not entirely selfish, because it will also make it easier for future readers to understand the history...

I'm excited by how much can be ripped out though! Very nice!

reseed_cnt_reached_q[ai];
assign reseed_cnt_reached_d[ai] = (state_db_wr_vld && (state_db_wr_data.inst_id == ai)) ?
(state_db_wr_data.rs_ctr >= reg2hw.reseed_interval.q) :
reseed_cnt_reached_q[ai];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think this is a character too far in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the alignment is still not right for that last line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gnah, ofc you are right. Third time's the charm, I guess :(

This bit will stay set until the next reset.
'''
}
{ bits: "7",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's easy, I'd consider splitting this commit in two, where the first part removes the FIFO (and wires zero to this error signal) and the second part removes the register field. I think the result would probably be a lot easier to follow.

Copy link
Contributor Author

@glaserf glaserf Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, splitting this up would be quite a bit of work, as this affects in total six commits in this and the follow-up PR (which would then become twelve or 13 commits, given your suggestion of splitting one of them into three). Apart from this, I would like to keep the regfile changes together with the rtl and dv changes in a single commit for each FIFO, respectively, for the following reasons:

  • Doing otherwise would break consistency with the already merged [csrng/rtl] Remove four prim_fifo_sync from the data path #28428
  • Splitting the changes up would make the commits not self-contained anymore, which they currently are. We'd introduce commits to master where the documentation claims a register field and associated functionality that is not there. IIRC that goes against the contribution guidelines.

Of course, please let me know if you feel strongly that the split up would be necessary.

This bit will stay set until the next reset.
'''
}
{ bits: "3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit like with the previous commit, can this one be split as well? Here, it would be in three parts. I think the SFIFO_RCSTATE_ERR field could be removed as a later commit (and driven with zero beforehand). Similarly, I think DRBG_CMD_SM_ERR be added as a first commit (driven with zero). That way, all the "register shuffling cruft" gets separated from the real work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my reply to your question in the previous commit which should (hopefully, at least 😊) address all comments that request the split-out of the regfile changes.

This bit will stay set until the next reset.
'''
}
{ bits: "4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realise that I'm repeating myself (sorry!), but I think it would make sense to split this commit into two pieces: the first one would remove the fifo and wire zero into the error field; the second would remove the field.

Copy link
Contributor

@vogelpi vogelpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the first commits and will continue later. Thanks for the PR @glaserf !

Copy link
Contributor

@vogelpi vogelpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now also reviewed the final two commits and I have some more questions. But this looks good to me in general.

Copy link
Contributor Author

@glaserf glaserf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rswarbrick and @vogelpi for the swift and thorough reviews! I have addressed your comments in individual replies and pushed the appropriate changes.

@rswarbrick I addressed your comments about splitting up the commits in a reply to one of them, I hope that is okay.

reseed_cnt_reached_q[ai];
assign reseed_cnt_reached_d[ai] = (state_db_wr_vld && (state_db_wr_data.inst_id == ai)) ?
(state_db_wr_data.rs_ctr >= reg2hw.reseed_interval.q) :
reseed_cnt_reached_q[ai];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

This bit will stay set until the next reset.
'''
}
{ bits: "7",
Copy link
Contributor Author

@glaserf glaserf Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, splitting this up would be quite a bit of work, as this affects in total six commits in this and the follow-up PR (which would then become twelve or 13 commits, given your suggestion of splitting one of them into three). Apart from this, I would like to keep the regfile changes together with the rtl and dv changes in a single commit for each FIFO, respectively, for the following reasons:

  • Doing otherwise would break consistency with the already merged [csrng/rtl] Remove four prim_fifo_sync from the data path #28428
  • Splitting the changes up would make the commits not self-contained anymore, which they currently are. We'd introduce commits to master where the documentation claims a register field and associated functionality that is not there. IIRC that goes against the contribution guidelines.

Of course, please let me know if you feel strongly that the split up would be necessary.

@glaserf glaserf force-pushed the csrng_sfifo_pr branch 2 times, most recently from d16ce56 to 205519d Compare November 4, 2025 18:21
Copy link
Contributor

@vogelpi vogelpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my comments, this looks good to me!

@vogelpi
Copy link
Contributor

vogelpi commented Nov 5, 2025

CHANGE AUTHORIZED: hw/ip/csrng/data/csrng.hjson
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_block_encrypt.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_core.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_ctr_drbg_cmd.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_ctr_drbg_upd.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_main_sm.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_reg_pkg.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_reg_top.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_state_db.sv

This PR modifies the RTL of CSRNG to remove more area and simplify the design. The changes are part of a bigger restructuring effort which has been discussed in multiple WG meetings. The pass rate and coverage remain above the V2(S) thresholds. This is fine.

Copy link
Contributor

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments from my side.

reseed_cnt_reached_q[ai];
assign reseed_cnt_reached_d[ai] = (state_db_wr_vld && (state_db_wr_data.inst_id == ai)) ?
(state_db_wr_data.rs_ctr >= reg2hw.reseed_interval.q) :
reseed_cnt_reached_q[ai];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the alignment is still not right for that last line.

logic unused_state_db_inst_state;

assign unused_err_code_test_bit = (|err_code_test_bit[19:16]) || (|err_code_test_bit[27:26]) ||
assign unused_err_code_test_bit = err_code_test_bit[27] || (|err_code_test_bit[19:16]) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What bout 26?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Marno, I will carefully check again if I made a mistake here. It's quite a pain to keep track of these unused bits and in addition there was one bit wrong in there right from the start (before I started the refactoring efforts at all), but I forgot which one it exactly was.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it turns out, it was indeed err_code_test_bit[26] that is (and always was) indeed used and therefore does not belong here in the unused bits list.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I've noticed as well when reviewing this.

err_code_test_bit[8] || (|err_code_test_bit[6:5]) ||
err_code_test_bit[2];
assign unused_enable_fo = cs_enable_fo[10] || (|cs_enable_fo[8:7]) || cs_enable_fo[4];
assign unused_enable_fo = cs_enable_fo[42] || cs_enable_fo[10] || (|cs_enable_fo[8:7]) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 42 added here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is not used anymore, see this line (I hope the link works after rebase -i, it was on line 1126 of the old state.

Comment on lines 1480 to 1468
err_code_test_bit[8] || (|err_code_test_bit[6:5]) ||
err_code_test_bit[2];
assign unused_enable_fo = cs_enable_fo[42] || cs_enable_fo[10] || (|cs_enable_fo[8:7]) ||
cs_enable_fo[4];
(|err_code_test_bit[8:5]) || err_code_test_bit[2];
assign unused_enable_fo = cs_enable_fo[42] || (|cs_enable_fo[10:7]) || cs_enable_fo[4];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some of these changes crept into the previous commit unintentionally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm no, this is fine I think: This commit makes

  • err_code_test_bit[7]
  • cs_enable_fo[9]

unused, which is what the diff should add to the respective unused-signals.

@phani-lowrisc
Copy link
Contributor

+1 fr DV changes.

Replace the toggle-style state db arbitration by a simple valid-based
scheme that leverages the fact that the ctr_drbg_gen and ctr_drbg_cmd
units cannot deadlock or starve each other.

Signed-off-by: Florian Glaser <[email protected]>
This removal requires slight adaptions to the handshaking done with
block_encrypt as well as the removal of a complex SVA from the tb.

No functional or timing impact; the response data from block_encrypt
even still feed into registers.

Signed-off-by: Florian Glaser <[email protected]>
This commit removes another large FIFO from the data path, measuring
about 6kGE. Since the data path bifurcates in ctr_drbg_cmd for all
commands that require processing by ctr_drbg_upd, a simple FSM is now
required to orchestrate handshaking between the upstream requester,
ctr_drbg_upd and the keyvrc FIFO.

This step hence also requires the testing of the added sparse-encoded
FSM in dv, documentation of this SEC.CM, and a corresponding bit in the
ERR_CODE register.

Signed-off-by: Florian Glaser <[email protected]>
This commit removes the last FIFO from the ctr_drbg_cmd module. Since
the request and response ready signals are now in many cases asserted in
the same cycle, slight adaptions to the main FSM are also necessary.

Signed-off-by: Florian Glaser <[email protected]>
Copy link
Contributor Author

@glaserf glaserf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marnovandermaas and @rswarbrick for your feedback. I hopefully have now addressed all your points. Please have another look :)

logic unused_state_db_inst_state;

assign unused_err_code_test_bit = (|err_code_test_bit[19:16]) || (|err_code_test_bit[27:26]) ||
assign unused_err_code_test_bit = err_code_test_bit[27] || (|err_code_test_bit[19:16]) ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it turns out, it was indeed err_code_test_bit[26] that is (and always was) indeed used and therefore does not belong here in the unused bits list.

err_code_test_bit[8] || (|err_code_test_bit[6:5]) ||
err_code_test_bit[2];
assign unused_enable_fo = cs_enable_fo[10] || (|cs_enable_fo[8:7]) || cs_enable_fo[4];
assign unused_enable_fo = cs_enable_fo[42] || cs_enable_fo[10] || (|cs_enable_fo[8:7]) ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is not used anymore, see this line (I hope the link works after rebase -i, it was on line 1126 of the old state.

Comment on lines 1480 to 1468
err_code_test_bit[8] || (|err_code_test_bit[6:5]) ||
err_code_test_bit[2];
assign unused_enable_fo = cs_enable_fo[42] || cs_enable_fo[10] || (|cs_enable_fo[8:7]) ||
cs_enable_fo[4];
(|err_code_test_bit[8:5]) || err_code_test_bit[2];
assign unused_enable_fo = cs_enable_fo[42] || (|cs_enable_fo[10:7]) || cs_enable_fo[4];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm no, this is fine I think: This commit makes

  • err_code_test_bit[7]
  • cs_enable_fo[9]

unused, which is what the diff should add to the respective unused-signals.

This bit will stay set until the next reset.
'''
}
{ bits: "3",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my reply to your question in the previous commit which should (hopefully, at least 😊) address all comments that request the split-out of the regfile changes.

reseed_cnt_reached_q[ai];
assign reseed_cnt_reached_d[ai] = (state_db_wr_vld && (state_db_wr_data.inst_id == ai)) ?
(state_db_wr_data.rs_ctr >= reg2hw.reseed_interval.q) :
reseed_cnt_reached_q[ai];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gnah, ofc you are right. Third time's the charm, I guess :(

@andreaskurth
Copy link
Contributor

CHANGE AUTHORIZED: hw/ip/csrng/data/csrng.hjson
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_block_encrypt.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_core.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_ctr_drbg_cmd.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_ctr_drbg_upd.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_main_sm.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_reg_pkg.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_reg_top.sv
CHANGE AUTHORIZED: hw/ip/csrng/rtl/csrng_state_db.sv

This PR modifies the RTL of CSRNG to remove more area and simplify the design. The changes are part of a bigger restructuring effort which has been discussed in multiple WG meetings. The pass rate and coverage remain above the V2(S) thresholds. This is fine.

@vogelpi vogelpi added the CI:Rerun Rerun failed CI jobs label Nov 10, 2025
@github-actions github-actions bot removed the CI:Rerun Rerun failed CI jobs label Nov 10, 2025
@vogelpi vogelpi added this pull request to the merge queue Nov 10, 2025
Merged via the queue into lowRISC:master with commit 81ccf27 Nov 10, 2025
49 of 50 checks passed
@glaserf glaserf deleted the csrng_sfifo_pr branch November 13, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants