sail-riscv
sail-riscv copied to clipboard
replace vxrm with vcsr[vxrm]
When I run the vasub test file from the riscv-vector-test suite, I encountered a discrepancy between the outputs of Sail-RISCV and Spike, as shown in the image (highlighted in red). The issue stems from the function get_fixed_rounding_incr, which is incorrectly using the vxrm[1..0] bits instead of vcsr[vxrm]. The vxrm register is not being set by a CSR instruction; it is initialized to zero and remains zero throughout the execution, causing this mismatch.
Presumably this issue also exists for vxsat? I think we should also fix the duplicate read_csr and write_csr clauses at the same time.
Test Results
396 tests ±0 396 :white_check_mark: ±0 0s :stopwatch: ±0s 4 suites ±0 0 :zzz: ±0 1 files ±0 0 :x: ±0
Results for commit dae4fc00. ± Comparison against base commit b63b12f2.
:recycle: This comment has been updated with latest results.
Is it appropriate to remove the registers vxrm and vxset in this context?
I don't think vxrm and vxsat should be actual Sail registers no, I think they are just parts of vcsr that should be accessible via the read_csr and write_csr functions.