Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
e0ad0f1
simx: deliver same-cycle channel events in the order they were sent
tinebp Oct 6, 2026
cbd9cbe
sw, tests: make device index math portable to RV64
tinebp Oct 8, 2026
577a4af
rtu: carry full-width scene and payload pointers on RV64
tinebp Oct 10, 2026
9e90dab
rtu: NaN-box single-precision slot reads into FP registers on RV64
tinebp Oct 10, 2026
127b039
gfx: store the depth plane modulo 2^32 instead of converting out of r…
tinebp Oct 10, 2026
afd7acb
kernel: check vx_printf formats, and print vx_putint without a float …
tinebp Oct 10, 2026
2a8e29d
sgemm_tcu_wg_dxa: widen the SW_LOAD_B index math, build SW_LOAD_A + S…
tinebp Oct 10, 2026
5d224d8
tests: widen the index math of demo, fence, dogfood, softmax and sgem…
tinebp Oct 10, 2026
5ad73c1
Merge origin/master into rv64-fixes
tinebp Oct 10, 2026
6c26b42
rtu: carry the full scene address through the ray log and rt_replay
tinebp Oct 10, 2026
78dbecf
config: hardware profiles shared by every flow
tinebp Oct 6, 2026
7b91e0e
build: restore the zero-warnings policy everywhere
tinebp Oct 11, 2026
57f28d2
gen_config: accept enum flag overrides whose value contains '_'
tinebp Oct 11, 2026
4b924f2
caps: report exact warp, core and cluster counts
tinebp Oct 11, 2026
5f6d3e1
runtime: VORTEX_VM_MEGAPAGE_HEAP maps the heap with superpages
tinebp Oct 11, 2026
4dbb615
simx: widen the cache config's input count and pipeline latency
tinebp Oct 11, 2026
325d685
lsu: declare the LMEM window parameters only when LMEM exists
tinebp Oct 11, 2026
1642289
tests: guard the global index in vecadd, relu, dropout and minimal
tinebp Oct 11, 2026
997ee24
cache: admit LLC fills against the AMO writeback queue's room
tinebp Oct 11, 2026
843536c
sim: redesign the DRAM model: independent channels, refresh, configur…
tinebp Oct 11, 2026
0897cbd
profiles: add a100, h100, v100, rtx1080 and tinygpu; document profiles
tinebp Oct 11, 2026
21861d6
CHANGELOG: profiles, RV64 portability, zero warnings, DRAM model
tinebp Oct 11, 2026
49613f8
ci: default GEM5_HOME to the configured tool directory
tinebp Oct 11, 2026
1c6ef7e
ci: re-record the rtlsim perf-gate baselines
tinebp Oct 11, 2026
2970e9d
tests: compute dogfood's fused multiply-add references fused
tinebp Oct 11, 2026
0a46eef
vm: share one VPN superpage mask function from the TLB package
tinebp Oct 11, 2026
f80af4c
sim: configure the DRAM model from data-sheet values
tinebp Oct 12, 2026
03efecb
simx: issue warps with the RTL's greedy round-robin arbiter
tinebp Oct 12, 2026
72b574b
simx: let a cache bank pipeline hold one request per stage
tinebp Oct 12, 2026
c068cea
ci: re-record the rtlsim perf-gate baselines for the DRAM model
tinebp Oct 12, 2026
046ff33
Flush caches with one broadcast write and per-port flush tokens
tinebp Oct 13, 2026
ef75f8e
Hash the cache bank select so power-of-two strides spread over the banks
tinebp Oct 15, 2026
bdf3953
Keep the other sectors' dirty bytes when a sector refills a line
tinebp Oct 15, 2026
f9dfa6a
Let fills follow each other into a cache bank pipe back to back
tinebp Oct 15, 2026
7ce8a74
Flush only the L1 caches between launches when the LLC is the coheren…
tinebp Oct 17, 2026
4f173e3
Let a write-back LLC allocate on a store miss without fetching the line
tinebp Oct 18, 2026
e587204
core: decouple fetch width from issue width (VX_CFG_FETCH_WIDTH)
tinebp Oct 18, 2026
285e946
simx: model the RTL's buffer structure at every pipeline boundary
tinebp Oct 18, 2026
397d7d2
rtl: fix -DSCOPE builds of fetch, issue, LSU, TCU and graphics
tinebp Oct 18, 2026
8705e2b
core: derive the core partitioning from the widths
tinebp Oct 18, 2026
e849c56
simx: register the cache core-response port as the RTL does
tinebp Oct 18, 2026
6d7df03
simx: never launch two warps of one CTA into the same slot
tinebp Oct 18, 2026
64c2039
simx: model the depth of the cache networks
tinebp Oct 18, 2026
f367237
simx: register the icache core-response port as the RTL does
tinebp Oct 18, 2026
6f3ea11
ci: add a model_parity case for SGEMM on two frontend slices
tinebp Oct 18, 2026
5f1ef4f
Count global barriers across the whole device, not per cluster
tinebp Oct 18, 2026
3f27ba4
Stop fences at the point of coherence and skip the walk for IO fences
tinebp Oct 19, 2026
9473f26
Let a shared L3 answer L1-only flush tokens without a walk
tinebp Oct 19, 2026
1d3db49
Let the command processor's DMA use the shared last-level cache
tinebp Oct 19, 2026
1de9126
Check a victim's dirty bytes only when the victim way is valid
tinebp Oct 19, 2026
4e1d2a7
Serve a warp's identical loads with one dcache bank access
tinebp Oct 19, 2026
5e8e5c2
Size the local-memory reservation hold budget by the core's harts
tinebp Oct 19, 2026
75984cc
Track MSHR misses in a line table so a cache can hold more in flight
tinebp Oct 19, 2026
227c49e
tests: make mstress check every loaded value
tinebp Oct 19, 2026
f0b7504
simx: give each warp's instruction buffer its staging slot
tinebp Oct 19, 2026
62dc764
simx: send a fence to the data cache as a flush token
tinebp Oct 19, 2026
18b6fe5
simx: stop fences at the point of coherence and skip the walk for IO …
tinebp Oct 19, 2026
2342ffd
simx: serve a warp's identical loads with one dcache bank access
tinebp Oct 19, 2026
c1516d3
simx: route a single cluster's global barrier through its arbiters
tinebp Oct 19, 2026
46080c0
simx: track MSHR misses in a line table when MSHR_LINES is set
tinebp Oct 19, 2026
a2b16ad
simx: let each slice of a cache arbiter tree grant on its own
tinebp Oct 19, 2026
a9bd77b
simx: register a shared cache's input arbiter as the RTL does
tinebp Oct 19, 2026
bbad636
simx: let the command processor's DMA use the shared last-level cache
tinebp Oct 19, 2026
fd151ef
Build VX_csr_fpu only when the F extension is enabled
tinebp Oct 20, 2026
cc7bb17
rtlsim: ask the processor whether the CP DMA is an LLC client
tinebp Oct 20, 2026
5475438
simx: drop the extra register on the LSU's path to commit
tinebp Oct 20, 2026
14f944c
dxa: stream GMEM responses straight to smem_wr again
tinebp Oct 20, 2026
9e95002
Include VX_define.vh before VX_csr_fpu's F-extension guard
tinebp Oct 20, 2026
360cd99
hw/unittest: test the CP DMA port's launch fence
tinebp Oct 20, 2026
64f4268
docs: select the FPGA target with blackbox.sh --target
tinebp Oct 20, 2026
c961402
Round-robin the DXA and TCU on the LMEM DMA port
tinebp Oct 20, 2026
4c0f266
Size each slice of a stream arbiter tree by its own requests
tinebp Oct 21, 2026
f321887
simx: let a cache's port arbiter take more than 64 ports
tinebp Oct 21, 2026
9681b60
Keep each uncached request on its own memory port when a cache has fe…
tinebp Oct 21, 2026
18cccfd
lsu: select the stack-interleave high bits instead of adding the corr…
tinebp Oct 21, 2026
5a3e84f
core: decide the warp-control unit's ready from the opcode
tinebp Oct 21, 2026
f0667eb
simx: hold off a local-memory read after any write and release the co…
tinebp Oct 21, 2026
b3cad81
simx: launch each cluster on the nearest ready core
tinebp Oct 21, 2026
4470f27
simx: count a core's cycles only while it has work
tinebp Oct 21, 2026
7039eea
ci: size the fp16-mc parity case like its perf_gate twin
tinebp Oct 21, 2026
8d9335a
CHANGELOG: memory-level parallelism, phase 1
tinebp Oct 21, 2026
60e7a2b
tests: render raycast at 64x64 by default
tinebp Oct 21, 2026
4faf32c
cache: size the flush-token attribute and hash input to their fields
tinebp Oct 22, 2026
3b241d7
simx: let the CP LLC port build in the functional simulator
tinebp Oct 22, 2026
8e2aa61
core: give each LSU block its own memory path
tinebp Oct 22, 2026
304e0db
core: export the LSU blocks' status bits instead of combining them in…
tinebp Oct 22, 2026
8410590
core: keep each SFU block's CTA context RAM in the block
tinebp Oct 22, 2026
4784485
tcu: give each TCU block its own metadata port into its slice's LSU s…
tinebp Oct 22, 2026
fc0a35b
tcu: move the TCU_LD AGU into each TCU block and drop its gather buffer
tinebp Oct 22, 2026
365895a
core: drop the live-warps CSR bits above XLEN explicitly
tinebp Oct 23, 2026
e311957
core: support a warp count per issue slice that is not a power of two
tinebp Oct 23, 2026
0c603f4
hw/unittest: wire the tcu and tensor wrappers to the per-block TCU me…
tinebp Oct 23, 2026
45e6a23
afu: let the memory ports keep many transactions in flight
tinebp Oct 23, 2026
f93df32
cache: route a crossbar input's ready from its own output, drain slic…
tinebp Oct 24, 2026
c5ed76a
profiles: per-partition fetch and the CP as an LLC client on the GPU …
tinebp Oct 24, 2026
1a3055f
Support core, socket and cluster counts that are not powers of two
tinebp Oct 24, 2026
2183b6a
ci: re-record perf baselines for the MLP Phase 1 timing
tinebp Oct 24, 2026
afd4331
afu: one AXI port per GPU memory port, W forwarded with its AW
tinebp Oct 24, 2026
78f2d2c
simx: model the miss path's buffers and registered stages
tinebp Oct 26, 2026
05d1237
cache: refetch a fully written lazy-fetch sector without a memory read
tinebp Oct 26, 2026
73db36c
simx: model KMU, CTA retirement, barrier and collector timing
tinebp Oct 26, 2026
347c914
runtime: stage kernel args in clean slots without a cache flush
tinebp Oct 26, 2026
3981976
simx: feed full-bandwidth ALU and FPU straight from the dispatch queue
tinebp Oct 26, 2026
03e8304
lsu: split memory fences into acquire and release, order .aq/.rl AMOs
tinebp Oct 26, 2026
d6be497
core: keep the dcache tag whole on passthru lanes so port 0 reads merge
tinebp Oct 26, 2026
a010af4
cache: drop .aq/.rl fences at a coherent dcache, add a bank-0 delay knob
tinebp Oct 26, 2026
b9e7a24
ci: require a debug build to match release cycles (release_parity)
tinebp Oct 26, 2026
009a9d5
tcu: fp32-only output, bit-exact TFR numerics in SimX, tcu_unit test
tinebp Oct 26, 2026
8206c72
ci: check fence_mp's release fence and .rl atomic behind a slow bank 0
tinebp Oct 26, 2026
c9b7816
cache: merge same-line icache fetches from a core's fetch slices
tinebp Oct 26, 2026
1babe84
cache: keep a draining write-through chain pending, retime bank paths
tinebp Oct 26, 2026
32432bb
simx: match LSU ingress, SFU result buffers and lmem crossbar to RTL
tinebp Oct 26, 2026
d0cb49c
cache: fix a lazy-fetch dcache deadlock between AMO write-back and fills
tinebp Oct 26, 2026
5391be5
syn: read vortex_afu.v as SystemVerilog in the Vivado flows
tinebp Oct 26, 2026
7820027
simx: keep the last-level cache across a launch reset
tinebp Oct 26, 2026
b671705
ci: re-record the perf_gate baselines for the MLP changes
tinebp Oct 26, 2026
c08c245
docs: add the memory-level parallelism design document
tinebp Oct 26, 2026
2339de0
syn: leave the XRT platform top out of the yosys AFU DUT
tinebp Oct 26, 2026
058d0e7
Merge origin/master into feature/mlp-phase2
tinebp Oct 26, 2026
1578b79
ci: split the model_parity and perf_gate cells into hour-long shards
tinebp Oct 26, 2026
3500f0a
simx: keep a straddling instruction's low half until decode takes it
tinebp Oct 26, 2026
29c250d
core: drop the MUFU instance the master merge left in VX_sfu_unit
tinebp Oct 26, 2026
48f4e42
ci: re-record the perf_gate baselines after the master merge
tinebp Oct 26, 2026
40ec5f4
core: read the RTU perf counters through the MPM DCR window
tinebp Oct 26, 2026
ffd8a86
AGENTS: drop the proposals section
tinebp Oct 27, 2026
3f25c83
afu: pass the AXI memory ports to VX_afu_wrap as flat buses
tinebp Oct 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 3 additions & 12 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ This is the canonical entry point for **both human contributors and AI coding ag
- [CONTRIBUTING.md](CONTRIBUTING.md) — public fork/PR contribution flow
- [docs/bug_fixes.md](docs/bug_fixes.md) — bug-fix discipline (root-cause vs patch)
- [docs/continuous_integration.md](docs/continuous_integration.md) — CI pipeline
- [docs/proposals/](docs/proposals/) — design and migration proposals (drafts and in-progress)
- [docs/designs/](docs/designs/) — accepted designs (post-proposal, post-implementation)
- [docs/designs/](docs/designs/) — accepted designs (implemented)

---

Expand Down Expand Up @@ -154,19 +153,11 @@ See [docs/coding_guidelines_cpp.md](docs/coding_guidelines_cpp.md) and [docs/cod

---

## 7. Proposals

Design and migration proposals belong in [`docs/proposals/`](docs/proposals/) — never in build dirs or the repo root. A proposal captures the *why* of a non-trivial change before the code lands.

Accepted designs that outlive their proposal phase live in [`docs/designs/`](docs/designs/).

---

## 8. Living Document Policy
## 7. Living Document Policy

This file is versioned alongside the code and evolves with it. Both humans and agents are expected to update it:

- **Add a rule** when you discover a footgun the next contributor will hit. Include the *why*.
- **Update or remove a rule** that's gone stale. A stale rule is worse than no rule.
- **Don't duplicate** content from the topic docs in `docs/`. AGENTS.md links; the topic doc explains.
- **Branch-specific addenda are forbidden.** Branch context goes in a `docs/proposals/<feature>_proposal.md`, not in branch-local `AGENTS.md` variants. If the rule is general, promote it here; if it's a project-tracking detail, keep it in the proposal.
- **Branch-specific addenda are forbidden.** No branch-local `AGENTS.md` variants: if a rule is general, promote it here; project-tracking details stay out of the repo docs.
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,31 @@ follows the version pins recorded in [VERSION](VERSION) (`VORTEX_VERSION`,
- **Hardware profiles.** `profiles/<name>.json` names a machine (`tinygpu`, `rtx1080`, `v100`, `a100`, `h100`, `rtx5080`) that every flow
builds through `configure --profile=<name>` or `blackbox.sh --profile=<name>`; explicit `CONFIGS` win over the profile.
See [docs/simulation.md](docs/simulation.md#hardware-profiles).
- **Per-partition fetch (`VX_CFG_FETCH_WIDTH`, default 1).** The front end splits into FETCH_WIDTH slices, each with its own warp
scheduler, fetch, decode and icache port, serving the warps with `wid % FETCH_WIDTH == f`; CTA dispatch, barriers and warp control
stay core-wide. The core takes one of three structures from the fetch width, issue width and per-unit block counts; with one block
of every unit per issue slice and FETCH_WIDTH equal to ISSUE_WIDTH, each slice is a self-contained compute slice (the NVIDIA
processing-block organization). *Why:* sgemm at 16 warps x 16 threads, ISSUE_WIDTH 4: -31.6% cycles at FETCH_WIDTH 2.
- **Hashed cache bank select (`VX_CFG_{DCACHE,L2}_BANK_HASH`).** The bank index is the raw bank bits XORed with a hash of the line
address above them (IPOLY(5) for 16 banks, IPOLY(37) for 32, an XOR fold otherwise), so power-of-two strides spread over the banks.
On by default for the L2 and for a dcache with 4 or more banks. *Why:* rtlsim sgemv 512x512 at 16 threads -32.8%, fp16 TCU SGEMM
on 2 cores + L2 at 16 threads -13.8%, WGMMA with DXA -13.5%.
- **Dcache read merge (`VX_CFG_DCACHE_READ_MERGE`, on by default).** Plain reads of the same word from the ports of one LSU block in
the same cycle are served by one bank access, and the response is multicast to every port; each port's order into the bank is
unchanged. *Why:* uniform loads (kernel arguments, SGEMM's shared operand) no longer serialize on one bank: rtlsim sgemm -n128 at
16 threads -6.5%, -17.2% with an 8-byte dcache word.
- **Write-allocate without fetch (`VX_CFG_{DCACHE,L2,L3}_LAZY_FETCH`, off by default).** A store miss in a write-back cache installs
the sector with its dirty-byte mask and a partial bit instead of fetching the line; a later load or AMO merges memory data under the
unwritten bytes, and evictions write back only dirty bytes. *Why:* streaming writes no longer read every line first: 1-core vecadd
DRAM reads -33%.
- **MSHR line table (`VX_CFG_{DCACHE,L2,L3}_MSHR_LINES`, off by default).** Misses are tracked in a reference-counted table of
distinct {line, sector} entries, and request entries keep only an index into it, so the MSHR holds more requests without widening
its address compares. *Why:* at 400-cycle memory latency, 64 requests over 16 lines: sgemm -n128 -15.3%, raycast -8.1%.
- **Command-processor DMA through the shared LLC (`VX_CFG_CP_LLC_CLIENT`, off by default).** When one LLC serves every core, the
CP's transfers enter it on their own client slot, so host transfers need only an L1 flush, not a walk of the whole LLC; transfers
of at least half the LLC write around it. A launch behind DMA writes waits for an L1-only flush token sent on the slot. The runtime
sees the new `DMA_LLC_CLIENT` CP capability. *Why:* rtlsim at 2 clusters + L2 + L3: dogfood -30%, multikernel -42.7%; dogfood
-64% with an 8 MB L3.

### Changed

Expand All @@ -23,6 +48,48 @@ follows the version pins recorded in [VERSION](VERSION) (`VORTEX_VERSION`,
(JEDEC HBM2/HBM3/GDDR6 organization and nanosecond timing, 32 B bursts, permuted open-page bank interleave, per-channel
responses), configured from data-sheet values: `VX_CFG_PLATFORM_MEMORY_{TYPE,DATA_RATE,LATENCY,QUEUE_SIZE}`. The default machine
keeps its idle read latency (14/26 cycles open-row/conflict, was 13/27) and one-block-per-cycle peak.
- **Cache flush architecture.** The CP starts every core's flush with one broadcast `CACHE_FLUSH` DCR write, then reads each core's
completion, so the flushes overlap; a flush read without a preceding write no longer starts one. A cache walks its banks, sends one
flush token down every memory port and answers once all ports have; every independently buffered write path (each dcache lane, each
OM input of the ocache) carries its own token. Read-only caches (icache, tcache, rtcache, rcache) no longer forward flushes.
`DBG_FLUSH_STALL` adds random input backpressure to the flush path for stress tests.
- **L1-only flush between launches.** When a single LLC serves every memory client it is the point of coherence, so a launch
boundary cleans only the L1s: `CMD_CACHE_FLUSH` gains an L1-only flag, carried as a flush-token kind that a shared LLC answers
without a walk. Replicated LLCs and LLCs with peer clients (TEX, RTU, RASTER, OM, DXA) still walk. The runtime posts flushes
lazily and flushes fully before any device-memory transfer, and device busy stays high until every core write, uncached IO stores
included, is visible in memory. *Why:* per-launch flush cost at 4 cores + L2 drops from 2,750 to 180 cycles.
- **Targeted fences.** A memory fence sends an L1-only flush token that the shared LLC answers without a walk. A fence that orders
only device (I/O) accesses decodes as its own LSU op, and its token makes each level drain to its memory ports without walking.
*Why:* printf, which fences after each device write, runs 13.6x faster on rtlsim at 2 cores + L2.
- **LMEM DMA arbitration.** DXA writes into shared memory and the TCU's WGMMA operand reads now share the local-memory DMA port
round-robin. DXA had fixed priority and starved the TCU for about 510 cycles per tiled-scatter transfer. *Why:* rtlsim WGMMA with
DXA -10.2%, sparse WGMMA with DXA -11.6%.
- **SimX timing model follows the RTL's structure.** Buffer capacities and registered ready at every pipeline boundary, per-slice
cache arbiter trees and network depths, registered cache core-response ports, flush and fence tokens end to end, and CTA launch onto
the nearest ready core with two launch credits per core. SimX's per-core cycle counter (`mcycle`) now advances only while the core
has work, as the RTL's does. rtlsim completes DRAM requests in per-bank arrival order, as the AXI platform does.

### Fixed

- **Global barriers across clusters.** Each cluster ran its own global-barrier unit that saw only its own cores, while
`vx_num_cores()`, and so `vortex::gbarrier`, counts the whole device. On SimX every global barrier hung with more than one
cluster; on the RTL, 2 clusters x 1 core timed out and 2 clusters x 2 cores released each cluster on its own arrivals, with no
ordering between clusters. One device-level unit now counts every core.
- **Writes left dirty by a flush.** A cache forwarded its flush token on memory port 0 only, so writes queued on another port could
reach the next level after that level's walk and stay dirty there.
- **Dirty sectors dropped on a sector refill.** With dirty-byte tracking and several sectors per line, installing a sector into a
resident line cleared the whole line's byte mask, so a dirty sibling sector wrote back with no bytes enabled and its data was lost
(mstress at 4 cores with a write-back, sectored L2).
- **Local-memory LR/SC livelock at 16 threads.** One warp's per-lane LR burst used up a reservation's fixed hold budget of 7 refusals,
so contended LR/SC loops on shared memory stopped making progress. The budget now scales with the core's harts.
- **`VX_stream_arb` trees with a partial last slice.** When the request count was not a whole number of slices, the last slice's
select was sized and placed as if it were full: the build failed lint, and with several outputs requests went to the wrong output.
- **`-DSCOPE` builds.** The scope buses of fetch, issue, LSU, TCU, TEX, RASTER and OM were declared only under their `DBG_SCOPE_*`
taps, left unbound, or did not parse, so debug-scope builds failed to elaborate.
- **mstress checked no data.** Its host reference was always 0, so the test passed with corrupted loads; it now checks every loaded
value exactly.
- **FPGA run instructions.** The docs exported `TARGET=hw`, which `blackbox.sh` ignores, so runs fell back to xrtsim; they now pass
`--target=hw`.

## [3.0] — 2026-10-07

Expand Down
46 changes: 42 additions & 4 deletions VX_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ VX_CFG_MAX_BAR_EVENTS = 32
VX_CFG_IBUF_SIZE = 4
VX_CFG_DISPATCH_QUEUE_SIZE = 4
VX_CFG_ISSUE_WIDTH = "expr: up($VX_CFG_NUM_WARPS / 16)"
# Fetch slices, each scheduling and fetching its own warps on its own icache
# port: a power of two that divides ISSUE_WIDTH.
VX_CFG_FETCH_WIDTH = 1
VX_CFG_SIMD_WIDTH = "expr: $VX_CFG_NUM_THREADS"
VX_CFG_NUM_OPCS = "expr: up($VX_CFG_NUM_WARPS / (4 * $VX_CFG_ISSUE_WIDTH))"

VX_CFG_NUM_GPR_BANKS = 4
VX_CFG_NUM_VGPR_BANKS = 2

Expand Down Expand Up @@ -205,6 +207,13 @@ l3_is_llc = "expr: $VX_CFG_L3_ENABLED == 1"
single_core = "expr: $VX_CFG_NUM_CORES == 1 and $VX_CFG_NUM_CLUSTERS == 1"
single_cluster = "expr: $VX_CFG_NUM_CLUSTERS == 1"

# The command processor's DMA becomes a client of the last-level cache, which
# is then the point of coherence for host transfers: they need no cache flush.
# Only a last-level cache that alone serves every core can take it (an L2 with
# one cluster, or an L3); VX_CFG_CP_ON_LLC is set where it took effect.
VX_CFG_CP_LLC_CLIENT = 0
VX_CFG_CP_ON_LLC = "expr: int($VX_CFG_CP_LLC_CLIENT != 0 and (($l2_is_llc and $single_cluster) or $l3_is_llc))"

[l1cache]
VX_CFG_ICACHE_SIZE = 16384
VX_CFG_ICACHE_NUM_WAYS = 4
Expand All @@ -215,6 +224,11 @@ VX_CFG_ICACHE_MRSQ_SIZE = 0
VX_CFG_ICACHE_MREQ_SIZE = 0
VX_CFG_ICACHE_CRSQ_SIZE = 0
VX_CFG_ICACHE_MEM_PORTS = 1
# banks behind the fetch-slice request ports
VX_CFG_ICACHE_NUM_BANKS = "expr: pow(2, clog2($VX_CFG_FETCH_WIDTH))"
# Merge same-line fetches from the core's slices in the same cycle into one
# bank access; the response goes to every merged slice, each with its word.
VX_CFG_ICACHE_READ_MERGE = 1
VX_CFG_ICACHE_LATENCY = "expr: 2 + max(0, clog2($VX_CFG_ICACHE_SIZE) - clog2(16384))"

VX_CFG_DCACHE_SIZE = 16384
Expand All @@ -224,9 +238,18 @@ VX_CFG_DCACHE_NUM_WAYS = 4
# stays moderate: NT 1/2/4/8/16/32/64 -> word 4/8/8/16/16/32/32, banks 1/1/2/2/4/4/8.
VX_CFG_DCACHE_WORD_SIZE = "expr: min($VX_CFG_L1_LINE_SIZE, min($VX_CFG_MEM_BLOCK_SIZE, ($VX_CFG_XLEN / 8) * pow(2, (clog2($VX_CFG_NUM_LSU_LANES) + 1) / 2)))"
VX_CFG_DCACHE_WRITEBACK = "expr: int($dcache_is_llc and $single_core)"
VX_CFG_DCACHE_DIRTYBYTES = 0
# LAZY_FETCH (write-back LLC only): a store miss allocates its line without a
# fill and a later read fetches and merges under the dirty bytes. It needs the
# per-byte dirty masks, so it turns DIRTYBYTES on; DIRTYBYTES alone keeps
# fetch-on-write. The same pair exists for L2 and L3.
VX_CFG_DCACHE_DIRTYBYTES = "expr: $VX_CFG_DCACHE_LAZY_FETCH"
VX_CFG_DCACHE_LAZY_FETCH = 0
VX_CFG_DCACHE_REPL_POLICY = "expr: $__cache_repl_fifo"
VX_CFG_DCACHE_MSHR_SIZE = 16
# MSHR line entries: distinct {line, sector} misses a bank tracks, each naming
# the chain of requests merged on it; MSHR_SIZE then sizes the request pool.
# 0 keeps the address in every request entry (lines = requests).
VX_CFG_DCACHE_MSHR_LINES = 0
# dcache is unsectored: line = sector = mem transaction granule = L1_LINE (which
# defaults to MEM_BLOCK but can be configured smaller). Banking comes from the
# reduced WORD above (>= sector is clamped), not the line. Deriving from L1_LINE
Expand All @@ -243,31 +266,46 @@ VX_CFG_NUM_ICACHES = "expr: up($VX_CFG_SOCKET_SIZE / 4) if $VX_CFG_ICACHE_ENABLE
VX_CFG_NUM_DCACHES = "expr: up($VX_CFG_SOCKET_SIZE / 4) if $VX_CFG_DCACHE_ENABLE else 0"

VX_CFG_DCACHE_NUM_BANKS = "expr: pow(2, clog2(min($VX_CFG_DCACHE_NUM_REQS, 16)))"
# XOR/IPOLY bank-select hash, so power-of-two strides spread over the banks.
# With two banks it can only swap a line on parity, and the extra parallel
# misses cost more in memory queuing than the spreading saves.
VX_CFG_DCACHE_BANK_HASH = "expr: int($VX_CFG_DCACHE_NUM_BANKS >= 4)"
# One bank access serves a warp's same-word reads arriving together on its
# coalescer channels (uniform loads), and the response returns to all of
# them in the same cycle.
VX_CFG_DCACHE_READ_MERGE = 1

VX_CFG_L1_MEM_PORTS = "expr: min($VX_CFG_DCACHE_NUM_BANKS, $VX_CFG_PLATFORM_MEMORY_NUM_BANKS) if ($VX_CFG_ICACHE_ENABLE or $VX_CFG_DCACHE_ENABLE) else min($VX_CFG_DCACHE_NUM_REQS, $VX_CFG_PLATFORM_MEMORY_NUM_BANKS)"

[l2cache]
VX_CFG_L2_SIZE = 1048576
VX_CFG_L2_NUM_WAYS = 8
VX_CFG_L2_WRITEBACK = "expr: int($l2_is_llc and $single_cluster)"
VX_CFG_L2_DIRTYBYTES = 0
VX_CFG_L2_DIRTYBYTES = "expr: $VX_CFG_L2_LAZY_FETCH"
VX_CFG_L2_LAZY_FETCH = 0
VX_CFG_L2_REPL_POLICY = "expr: $__cache_repl_fifo"
VX_CFG_L2_MSHR_SIZE = 16
VX_CFG_L2_MSHR_LINES = 0
VX_CFG_L2_LATENCY = "expr: 4 + max(0, clog2($VX_CFG_L2_SIZE) - clog2(1048576))"
VX_CFG_L2_MRSQ_SIZE = 4
VX_CFG_L2_MREQ_SIZE = 0
VX_CFG_L2_CRSQ_SIZE = 0

VX_CFG_L2_NUM_BANKS = "expr: pow(2, clog2(min($VX_CFG_L2_NUM_REQS, 16)))"
# On at every bank count: unlike the dcache, a 2-bank L2 measured neutral
# (sgemm-mc-nt4 -0.6%, fp16-mc-nt4 +0.1%), and it gains from 4 banks up.
VX_CFG_L2_BANK_HASH = 1
VX_CFG_L2_MEM_PORTS = "expr: min($VX_CFG_L2_NUM_BANKS, $VX_CFG_PLATFORM_MEMORY_NUM_BANKS) if $VX_CFG_L2_ENABLE else min($VX_CFG_L2_NUM_REQS, $VX_CFG_PLATFORM_MEMORY_NUM_BANKS)"

[l3cache]
VX_CFG_L3_SIZE = 2097152
VX_CFG_L3_NUM_WAYS = 8
VX_CFG_L3_WRITEBACK = "expr: int($l3_is_llc)"
VX_CFG_L3_DIRTYBYTES = 0
VX_CFG_L3_DIRTYBYTES = "expr: $VX_CFG_L3_LAZY_FETCH"
VX_CFG_L3_LAZY_FETCH = 0
VX_CFG_L3_REPL_POLICY = "expr: $__cache_repl_fifo"
VX_CFG_L3_MSHR_SIZE = 16
VX_CFG_L3_MSHR_LINES = 0
VX_CFG_L3_LATENCY = "expr: 4 + max(0, clog2($VX_CFG_L3_SIZE) - clog2(2097152))"
VX_CFG_L3_MRSQ_SIZE = 4
VX_CFG_L3_MREQ_SIZE = 0
Expand Down
5 changes: 5 additions & 0 deletions VX_types.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ VX_DCR_BASE_CACHE_FLUSH = 0x000
VX_DCR_BASE_MPM_VALUE = 0x001
VX_DCR_BASE_STATE_END = 0x002

[cache_flush]
# VX_DCR_BASE_CACHE_FLUSH write value: flush only the levels above the
# last-level cache, which stays the point of coherence for the next kernel.
VX_CACHE_FLUSH_L1_ONLY = 0x10000

[dcr_mmu]
VX_DCR_MMU_STATE_BEGIN = 0x004
VX_DCR_MMU_SATP_LO = 0x004
Expand Down
Loading
Loading