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

[dv,usbdev] Type fixes for xcelium testing #20918

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

alees24
Copy link
Contributor

@alees24 alees24 commented Jan 22, 2024

This PR makes minimal changes to the recently-introduced usbdev_smoke test to achieve the same behavior whichever simulation tool is used.

Introduce type casts required for strong typing with xcelium.
Use enum types not strings within usdbev_smoke_vseq; attempting to use run-time strings to identify the different enumeration values does not work, and unfortunately does not result in a build error because the strings are treated as open arrays of bytes and subject to bit-streaming casts.

Introduce type casts required for strong typing with xcelium.
Use enum types not strings within usdbev_smoke_vseq.

Signed-off-by: Adrian Lees <[email protected]>
@alees24 alees24 requested a review from a team as a code owner January 22, 2024 16:14
@alees24 alees24 requested review from jdonjdon and removed request for a team January 22, 2024 16:14
@@ -48,7 +48,7 @@ class usbdev_smoke_vseq extends usbdev_base_vseq;
csr_update(ral.avbuffer);
endtask

task call_token_sequence(input string pkt_type, input string pid_type);
task call_token_sequence(input pkt_type_e pkt_type, input pid_type_e pid_type);
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch @alees24,
apart from strong typing, I think this wouldn't pass even in vcs.

Copy link
Contributor Author

@alees24 alees24 Jan 22, 2024

Choose a reason for hiding this comment

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

It certainly wouldn't have been behaving as intended, but sadly is syntactically permissible according to the specification, given that vcs is not enforcing strong typing rules. It ended up loading the raw bytes from the string literal into the 'm_pid_type' enum variable!

@msfschaffner msfschaffner merged commit 71c00a8 into lowRISC:master Jan 24, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants