-
Notifications
You must be signed in to change notification settings - Fork 18
[dv] Enable DRAM backdoor for the UVM TB #615
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
Open
martin-velay
wants to merge
5
commits into
lowRISC:main
Choose a base branch
from
martin-velay:dv_dram_backdoor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
95705e4
[dv/tb] Move sim DRAM/SRAM wrappers into dv/common
martin-velay 2da4877
[dv/env] Add DRAM backdoor load support to UVM TB
martin-velay c8b67e2
[dv/cfg,sw] Switch UVM tests to DRAM-linked bins
martin-velay 11686de
[dv/env] Fix i2c vseq to use ChipMemDRAM
martin-velay 2738ba2
[ci] Fix sim_sram_axi.svg missing license header
martin-velay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| CAPI=2: | ||
| # Copyright lowRISC contributors (COSMIC project). | ||
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: "lowrisc:mocha_dv:sim_dram_axi:0.1" | ||
| description: "DRAM simulation wrapper providing an AXI-accessible mock memory for chip-level simulation." | ||
| filesets: | ||
| files_dv: | ||
| depend: | ||
| - lowrisc:prim:ram_1p | ||
| - lowrisc:mocha:top_chip_system | ||
| files: | ||
| - sim_dram_wrapper.sv | ||
| file_type: systemVerilogSource | ||
|
|
||
| targets: | ||
| default: | ||
| filesets: | ||
| - files_dv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
...chip/dv/sim_sram_axi/doc/sim_sram_axi.svg → .../common/sim_sram_axi/doc/sim_sram_axi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ module tb; | |
| top_pkg::axi_dram_req_t dram_req; | ||
| top_pkg::axi_dram_resp_t dram_resp; | ||
|
|
||
| dram_wrapper_sim u_dram_wrapper ( | ||
| sim_dram_wrapper u_dram_wrapper ( | ||
| // Clock and reset. | ||
| .clk_i (dut.clkmgr_clocks.clk_main_infra), | ||
| .rst_ni (dut.rstmgr_resets.rst_main_n[rstmgr_pkg::DomainMainSel]), | ||
|
|
@@ -204,21 +204,37 @@ module tb; | |
| .system_base_addr (top_pkg::SRAMBase ) | ||
| ); | ||
|
|
||
| // Zero-initialising the SRAM ensures valid BSS. | ||
| // Zero-initialise SRAM to prevent X-propagation through its AXI path. | ||
| m_mem_bkdr_util[ChipMemSRAM].clear_mem(); | ||
| `MEM_BKDR_UTIL_FILE_OP(m_mem_bkdr_util[ChipMemSRAM], `SRAM_MEM_HIER) | ||
|
|
||
| m_mem_bkdr_util[ChipMemROM] = new( | ||
| .name ("mem_bkdr_util[ChipMemROM]" ), | ||
| .path (`DV_STRINGIFY(`ROM_MEM_HIER) ), | ||
| .depth ($size(`ROM_MEM_HIER) ), | ||
| .n_bits ($bits(`ROM_MEM_HIER) ), | ||
| .path (`DV_STRINGIFY(`ROM_MEM_HIER) ), | ||
| .depth ($size(`ROM_MEM_HIER) ), | ||
| .n_bits ($bits(`ROM_MEM_HIER) ), | ||
| .err_detection_scheme (mem_bkdr_util_pkg::ErrDetectionNone), | ||
| .system_base_addr (top_pkg::RomCtrlMemBase ) | ||
| .system_base_addr (top_pkg::RomCtrlMemBase ) | ||
| ); | ||
|
|
||
| `MEM_BKDR_UTIL_FILE_OP(m_mem_bkdr_util[ChipMemROM], `ROM_MEM_HIER) | ||
|
|
||
| // Zero-init DRAM with a direct SV loop (not clear_mem) before loading the vmem: prim_ram_1p | ||
| // starts as X, and reads outside the binary range propagate into tag-controller FIFOs (DataKnown_A). | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm, this sounds like a bug in the tag controller to me.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am unsure about that one, I don't know the design enough. To whom can I ask to take a look? |
||
| for (int unsigned dram_init_i = 0; dram_init_i < $size(`DRAM_MEM_HIER); dram_init_i++) begin | ||
| `DRAM_MEM_HIER[dram_init_i] = '0; | ||
| end | ||
|
|
||
| m_mem_bkdr_util[ChipMemDRAM] = new( | ||
| .name ("mem_bkdr_util[ChipMemDRAM]" ), | ||
| .path (`DV_STRINGIFY(`DRAM_MEM_HIER) ), | ||
| .depth ($size(`DRAM_MEM_HIER) ), | ||
| .n_bits (longint'($size(`DRAM_MEM_HIER))*$bits(`DRAM_MEM_HIER[0])), | ||
| .err_detection_scheme (mem_bkdr_util_pkg::ErrDetectionNone), | ||
| .system_base_addr (top_pkg::DRAMBase ) | ||
| ); | ||
|
|
||
| `MEM_BKDR_UTIL_FILE_OP(m_mem_bkdr_util[ChipMemDRAM], `DRAM_MEM_HIER) | ||
|
|
||
| // TODO MVy, see if required | ||
| // Zero-initialise the SRAM Capability tags, otherwise TL-UL FIFO assertions will fire; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.