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

[aes,dv] Fix coverage definition of AES operation (enc/dec) #20753

Closed
Alfaisal57 opened this issue Jan 3, 2024 · 2 comments · Fixed by #20940
Closed

[aes,dv] Fix coverage definition of AES operation (enc/dec) #20753

Alfaisal57 opened this issue Jan 3, 2024 · 2 comments · Fixed by #20940
Assignees
Labels
Component:DV DV issue: testbench, test case, etc. IP:aes Type:Cleanup Cleanup tasks

Comments

@Alfaisal57
Copy link

Alfaisal57 commented Jan 3, 2024

During regression i found that dec bin never got hit. because missing bit width definition.

covergroup aes_ctrl_cg with function sample(
bit aes_op, //here is the error
bit [aes_pkg::AES_MODE_WIDTH-1:0] aes_mode,
bit [aes_pkg::AES_KEYLEN_WIDTH-1:0] aes_keylen,
bit aes_man_op,
bit aes_sideload,
bit [aes_pkg::AES_PRNGRESEEDRATE_WIDTH-1:0] aes_prng_reseed_rate
);
option.per_instance = 1;
option.name = "aes_ctrl_cg";

cp_operation: coverpoint aes_op
  {
   bins enc     = {AES_ENC};
   bins dec     = {AES_DEC};
   bins illegal = { [0:$] } with ($countones(item) != 1);
  }

Solution :
covergroup aes_ctrl_cg with function sample(
bit [aes_pkg::AES_OP_WIDTH-1:0] aes_op, //Modification
bit [aes_pkg::AES_MODE_WIDTH-1:0] aes_mode,
bit [aes_pkg::AES_KEYLEN_WIDTH-1:0] aes_keylen,
bit aes_man_op,
bit aes_sideload,
bit [aes_pkg::AES_PRNGRESEEDRATE_WIDTH-1:0] aes_prng_reseed_rate
);

Thanks a lot to all contributor !

Edit by @vogelpi :
the file to change is: https://github.com/lowRISC/opentitan/blob/master/hw/ip/aes/dv/cov/aes_cov_if.sv

@rswarbrick
Copy link
Contributor

Oops, that looks like a silly error that we made! Thanks for noticing it. Would you be happy to open a PR with the fix?

At a glance, I think the declaration of cg_ctrl_sample also needs sorting out to match.

@vogelpi vogelpi self-assigned this Jan 23, 2024
@vogelpi vogelpi added Component:DV DV issue: testbench, test case, etc. IP:aes labels Jan 23, 2024
@vogelpi vogelpi added this to the Earlgrey-PROD.M5 milestone Jan 23, 2024
@vogelpi vogelpi added the Type:Cleanup Cleanup tasks label Jan 23, 2024
@vogelpi vogelpi changed the title Error and solution in "https://github.com/lowRISC/opentitan/blob/master/hw/ip/aes/dv/cov/aes_cov_if.sv"coverage definition of AES [aes,dv] Fix coverage definition of AES operation (enc/dec) Jan 23, 2024
vogelpi added a commit to vogelpi/opentitan that referenced this issue Jan 23, 2024
This resolves lowRISC#20753.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
@vogelpi
Copy link
Contributor

vogelpi commented Jan 23, 2024

Thanks for reporting this issue @Alfaisal57 . I've now filed a PR to fix the sample function declaration.

This bug masked a little coverage hole that we should fix at some point. I am not worried about this as the logic is very similar to other register fields but we should do it. I've opened #20941 to track this.

vogelpi added a commit that referenced this issue Jan 25, 2024
This resolves #20753.

Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
This was referenced Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:DV DV issue: testbench, test case, etc. IP:aes Type:Cleanup Cleanup tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants