Quickstart¶
Five minutes from git clone to the first SPARC instruction running
inside Lince.
1. Build¶
git clone https://github.com/claaj/lince.git
cd lince
cmake -S . -B build -G Ninja
cmake --build build
CMake fetches Catch2 and tl::expected automatically. SoftFloat is
vendored. No system packages need to be installed beyond a C++20
compiler and CMake/Ninja.
2. Run the test suite¶
You should see 263 tests pass. The single skip — test_rtems_boot —
is conditional on a cross-compiled RTEMS image and does not affect
correctness.
3. Run a tiny SPARC program¶
A minimal "hello UART" assembly program is shipped under
tests/asm/hello_uart.S.
The test harness builds it with the RCC cross-compiler and the resulting
ELF can be passed to the CLI:
Expected output:
(The newline is provided by the program; nothing else is buffered or post-processed.)
4. Inspect the lifecycle¶
Add --verbose to see the emulator narrate each phase:
You will see, in order:
EmulatorConfigvalidation- RAM allocation at the configured base
- Default GR712RC peripherals wiring (IRQMP → GPTimer → APBUart → MemCtrl)
- ELF segment loading with addresses and sizes
- Round-robin step loop entering, with periodic time markers
5. Try multi-core¶
CPU 1 boots in power-down mode (per real GR712RC behaviour). It will remain idle until CPU 0 releases it via the IRQMP, exactly as on the hardware. The single-threaded round-robin scheduler still ensures TSO and makes atomics correct by construction.
What next?¶
- Embed Lince as a library — three lines of code, no allocation, no globals.
- Write a custom peripheral — implement
IPeripheral, register it withadd_peripheral(). DMA, IRQs and scheduled events all work out of the box. - Boot real RTEMS — cross-compile a hello-world image and watch the BSP come up.
- Read the architecture — the design decisions that make the emulator embeddable, deterministic and SMP2-compatible.