-
Notifications
You must be signed in to change notification settings - Fork 20
[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
base: main
Are you sure you want to change the base?
Changes from 2 commits
0f0bc80
3c7985b
2410933
8ce4121
33005e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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]), | ||
|
|
@@ -210,21 +210,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 | ||
|
Comment on lines
+230
to
+232
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. Just because I'm interested: Why doesn't |
||
|
|
||
| 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; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.