Skip to content
fusiledPublic

About

Simple Architectural Modeling

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Simo - Simple Modeling

Simulation of computer architectures is hard. Harnessing the underlying infrastructure must be easy.

What is this?

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.

Documentation

GitHub Pages stores Doxygen documentation and guides (Markdown files inside docs folder).

Get the repository and build in 3 commands

Assuming nix:

git clone https://github.com/fusiled/Simo
cd Simo
nix build

The build is going to be accessible in the result folder.

Build

Clone Simo and initialize the submodules:

Build dependencies:

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 the result folder.
  • Run nix develop to enter a virtual environment with all the required tools installed. The GitHub actions run entering the virtual environment of nix develop.

Support scripts

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 tests

To 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.

First Steps

Look inside docs/guided_examples.

Features

  • Loading components from shared objects at runtime (examples)

Motivations of creating Simo

Simulators publicly available pretends to be easy to use, but in practice they are not. More information in docs.

Code Contributions

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.

IDEs

You can see this guide on how to use nix binaries to build in CLion.

To Do

  • Create a collector with periodic window collection functionality
  • More documentation and examples
  • Benchmark Simo against Gem5 and SystemC

About

Simple Architectural Modeling

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages