Skip to content

[dv] Look up more registers through a root map - #31017

Open
rswarbrick wants to merge 3 commits into
lowRISC:masterfrom
rswarbrick:root-map-lookups
Open

[dv] Look up more registers through a root map#31017
rswarbrick wants to merge 3 commits into
lowRISC:masterfrom
rswarbrick:root-map-lookups

Conversation

@rswarbrick

Copy link
Copy Markdown
Contributor
  • The first commit in this PR explicitly looks up a register through a root map in cip_base_scoreboard. This is needed for vertical re-use, because the block-level scoreboard will be using a uvm_reg_map from that block's uvm_reg_block. That won't be the root map, so looking up registers by address doesn't work.
  • The second commit in the PR fixes a bug in the scoreboard where there would be a null pointer dereference if is_tl_csr_write_size_gte_csr_width was called with an address that didn't have an associated register. Now, things behave a little more predictably.
  • The final commit is analogous to the first one, but applies to rom_ctrl_scoreboard (because that is the block that I am trying to reuse vertically).

These changes were found when trying to get #30851 to work properly, and these should be reviewed/merged before that PR.

The is_tl_access_mapped_addr function is designed to tell the
scoreboard whether an address is actually mapped to something in the
block.

This works by asking a uvm_reg_map to look up the address. *This* only
works with the root map, because UVM doesn't pass the addresses to
child maps when setting everything up.

It matters for a chip-level simulation with a block-level scoreboard
sitting inside it. In this case, "block" might be the block's
uvm_reg_block, and block.get_default_map() will return that block's
local map, rather than the chip-level one.

One example of this going wrong the is is_tl_access_mapped_addr
function. Without using the root map, the scoreboard will conclude
that the address is unmapped, and will expect a TileLink error in the
response.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
If get_reg_by_addr fails to find a register, it returns a null result.
The `downcast macro will perfectly happily cast it to a null handle
for an arbitrary type.

Unpack things more carefully and also give a more helpful message if
either of the following casts fails.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
In case this is seeing vertical reuse, we need to look up registers
through the root map.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
@rswarbrick
rswarbrick requested a review from a team as a code owner August 16, 2026 21:01
@rswarbrick rswarbrick added the Component:DV DV issue: testbench, test case, etc. label Aug 16, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant