Simulation of computer architectures is hard. Harnessing the underlying infrastructure must be easy.
Simo is a C++ library that allows to simulate computer systems. It uses a discrete-event system where a cycle-based approach is encouraged. This library has been created after years of experience with computer systems simulators (both in research and in industry) and it tries to create something that it is missing: a simple, easy to use library that does what you need.
GitHub Pages stores Doxygen documentation and guides (Markdown files inside docs folder).
Assuming nix:
git clone https://github.com/fusiled/Simo
cd Simo
nix buildThe build is going to be accessible in the result folder.
Clone Simo and initialize the submodules:
Build dependencies:
- Clang (recommended) or gcc
- CMake >= 3.31.0
- Boost (Boost.Test, Boost.TypeIndex)
- Glaze
- Doxygen (for documentation)
The build will produce libSimo (core library) and SimoSim (a general purpose
executable to run simulations).
The nix flake simplifies the setup of the dependencies. With nix installed you can:
- Build the package with
nix build. The build will be accessible in theresultfolder. - Run
nix developto enter a virtual environment with all the required tools installed. The GitHub actions run entering the virtual environment ofnix develop.
From the repository root, enter Simo's development shell with nix develop,
then run cpp-check-format, run-ast-grep, or verify-coverage ./build 70
directly. You can also run each script with nix run.
nix run .#cpp-check-format # Add -- --auto-format to apply fixes
nix run .#run-ast-grep # Scan include/ using the repository rules
nix run .#verify-coverage -- ./build 70 # Check region coverage after running instrumented testsTo put all three commands on another project's development shell PATH, add Simo
to that project's flake inputs and include simo in the arguments to outputs.
inputs.simo.url = "github:fusiled/Simo";In the existing pkgs.mkShell, add the bundle to packages for the shell's system.
packages = [ simo.packages.${system}.support-scripts ];For just one command, use its package directly, for example
simo.packages.${system}.cpp-check-format. After nix develop, invoke the
commands by name. They use the current project directory. run-ast-grep scans
include/ using the project's ast-grep configuration. verify-coverage
expects LLVM .profraw files and an instrumented libSimo.so (Linux) or
libSimo.dylib (macOS) in the specified build directory.
Look inside docs/guided_examples.
- Loading components from shared objects at runtime (examples)
Simulators publicly available pretends to be easy to use, but in practice they are not. More information in docs.
Contributions are welcome. Contributions MUST be:
- Easy to understand
- Easy to maintain
This can be achieved with:
- Simple logic and simple code
- Good documented code
- Proper unit-testing coverage
Default compiler is clang. There is support for gcc build as well. With nix, use nix develop .#gcc to obtain
a development environment that uses gcc as compiler.
You can see this guide on how to use nix binaries to build in CLion.
- Create a collector with periodic window collection functionality
- More documentation and examples
- Benchmark Simo against Gem5 and SystemC