riscv / sail-riscv

Sail RISC-V model
https://lists.riscv.org/g/tech-golden-model
Other
407 stars 148 forks source link

Add Svinval extension. #462

Closed martinberger closed 2 months ago

martinberger commented 2 months ago
These changes add the "Svinval" Standard Extension for Fine-Grained
Address-Translation Cache Invalidation, Version 1.0 to the sail-riscv model.

This extension defines five new instructions: SINVAL.VMA, SFENCE.W.INVAL,
SFENCE.INVAL.IR, HINVAL.VVMA, HINVAL.GVMA.

HINVAL.VVMA & HINVAL.GVMA are omitted since they build on the
Hypervisor Extension which is yet to be included in the model.

SFENCE.W.INVAL & SFENCE.INVAL.IR are treated as nops pending integration
of the coherency model (rmem) with sail.

The specification says that SINVAL.VMA behaves just as SFENCE.VMA,
except there are additional ordering constraints with respect to the new
SFENCE.W.INVAL & SFENCE.INVAL.IR instructions. Since these are nops, we
can treat SINVAL.VMA as if it were SFENCE.VMA.
martinberger commented 2 months ago

This is essentially the same PR as https://github.com/riscv/sail-riscv/pull/297 from @kristinbarber but I've added the missing haveSvinval() gates in the encdec functions.

martinberger commented 2 months ago

One question is: should this be in a separate riscv_insts_svinval.sail file?

github-actions[bot] commented 2 months ago

Test Results

712 tests  ±0     0 :white_check_mark:  - 712   0s :stopwatch: ±0s   6 suites ±0     0 :zzz: ±  0    1 files   ±0   712 :x: +712 

For more details on these failures, see this check.

Results for commit ff98dccc. ± Comparison against base commit c5ee87df.