Skip to main content
This is how to run the whole test suite against something other than the built-in simulator (an RTL simulator such as Verilator behind your own compiler, or the chip).

Kernels: attach a driver

From then on k[grid, block](...) on arrays placed on "atreides-hw" goes through the driver, and LaunchResult.status is built from the Counters it returns. Raise sf.SFDeviceError from launch for a device fault. To get the generated C for the compiler (sf16 only):
The emitted function is void sf_kernel(int64_t *arg0, int64_t arg0__size, ..., int64_t gx, gy, gz, sf_counters *C) with pointers first, scalars after, each pointer followed by its element count. src/sf/kernels/sf16_builtins.h is the reference for what the builtins must compute.

Built-ins (Stage 1.1 arrays, Stage 2 models): register a device

Look at src/sf/_device.py (MockAtreides, MockAtreidesFlags) for the exact run contract and the op names.

Running the suite against it

The Stage 3 tests take the target from the DEV constant at the top of tests/test_3_kernels.py and tests/test_review_findings_3.py; the Stage 1.1 device tests use the mock names in tests/test_1_1_3_matmul_device.py. Point those at your device name and run pytest. Every assertion compares integer codes and event counts, so any difference from the host reference is a real disagreement between the hardware and the spec.