Closed gundy closed 6 years ago
I've submitted pull request #87 to address this.
This is intentional and matches the default configuration of PicoRV32. Otherwise the regs file would be twice as large as needed in the default configuration. picorv32_regs
is just a simple example. If you set PICORV32_REGS
then you would of course provide your own implementation that has the size you need.
The comment on picorv32_regs
states all that, even explicitly reminds you that you must make appropriate changes if you want to use it with QREGS:
// This is a simple example implementation of PICORV32_REGS.
// Use the PICORV32_REGS mechanism if you want to use custom
// memory resources to implement the processor register file.
// Note that your implementation must match the requirements of
// the PicoRV32 configuration. (e.g. QREGS, etc)
module picorv32_regs ...
endmodule
👍 Fair enough - sorry about that..
My default configuration came from the TinyFPGA-BX repo's picosoc, where QREGS was enabled and the reg file still only had 32-registers .. Consequently I just spent the better part of a day chasing this one down. I somehow missed that the defaults here were different.
Sorry for wasting your time with this.
D.
Hi.
Today I discovered that the default PicoSoc configuration doesn't seem to support the q registers, which are used for saving registers in IRQ handlers.
The test case that I used was a basic IRQ handler in ASM. In my test case, this worked fine:
.. but this didn’t:
It turned out that the issue was in the default register bank provided by PicoSoc, and the fact that picorv32 uses registers r32-r35 for the Q registers. The default register bank truncates addresses to 5 bits, so the q registers don't work.
I've got a pull request ready to go - I'll send it through for review shortly.
D.