aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_vext_regs.sail
AgeCommit message (Collapse)AuthorFilesLines
2024-09-24Remove dec parameters from vectorsAlasdair1-15/+15
In the latest version of Sail these do nothing, and are only allowed for backwards compatability reasons.
2024-09-20Vector: Remove now unnecessary uses of undefinedAlasdair Armstrong1-62/+54
Sail 0.18 contains the vector_init primitive, to make initialising vectors with defined values easier. We can use this in some places where the vector code was creating an uninitalised vector, only to then initialize it later. Second, we can remove some uses of undefined by refactoring slightly how init_masked_result is used, which has the added benefit of making mask immutable. Some additional constraints need to be added to use the vector_init primitive. Sail's pattern completeness checker is now smarter than before, so some wildcard cases can also be safely removed.
2024-09-09Add explicit vars and enable --strict-varTim Hutt1-2/+2
This adds explicit `var` keywords where they were missing before, and enables the `--strict-var` flag to prevent us from missing them out in future. Implicit `var` was a mistake inherited from ASL.
2024-08-27Remove int_power and use built-in 2 ^Tim Hutt1-1/+1
Sail has built-in support for `2 ^`, and this is the only exponent we use so there's no need for the more generic `int_power`. Additionally the type of `int_power` is both way looser than `2 ^` (which is understood at the type level), and actually wrong, e.g. it will let you do `3 ^ -1` and give the result as 3. Note I had to add spaces because this was required until a very recent Sail version - see https://github.com/rems-project/sail/issues/657
2024-07-04Update register reads/writes to use range and type aliases instead of forall 'nJordan Carlin1-7/+5
Replace forall 'n, 0 < 'n <= * with range(0, *) for register access. With this change, many of them can also switch to using the already defined type aliases. Fixes #426
2024-02-08Shorten copyright notice at the top of each fileTim Hutt1-37/+7
This script was used to do the modification: ``` from pathlib import Path import re RE_LINE = r"/\*={50,150}\*/\n" RE_MIDDLE = r"/\*.*\*/\n" NEW_TEXT = """/*=======================================================================================*/ /* This Sail RISC-V architecture model, comprising all files and */ /* directories except where otherwise noted is subject the BSD */ /* two-clause license in the LICENSE file. */ /* */ /* SPDX-License-Identifier: BSD-2-Clause */ /*=======================================================================================*/ """ REPLACEMENT = re.compile(rf"^{RE_LINE}(?:{RE_MIDDLE}){{10,100}}{RE_LINE}") def main(): for file in Path("model").glob("**/*.sail"): text = file.read_text(encoding="utf-8") text = REPLACEMENT.sub(NEW_TEXT, text, 1) file.write_text(text, encoding="utf-8") if __name__ == "__main__": main() ```
2024-02-05Rename string_of_int to dec_strTim Hutt1-1/+1
And string_of_bits to bits_str. These are the names that Sail uses so it makes sense to use them.
2024-01-31Update bitfield syntaxAlasdair1-4/+4
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.
2023-12-06Remove effect annotations from vector extensionAlasdair1-14/+14
2023-10-17RISC-V Vector Extension SupportXinlai Wan1-0/+463
This PR adds the following: General Framework and Configurations: * Introduced the V extension's general framework and configuration setting instructions. * Updated model/riscv_insts_vext_vset.sail and effect matching functions in riscv_vlen.sail. * Addressed code formatting issues and made revisions post the Nov 22 meeting. * Co-authored by Nicolas Brunie and Jessica Clarke. Vector Load/Store Instructions: * Integrated vector load and store instructions. * Enhanced the implementation of SEW, LMUL, VLEN and removed real numbers from the code. * Updated vstart settings and removed unnecessary assert statements. * Rectified bugs in vleff instructions and overhauled coding styles. * Incorporated guards for vector encdec clauses and optimized memory access post vector load/store failures. Vector Integer/Fixed-Point Instructions: * Added vector integer/fixed-point arithmetic and mask instructions. * Improved vector EEW and EMUL checking functions and introduced illegal instruction check functions. * Fine-tuned code formatting for vector instruction checks. Vector Floating-Point Instructions: * Rolled out vector floating-point instructions and updated their conversion counterparts. * Refreshed copyright headers specific to the vector extension code. Vector Reduction and Mask Instructions: * Integrated vector mask and reduction instructions. * Addressed register overlap checks for vector mask instructions. Miscellaneous Enhancements and Fixes: * Updated vector CSR vtype.vill settings and judgements. * Systematized patterns for vector illegal instruction checks. * Rectified issues in vector load/store and reduction operations. * Purged redundant elements from the V extension code and vector floating-point functions. * Cleaned up softfloat makefiles and renamed EXTZ and EXTS within the V extension code. * Addressed a clang-format check issue and NaN boxing anomalies. Provided annotations for pending RVV configurations. * Initialized default VLEN value and set vlenb CSR. * Set constraints for vector variable initialization and added mstatus.VS settings specific to the vector extension.