Repository navigation
Dev/bypass - #57
Open
DiyouS wants to merge 3 commits into
Open
Dev/bypass#57DiyouS wants to merge 3 commits into
DiyouS wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved correctness issues can compromise memory transactions, preserve neither cached data nor configuration compatibility, and hide test failures.
5 open issues
Preserve conventional cache configuration when bypass is disabled · New Align bypass AXI addresses to beat boundaries · New Avoid data loss when l1d_commit reinitializes the cache · New Cached counters remain stale across tile-private banks · New Reject oversized configurations before array access and collective setup · New
What changed in this PR
Adds a runtime-controlled L1 data-cache bypass path for Spatz and Snitch, connecting private-range accesses directly to DRAM through the existing refill infrastructure.
Changes:
- Adds bypass control registers, routing metadata, and a dedicated single-beat AXI converter.
- Exposes runtime controls and linker storage, with a directed test registered in both CI configurations.
- Updates monitoring and refill-width defaults, and adds FFT stage synchronization for dual-scalar configurations.
| File | Description |
|---|---|
software/tests/l1-bypass/main.c |
Tests scalar/vector bypass accesses, visibility, and timing. |
software/tests/CMakeLists.txt |
Registers the bypass test. |
software/snRuntime/src/l1cache.c |
Implements runtime bypass control. |
software/snRuntime/link/common.ld.in |
Adds the bypass memory region and section. |
software/snRuntime/include/l1cache.h |
Declares the bypass API and cache-maintenance contract. |
software/snRuntime/include/cachepool_peripheral.h |
Adds bypass register definitions and shifts crossbar offsets. |
software/kernels/fp/fft-32b/kernel/fft.c |
Fences intermediate FFT stages on dual-scalar configurations. |
hardware/tb/tb_cachepool.sv |
Uses the expanded DRAM AXI user width. |
hardware/tb/cachepool_monitor.sv |
Separates bypass traffic statistics from cache refills. |
hardware/src/cachepool_tile.sv |
Connects bypass controls and metadata to cache controllers. |
hardware/src/cachepool_reqrsp_to_axi.sv |
Adds single-beat AXI conversion with bypass payload handling. |
hardware/src/cachepool_pkg.sv |
Defines bypass parameters, metadata, and widened AXI types. |
hardware/src/cachepool_group.sv |
Forwards bypass control and updates request metadata. |
hardware/src/cachepool_group_noc_wrapper.sv |
Registers and forwards bypass control. |
hardware/src/cachepool_cluster.sv |
Integrates DRAM converters and bypass assertions. |
hardware/cachepool_peripheral/cachepool_peripheral.sv |
Applies bypass configuration on commit. |
hardware/cachepool_peripheral/cachepool_peripheral_reg.hjson.tmpl |
Defines the bypass control register. |
hardware/cachepool_peripheral/cachepool_peripheral_reg_top.sv |
Implements register storage and decoding. |
hardware/cachepool_peripheral/cachepool_peripheral_reg_pkg.sv |
Updates register types, offsets, and permissions. |
config/README.md |
Documents the full-line refill-width requirement. |
config/config.mk |
Defaults refill width to 512 bits and updates comments. |
config/cachepool_fpu_4g.mk |
Corrects the DRAM-selection comment only. |
config/cachepool_fpu_16g.mk |
Corrects the DRAM-selection comment only. |
config/cachepool_fpu_16g_tiny.mk |
Corrects the DRAM-selection comment only. |
config/cachepool_dual_fpu_4g.mk |
Corrects the DRAM-selection comment only. |
config/cachepool_dual_fpu_16g.mk |
Corrects the DRAM-selection comment only. |
config/cachepool_dual_4g.mk |
Corrects the DRAM-selection comment only. |
config/cachepool_4g.mk |
Corrects the DRAM-selection comment only. |
Bender.yml |
Includes the new AXI converter source. |
Bender.lock |
Updates the Insitu-Cache dependency revision. |
.gitlab-ci.yml |
Adds bypass testing to standard and dual-scalar jobs. |
Review effort: Balanced
| // L1 bypass (built if L1BypassEn; enabled at runtime by L1D_BYPASS): the private range | ||
| // [L1D_ADDR, L1BypassEnd) goes around the L1 cache straight to DRAM. The fixed end keeps a | ||
| // stack overflowing the stack SPM cached. | ||
| localparam bit L1BypassEn = 1'b1; |
Comment on lines
+139
to
+156
| assign axi_req_o.ar.addr = reqrsp_req_i.q.addr; | ||
| assign axi_req_o.ar.len = '0; | ||
| assign axi_req_o.ar.size = {1'b0, reqrsp_req_i.q.size}; | ||
| assign axi_req_o.ar.burst = axi_pkg::BURST_INCR; | ||
| assign axi_req_o.ar.lock = '0; | ||
| assign axi_req_o.ar.cache = axi_pkg::CACHE_MODIFIABLE; | ||
| assign axi_req_o.ar.prot = '0; | ||
| assign axi_req_o.ar.qos = '0; | ||
| assign axi_req_o.ar.region = '0; | ||
| assign axi_req_o.ar.user = q_axi_user; | ||
| assign axi_req_o.ar_valid = q_valid_read; | ||
| assign q_ready_read = axi_rsp_i.ar_ready; | ||
|
|
||
| // ------------- | ||
| // Write Channel | ||
| // ------------- | ||
| assign axi_req_o.aw.id = q_id; | ||
| assign axi_req_o.aw.addr = reqrsp_req_i.q.addr; |
| (uint32_t *)(_snrt_team_current->root->cluster_mem.end + | ||
| CACHEPOOL_PERIPHERAL_L1D_BYPASS_REG_OFFSET); | ||
| *cfg_bypass = en & 0x1u; | ||
| l1d_commit(); |
| #define MAX_CORES 64u | ||
| #define MAX_SLICE_WORDS (BYP_WORDS / 16u) | ||
| static uint32_t vbuf[MAX_CORES][MAX_SLICE_WORDS] __attribute__((section(".data"))); | ||
| static int error_cnt[MAX_CORES] __attribute__((section(".data"))); |
| const uint32_t num_cores = snrt_cluster_vpu_num(); | ||
| const uint32_t cid = snrt_cluster_vpu_idx(); | ||
| const int is_primary = snrt_cluster_is_primary(); | ||
| int num_fails = 0; |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Add bypass path for Spatz and Snitch