sail-riscv icon indicating copy to clipboard operation
sail-riscv copied to clipboard

replace vxrm with vcsr[vxrm]

Open rez5427 opened this issue 1 year ago • 4 comments

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.

image

rez5427 avatar Sep 28 '24 11:09 rez5427

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.

Timmmm avatar Sep 28 '24 11:09 Timmmm

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.

github-actions[bot] avatar Sep 28 '24 11:09 github-actions[bot]

Is it appropriate to remove the registers vxrm and vxset in this context?

rez5427 avatar Sep 28 '24 16:09 rez5427

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.

Alasdair avatar Sep 28 '24 23:09 Alasdair