diff options
author | Yann Herklotz <git@yannherklotz.com> | 2022-11-24 18:49:44 +0000 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2022-11-24 18:49:44 +0000 |
commit | 3291d86ec38031e191ec1e7e5e8ddfa74b77cb7c (patch) | |
tree | 7d604206a2deb29c9f097ff1f3b7de78f44b34a3 /scripts/presyn/Makefile | |
download | butterstick-3291d86ec38031e191ec1e7e5e8ddfa74b77cb7c.tar.gz butterstick-3291d86ec38031e191ec1e7e5e8ddfa74b77cb7c.zip |
Squashed 'picorv32/' content from commit f00a88c
git-subtree-dir: picorv32
git-subtree-split: f00a88c36eaab478b64ee27d8162e421049bcc66
Diffstat (limited to 'scripts/presyn/Makefile')
-rw-r--r-- | scripts/presyn/Makefile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/presyn/Makefile b/scripts/presyn/Makefile new file mode 100644 index 0000000..d1c367e --- /dev/null +++ b/scripts/presyn/Makefile @@ -0,0 +1,22 @@ + +TOOLCHAIN_PREFIX = /opt/riscv32ic/bin/riscv32-unknown-elf- + +run: testbench.vvp firmware.hex + vvp -N testbench.vvp + +firmware.hex: firmware.S firmware.c firmware.lds + $(TOOLCHAIN_PREFIX)gcc -Os -ffreestanding -nostdlib -o firmware.elf firmware.S firmware.c \ + --std=gnu99 -Wl,-Bstatic,-T,firmware.lds,-Map,firmware.map,--strip-debug -lgcc + $(TOOLCHAIN_PREFIX)objcopy -O binary firmware.elf firmware.bin + python3 ../../firmware/makehex.py firmware.bin 4096 > firmware.hex + +picorv32_presyn.v: picorv32_presyn.ys picorv32_regs.txt ../../picorv32.v + yosys -v0 picorv32_presyn.ys + +testbench.vvp: testbench.v picorv32_presyn.v + iverilog -o testbench.vvp testbench.v picorv32_presyn.v + +clean: + rm -f firmware.bin firmware.elf firmware.hex firmware.map + rm -f picorv32_presyn.v testbench.vvp testbench.vcd + |