opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[csrng] List of requested changes and improvements

Open glaserf opened this issue 5 months ago • 0 comments

Description

This issue tracks the open points for the refactor and simplification efforts around the CSRNG.

Style

  • [x] Consistently put spaces around operators.
  • [x] Drop module-name prefixes for module-local signals and ports
  • [x] Refactor complex nested ternary-if/else assign statements into readable always_comb processes.

Architecture

  • [x] Remove most, if not all, FIFOs in the data path, which make up almost 50% of the area of the CSRNG without being required for timing or throughput.
  • [x] Simplify the data path. Remove the arbiters between update and cmd/generate stages and block_encrypt and update/generate stages. Fuse the update and generate stages into a single one as the data path of both is almost identical. Give this new unit exclusive access to block_encrypt.
  • [x] Simplify FIFO control signals, make ready independent from valid wherever possible.
  • [x] Remove FIFO error signals, especially the ones that equate to logic zero.
  • [x] Avoid tracking inst_id and cmd through the whole data path (instead select one app intf with a pending operation and make the correct state/data belonging to said interface available for all data path units).
  • [ ] Get rid of the main_sm and include its functionality into the cmd stages and the control logic of the to-be-created combined update_gen block outlined above.
  • [ ] Review the (un)packers present in the design. Find a solution to store adata/pdata for each application interface with the least amount of flops possible.

Features/Improvements

  • [ ] Clarify what the exact condition for skipping the initial update() call on GENerate commands is (pdata/adata being an all-zero bit vector or pdata/adata LENGTH being zero).
  • [ ] Only emit requests from command stages to the core data path after required entropy has become available. This is to avoid stalling the core data path for all app interfaces during possibly very long wait times for entropy to become available. This involves moving the interface handling to and from entropy source from the main FSM to the FSMs inside the command stages and adding simple arbitration logic to the top level.
  • [ ] Add the possibility to abort in-flight generation requests. The EDNs can request very long random bit sequences, during the processing of which it might become necessary to reconfigure an EDN and hence un-instantiate the associated CSRNG instance. Currently, for this to happen, the requested random sequence must be fully consumed first from CSRNG which can take a long time.

glaserf avatar Sep 04 '25 14:09 glaserf