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/dv] Test whether noise source symbols are not dropped #21821

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

h-filali
Copy link

@h-filali h-filali commented Mar 4, 2024

This PR adds checks for the comparison between entropy coming in from the noise source and the entropy going into the observe FIFO.
For further information check the commit message.
This reasolves #20953

I had to change the used vseq for the fw_ov test from the rng_vseq to the fw_ov_vseq.
We need to discuss whether I should add a new test instead.
I also still need to set the cfg for the fw_ov test appropriately once discussed.

@h-filali h-filali requested a review from a team as a code owner March 4, 2024 17:09
@h-filali h-filali requested review from hcallahan-lowrisc, vogelpi and andreaskurth and removed request for a team and hcallahan-lowrisc March 4, 2024 17:09
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.

Nice work, thanks for doing this @h-filali !

I also checked the functions filling the observe_fifo_q. I think this PR is exactly what we need. :-)

end else begin
observe_fifo_drops++;
msg = $sformatf("Dropped word: %d\n", observe_fifo_drops);
fork
Copy link
Contributor

Choose a reason for hiding this comment

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

Our of curiosity: why do we need the fork/join_none here?

Copy link
Author

@h-filali h-filali Mar 5, 2024

Choose a reason for hiding this comment

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

I had to add a backdoor read which is time consuming. This is inside of a function so time consuming operations aren't allowed here. So I had two possible solutions either we turn the function into a task or put the time consuming part inside a fork. I went for the latter since in my experience we want the process_tl_access task to consume as little time as possible (I ran into issues in the past because of this).
What do you think should I leave it, turn it into a function or add a comment explaining this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the comment and for explaining. I think that's sufficient. I wasn't aware that forks are even possible inside functions :-)

Comment on lines +227 to +234
// We need to make sure that we can read out 1024 contiguous symbols, that's why
// we set the probability for 128 seeds to 40 pct (this is exactly 1024 symbols
// when using all 4 lanes).
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I can't follow. Would you mind explaining what seed_cnt is please? I couldn't find this really in the code. I know it was there before and you haven't invented the concept but you seem to understand it :-)

Copy link
Author

Choose a reason for hiding this comment

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

So the way I understood it, the seed_cnt used to be the number of 32 bit words extracted in the vseq. In the 4 lane mode one 32 bit word contains 8 symbols. 128 times 8 symbols is exactly the 1024 symbols we want to read out contiguously. I'll write it a bit more clear.

Copy link
Author

Choose a reason for hiding this comment

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

I just noticed. For other vseqs it's the number of bundles read from the observe FIFO. I'll add a new variable for this and keep the seed_cnt as is. For our case here I think it's better to deal in words rather than bundles.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, this sounds good. Thanks for explaining.

@h-filali
Copy link
Author

h-filali commented Mar 5, 2024

@vogelpi thanks for reviewing.
I now added a new test ecplicitly for the fow_ov_contiguous vseq (used to be called fw_ov_vseq).
I also added some comments to the sections you had questions for.
Furthermore I now addressed my comments in the PR message and adapted the settings for the test.
@andreaskurth if you could have a look such that we could merge if the CI passed, that would be great!

This commit adds changes to checks for comparing entropy in the observe FIFO to
the actual noise from the noise source. The scoreboard now knows when pushed
into the observe FIFO is dropped and when it isnt.
This commit also revives a vseq that was unused and changes some settings.
Furthermore, the task reading entropy from the observe FIFO now has optional
checks to make sure that the entropy is contiguous.

Signed-off-by: Hakim Filali <[email protected]>
@vogelpi
Copy link
Contributor

vogelpi commented Mar 6, 2024

I've now rebased this on master. There was an issue not related to this PR.

@vogelpi vogelpi added the Status:Ready to merge PR is ready to be merged by a committer. label Mar 6, 2024
@vogelpi
Copy link
Contributor

vogelpi commented Mar 6, 2024

I am merging this. There was one failure in the SiVal tests but it's spurious and unrelated to this PR. This PR only touches DV files.

@vogelpi vogelpi merged commit 4e422bd into lowRISC:master Mar 6, 2024
31 of 33 checks passed
This was referenced Mar 29, 2024
@h-filali h-filali deleted the es-observe-entropy-match branch October 7, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Ready to merge PR is ready to be merged by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants