-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trap in simulation with existing compiler #210
Comments
Just encounter the same problem. The problem seems to be caused by an unalign memory access in the early part of .balign 16
irq_vec:
/* save registers */
#ifdef ENABLE_QREGS
picorv32_setq_insn(q2, x1)
picorv32_setq_insn(q3, x2)
# Load the address of irq_regs into x1, aka sp
lui x1, %hi(irq_regs)
addi x1, x1, %lo(irq_regs)
picorv32_getq_insn(x2, q0)
sw x2, 0*4(x1) # This very instruction causes an unaligned memory access However, the symbol lw x28, 28*4+0x200(zero)
lw x29, 29*4+0x200(zero)
lw x30, 30*4+0x200(zero)
lw x31, 31*4+0x200(zero)
#endif
#endif // ENABLE_QREGS
picorv32_retirq_insn()
#ifndef ENABLE_QREGS
.balign 0x200
#endif
irq_regs:
// registers are saved to this memory region during interrupt handling
// the program counter is saved as register 0
.fill 32,4
// stack for the interrupt handler
.fill 128,4
irq_stack: I have no idea why |
I tried removing the ifndef arounf
|
I haven't looked at this core for a while, but for me it seems that the problem was related to compiling the RISCV toolchain from source (although I am not sure about the exact cause). When using a pre-compiled toolchain the If you want to try it, simply:
HTH |
Hi @patrickerich ! Thanks for the quick reply. i did try the pre-compiled toolchain but it still doesn't work. I made sure to clean the existing files before running it with the new toolchain as well. Still getting the same error. |
Short reply: Longer reply:
When I check out a fresh copy of the git repo and ONLY change the
HTH |
The solution posted by @retrhelo is completely correct (Thanks @retrhelo!). I suspect that the reason that the lowrisc pre-build toolchain did not show the same problem (for me), is because of the configuration of the build. I am not sure exactly which option made the difference, but I did notice that a |
Hi @patrickerich, Thanks for your patience. A clean reinstall did the trick. |
I was trying to run
make test
with my existing 32-bit compiler, I got the following error:My compiler was configured with:
Any idea which flag is missing (or maybe several flags) ?
The text was updated successfully, but these errors were encountered: