This is a simulator. Not an emulator (yet).
Version 0.9 (first release):
- Multiple boards running in the same 'step time'
- Global barrier for all
stepfunctions/procedures in the simulator (#4) - Event system from core sim to usim
- Event system from usim to core sim (#5)
- Handle Ctrl+C to stop the simulator from running in a graceful way (#3)
- SysTick emulation
- [/] GPIO emulation (output is done, input is not)
- Basic timer emulation
- PWM emulation
- DMA emulation
Version 1.0:
- Make a version of the HAL that builds with simulator native build
hermes --cfg <config json> [--max-iterations <integer>] [--max-time <string>]
example:
hermes --cfg cfg.json --max-iterations 1000_000
An example json config can be found in cfg.json and its schema in https://raw.githubusercontent.com/Hyperloop-UPV/HERMES/refs/heads/main/misc/sim-cfg.schema.json
odin run .
or alternatively, keep the build executable and run it later:
on linux:
odin build . -out:build
./build
on windows:
odin build . -out:build.exe
build
You can build the usim examples by adding -build-example-usims in build script:
./build -build-example-usims
simulator.odin: contains main program for the simulatorcmdline.odin: contains command line parsing for core simulatorsim_platform: contains any platform specific code needed for main program (simulator.odinwill use this when it is made)sim_peripherals: contains all simulation for peripheralsmcu/stm32h723xx/core_cm7.odin: contains definitions for cm7 core registersmcu/stm32h723xx/stm32h723xx.odin: contains definitions for stm32h723xx peripheral registersusim: contains the api for micro simulators
Extra info:
build.odin: odin build script for the simulatorcfg.json: example, working config for running the simulatorChanges.md: lists changes that had to be made to make the simulated board code compile/runcodegen/ioctl_defs_linux.c: small code to autogeneratesim_platform_linux_ioctls.odinexample-board: an example code for a boardexample-usim: example micro simulator codeexample-usim/first: a very simple example of a micro simulatorexample-usim/vis: a visualization micro simulatorexample-usim/FunctionalMockupInterface: an example micro simulator that loads and runs a FMUols.json: odin language server config, to specify any collections used
We are choosing Odin because:
- It is a systems programming language
- It is simple, as opposed to C++ and Rust. The overview describes the whole language
- It has a good standard library, as opposed to C or C++ which don't include much
- It has hashmaps builtin to the language (which we will probably use)
- It has generics and reflection (which we will probably use)
- It has inline assembly built in to the compiler (we might use this)
- It has a large repository of easy to find example code
- It contains, in its standard library an odin parser
- It contains, in its standard library an easy to use profiler
- It contains, in its standard library, channels for thread-safe communication between multiple readers and multiple writers
- It contains, in its standard library a high-performance multi-architecture encoder/decoder/printer
- It contains, in its vendor library (provided by the compiler), a high performance real time physics simulation library
- It is soon to get to v1.0
Personally:
- It is a language I enjoy using
- It is a language I have used many times before, as opposed to Rust, Haskell, Java, Prolog or Javascript