Skip to content
Merged
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VORTEX_VERSION=3.0
TOOLCHAIN_REV=v3.0.3
TOOLCHAIN_REV=v3.0.4
GEM5_REV=v25.0.0.1
FIRESIM_REV=8500116387e0a5fcfde303fb9d18ac3cc84de74f
14 changes: 10 additions & 4 deletions VX_types.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ VX_ISA_IMPL_ID = 0
# into them.
[memmap]
VX_MEM_USER_BASE_ADDR = "expr: 0x0000000000010000 if ($XLEN == 64) else 0x00010000"
VX_MEM_STACK_LOG2_SIZE = 13
# The stack window's top is aligned to max(256 KB, NUM_THREADS stacks): the
# 256 KB-aligned top, rounded down to a whole group of NUM_THREADS stacks. The
# 16 KiB per thread: a kernel's deepest call chain (register spills across an
# unrolled loop of calls into the SW sampler) can need more than 8 KiB, and a
# frame past its stack corrupts the neighbouring thread's.
VX_MEM_STACK_LOG2_SIZE = 14
# The stack window's top is aligned to max(512 KB, NUM_THREADS stacks): the
# 512 KB-aligned top, rounded down to a whole group of NUM_THREADS stacks. The
# window then lies on whole groups and the stack interleave is a pure bit
# permutation. The local memory window starts at the same address and runs to
# the next such boundary, which bounds its capacity.
stack_window_top = "expr: 0x00000001FFFC0000 if ($XLEN == 64) else 0xFFFC0000"
stack_window_top = "expr: 0x00000001FFF80000 if ($XLEN == 64) else 0xFFF80000"
VX_MEM_STACK_BASE_ADDR = "expr: $stack_window_top - ($stack_window_top % ($VX_CFG_NUM_THREADS << $VX_MEM_STACK_LOG2_SIZE))"
VX_MEM_LMEM_BASE_ADDR = "expr: $VX_MEM_STACK_BASE_ADDR"
VX_MEM_IO_BASE_ADDR = "expr: 0x0000000000000040 if ($XLEN == 64) else 0x00000040"
Expand Down Expand Up @@ -75,6 +78,9 @@ VX_VM_PT_LEVEL = "expr: 3 if ($XLEN == 64) else 2"
VX_VM_PTE_SIZE = "expr: 8 if ($XLEN == 64) else 4"
VX_VM_PT_SIZE = "expr: $VX_VM_PAGE_SIZE"
VX_VM_PT_SIZE_LIMIT = "expr: (1 << 25) if ($XLEN == 64) else (1 << 23)"
# A leaf PTE with this RSW bit set is a null translation: the page is reserved
# but unbound, so reads return 0 and writes are discarded (sparse residency).
VX_VM_PTE_SPARSE_BIT = 8

[dcr_base]
VX_DCR_BASE_STATE_BEGIN = 0x000
Expand Down
4 changes: 2 additions & 2 deletions ci/mesa_install.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# (ci/toolchain_install.sh). The apt steps need sudo.
#
# The defaults build the Vortex Mesa fork
# https://github.com/vortexgpgpu/mesa (branch vortex_3.x)
# https://github.com/vortexgpgpu/mesa (branch vortex_3.1)
# whose `vortexpipe` Gallium driver runs Vulkan workloads on the
# Vortex GPU. For a vanilla-lavapipe baseline (no vortexpipe),
# override MESA_REPO/MESA_REV and set GALLIUM_DRIVERS=llvmpipe.
Expand Down Expand Up @@ -61,7 +61,7 @@ fi

# Pinned source: the Vortex Mesa fork carrying the vortexpipe driver.
MESA_REPO=${MESA_REPO:=https://github.com/vortexgpgpu/mesa.git}
MESA_REV=${MESA_REV:=vortex_3.x}
MESA_REV=${MESA_REV:=vortex_3.1}

# Gallium / Vulkan driver set. `llvmpipe`+`vortexpipe` (Gallium) under
# `swrast` (Vulkan) is lavapipe plus the Vortex accelerator:
Expand Down
6 changes: 5 additions & 1 deletion ci/testcases/cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,18 @@ tests:
args: -f -n1
configs: -DVX_CFG_EXT_A_ENABLE -DVX_CFG_DCACHE_LAZY_FETCH=1
flags: --perf=7
# The host's pre-pattern must sit in memory, not in the L2: with the command
# processor's DMA on the LLC (the default), the upload leaves every sector
# fully written and resident, and the partially stored control lines then
# loop back instead of reading memory. The DMA goes straight to memory here.
- id: lazy_fetch-4
via: blackbox
drivers:
- simx
- rtlsim
app: lazy_fetch
args: -f -n1
configs: -DVX_CFG_EXT_A_ENABLE -DVX_CFG_SOCKET_SIZE=1 -DVX_CFG_L2_WRITEBACK=1 -DVX_CFG_L2_LAZY_FETCH=1
configs: -DVX_CFG_EXT_A_ENABLE -DVX_CFG_SOCKET_SIZE=1 -DVX_CFG_L2_WRITEBACK=1 -DVX_CFG_L2_LAZY_FETCH=1 -DVX_CFG_CP_LLC_CLIENT=0
flags: --perf=7
shape:
cores: 4
Expand Down
16 changes: 14 additions & 2 deletions ci/testcases/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,14 @@ tests:
configs: -DVX_CFG_DCACHE_LAZY_FETCH=1
# Fully written sectors on a lazy-fetch write-back L2 shared by 4 cores:
# partial-miss loads and parked chain heads refetch them through the loopback.
# The CP DMA bypasses the L2, as in cache:lazy_fetch-4, so the host's
# pre-pattern is not already resident and fully written at launch.
- id: parity-lazy-fetch-full
check: model_parity
via: blackbox
app: lazy_fetch
args: -f -n1
configs: -DVX_CFG_EXT_A_ENABLE -DVX_CFG_SOCKET_SIZE=1 -DVX_CFG_L2_WRITEBACK=1 -DVX_CFG_L2_LAZY_FETCH=1
configs: -DVX_CFG_EXT_A_ENABLE -DVX_CFG_SOCKET_SIZE=1 -DVX_CFG_L2_WRITEBACK=1 -DVX_CFG_L2_LAZY_FETCH=1 -DVX_CFG_CP_LLC_CLIENT=0
flags: --perf=7
shape:
cores: 4
Expand Down Expand Up @@ -224,11 +226,13 @@ tests:
check: model_parity
# Tighter than the default: the shape exercises those entries and the
# collectors' output register exactly.
# The CP DMA stays off the LLC: on it, the RTL settles into one of two
# warp phasings (~145k or ~156k cycles) on an 8-cycle DRAM-latency change.
tolerance: 0.03
via: blackbox
app: sgemm
args: -n64
configs: -DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8
configs: -DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_CP_LLC_CLIENT=0
shape: {cores: 2, l2cache: true}
# The same shape behind a 20-cycle link to the L2, each way: both cores' L2
# traffic, its fills and its back-pressure cross the link's delay buffers.
Expand Down Expand Up @@ -475,6 +479,14 @@ tests:
via: blackbox
app: stencil3d
args: -n32
# Command-processor indirect launch: a kernel writes the grid record, the next
# launch takes its grid from it, a predicated-off launch skips itself and the
# launch behind it, and a dependent kernel consumes the result.
- id: parity-indirect
check: model_parity
via: blackbox
app: indirect
args: -n16384
# Software raycaster: divergent control flow + mixed ALU/FPU.
- id: parity-raycast
check: model_parity
Expand Down
11 changes: 11 additions & 0 deletions ci/testcases/fpga_gate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ builds:
-DVX_CFG_EXT_A_ENABLE -DVX_CFG_VM_ENABLE
-DVX_CFG_DCACHE_LATENCY=3

# --- command processor ---------------------------------------------------------

# Command processor: ring fetch/unpack, per-queue engine, resource arbiters,
# DMA, event unit, DCR proxy and KMU launch sequencer behind the host and
# device AXI crossbars.
- id: cp
group: core
dut: cp
clock_mhz: 300
configs: ""

# --- dxa ---------------------------------------------------------------------

# DXA engine: descriptor queue, address generation, multicast distribution.
Expand Down
8 changes: 8 additions & 0 deletions ci/testcases/regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,14 @@ tests:
drivers:
- rtlsim
app: single_cta
# Command-processor indirect launch through the RTL command processor (the
# xrt path runs VX_cp_core; simx/rtlsim run its C++ model, covered by isa-*).
- id: indirect-xrt
via: blackbox
drivers:
- xrt
app: indirect
args: -n1024
- id: module_reload-1
via: blackbox
drivers:
Expand Down
7 changes: 4 additions & 3 deletions ci/testcases/sw/runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
# (libvortex-simx.so) at vx_dev_open; `make software` only builds
# kernel+stub, and this host case has no driver sim_build to produce it,
# so build it explicitly here.
# 2. `make -C tests/regression/basic kernel.vxbin` — test_module_kernel
# consumes the `basic` regression .vxbin, which run-simx does NOT build.
# 2. `make -C tests/regression/{basic,indirect} kernel.vxbin` —
# test_module_kernel and test_indirect consume those regression .vxbins,
# which run-simx does NOT build.
# 3. `make -C tests/runtime run-simx` — build + run the test binaries.
category: sw
defaults:
Expand All @@ -16,4 +17,4 @@ defaults:
tests:
- id: runtime-1
via: script
run: "make -C sw/runtime simx && make -C tests/regression/basic kernel.vxbin && make -C tests/runtime run-simx"
run: "make -C sw/runtime simx && make -C tests/regression/basic kernel.vxbin && make -C tests/regression/indirect kernel.vxbin && make -C tests/runtime run-simx"
7 changes: 7 additions & 0 deletions ci/testcases/unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ tests:
- id: hw-fpu
via: script
run: "make -C hw/unittest run-fpu"
# Command processor (fetch/unpack/engine/arbiters/DMA/DCR proxy/launch
# sequencer/full core): the `hw` lane only builds these; this lane executes
# them so a CP RTL change is gated against its cycle-level unit models.
- id: hw-cp
via: script
run: "make -C hw/unittest run-cp"
touches: [hw/rtl/cp, hw/unittest/cp_]
# TCU FEDP datapath: the `hw` lane only builds it; this lane executes tcu_fedp
# per format (native TFR + DPI). touches gates it on tcu changes.
- id: hw-tcu
Expand Down
17 changes: 17 additions & 0 deletions ci/testcases/vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,17 @@ tests:
target: run-{driver}
vars:
OPTS: -t0
# Sparse reservations (VX_MEM_SPARSE): unbound pages read 0 and discard stores
# and atomics without a fault, bound pages reach the memory behind them, two
# pages may map one, and a rebind holds for the next launch and the CP's copies.
- id: vm-sparse
via: make-run
drivers:
- simx
- rtlsim
dir: tests/regression/vm_sparse
target: run-{driver}
configs+: -DVX_CFG_EXT_A_ENABLE
# vm-fault-perm (-t1, read-only-store permission fault) needs L1 permission-fault
# reporting, which is not currently implemented; only structural faults (-t0,
# above) are reported, via the shared walker. Re-enable when L1 permission-fault
Expand Down Expand Up @@ -364,6 +375,12 @@ tests:
via: blackbox
app: vecadd
args: -n16384
- id: parity-vm-sparse
check: model_parity
via: blackbox
app: vm_sparse
configs+: -DVX_CFG_EXT_A_ENABLE

# A Kepler SMX's core (keplertitan profile): 16 warps behind each of four fetch
# slices and four 8-lane LSU blocks keep the kernel's code and argument pages
# busy on every MMU lane, so once a page fills its accesses must hit the TLB
Expand Down
17 changes: 16 additions & 1 deletion ci/toolchain_install.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ mesa()
rm -rf mesa-vortex.tar.bz2
}

# The Khronos Vulkan loader (libvulkan.so.1) the Vulkan tests and the CTS run
# with, ahead of the host's: hosts ship loaders without upstream fixes the
# Vortex driver depends on (EL9 1.4.328.1 dlcloses an ICD twice on an
# out-of-memory path of vkCreateInstance; fixed in Vulkan-Loader v1.4.333).
vulkan_loader()
{
wget $REPOSITORY/vulkan-loader/$OSVERSION/vulkan-loader.tar.bz2
tar -xvf vulkan-loader.tar.bz2
mkdir -p $TOOLDIR && rm -rf $TOOLDIR/vulkan-loader && mv vulkan-loader $TOOLDIR
rm -rf vulkan-loader.tar.bz2
}

verilator()
{
fetch_parts verilator verilator/$OSVERSION
Expand Down Expand Up @@ -240,6 +252,7 @@ install_base()
yosys
sta
mesa
vulkan_loader
}

# SST is built from source by ci/sst_install.sh — see the matching
Expand All @@ -248,7 +261,7 @@ install_base()
show_usage()
{
echo "Install Pre-built Vortex Toolchain"
echo "Usage: $0 [--pocl] [--chipstar] [--mesa] [--verilator] [--riscv32] [--riscv64] [--llvm] [--libcrt32] [--libcrt64] [--libc32] [--libc64] [--circt] [--foldsim] [--beacon] [--yosys] [--sta] [--gem5] [--all] [-h|--help]"
echo "Usage: $0 [--pocl] [--chipstar] [--mesa] [--vulkan-loader] [--verilator] [--riscv32] [--riscv64] [--llvm] [--libcrt32] [--libcrt64] [--libc32] [--libc64] [--circt] [--foldsim] [--beacon] [--yosys] [--sta] [--gem5] [--all] [-h|--help]"
echo " (no arguments: install all components except Foldsim, Beacon and gem5)"
echo " Foldsim, Beacon and gem5 are opt-in: Foldsim serves only the Foldsim flow,"
echo " Beacon only the logic gate, and gem5 is a large source build. --all"
Expand All @@ -269,6 +282,8 @@ while [ "$1" != "" ]; do
;;
--mesa ) mesa
;;
--vulkan-loader ) vulkan_loader
;;
--verilator ) verilator
;;
--riscv32 ) riscv32
Expand Down
15 changes: 14 additions & 1 deletion ci/toolchain_prebuilt.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ mesa()
mv mesa-vortex.tar.bz2 ./mesa-vortex/$OSVERSION
}

# The Khronos Vulkan loader, a per-OS tarball unpacked into
# $TOOLDIR/vulkan-loader (lib/libvulkan.so*). ~0.2 MB compressed.
vulkan_loader()
{
echo "prebuilt vulkan-loader..."
tar -C $TOOLDIR -cvjf vulkan-loader.tar.bz2 vulkan-loader
mkdir -p ./vulkan-loader/$OSVERSION
mv vulkan-loader.tar.bz2 ./vulkan-loader/$OSVERSION
}

verilator()
{
echo "prebuilt verilator..."
Expand Down Expand Up @@ -201,7 +211,7 @@ gem5()
show_usage()
{
echo "Setup Pre-built Vortex Toolchain"
echo "Usage: $0 [--pocl] [--chipstar] [--mesa] [--verilator] [--riscv32] [--riscv64] [--llvm] [--libcrt32] [--libcrt64] [--libc32] [--libc64] [--circt] [--foldsim] [--beacon] [--yosys] [--sta] [--gem5] [--all] [-h|--help]"
echo "Usage: $0 [--pocl] [--chipstar] [--mesa] [--vulkan-loader] [--verilator] [--riscv32] [--riscv64] [--llvm] [--libcrt32] [--libcrt64] [--libc32] [--libc64] [--circt] [--foldsim] [--beacon] [--yosys] [--sta] [--gem5] [--all] [-h|--help]"
}

while [ "$1" != "" ]; do
Expand All @@ -212,6 +222,8 @@ while [ "$1" != "" ]; do
;;
--mesa ) mesa
;;
--vulkan-loader ) vulkan_loader
;;
--verilator ) verilator
;;
--riscv32 ) riscv32
Expand Down Expand Up @@ -256,6 +268,7 @@ while [ "$1" != "" ]; do
yosys
sta
mesa
vulkan_loader
gem5
;;
-h | --help ) show_usage
Expand Down
53 changes: 53 additions & 0 deletions ci/vk_loader_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
# Print the Vulkan loader a Vulkan test or CTS run will load, and fail with a
# clear message when it is older than 1.4.333 while the ICD is not robust to it.
#
# Vulkan-Loader before v1.4.333 (EL9 ships 1.4.328.1) closes the ICD twice when
# an allocation fails inside vkCreateInstance (upstream fix dc509c2de). The
# extra dlclose unmaps lavapipe/vortexpipe under a live instance unless the ICD
# is linked with -z nodelete, and the run then crashes (CTS
# api.device_init.create_instance_device_intentional_alloc_fail). The toolchain
# ships a fixed loader: ci/toolchain_install.sh --vulkan-loader.
#
# Usage: vk_loader_check.sh [icd.json] (default: $VK_ICD_FILENAMES)
# Resolves libvulkan.so.1 the way the dynamic linker does for the caller's
# LD_LIBRARY_PATH (then the ld.so cache). Exit 0: usable; 1: old loader and a
# non-robust ICD; 2: no loader found.

ICD=${1:-${VK_ICD_FILENAMES%%:*}}

LIB=
IFS=: read -ra dirs <<< "${LD_LIBRARY_PATH:-}"
for d in "${dirs[@]}"; do
[ -n "$d" ] && [ -e "$d/libvulkan.so.1" ] && { LIB=$d/libvulkan.so.1; break; }
done
[ -n "$LIB" ] || LIB=$(ldconfig -p 2>/dev/null | sed -n 's/.*libvulkan\.so\.1 (libc6,x86-64) => //p' | head -1)
if [ -z "$LIB" ]; then
echo "vk_loader_check: FAIL: no libvulkan.so.1 on LD_LIBRARY_PATH or in the ld.so cache"
exit 2
fi
REAL=$(readlink -f "$LIB")
VER=$(basename "$REAL" | sed -n 's/^libvulkan\.so\.\([0-9][0-9.]*\)$/\1/p')
[ -n "$VER" ] || VER=$(strings -a "$REAL" 2>/dev/null | sed -n 's/^.*Vulkan Loader Version \([0-9][0-9.]*\).*$/\1/p' | head -1)

ROBUST=no
if [ -n "$ICD" ] && [ -f "$ICD" ]; then
so=$(sed -n 's/.*"library_path"[^"]*"\([^"]*\)".*/\1/p' "$ICD" | head -1)
case $so in /*) ;; *) so=$(dirname "$ICD")/$so ;; esac
readelf -d "$so" 2>/dev/null | grep -q 'FLAGS_1.*NODELETE' && ROBUST=yes
fi

echo "vk_loader_check: loader $REAL (version ${VER:-unknown}); ICD ${ICD:-none} nodelete=$ROBUST"
older=1
if [ -n "$VER" ]; then
[ "$(printf '%s\n1.4.333\n' "$VER" | sort -V | head -1)" = 1.4.333 ] && older=0
fi
if [ $older = 1 ] && [ $ROBUST = no ]; then
echo "vk_loader_check: FAIL: Vulkan loader ${VER:-of unknown version} is older than 1.4.333 and the ICD is not linked"
echo " with -z nodelete: an allocation failure in vkCreateInstance unmaps the ICD under a live instance."
echo " Install the toolchain loader (ci/toolchain_install.sh --vulkan-loader) and put"
echo " \$TOOLDIR/vulkan-loader/lib first on LD_LIBRARY_PATH (tests/vulkan/common.mk does), or use a"
echo " Mesa whose libvulkan_lvp.so is linked with -z nodelete."
exit 1
fi
exit 0
4 changes: 2 additions & 2 deletions docs/assets/img/cp_architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/assets/img/gfx_software_stack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/assets/img/opencl_system_architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/assets/img/vm_tlb_l2_uarch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading