vyoma-systems / zilsd

0 stars 0 forks source link

clang compile issues #4

Open lavanyajagan opened 5 months ago

lavanyajagan commented 5 months ago

Both the tests, when run with riscv32-unknown-elf-gcc it compiles without any issue.

jal instruction

jal_inst.zip

Jal does not compile with the offset as +(0) with clang

clang -march=rv32i   -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles  -T ./env/link.ld  -I ./env -mabi=ilp32  ./jal.S -o dut.elf
/tmp/jal-0a1390.s:1007:5: error: unsupported relocation type
;2: jal x21, 1b +(0);

misalign test with -Drvtest_mtrap_routine=True

misalign_inst.zip

clang -march=rv32i_zicsr   -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles  -T ./env/link.ld  -I ./env -mabi=ilp32  ./misalign-beq-01.S  -o dut.elf -Drvtest_mtrap_routine=True -DTEST_CASE_1=True -DXLEN=32
<instantiation>:12:19: error: operand must be a valid system register name or an integer in the range [0, 4095]
        csrrw x8, CSR_XSCRATCH, x6
lavanyajagan commented 3 months ago

jal is fixed with latest release, the csr name issue is still open