Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/redthing1/irre-tools
toy handwritten assembler, emulator, compiler, toolchain for a lightweight RISC architecture
https://github.com/redthing1/irre-tools
architecture assembler emulator irre regularvm risc vbcc virtual-machine
Last synced: about 2 months ago
JSON representation
toy handwritten assembler, emulator, compiler, toolchain for a lightweight RISC architecture
- Host: GitHub
- URL: https://github.com/redthing1/irre-tools
- Owner: redthing1
- License: apache-2.0
- Created: 2020-05-14T05:30:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-16T03:57:55.000Z (about 1 year ago)
- Last Synced: 2024-04-19T09:56:41.751Z (8 months ago)
- Topics: architecture, assembler, emulator, irre, regularvm, risc, vbcc, virtual-machine
- Language: D
- Homepage:
- Size: 1.92 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![icon](doc/icon.png)
# irre-tools
toy handwritten assembler, emulator, compiler, toolchain for a lightweight RISC architecture
## documentation
documentation and specifications ([arch](doc/arch.md), [asm](doc.asm.md)) are available in [doc](doc/).
## setup
grab submodules:
```sh
git submodule update --init --recursive
```install dependencies:
+ C compiler
+ [D compiler](https://dlang.org/download.html)### quickstart build
```sh
./script/build_tools.sh
```tools you now have:
+ `./src/irretool/irretool` (irre multitool)
+ `./tools/chcc/chibicc` (c->irre compiler)## compile a C program
```c
// my_prog.cint add(int a, int b) {
return a + b;
}int main() {
int a = 3;
int b = 4;
int sum = add(a, b);
return sum;
}```
now build and run:
```sh
# compile to binary
./script/irrecc -v -o my_prog.bin my_prog.c
# run in emulator
./src/irretool/irretool -v emu my_prog.bin
```## run flow tracking
1. run a compiled program and log commits and snapshots
```sh
./src/irretool/irretool -v emu --commit-log --save-commits t1_trace.bin my_prog.bin
```
2. run analyzer```sh
./src/irretool/irretool analyze --ift --pl --pl-threads 4 --ift-graph --ift-graph-analysis --ift-save-graph t1_graph.dot t1_trace.bin
```