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

[csrng] Extend coverage definition for glen #23847

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hw/dv/sv/csrng_agent/csrng_item.sv
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class csrng_item extends uvm_sequence_item;

constraint c_glen {
glen dist {
// TODO(#18350): Add a bin for 0 (with 5% chance, like for 4095?).
// Note that 0 isn't supported by the implementation, see #23846.
[1:32] :/ 75,
[33:128] :/ 10,
[129:1024] :/ 5,
Expand Down
2 changes: 1 addition & 1 deletion hw/ip/csrng/doc/theory_of_operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Below is a description of the fields of this header:
Each unit represents 128 bits of entropy returned.
This field allows values between 1 and 4095.
A value of 1 returns 1 * 128 bits of entropy.
A value of 4095 returns 4095 * 128 bits of entropy, which is less than the 2<sup>19</sup> bits allowed by NIST (referenced to as <tt>max_number_of_bit_per_request</tt>).
A value of 4095 returns 4095 * 128 bits of entropy, which is less than the 2<sup>19</sup> bits allowed by NIST (referenced to as <tt>max_number_of_bits_per_request</tt>).
</td>
</tr>
<tr>
Expand Down
9 changes: 6 additions & 3 deletions hw/ip/csrng/dv/cov/csrng_cov_if.sv
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,12 @@ interface csrng_cov_if (
}

cp_glen: coverpoint glen {
bins one = { 1 };
bins multiple = { [2:$] };
ignore_bins zero = { 0 };
bins one = { 1 };
bins sml = { [2:32] };
bins med = { [33:128] };
bins lrg = { [129:1024] };
bins xtr = { [1025:4094] };
bins max = { 4095 };
}

// Coverpoint for all of the possible transitions of flag0 that can cause a
Expand Down
Loading