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

Enable entropy_src block level tests to run using vcs simulator tool … #24730

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

venkatk-ot
Copy link
Contributor

…by fixing a couple of issues

Issue 1: csr_rd function didn't specify all required arguments. In this case, it was the value argument.
------------------------------------------------------------------- Error-[TFAFTC] Too few arguments to function/task call
../src/lowrisc_dv_entropy_src_env_0.1/seq_lib/entropy_src_rng_vseq.sv, 507
vcs_paramclassrepository, "csr_utils_pkg::csr_rd(ral.fw_ov_wr_fifo_full.fw_ov_wr_fifo_full);"
The above function/task call is not done with sufficient arguments.
-------------------------------------------------------------------- Solution: declare a variable (call it unused for clarity that the value will not be sampled elsewhere in code) pass this 'unused' variable as the value argument of the csr_rd call -------------------------------------------------------------------- -------------------------------------------------------------------- Issue 2: code to disable assertion from within sequences using XMR doesnt compile This is because VCS prohibits SV class inside a package to have XMRs to code in module outside -------------------------------------------------------------------- Error-[SV-LCM-HRP] Hierarchical reference in package
../src/lowrisc_dv_entropy_src_env_0.1/seq_lib/entropy_src_rng_vseq.sv, 861
entropy_src_env_pkg, "tb.dut.u_entropy_src_core.AtReset_EsrngFifoPushedIntoEsbitOrPosthtFifos_A"
Hierarchical reference from package 'entropy_src_env_pkg' into module 'tb'
is not allowed.
-------------------------------------------------------------------- Solution: move the functions containing assert_off tasks to the entropy_src_path_if call these functions as appropriate from the sequences using handle to the virtual interface

@venkatk-ot venkatk-ot requested a review from a team as a code owner October 4, 2024 02:11
@venkatk-ot venkatk-ot requested review from eshapira and removed request for a team October 4, 2024 02:11
Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

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

Hah, this is quite funny! The "assertoff in a vseq" code was actually my fault (6a75417). With this change, the net result is squashing together two interfaces. I wish I'd thought to do that in the first place!

As with the OTBN example, please could you split this into two commits (one for each change) and give each commit a helpful error message?

@venkatk-ot
Copy link
Contributor Author

split into two different commits done!

@venkatk-ot venkatk-ot force-pushed the entropy_vcs branch 2 times, most recently from 4e2cab1 to 2f38965 Compare October 5, 2024 02:00
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.

Thanks @venkatk-ot for your PR! The code looks good to me.

Can you please update the commit messages to follow our guidance. This will help us tracking changes (relevant for porting across branches etc.). In particular, we would need you to:

  • Add a tag to the subject line of the commit message, e.g., [entropy_src/dv] would be very suitable
  • Wrap lines at 72 chars max. This holds for subject and body.
  • It's great that you motivate why the changes are needed, but including the error message of the tool is not required.

To give you an example, the commit message of your second commit could be:

[entropy_src/dv] Add missing 'value' argument to the csr_rd call

This change fixes an issue seen when trying to run the entropy_src
block using VCS. A call of csr_rd() function did not specify all
required arguments. This commit solves the issue by declaring a
variable (it's called unused for clarity that the value will not be
sampled elsewhere in code) and passing this 'unused' variable as the
value argument of the csr_rd call.

Signed-off-by: Venkat Krishnan <venkateswarank.opentitan@gmail.com>

This change fixes an issue seen when trying to run the entropy_src
block using VCS. A call of csr_rd() function did not specify all
required arguments. This commit solves the issue by declaring a
variable (it's called unused for clarity that the value will not be
sampled elsewhere in code) and passing this 'unused' variable as the
value argument of the csr_rd call.

Signed-off-by: Venkat Krishnan <venkateswarank.opentitan@gmail.com>
@venkatk-ot
Copy link
Contributor Author

Thanks @vogelpi . I have updated the commit messages per your suggestions. Please take a look.

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.

Thanks @venkatk-ot for implementing the feedback. This looks good to me!

@vogelpi
Copy link
Contributor

vogelpi commented Oct 10, 2024

@venkatk-ot , after triggering the lint step, I noticed some Verible lint warnings that fail CI:

### Messages for Build Mode `'default'`
#### Lint Warnings
../src/lowrisc_dv_entropy_src_env_0.1/entropy_src_path_if.sv:50:8-21: Explicitly define static or automatic lifetime for non-class tasks [Style: function-task-explicit-lifetime] [explicit-task-lifetime]

../src/lowrisc_dv_entropy_src_env_0.1/entropy_src_path_if.sv:99:17-46: Explicitly define static or automatic lifetime for non-class functions [Style: function-task-explicit-lifetime] [explicit-function-lifetime]

Would you mind fixing these please? You can locally re-run Verible lint using:

util/dvsim/dvsim.py hw/top_earlgrey/lint/top_earlgrey_dv_lint_cfgs.hjson --tool veriblelint --local --purge --select-cfgs entropy_src

This change fixes a build issue seen when trying to run the entropy_src
using VCS simulator. The code to disable assertion from within sequences
using XMR doesnt compile.This is because VCS prohibits SV class inside
a package to have XMRs to code in module outside
The solution implemented in this commit moves the functions containing
assert_off tasks to the entropy_src_path_if.
These functions are then called as appropriate from the sequences using
a handle to the virtual interface

Signed-off-by: Venkat Krishnan <venkateswarank.opentitan@gmail.com>
@venkatk-ot
Copy link
Contributor Author

@vogelpi , thanks for letting me know the errors and steps to reproduce them.
I have fixed the lint warnings in the latest patch

@moidx moidx merged commit 8a1401d into lowRISC:master Oct 11, 2024
42 checks passed
@moidx
Copy link
Contributor

moidx commented Oct 11, 2024

Picking this up before the next regression run. Thanks everyone.

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.

4 participants