diff options
Diffstat (limited to 'assembly')
| -rw-r--r-- | assembly/zicboztest/Makefile | 24 | ||||
| l--------- | assembly/zicboztest/rvcontroller.ld | 1 | ||||
| -rw-r--r-- | assembly/zicboztest/zicboztest.S | 17 |
3 files changed, 42 insertions, 0 deletions
diff --git a/assembly/zicboztest/Makefile b/assembly/zicboztest/Makefile new file mode 100644 index 0000000..60747f2 --- /dev/null +++ b/assembly/zicboztest/Makefile @@ -0,0 +1,24 @@ +MARCH ?= rv32imacbzicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt_zicboz + +.PHONY: all dump load clean + +all: zicboztest.hex + +zicboztest.o: zicboztest.S + riscv32-none-elf-as -I../rvcontroller-libraries -march=${MARCH} -o zicboztest.o zicboztest.S + +zicboztest.elf: zicboztest.o + riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o zicboztest.elf zicboztest.o + +dump: zicboztest.elf + riscv32-none-elf-objdump -d zicboztest.elf + +zicboztest.hex: zicboztest.elf + riscv32-none-elf-objcopy -O ihex zicboztest.elf zicboztest.hex + +load: zicboztest.hex + bash -c "wl-copy < zicboztest.hex" + +clean: + rm -f zicboztest.hex zicboztest.elf zicboztest.o + diff --git a/assembly/zicboztest/rvcontroller.ld b/assembly/zicboztest/rvcontroller.ld new file mode 120000 index 0000000..bc01402 --- /dev/null +++ b/assembly/zicboztest/rvcontroller.ld @@ -0,0 +1 @@ +../../rvcontroller.ld
\ No newline at end of file diff --git a/assembly/zicboztest/zicboztest.S b/assembly/zicboztest/zicboztest.S new file mode 100644 index 0000000..c9c5289 --- /dev/null +++ b/assembly/zicboztest/zicboztest.S @@ -0,0 +1,17 @@ +li t0,0x4000 +li t1,0xdeadbeef +li t2,0x7000 +1: sw t1,0(t0) +addi t0,t0,4 +andi t3,t0,0xff +bnez t3,2f +li a7,11 +li a0,'.' +ecall +2: blt t0,t2,1b + +li a0,0x5000 +cbo.zero 0(a0) + +li a7,10 +ecall |
