Skip to content

[rv_dm,dv] Make the scoreboard TL handling a bit clearer#29920

Open
rswarbrick wants to merge 1 commit intolowRISC:masterfrom
rswarbrick:rv-dm-invalid-regs
Open

[rv_dm,dv] Make the scoreboard TL handling a bit clearer#29920
rswarbrick wants to merge 1 commit intolowRISC:masterfrom
rswarbrick:rv-dm-invalid-regs

Conversation

@rswarbrick
Copy link
Copy Markdown
Contributor

@rswarbrick rswarbrick commented Apr 26, 2026

The reason for making the change is that the scoreboard was failing an assertion that tried to check every access was either to a memory or to a known CSR.

This isn't true, because the debug memory is represented as an array of CSRs and out-of-bound accesses in the debug memory map are ignored in the design. Indeed, the layout of the debug memory in the PULP project is documented as an "implementation detail of the Debug Module".

Changes in this commit:

  • Split the process_tl_access task into separate parts for the register and debug memory interfaces.

  • Do the case split on register directly ("if (csr == blk.some_register)" instead of doing a shell globbing match on the CSR name.

  • Actually check the result from calling csr.predict

  • Allow access to unknown registers in the debug memory, but check they respond with no error and with zero read data.

@rswarbrick rswarbrick requested a review from SamuelRiedel April 26, 2026 20:55
@rswarbrick rswarbrick added the Component:DV DV issue: testbench, test case, etc. label Apr 26, 2026
@rswarbrick rswarbrick requested a review from a team as a code owner April 26, 2026 20:55
@rswarbrick rswarbrick requested review from hcallahan-lowrisc and removed request for a team April 26, 2026 20:55
Copy link
Copy Markdown
Contributor

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

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

Some comments from my side. I feel like this PR does more than the commit message says since it essentially rewrites all the logic, maybe it is worth explaining that rewrite.

Comment thread hw/ip/rv_dm/dv/env/rv_dm_scoreboard.sv Outdated
do_read_check = 0;
end else if (csr inside {blk.dataaddr}) begin
end else if (csr inside {blk.flags}) begin
// hw can update this value. So check manually.
Copy link
Copy Markdown
Contributor

@marnovandermaas marnovandermaas May 8, 2026

Choose a reason for hiding this comment

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

Nit: start comment with capital.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree. I hadn't actually touched the line, but (since I touched the one next door) it probably makes sense to fix.

Done!

Comment thread hw/ip/rv_dm/dv/env/rv_dm_scoreboard.sv Outdated

// If reg_mirrored has been cleared, this is not a register that we model. Nothing more to do
// here.
if (!reg_mirrored) return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't we put this inside the else statement above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let's do that. I suspect I was thinking about the csr == null case when I wrote this, but that has completely handled already, so there's no need.

I suspect that I'd restructured this a bit when writing the PR. Thanks for spotting that things are now a bit silly.

@rswarbrick rswarbrick force-pushed the rv-dm-invalid-regs branch from 575599b to 666efd8 Compare May 9, 2026 22:10
The reason for making the change is that the scoreboard was failing an
assertion that tried to check every access was either to a memory or
to a known CSR.

This isn't true, because the debug memory is represented as an array
of CSRs and out-of-bound accesses in the debug memory map are ignored
in the design. Indeed, the layout of the debug memory in the PULP
project is documented as an "implementation detail of the Debug
Module".

Changes in this commit:

  - Split the process_tl_access task into separate parts for the
    register and debug memory interfaces.

  - Do the case split on register directly ("if (csr ==
    blk.some_register)" instead of doing a shell globbing match on the
    CSR name.

  - Actually check the result from calling csr.predict

  - Allow access to unknown registers in the debug memory, but check
    they respond with no error and with zero read data.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
@rswarbrick rswarbrick force-pushed the rv-dm-invalid-regs branch from 666efd8 to 7d3a2a8 Compare May 9, 2026 22:11
@rswarbrick
Copy link
Copy Markdown
Contributor Author

Some comments from my side. I feel like this PR does more than the commit message says since it essentially rewrites all the logic, maybe it is worth explaining that rewrite.

Good point. I've expanded out the commit message (and will update the PR description in a sec).

@rswarbrick rswarbrick requested a review from marnovandermaas May 9, 2026 22:13
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:rv_dm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants