RVMODEL_IO_ASSERT_GPR_RQ used for float point registers
Closed this issue · 2 comments
When updating an old testbench where we use a custom RVMODEL_IO_ASSERT_GPR_EQ
macro in model_test.h
for reporting I can't build the F & D tests. The reason for this is that TEST_CASE_F
in test_macros.h
uses RVMODEL_IO_ASSERT_GPR_EQ
, passing a float point register as the destreg
, and our implementation of that macro assumes that destreg
will be an integer register.
Given that the template also provides two macros that seem to me to be for float comparison (https://github.com/riscv-software-src/riscof/blob/108fa2d4e824b3e37fcff82e4fbbb7243127320b/riscof/Templates/setup/reference/env/model_test.h#L40-L42), should TEST_CASE_F
call those instead of the GPR version?
If not, did I overlook a way to decide between mv
and fmv
depending on the register?
The trail of breadcrumbs:
passes
f25
as the destreg
riscv-arch-test/riscv-test-suite/env/test_macros.h
Lines 721 to 722 in 8a52b01
passes that on to:
riscv-arch-test/riscv-test-suite/env/test_macros.h
Lines 613 to 616 in 8a52b01
and on to RVMODEL_IO_ASSERT_GPR_EQ
as _R
In our specific RVMODEL_IO_ASSERT_GPR_EQ
we then mv
that register to s0
which yields an invalid instruction for this (and many other) case.
#define RVMODEL_IO_ASSERT_GPR_EQ(_SP, _R, _I) \
LOCAL_IO_PUSH(_SP) \
mv s0, _R;
Yes, you are totally right - I shouldn't have only searched the issues...
Closing this as there is #426 already