Age | Commit message (Collapse) | Author | Files | Lines |
|
Use newer bitfield syntax, which has been part of Sail for
a while now. Should in theory be more efficient as it removes
a level of indirection for bitfield accesses.
It's also much more friendly to `sail -fmt`, which has no idea
how to handle the old bitfield syntax.
|
|
The operand order for Store-Conditional assembly has the second
and third operands reversed.
The RISC-V Instruction Set Manual states:
> ```
> SC.W conditionally writes a word in rs2 to the address in rs1 [...]
> If the SC.W succeeds, the instruction writes the word in rs2 to memory,
> and it writes zero to rd. If the SC.W fails, the instruction does not
> write to memory, and it writes a nonzero value to rd.
> ```
`rd` is for the return code, `rs2` is the value, and `rs1` is the memory
address.
For the syntax `sc.w A,B,(C)`:
- `A` is where the result is stored, per convention. So, this is `rd`.
- `B` is the value to be stored. So, this is `rs2`.
- `C` is the address at which to store the value. So, this is `rs1`.
The resulting syntax would be `stc.w rd,rs2,(rs1)`.
The current assembly representation is:
```
"sc." ^ size_mnemonic(size) [...] reg_name(rd) ^ sep() ^ reg_name(rs1) ^ sep() ^ reg_name(rs2)
```
Note that the order is wrong. In addition, parentheses are missing around `rs2`.
Fix this instance, as well as two other instances where parentheses are missing.
Fixes #338.
Fixes #344.
Suggested-by: Tim Hutt <timothy.hutt@codasip.com>
|
|
SHIFTW and SHIFTIWOP were duplicated. This did not cause any harm except that the disassembly for the SHIFTW version was incorrect. Therefore I removed that version.
The `execute()` functions were identical but the SHIFTW version is slightly neater (only one `[31..0]`) so I applied that to the SHIFTIWOP version.
This should cause no functional changes to the model except that the disassembly will have the extra `w` which is correct.
|
|
This implements the m/senvcfg(h) CSRs. This CSR is used to enable/disable extensions and behaviours for lower privilege modes. Currently the only implemented bit is FIOM which affects how fences work.
It also affects how atomic memory accesses work in non-cacheable regions, but the model does not currently support PMAs so that can't easily be implemented.
|
|
Since Sail 0.15 (released Nov 2022), effects have had no effect. They now generate a deprecation warning. This commit removes all the effect annotations from the model, thus fixing the compiler warnings.
|
|
Rename EXTZ to zero_extend and EXTS to sign_extend. Two main reasons
for doing this - it means that the source more closely follows the
descriptions in the documentation with more readable names, and EXTS
and EXTZ are visually very close to each other with just the S and Z.
They are also following an odd convention where they are ALLCAPS rather
than snake_case like other functions in the spec.
I think this convention comes from early Power specs in Sail, which
influenced Sail MIPS and CHERI-MIPS, but I don't think it's a very
good convention we should be keeping in sail-riscv
|
|
This strips trailing whitespace and fixes line endings. I had to add the
*.dump files to the exclude list to avoid excessive changes, but
ideally these would not be part of the repository since they can just be
generated by running objdump manually.
|
|
|
|
This may be more readable and also matches the sail-cheri-riscv model.
For now this keeps ~ overloaded to accept bool, but in the future we may
want to consider removing it (which is what I did to find all uses
modified in this patch)
|
|
Sail tries to check for pattern match completeness and issues warnings
but this often gives false positives: see discussion at
https://github.com/rems-project/sail/issues/191 . To suppress these
we add a wildcard case that raises an internal error. There is
effectively no behaviour change as these would previously have
resulted in a match error at runtime and they should be unreachable
anyway.
At the same time we change the DOUBLE case in memory access paths to
allow for xlen > 64.
Following discussion on the PR I also changed internal_error to take a
file and line number as an argument to aid with debugging.
Fixes: https://github.com/riscv/sail-riscv/issues/194
|
|
|
|
|
|
|
|
Fixes #70.
|
|
concurrency is not yet modelled.
Thanks to Christopher Pulte.
|
|
|
|
|
|
|
|
|
|
extension. Note that illegal exception on mode check failure takes precedence over CHERI to allow for virtualisation.
|
|
|
|
|
|
|
|
|
|
E_CHERI code. Enable extensions for PTE checks and PTW errors, and propagate those into exception codes.
|
|
|
|
|
|
not what is in the PC register because the architectural PC is the offset of PCC and the PC register stores the absolute PC (at present -- may review this decision in future). This allows fix for AUIPC and RVFI reported PC.
|
|
Move updated 0.11 lem files from Shaked's commit into their own directory
Remove the 0.7.1 lem directory that performed a similar purpose during the prompt monad changes
Re-add model changes from Shaked's commit with a feature flag
|
|
Move this commit to new_barriers branch until we can update C/SMT/etc
and make a new release of Sail for backwards compatability with the
opam package
This reverts commit 273ec8b0715b39844101c8081114f2697f291312.
|
|
|
|
definitions.
|
|
- unify AccessType and ReadType since they were essentially redundant,
making it easier to implement PMP checks for ReadWrite/atomic accesses.
- add command line options to enable PMP in the platform
- also fix the matching for the case when all entries are off
|
|
|
|
being built.
|
|
contents of a register.
|
|
to improve clarity.
|
|
|
|
|
|
handlers return nextPC values as opposed to setting them.
|
|
data_get_addr. This avoids a double register read in CHERI case.
|
|
assist with implementing CHERI capability mode.
|
|
|
|
|
|
|
|
|
|
- handle sfence.vma in machine-mode
- flush both tlb39 and tlb48 in 64-bit mode
|
|
- fix and simplify model initialization, to enable generic TLB initialization
- re-enable sfence.vma
|
|
|
|
|