aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-05-23Merge pull request #476 from Timmmm/user/timh/minor_fixesBill McSpadden2-5/+3
Minor style fixes
2024-05-23Merge pull request #483 from Alasdair/c23_warn_fixBill McSpadden2-2/+2
csim: Fix C23 compatability warning
2024-05-21Update bitfield syntaxJordan Carlin3-6/+6
2024-05-21Merge pull request #479 from jordancarlin/remove_unused_reg_name_functionsBill McSpadden2-84/+0
Remove unused (f)reg_name_abi functions
2024-05-21csim: Fix C23 compatability warningAlasdair2-2/+2
The plat_get_16_random_bits was missing its unit argument, which produces the following warning: ``` generated_definitions/c/riscv_model_RV64.c:28041:34: warning: passing arguments to 'plat_get_16_random_bits' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] zseed = plat_get_16_random_bits(UNIT); ``` This commit adds the appropriate argument to the function in the C simulator
2024-05-20Fix mext whitespaceJordan Carlin1-53/+53
2024-05-20Merge pull request #458 from Alasdair/interfaceBill McSpadden8-454/+194
RVWMO support via Sail concurrency interface
2024-05-20Merge pull request #461 from Timmmm/user/timh/fix_pte_sizeBill McSpadden1-17/+18
Don't read or write 8 bytes for 4-byte PTEs
2024-05-20Merge pull request #469 from Timmmm/user/timh/have_atomicsBill McSpadden1-176/+161
Move haveAtomics() guard for atomic instructions to guard clauses
2024-05-20Merge pull request #480 from jordancarlin/have_MulDivBill McSpadden1-42/+12
Move haveMulDiv() guard to encdec for M extension
2024-05-18Move haveMulDiv() guard to encdec for M extensionJordan Carlin1-42/+12
2024-05-19Remove effect from vext_vsetJordan Carlin1-1/+1
2024-05-18Remove unused (f)reg_name_abi functionsJordan Carlin2-84/+0
2024-05-17Replace some bits(12)s with csregTim Hutt2-2/+2
Very minor. Uses an existing type alias.
2024-05-16Merge pull request #359 from XinlaiWan/masterBill McSpadden2-81/+98
Fix the encoding and assembly of `vsetvl` instruction
2024-05-16Merge branch 'master' into masterBill McSpadden29-138/+223
2024-05-15Add some missing explicit var declarationsTim Hutt4-20/+20
Implicit `var` declarations will eventually be an error. This makes some implicit `var` declarations explicit.
2024-05-15Handle 34-bit PMP address overflowTim Hutt1-18/+25
The existing PMP code could not handle physical addresses above 32 bits on RV32, which are possible since Sv32 has 34-bit physical addresses, and the PMP registers are in units of 4 bytes, so they can encode 34-bit addresses. This fixes that by delaying the *4 until the comparison where it can be done using `nat` instead of `xlenbits` which it would overflow.
2024-05-15Don't read or write 8 bytes for 4-byte PTEsTim Hutt1-17/+18
For Sv32 Page Table Entries are only 4 bytes, but the old code was unconditionally reading and writing 8 bytes. Fixes #459
2024-05-15Minor style fixesTim Hutt2-5/+3
* Remove unnecessary `f` variable * Remove redundant type delcaration for `fetch`. * Indentation
2024-05-14Move haveAtomics() guard for atomic instructions to guard clausesTim Hutt1-176/+161
This matches the style of all the other instructions, which use the decoder mapping for this purpose.
2024-05-12Refactor MUL instructionAlasdair3-34/+28
This instruction had a bit of a case of 'boolean blindness' code smell, where the mul operation was represented as a triple of booleans. This commit refactors the implemention to use a struct with named fields for high, signed_rs1, and signed_rs2. The C_MUL instruction in Zcb also needs to be changed appropriately The mul_op struct was added in riscv_types While there do some housekeeping w.r.t the comment about a workaround for Sail < 0.15.1, as this is no longer needed.
2024-05-10lem: Add PMP related stubs for Isabelle buildAlasdair1-0/+8
These stub functions are required for building the Riscv.thy file from the generated lem file.
2024-05-10Makefile: Make sure OPAMCLI is 2.0 in all subshellsAlasdair1-5/+7
Furthermore, make sure variables defined by calling opam are created using :=, so opam is not called each time they are expanded
2024-05-10Remove theorem prover targets from default Makefile rule (#464)Alasdair Armstrong1-1/+1
In general we aren't requiring contributors to implement the correct Lem/Isabelle/HOL4/Coq stubs for new extensions (this would almost certainly be way too high a bar) so having these in the default set of build targets just means that typing 'make' is broken until those of us who are invested in maintaining those targets can add updates for those stubs.
2024-05-09Replace vmandnot and vmornot with vmandn and vmorn - Issue #421 (#465)Shivang Mishra2-7/+7
Updates the instruction mnemonics for vmandn and vmorn * replace mnemonics "vmandnot" and "vmornot" with "vmandn" and "vmorn" respectively * renamed MM_VMORNOT and MM_VMANDNOT to match mnemonics
2024-05-07Add missing decoder guards for crypto extensionsTim Hutt2-29/+29
These guards were missing from one side of each clause.
2024-05-07Add Svinval extension.Martin Berger2-3/+3
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. Co-authored-by: Kristin Barber <kristinbarber@google.com>
2024-05-07fixup! fixup! fixup! Add Svinval extension.Martin Berger3-46/+54
2024-05-07fixup! fixup! Add Svinval extension.Martin Berger2-3/+2
2024-05-07fixup! Add Svinval extension.Martin Berger8-0/+20
2024-05-07Add Svinval extension.Martin Berger1-0/+46
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.
2024-04-30Adapt memory builtins for Sail concurrency interfaceAlasdair8-454/+194
Sail has for a while now had a flexible way of passing additional information to either operational or axiomatic concurrency models by instantiating outcomes (effects) with model-specific types. The set of possible outcomes is defined in the Sail library, and a subset of these can be instantiated by any model. As part of adapting the model to this newer concurrency interface, the riscv_analysis file is no-longer needed, so it has been removed.
2024-04-29split fcvtmod.w.d invalid check into 2 if statementsJordan Carlin1-1/+2
2024-04-29Correct fcvtmod.w.d flag generation logicJordan Carlin1-1/+3
2024-04-27Remove trailing whitespace in README (#460)Alasdair Armstrong1-1/+1
The pre-commit check is strict about this, and even checks non code files.
2024-04-27Update README.mdPeter Sewell1-1/+1
Signed-off-by: Peter Sewell <Peter.Sewell@cl.cam.ac.uk>
2024-04-27Update README.mdPeter Sewell1-1/+2
Signed-off-by: Peter Sewell <Peter.Sewell@cl.cam.ac.uk>
2024-04-27Update README.mdPeter Sewell1-17/+9
Signed-off-by: Peter Sewell <Peter.Sewell@cl.cam.ac.uk>
2024-04-24Add missing check for RV64 on float conversion instructionsTim Hutt1-4/+4
These two instructions are RV64-only, as noted in the comment, but were missing the check. There are other instructions in this file that did have the check so it was just an ommission.
2024-04-24Add read-only CSR MCONFIGPTRAlasdair4-0/+5
CSR MCONFIGPTR is defined in RISCV priv spec 1.12 but is missing from the RISC-V SAIL model. This commit adds the read-only CSR MCONFIGPTR. Co-authored-by: Dan Smathers <dan.smathers@seagate.com>
2024-04-17Merge branch 'master' into masterXinlai Wan126-9619/+4065
Signed-off-by: Xinlai Wan <xinlai.w@rioslab.org>
2024-04-15Implement Zcb extensionTim Hutt11-1/+237
This adds an implementation of the Zcb code size extension. Co-authored-by: Martin Berger <martinberger@users.noreply.github.com>
2024-04-14Fix compiler warnings in vextVed Shanbhogue6-20/+25
2024-04-12Remove & rename duplicate word_width <-> bytes mappingsTim Hutt4-29/+22
* Remove the duplicate mapping functions. * Rename to `size_bytes` for consistency with the other two functions. * Rename `size_bits` to `size_enc`, otherwise it's quite confusing that `size_bits` is not just `8 * size_bytes`. Fixes #423
2024-04-09Clean up memory checking functions slightlyTim Hutt1-65/+73
* Move `write_knd_of_flags` into its own function. * Wrap really long lines * Move PMP check into `phys_access_check` function. This is needed for two reasons: - The CBO extension needs to do explicit access checks. - In future it will also check PMAs so the name needs changing.
2024-04-03Fix flen=32 compilationTim Hutt3-10/+10
This has been broken for at least 2 years. This fixes the compilation. Fixes #351
2024-04-01Unify VM code Rishiyur S. Nikhil14-1051/+1966
Old vmem code had much 'cut-and-paste' replication for RV32 (Sv32) and (#408) RV64 (Sv39, Sv48), and was scattered over several files. New code unifies them into single set of parameterized functions that works for RV32/RV64 and Sv32/Sv39/Sv48 (and is ready for Sv57). Deleted old files: riscv_vmem_rv32.sail riscv_vmem_rv64.sail riscv_vmem_sv32.sail riscv_vmem_sv39.sail riscv_vmem_sv48.sail riscv_pte.sail riscv_ptw.sail Current files: all named riscv_vmem_* riscv_vmem.sail (root file for vmem) riscv_vmem_common.sail riscv_vmem_pte.sail riscv_vmem_ptw.sail riscv_vmem_tlb.sail riscv_vmem_types.sail Modified top-level Makefile accordingly. Added documentation on new vmem code: doc/notes_Virtual_Memory.adoc
2024-03-25Fix MEnvCall valueTim Hutt1-1/+1
Fixes #294
2024-03-24Fix error in senvcfg definitionVed Shanbhogue2-11/+29