Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[entropy_src] Factor distr FIFO errors into ERR_CODE.FIFO_[STATE,READ,WRITE]_ERR #23988

Open
vogelpi opened this issue Jul 11, 2024 · 1 comment
Assignees
Labels
IP:entropy_src NoECO_IntegratePostM5 Accepted for integration post M5 Subsystem:Entropy entropy_src, csrng, or edn related issues Type:Bug Bugs

Comments

@vogelpi
Copy link
Contributor

vogelpi commented Jul 11, 2024

Description

Currently, errors triggered inside the distribution FIFO aren't factored into the ERR_CODE.FIFO_[STATE,READ,WRITE]_ERR fields. They still lead to a fatal alert and they still show up as error in the ERR_CODE CSR, but the type of error isn't reflected. This is an RTL bug but it's obviously not very critical.

The reason is simply that I forgot to include that signals into the fifo_[write,read,status]_err_sum signals. So it's very easy to fix. From entropy_src_core.sv:

  assign fifo_write_err_sum =
         sfifo_esrng_err[2] ||
         sfifo_observe_err[2] ||
         sfifo_esfinal_err[2] ||
         err_code_test_bit[28];
  assign fifo_read_err_sum =
         sfifo_esrng_err[1] ||
         sfifo_observe_err[1] ||
         sfifo_esfinal_err[1] ||
         err_code_test_bit[29];
  assign fifo_status_err_sum =
         sfifo_esrng_err[0] ||
         sfifo_observe_err[0] ||
         sfifo_esfinal_err[0] ||
         err_code_test_bit[30];
@vogelpi vogelpi added Type:Bug Bugs IP:entropy_src NoECO_IntegratePostM5 Accepted for integration post M5 labels Jul 11, 2024
@vogelpi vogelpi added the Subsystem:Entropy entropy_src, csrng, or edn related issues label Jul 11, 2024
@vogelpi
Copy link
Contributor Author

vogelpi commented Aug 8, 2024

Related to this, I also noted that the signaling of errors via ERR_CODE CSR is handled a bit differently between ENTROPY_SRC and CSRNG/EDN:

  • CSRNG only signals errors via ERR_CODE if the module is enabled

// set the err code source bits
assign hw2reg.err_code.sfifo_cmd_err.d = 1'b1;
assign hw2reg.err_code.sfifo_cmd_err.de = cs_enable_fo[2] &&
(|cmd_stage_sfifo_cmd_err_sum);

  • EDN signals the FIFO errors when the module is enabled, FSM errors are always signaled

// set the err code source bits
assign hw2reg.err_code.sfifo_rescmd_err.d = 1'b1;
assign hw2reg.err_code.sfifo_rescmd_err.de = edn_enable_fo[ReseedCmdErr] && sfifo_rescmd_err_sum;
assign hw2reg.err_code.sfifo_gencmd_err.d = 1'b1;
assign hw2reg.err_code.sfifo_gencmd_err.de = edn_enable_fo[GenCmdErr] && sfifo_gencmd_err_sum;
assign hw2reg.err_code.edn_ack_sm_err.d = 1'b1;
assign hw2reg.err_code.edn_ack_sm_err.de = edn_ack_sm_err_sum;
assign hw2reg.err_code.edn_main_sm_err.d = 1'b1;
assign hw2reg.err_code.edn_main_sm_err.de = edn_main_sm_err_sum;
assign hw2reg.err_code.edn_cntr_err.d = 1'b1;
assign hw2reg.err_code.edn_cntr_err.de = edn_cntr_err_sum;

  • ENTROPY_SRC always signals errors via ERR_CODE register

// set the err code source bits
assign hw2reg.err_code.sfifo_esrng_err.d = 1'b1;
assign hw2reg.err_code.sfifo_esrng_err.de = sfifo_esrng_err_sum;

I think it would be better aligning ENTROPY_SRC with the other two blocks to ease integrations in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IP:entropy_src NoECO_IntegratePostM5 Accepted for integration post M5 Subsystem:Entropy entropy_src, csrng, or edn related issues Type:Bug Bugs
Projects
None yet
Development

No branches or pull requests

2 participants