aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
15 hoursRemove `etc` directory (#500)HEADmasterAbhinav Srivastava / August Radjoe2-10/+0
Remove apply_header target and etc directory, as it is no longer used
37 hoursUpdate README.md based on updated makefileJordan Carlin1-9/+9
#464 updated which targets are produced by just running make. This brings the README file up to date with those changes.
4 daysFix consecutive builds of the OCaml emulatorTim Hutt1-2/+6
These OCaml files can be read only, in which case copying them for a second build fails. To work around this use the `-f` flag which ignores the read-only-ness.
6 daysAdd missing mstatus.MPP legalizationVed Shanbhogue2-0/+20
`mstatus.MPP` legal values are User (`0b00`) (if U-mode implemented), Supervisor (`0b01`) (if S-mode implemented) and Machine (`0b11`). Encoding `0b10` is illegal.
11 daysAdd Zaamo and ZalrscVed Shanbhogue2-6/+10
These are sub-extensions for AMO and LR/SC support. Currently hard-coded to be the same as overall atomic support. Specification: https://github.com/ved-rivos/riscv-zaamo-zalrsc
11 daysDon't hard-code GCC in MakefileEt7f32-3/+3
This uses the `CC` variable (which defaults to `cc`) so that compilation works when using Clang. This also allows the compiler to be overridden via `CC=foo make`.
13 daysCheck misalignment of AMOs before address translation (#471)Tim Hutt1-1/+3
This is optional according to the spec - you can check afterwards. However 1. it seems extremely unlikely that any real designs will do that for atomics, which (ignoring Zam which the model doesn't support yet), always have to be aligned, and 2. the LR and SC instructions already check before address translation, so this wasn't even consistent. Ideally in future this would be configurable.
2024-06-04Merge pull request #477 from Timmmm/user/timh/silly_switchBill McSpadden2-155/+72
Remove unnecessary matches for loads/stores
2024-06-03Remove unnecessary matches for loads/storesTim Hutt2-155/+72
Simplify the load/store code by removing the unnecessary matches on the access size. I have not done it for float loads/stores because that requires a separate change to make the float code generic over size. This also simplifies the AMO operation by not extending and truncating the values so many times, and removing the use of to_bits.
2024-06-03Merge pull request #468 from Timmmm/user/timh/cheri_width_bytesBill McSpadden6-23/+30
Change ext_data_get_addr to use bytes for width
2024-06-03Change ext_data_get_addr to use bytes for widthTim Hutt6-23/+30
Instead of `word_width` which can only be up to 8 bytes, just use bytes. This allows larger accesses (the limit is increased to 4096), e.g. for `cbo.zero`.
2024-06-03Use multiple threads for LTOMudassir Ali1-1/+1
This uses the Make job server so that multiple threads can be used for LTO, which speeds up the build.
2024-05-23Merge pull request #456 from KotorinMinami/masterBill McSpadden5-20/+162
fix disassembly problems
2024-05-23Merge pull request #473 from Timmmm/user/timh/remove_duplicate_mem_readsBill McSpadden1-8/+0
Remove duplicate type declarations for mem_read
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-15Remove duplicate type declarations for mem_readTim Hutt1-8/+0
These used to be different because they had different effects annotations, but those have since been removed and now they are the same.
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-14fix format problem and prevent different nameKotorinMinami1-3/+3
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-11Change immediates to be signed in assemblyKotorinMinami5-20/+162
These immediates are sign extended and usually interpreted as signed, so it's less confusing to use signed numbers. This also matches SPIKE's disassembly.
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.