Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ python3 ci/roofline.py --app=sgemm --driver=simx --args="-n128" --flops=4194304

- **Vivado floating-point IP latency is an Fmax knob, and it is already at its maximum.**
- `hw/scripts/xilinx_ip_gen.tcl` sets each `floating_point` IP's `C_Latency`. More cycles means more internal pipelining, up to a per-operation maximum; Vivado rejects any value above it.
- The single-precision maxima on V80 and U55C are: FMA 16 (`Medium_Usage`; 19 with `Full_Usage`), divide 28, square root 28, multiply 8, add 11. `xil_fma`, `xil_fdiv`, `xil_fsqrt` and the TCU's `xil_fmul`/`xil_fadd` already use them, so FMA with `Full_Usage` (more DSPs) is the only headroom left.
- The single-precision maxima on V80 and U55C are: FMA 16 (`Medium_Usage`; 19 with `Full_Usage`), divide 28, multiply 8, add 11. `xil_fma`, the RTU's `xil_fdiv` and the TCU's `xil_fmul`/`xil_fadd` already use them, so FMA with `Full_Usage` (more DSPs) is the only headroom left.
- A change must move together: `C_Latency`, the matching `VX_CFG_*_LATENCY` in `VX_config.toml` (checked by the `STATIC_ASSERT`s in `hw/rtl/fpu/VX_f*_unit.sv`), and the SimX timing that reads it.
- This applies only to `FPU_TYPE_DSP`. The STD FPU's div/sqrt latency is fixed by its SRT stage count, and only its FMA latency is configurable.
- In the FPU this applies only to `FPU_TYPE_DSP`'s FMA; the FPU has no divider or square root (FDIV/FSQRT expand into TFU micro-ops).

- **Pipeline isolation** ([V-ISO-1…6](docs/guidelines/verilog/pipeline_isolation.md)): extensions attach at the extension points (an execution unit behind dispatch, decode, the uop sequencer, the existing scheduler hooks, memory), never inside the shared pipeline; anything else needs the V-ISO-6 justification and the maintainer's approval. The change-impact classifier raises such a change to R3.

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ follows the version pins recorded in [VERSION](VERSION) (`VORTEX_VERSION`,
negation are summed in parallel instead of a negate after the sum. Results stay bit-identical to `sw/common/tfu.cpp` and the
pipeline stays 7 stages. Beacon: the `tfu` DUT drops from 24 to 13 logic levels, and a 16-warp, 8-thread core with the TFU
from 23 to 15 (the TFU no longer sets its depth); the ASIC estimate of `tfu` rises from 913 to 1239 MHz with 7% fewer cells.
- **FDIV/FSQRT run on the TFU.** The FPU's divide/square-root units are gone: VX_uop_fdiv expands FDIV and FSQRT (.S and .D) into
TFU reciprocal/rsqrt micro-ops plus FMUL, FSUB, FSGNJX and F2F, writing only rd. Results are within 3 ulp, not correctly rounded,
and raise only the flags of the FPU micro-ops (no DZ). The TFU is now part of every F build (`VX_CFG_EXT_TFU_ENABLE` follows
`VX_CFG_EXT_F_ENABLE`) with one lane per 8 FMA lanes. `VX_CFG_FDIV_LATENCY`, `VX_CFG_FSQRT_LATENCY`, `VX_CFG_FDIV_PE_RATIO` and
`VX_CFG_FSQRT_PE_RATIO` are removed. See [docs/designs/floating_point_unit.md](docs/designs/floating_point_unit.md).
- **Machine-mode trap CSRs.** `mtvec` is one per core, held by the core scheduler and shared by every warp; `mcause` holds the
4-bit exception codes the core raises; `mtval` reads as zero. `mstatus` (its `MIE`, `MPIE` and `FS` fields), `mepc` and `mcause`
stay per warp. Per-warp trap state drops from 160 to at most 39 bits at XLEN 32.
Expand Down
23 changes: 6 additions & 17 deletions VX_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ VX_CFG_EXT_TEX_ENABLE = false
VX_CFG_EXT_RASTER_ENABLE = false
VX_CFG_EXT_OM_ENABLE = false
VX_CFG_EXT_RTU_ENABLE = false
VX_CFG_EXT_TFU_ENABLE = false
# FDIV/FSQRT expand into TFU micro-ops (VX_uop_fdiv), so F needs the TFU
VX_CFG_EXT_TFU_ENABLE = "expr: $VX_CFG_EXT_F_ENABLE"
# Wide loads and stores (vx_flw.d/.q, vx_fsw.d/.q): 2 or 4 consecutive words
# to or from an aligned FP register group, one flw/fsw uop per word. Requires
# F with FLEN 32 (no D).
Expand Down Expand Up @@ -163,17 +164,7 @@ VX_CFG_FPU_USE_DSP = "expr: 1 if ($SYNTHESIS and not $ASIC) else 0"
fpu_dsp_quartus = "expr: $VX_CFG_FPU_TYPE_DSP and $QUARTUS"
fpu_dsp_vivado = "expr: $VX_CFG_FPU_TYPE_DSP and $VIVADO"

# STD: FDIV_LATENCY must equal FSQRT_LATENCY (shared serializer in VX_fpu_std)
VX_CFG_FMA_LATENCY = "expr: 16 if $fpu_dsp_vivado else (4 if $fpu_dsp_quartus else (12 if $VX_CFG_EXT_D_ENABLE else 8))"
# STD timing; DPI is a fast STD and takes the same values.
fdiv_latency_std = "expr: 32 if $VX_CFG_EXT_D_ENABLE else 17"
fsqrt_latency_std = "expr: $fdiv_latency_std"
# The vendor divide and square-root IP is F32 only; with D they are the RTL cores.
fdiv_latency_dsp = "expr: 32 if $VX_CFG_EXT_D_ENABLE else (15 if $QUARTUS else (28 if $VIVADO else 17))"
fsqrt_latency_dsp = "expr: 32 if $VX_CFG_EXT_D_ENABLE else (10 if $QUARTUS else (28 if $VIVADO else 17))"

VX_CFG_FDIV_LATENCY = "expr: 16 if $VX_CFG_FPU_TYPE_FPNEW else ($fdiv_latency_dsp if $VX_CFG_FPU_TYPE_DSP else $fdiv_latency_std)"
VX_CFG_FSQRT_LATENCY= "expr: 16 if $VX_CFG_FPU_TYPE_FPNEW else ($fsqrt_latency_dsp if $VX_CFG_FPU_TYPE_DSP else $fsqrt_latency_std)"
VX_CFG_FNCP_LATENCY = 2
VX_CFG_FCVT_LATENCY = 5

Expand All @@ -183,14 +174,13 @@ VX_CFG_FCVT_LATENCY = 5
# differs from FMA, the F64 FMAs get a separate pool of F64-only PEs.
VX_CFG_FMA_PE_RATIO = 1
VX_CFG_FMA64_PE_RATIO= 1
VX_CFG_FDIV_PE_RATIO = 1
VX_CFG_FSQRT_PE_RATIO= 1
VX_CFG_FCVT_PE_RATIO = 1
VX_CFG_FNCP_PE_RATIO = 1

[tfu]
# TFU datapath lanes inside the SFU; the SFU's lanes are serialized onto them.
VX_CFG_NUM_TFU_LANES = 1
# One lane per 8 FMA lanes, the MUFU:FMA ratio of recent GPUs.
VX_CFG_NUM_TFU_LANES = "expr: max(1, $VX_CFG_NUM_FPU_BLOCKS * $VX_CFG_NUM_FPU_LANES // 8)"

[amo]
# LR/SC reservation stations per LLC bank; line-indexed in BRAM, eviction yields legal spurious SC failures
Expand Down Expand Up @@ -448,9 +438,8 @@ VX_CFG_RTU_RECIP_DSP_SEED = 0 # inv_d reciprocal backend: 0=LUT-NR, 1=BRAM s
# synth, off for ASIC/sim (mirrors VX_CFG_FPU_USE_DSP).
VX_CFG_RTU_USE_DSP = "expr: 1 if ($SYNTHESIS and not $ASIC) else 0"
# RTU divide latency. Unlike the flexible-latency soft FMA, VX_fdiv_unit has a FIXED
# depth per backend, so this is BACKEND-keyed like VX_CFG_FMA_LATENCY — NOT FPU-type
# keyed like VX_CFG_FDIV_LATENCY (which would hand the RTL divider the DPI/FPNEW
# model's 15/16 that the RTU never uses). Vendor xil_fdiv=28 on Vivado, altera=15 on
# depth per backend, so this is BACKEND-keyed like VX_CFG_FMA_LATENCY, not keyed
# on the FPU type. Vendor xil_fdiv=28 on Vivado, altera=15 on
# Quartus, soft VX_fdiv_unit_rtl F32=17 in sim/ASIC. Matches VX_fdiv_unit's own
# USE_VENDOR_IP = USE_DSP(=RTU_USE_DSP) && (VIVADO||QUARTUS).
VX_CFG_RTU_FDIV_LATENCY = "expr: 28 if $VIVADO else (15 if $QUARTUS else 17)"
Expand Down
58 changes: 29 additions & 29 deletions ci/baselines/perf/core.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"core:raycast-nt16:rtlsim": {
"32": {
"cycles": 7499743,
"instrs": 2234919
"cycles": 7575004,
"instrs": 2258191
},
"app": "raycast",
"args": "",
"config_hash": "6a8db2da81885bd3",
"config_hash": "57363097e97b43e0",
"configs": "-DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
"core:raycast-nt4:rtlsim": {
"32": {
"cycles": 18396204,
"instrs": 5636759
"cycles": 18552450,
"instrs": 5698339
},
"app": "raycast",
"args": "",
"config_hash": "a7365739bd29ae7f",
"config_hash": "9245d48e06c98ced",
"configs": "-DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
Expand All @@ -28,7 +28,7 @@
},
"app": "sgemm",
"args": "-n128",
"config_hash": "a94d5512bae0d0c4",
"config_hash": "36f8a3823290652c",
"configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=16 -DVX_CFG_L2_ENABLE",
"driver": "rtlsim"
},
Expand All @@ -39,7 +39,7 @@
},
"app": "sgemm",
"args": "-n128",
"config_hash": "ed82856d2fbdb4fa",
"config_hash": "984b01e8101cfc47",
"configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE",
"driver": "rtlsim"
},
Expand All @@ -50,7 +50,7 @@
},
"app": "sgemm",
"args": "-n128",
"config_hash": "207c97cf1edf224d",
"config_hash": "cde9952ab2b97bd9",
"configs": "-DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -61,7 +61,7 @@
},
"app": "sgemm",
"args": "-n128",
"config_hash": "ddaf766d29f0c9e2",
"config_hash": "322a72e62381f276",
"configs": "-DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
Expand All @@ -72,7 +72,7 @@
},
"app": "sgemm2",
"args": "-n64 -t4",
"config_hash": "e3a289024245088f",
"config_hash": "ff8c45e67d6cc15b",
"configs": "-DVX_CFG_EXT_LDST_WIDE_ENABLE -DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -83,7 +83,7 @@
},
"app": "sgemmx",
"args": "-n128",
"config_hash": "b33624dacfde5ab3",
"config_hash": "161b4f819b26531a",
"configs": "-DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -94,7 +94,7 @@
},
"app": "sgemmx",
"args": "-n128",
"config_hash": "c2faf5453d1010f0",
"config_hash": "202a63f8eb007416",
"configs": "-DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
Expand All @@ -105,7 +105,7 @@
},
"app": "sgemv",
"args": "-m512 -n512",
"config_hash": "ba5846fb3e38ff61",
"config_hash": "51a66e6894500a43",
"configs": "-DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -116,51 +116,51 @@
},
"app": "sgemv",
"args": "-m512 -n512",
"config_hash": "ff7c79ffef364ae9",
"config_hash": "ff5fd64440c02266",
"configs": "-DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
"core:softmax-nt16:rtlsim": {
"32": {
"cycles": 1271704,
"instrs": 462553
"cycles": 1274253,
"instrs": 463065
},
"app": "softmax",
"args": "-n64",
"config_hash": "5c38536ce941bce9",
"config_hash": "147969a83745f11a",
"configs": "-DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
"core:softmax-nt4:rtlsim": {
"32": {
"cycles": 4850762,
"instrs": 1783653
"cycles": 4859055,
"instrs": 1785701
},
"app": "softmax",
"args": "-n64",
"config_hash": "647c47cbc33e0b1e",
"config_hash": "4107408b3546b287",
"configs": "-DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
"core:stencil3d-nt16:rtlsim": {
"32": {
"cycles": 2090794,
"instrs": 888848
"cycles": 2137750,
"instrs": 897040
},
"app": "stencil3d",
"args": "-n32",
"config_hash": "e962be6c4a705bd0",
"config_hash": "56c620b8af62d61f",
"configs": "-DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
"core:stencil3d-nt4:rtlsim": {
"32": {
"cycles": 4145399,
"instrs": 1777680
"cycles": 4210252,
"instrs": 1794064
},
"app": "stencil3d",
"args": "-n32",
"config_hash": "44671bcb89d71094",
"config_hash": "5cb0f49ff28434f8",
"configs": "-DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
Expand All @@ -171,7 +171,7 @@
},
"app": "vecadd",
"args": "-n16384",
"config_hash": "3c46a73d97d7dde8",
"config_hash": "6c8e84402d768f8c",
"configs": "-DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -182,7 +182,7 @@
},
"app": "vecadd",
"args": "-n16384",
"config_hash": "67f76328e947f037",
"config_hash": "c7cdda870b2f2369",
"configs": "-DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
}
Expand Down
22 changes: 11 additions & 11 deletions ci/baselines/perf/dxa.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"app": "dxa_copy_mcast",
"args": "",
"config_hash": "a98f143d348178b8",
"config_hash": "7256353ed29b8be3",
"configs": "-DVX_CFG_EXT_DXA_ENABLE",
"driver": "rtlsim"
},
Expand All @@ -17,7 +17,7 @@
},
"app": "dxa_copy",
"args": "-d1",
"config_hash": "55c5155d6ab46f83",
"config_hash": "fb1f2e9ec30fda50",
"configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -28,7 +28,7 @@
},
"app": "dxa_copy",
"args": "-d1",
"config_hash": "ee5d9d68a6bee766",
"config_hash": "7f9fbf8169361c7d",
"configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
Expand All @@ -39,7 +39,7 @@
},
"app": "sgemm2_dxa_mcast",
"args": "-n128",
"config_hash": "82c50e47ea6ea51c",
"config_hash": "9936082f7f64c31c",
"configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -50,7 +50,7 @@
},
"app": "sgemm2_dxa_mcast",
"args": "-n128",
"config_hash": "8f2e3ded05181df5",
"config_hash": "42207bd5a2540914",
"configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
Expand All @@ -61,7 +61,7 @@
},
"app": "sgemm2_dxa",
"args": "-n128 -t4 -m1",
"config_hash": "a94548f6a341be69",
"config_hash": "182e784c92df69ec",
"configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -72,7 +72,7 @@
},
"app": "sgemm2_dxa",
"args": "-n128 -t4 -m1",
"config_hash": "b647693500d03cdb",
"config_hash": "502dd7dc09e817df",
"configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
Expand All @@ -83,7 +83,7 @@
},
"app": "sgemm_tcu_wg_dxa_mcast",
"args": "-m 128 -n 128 -k 64",
"config_hash": "7506c2b313ddfb40",
"config_hash": "6e9bafbc4d311719",
"configs": "-DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_THREADS=16",
"driver": "rtlsim"
},
Expand All @@ -94,7 +94,7 @@
},
"app": "sgemm_tcu_wg_dxa_mcast",
"args": "-m 128 -n 128 -k 64",
"config_hash": "a7d7a7c19cc97d7f",
"config_hash": "d65701a0bff5e490",
"configs": "-DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_THREADS=4",
"driver": "rtlsim"
},
Expand All @@ -105,7 +105,7 @@
},
"app": "sgemm_tcu_wg_dxa",
"args": "-m 128 -n 128 -k 64",
"config_hash": "0dfd4e6b3f65442b",
"config_hash": "95baccf7110a4641",
"configs": "-DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=16 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_THREADS=32",
"driver": "rtlsim"
},
Expand All @@ -116,7 +116,7 @@
},
"app": "sgemm_tcu_wg_sp_dxa",
"args": "-m 128 -n 128 -k 128",
"config_hash": "30f77e58ea21b51b",
"config_hash": "f9b2facc7c7a1318",
"configs": "-DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_THREADS=32",
"driver": "rtlsim"
}
Expand Down
Loading
Loading