linx-model is a small C++20 framework for queue-based, cycle-accurate
simulation. The core contract is that inter-module communication happens
through named SimQueue ports, while
Work() computes combinational behavior and Xfer() advances registered
state.
SimQueue<T>models latency-aware, cycle-visible FIFO movement for value payloads,std::unique_ptr<T>, andstd::shared_ptr<T>.isa::Minstis the single in-flight uop payload. Fetch allocatesMinstPtr, decode populates generated LinxISA v0.4 fields, and retire/flush or DFX consumes the same object.ProgramImageplus the ELF/raw loader and ISA disassembler let the model CLI load a binary, decode instructions, and print assembly directly from the generated codec.Module<Derived, PortT>provides recursive, namedinput/output/innerports plus parent-owned queue wiring and event-driven module dispatch.SimSystemowns the global cycle counter, logger, validation, and the top levelWork()thenXfer()schedule.- Validation checks enforce named ports, leaf-module I/O contracts, queue-role correctness, and top-level SimQueue-based composition.
cmake -S . -B build -G Ninja
cmake --build build
ctest --test-dir build --output-on-failureThe ctest suite includes committed LLVM-built ELF fixtures under
tests/fixtures/llvm_elf/. Regenerate them from a
superproject checkout with:
python3 tests/fixtures/llvm_elf/regenerate_llvm_elf_fixtures.py --root "$(pwd)"The repo also builds a standalone CLI:
./build/linx_model_cli --bin path/to/program.elf --disasm-only
./build/linx_model_cli --bin path/to/program.bin --raw-base 0x1000 --disasm-onlyTo run the sanitizer configuration:
cmake -S . -B build-sanitize -G Ninja -DLINX_MODEL_ENABLE_SANITIZERS=ON
cmake --build build-sanitize
ctest --test-dir build-sanitize --output-on-failureinclude/public headerssrc/non-template runtime supporttests/unit/unit teststests/system/system teststests/checks/validation and contract checksdocs/architecture, testing, and logging documentationtools/ci/local and CI helper scripts
docs/index.mddocumentation hubdocs/architecture.mdexecution model and queue semanticsdocs/testing.mdUT / ST / checks / sanitizersdocs/logging.mdstructured log format and packet dumpdocs/isa.mdgenerated LinxISA v0.4 codec andMinstpacket contract
Doxygen can be generated locally with:
cmake -S . -B build-docs -G Ninja -DLINX_MODEL_BUILD_DOCS=ON
cmake --build build-docs --target docsTo regenerate the committed LinxISA codec tables after updating the source JSON:
cmake --build build --target gen-isa-codec