riscv-vector-tests icon indicating copy to clipboard operation
riscv-vector-tests copied to clipboard

Add more tests which check CSR functionality

Open troibe opened this issue 1 year ago • 8 comments

Thanks for the test suite. It's super helpful for developing simulators and RTL. Maybe I missed something but I think the tests currently don't take into accout vxrm, frm, mstatus, sstatus, vsstatus and other CSRs.

troibe avatar Jan 03 '24 17:01 troibe

I'm currently busy with other things, but I will add them.

ksco avatar Jan 04 '24 09:01 ksco

I already added vxrm and vxsat support.

ksco avatar Jan 09 '24 16:01 ksco

Thanks so much! :tada:

troibe avatar Jan 09 '24 16:01 troibe

I think some vstart related tests would also be helpful. So far my ISA simulator always set vstart to zero which should lead to issues I think but there are no test cases covering it as far as I can tell.

troibe avatar Jan 29 '24 21:01 troibe

Normally, vstart is written by hardware on a trap, which is not straightforward to fit into our test framework. vstart can also be written by csrrw[i], which is a usage scenario not recommended by the v-spec, I can at least add support for the latter case.

ksco avatar Jan 30 '24 02:01 ksco

Note that implementations are not required to support non-zero vstart for instructions where they would never take a trap in the middle of execution.

jerryz123 avatar Jan 30 '24 02:01 jerryz123

Indeed. Then we have to make vstart support optional for arithmetic instructions if we add it to the test.

Page 14:

For example, some implementations will never take interrupts during execution of a vector arithmetic instruction, instead waiting until the instruction completes to take the interrupt. Such implementations are permitted to raise an illegal instruction exception when attempting to execute a vector arithmetic instruction when vstart is nonzero.

ksco avatar Jan 30 '24 03:01 ksco

It is also possible that an implementation that does not support exceptions only supports vstart == 0.

ksco avatar Jan 30 '24 03:01 ksco