summaryrefslogtreecommitdiff
path: root/assembly/misa/Makefile
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-05-30 08:58:29 -0500
committercheapie <cheapiephp@gmail.com>2026-05-30 08:58:29 -0500
commitd609dcb35dafebeafced9c40d92ddd5da630aa54 (patch)
treebe5b1083f2f12173dbe936306e46a11cff4d62ea /assembly/misa/Makefile
parent28be6fac111899c930c8072cd42bcbd7be6f5d40 (diff)
downloadrvcontroller-d609dcb35dafebeafced9c40d92ddd5da630aa54.tar
rvcontroller-d609dcb35dafebeafced9c40d92ddd5da630aa54.tar.gz
rvcontroller-d609dcb35dafebeafced9c40d92ddd5da630aa54.tar.bz2
rvcontroller-d609dcb35dafebeafced9c40d92ddd5da630aa54.tar.xz
rvcontroller-d609dcb35dafebeafced9c40d92ddd5da630aa54.zip
Organize files better and include binaries for assembly samples
Diffstat (limited to 'assembly/misa/Makefile')
-rw-r--r--assembly/misa/Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/assembly/misa/Makefile b/assembly/misa/Makefile
new file mode 100644
index 0000000..95095b6
--- /dev/null
+++ b/assembly/misa/Makefile
@@ -0,0 +1,26 @@
+# Intentionally less complete default march so that it's still compatible with RVController's minimum configuration
+# (in case someone changed the misa value and wants to decode the new one)
+MARCH ?= rv32ezicsr_zicond
+
+.PHONY: all dump load clean
+
+all: misa.hex
+
+misa.o: misa.S
+ riscv32-none-elf-as -I../rvcontroller-libraries -march=${MARCH} -o misa.o misa.S
+
+misa.elf: misa.o
+ riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o misa.elf misa.o
+
+dump: misa.elf
+ riscv32-none-elf-objdump -d misa.elf
+
+misa.hex: misa.elf
+ riscv32-none-elf-objcopy -O ihex misa.elf misa.hex
+
+load: misa.hex
+ bash -c "wl-copy < misa.hex"
+
+clean:
+ rm -f misa.bin misa.elf misa.o
+