Skip to content

[dv] Add support for HW_ID for SW#584

Draft
martin-velay wants to merge 1 commit into
lowRISC:mainfrom
martin-velay:sw_dv_hw_id
Draft

[dv] Add support for HW_ID for SW#584
martin-velay wants to merge 1 commit into
lowRISC:mainfrom
martin-velay:sw_dv_hw_id

Conversation

@martin-velay
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Collaborator

@engdoreis engdoreis left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, can you read the HW_ID in the test_framework and print it as test?

parameter bit [31:0] SW_DV_LOG_ADDR = SW_DV_START_ADDR + 'h04;
parameter bit [31:0] SW_DV_HW_ID_ADDR = SW_DV_START_ADDR + 'h08;

parameter bit [31:0] SW_DV_HW_ID = 32'h0000_002A;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are you planing to add this to FPGA?

Copy link
Copy Markdown
Collaborator

@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.

We should also have an ID for the FPGA platform.

Comment thread hw/top_chip/dv/tb/tb.sv Outdated
Comment on lines +252 to +253
`SIM_SRAM_IF.hw_id_addr = SW_DV_HW_ID_ADDR;
`SIM_SRAM_IF.hw_id = SW_DV_HW_ID;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: maybe put this in alphabetical order?

localparam bit [31:0] VERILATOR_SW_DV_TEST_STATUS_ADDR = VERILATOR_SW_DV_START_ADDR + 'h00;
localparam bit [31:0] VERILATOR_SW_DV_HW_ID_ADDR = VERILATOR_SW_DV_START_ADDR + 'h08;

localparam bit [31:0] VERILATOR_HW_ID = 32'h0000_001A; // Verilator specific ID
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How did you choose this value?

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 followed @engdoreis instructions from this issue: #423

@martin-velay
Copy link
Copy Markdown
Contributor Author

@marnovandermaas, about:

We should also have an ID for the FPGA platform.

I am unsure how this can be implemented for the FPGA platform. Maybe I can add something similar as done for Verilator?

@martin-velay
Copy link
Copy Markdown
Contributor Author

@engdoreis

I have tested, and indeed there was an issue. Now I can see this in the trace_hart_0.log:

547633ns    27228 M 00000000100016e6 0 00056603 lwu            a2, 0(a0)             a2  :000000000000002a a0  :0000000020020008 VA: 0000000020020008 PA: 00000020020008

With this patch: diff_sw_dv_hw_id.patch

@martin-velay martin-velay force-pushed the sw_dv_hw_id branch 2 times, most recently from e700905 to cd48d60 Compare May 28, 2026 11:03
- Related to issue lowRISC#423
- This commit adds support for a HW_ID register that can be used by
  SW DV tests to identify the hardware they are running on. This is
  useful for SW DV tests that need to run on multiple hardware platforms
  and need a way to differentiate between them.

Signed-off-by: martin-velay <mvelay@lowrisc.org>
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