aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_insts_cext.sail
AgeCommit message (Collapse)AuthorFilesLines
2024-07-19Use "extensionEnabled" function for C extensionsanket1-66/+68
2024-05-11Change immediates to be signed in assemblyKotorinMinami1-10/+10
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-03-24Add RV32 restriction for compressed shift instructionsTim Hutt1-4/+4
The restriction was present for `C.SLLI` but was missing for `C.SRLI` and `C.SRAI`. The format is copied from `C.SLLI`. Fixes #356
2024-02-08Shorten copyright notice at the top of each fileTim Hutt1-65/+3
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-01-31Update bitfield syntaxAlasdair1-1/+1
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-11-29Make consistent operand namesPaul A. Clarke1-2/+2
There are a few places where operand/field names are not consistent across scattered definitions for an instruction. Here, parameter `rs2` is used for encode/decode and execute, but `rd` is used for the same purpose in the assembly clause: ``` mapping clause encdec_compressed = C_SWSP(ui76 @ ui52, rs2) <-> 0b110 @ ui52 : bits(4) @ ui76 : bits(2) @ rs2 : regidx @ 0b10 function clause execute (C_SWSP(uimm, rs2)) = { let imm : bits(12) = zero_extend(uimm @ 0b00); execute(STORE(imm, rs2, sp, WORD, false, false)) } mapping clause assembly = C_SWSP(uimm, rd) <-> "c.swsp" ^ spc() ^ reg_name(rd) ^ sep() ^ hex_bits_6(uimm) ``` Fix these by using the operand names found in "The RISC-V Instruction Set Manual, Volume I: Unprivileged ISA", document version 20191213, and "RISC-V Cryptography Extensions Volumn I: Scalar & Entropy Source Instructions", version v1.0.1.
2023-08-01Rename EXTZ and EXTSAlasdair1-20/+20
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
2023-05-29apply_headers: regenerate copyright headersupdate-copyright-headersPhilipp Tomsich1-1/+3
2021-07-29Use headache to apply copyright header at request of Peter Sewell.Robert Norton1-0/+68
2020-05-22Add compressed F,D instructions.Prashanth Mundkur1-2/+0
Fixes #51.
2019-08-19RISC-V spec, without implicit castsAlasdair Armstrong1-2/+2
2019-05-10Rename regbits to regidx, to clarify the type is an index and not the ↵Prashanth Mundkur1-83/+83
contents of a register.
2019-05-10Use an explicit enum to indicate the retire status as opposed to a boolean ↵Prashanth Mundkur1-1/+1
to improve clarity.
2019-05-03Fix a todo for c.slli on RV32.Prashanth Mundkur1-3/+2
2019-05-03Minor formatting cleanup and remove obsolete comments.Prashanth Mundkur1-9/+13
2019-04-09Fix c.addiw to expand to a non-rvc instruction as per spec.Prashanth Mundkur1-7/+2
2019-02-19Use sizeof xlen instead of the value definitions of xlen.Prashanth Mundkur1-32/+32
2019-02-11Fix xlen variable name.Prashanth Mundkur1-32/+32
2019-02-08Add xlen guards on encdec and assembly guards, and encdec for c.jal.Prashanth Mundkur1-15/+43
2019-01-25Add misa checks for instructions not in the base set.Prashanth Mundkur1-0/+5
2019-01-25Factor out each extension into separate files, do some minor cleanup.Prashanth Mundkur1-0/+527