@author Sooraj Chetput V., Fan Jing Hoon
riscv64-unknown-elf-gcc \
-march=rv32i -mabi=ilp32 \
-Wl,-EL -Wl,-m,elf32lriscv \
-nostartfiles -nostdlib \
-O2 \
-o main.elf main.c amp_def.h matrix_alloc.h matrix_init.h
is what you use to compile the elf file.
Give's the dissassembly.
riscv64-unknown-elf-objdump -D main.elf > temp.txt
Convert ELF to raw binary
riscv64-unknown-elf-objcopy -O binary main.elf main.bin
might be useful for simulations.
riscv64-unknown-elf-objcopy -O ihex main.elf main.hex
main.c # Top-level test program amp_def.h # Inline assembly + encoding macros matrix_alloc.h # Memory allocation utilities matrix_init.h # Matrix data initialization
The matrix_init.h, matrix_alloc.h, and matrix_body.inc are generated by running array_rand_init.py for one, and register_allocate.py for the other 2.
Also, keep in mind that the starting PC of this is not 0 -- set that correctly.