Trap and exit code includes non-RV32E compliant registers
Closed this issue · 9 comments
The trap code in arch_test.h contains t3, 4, and 5 which are registers x28-x30, and do not exist for RV32E architectures
RVTEST_CODE_END uses t4 in abort_tests
Also, the init register code uses RVTEST_E, but the gpr save register code uses RV32E
Also sw x1,tohost,t5 in model_test.h not compatible for rv32e.
Ok, So Is there a version for model_test.h that is rv32e compatible?
I am trying RISCOF framework, and getting model_test.h generated in that.
It comes from here ->
model_test.h
I was suggesting the same. Also asked for same here in riscof repo. - issue-85.
I think it'll be good if that one line in model_test.h has rv32e compliant register as the tests are present in repo.
Thanks! I only have one concern about the maintenance and readability of this code:
#define T1 x6
...
LREG T1, code_bgn_off + 2*sv_area_sz(sp)
T1 looks really like the ABI register t1, and I can see where the code has all been changed to reflect this "local temporary", but I'm confused why a full self-documenting rename like "TEMP1" or "LTEMP1" or even something more specific like "ACT1" or "EXCEPTHAND1" wasn't used. T1 seems to imply t1, and it clearly shouldn't.
Additionally, it seems dangerous to be combining both ABI and gpr names for registers. You can see in that LREG code that the stack pointer register sp (x2) is used. But the redefinition for "T1" uses x6 (which in this case IS actually t1, but of course, is NOT true for t4, the original problem register). I would think our code would use one or the other, but mixing them could get us into trouble in the future.