Open gameboo opened 6 years ago
RV32 tests aren't intended to run in RV64.
Fair enough :) Would the change that made them pass on rv64 for me (and any other potential one, actually probably not that one but something MXL based perhaps) be of any value? Or should I just forget about making them run on rv64 altogether?
I would say it's a feature that the tests don't run correctly on RV64 systems. Put a different way, if all RV32 tests ran correctly on native RV64, that would mean their coverage was poor: they can't tell RV32 and RV64 apart!
The canonical way to solve this problem is to implement MXL and switch to RV32 mode.
Yes. I edited my message a bit late maybe, but the MXL and mode switch at the beginning of the test is what I meant. I was thinking you'd want to be able to test that your rv64 implementation can correctly run code that is supposed to run on an rv32 implementation, and maybe explicitly test separately the behaviour that currently cause rv32 to fail on rv64 for explicit coverage... Not worth the hassle?
Yes, that's reasonable; it would probably go in the implementation of the RVTEST_RV32x macros.
I was trying to test a rv64 implementation (happy running rv64 tests) with rv32 tests and expected to maybe find bugs in the style of "you didn't sign extend things correctly" or the likes.
Quite a few tests were happy, and, sure thing, some other tests failed. However, looking a bit more into it, it seems like the
TEST_CASE
macro cannot cope with a test built for rv32 when ran on rv64:If I understand correctly,
li
(and ultimatelylui
) will sign extend the value passed toMASK_XLEN
according to the specified behaviour when running in 64 bit mode. In particular, that looks to me like it breaks things likeTEST_IMM_OP( 12, addi, 0x000000007ffff7ff, 0x000000007fffffff, 0x800 );
(used in isa/rv64ui/addi.S linked from isa/rv32ui/addi.S) (and I do fail the test in this way).Just as a quick sanity check, I did something like this:
and the test (along with a few others that were previously failing) started passing. Some other tests still fail for things that I suspect are similar reasons (and possibly some bugs in the rv64 implementation itself).
Are rv32 tests simply not expected to be run on rv64 implementations? Or am I missing a step somewhere maybe ?