aboutsummaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2024-05-20Merge pull request #458 from Alasdair/interfaceBill McSpadden1-5/+2
RVWMO support via Sail concurrency interface
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-07fixup! fixup! fixup! Add Svinval extension.Martin Berger1-0/+2
2024-04-30Adapt memory builtins for Sail concurrency interfaceAlasdair1-5/+2
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-15Implement Zcb extensionTim Hutt1-0/+2
This adds an implementation of the Zcb code size extension. Co-authored-by: Martin Berger <martinberger@users.noreply.github.com>
2024-04-01Unify VM code Rishiyur S. Nikhil1-9/+15
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-02-01Simplify prelude.sail by including generic_equality.sail and mapping.sailTim Hutt1-1/+1
This change includes `generic_equality.sail` and `mapping.sail` from the Sail standard library which defines a lot of things that were defined in `prelude.sail`. I also removed `reg_deref` which is no longer required. The `mapping.sail` and `hex_bits.sail` files are in Sail 0.18 which is not yet released, so they have been temporarily copied here.
2024-01-31Update bitfield syntaxAlasdair1-2/+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-19lem: Fix issues created by vector extensionAlasdair1-11/+3
Switch to bitlist representation because the machine words can't handle the vector code currently Remove RMEM target from default set of targets in Makefile. This is only interesting for RMEM maintainers. There's no reason for it to be generated by default, and it's also broken. While we are hacking on these files purge the duplicate versions for Sail 0.11+
2023-12-06Makefile: Set OPAMCLI to 2.0Alasdair1-0/+3
This removes the warning about `opam config var`. Setting OPAMCLI in this way is the correct thing to do if we want to continue supporting opam 2.0. If we decide to require opam 2.1+ then all `opam var` invocations should become `opam --cli=2.1 var`, as per the opam CLI versioning spec: https://github.com/ocaml/opam/wiki/Spec-for-opam-CLI-versioning
2023-10-17RISC-V Vector Extension SupportXinlai Wan1-1/+13
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.
2023-07-04Adjust Makefile to only use posix options for sedBrian Campbell1-4/+10
Allows for (e.g.) BSD sed, which uses -i differently.
2023-06-27Add Sail documentation target to MakefileAlasdair1-0/+6
2023-05-31Add opam packaging for the Coq outputBrian Campbell1-0/+11
2023-05-29Add Zfa extension support (excl. quad-precision)Philipp Tomsich1-0/+3
This commit adds the following: - infrastructure for Zfa (e.g., existence macro) - support for the following instructions: + FLI.[HSD] + FMINM.[HSD] and FMAXM.[HSD] + FROUND.[HSD] and FROUNDNX.[HSD] + FMVH.X.D and FMVP.D.X + FLEQ.[HSD] and FLTQ.[HSD] + FCVTMOD.W.D Note the following implementation details: FMINM and FMAXM provide similar functionality to FMIN and FMAX, differing only in their NaN-handling: * FMIN/FMAX return a canonical NaN only if both operands are a NaN * FMINM/FMAXM return a canonical Nan if any operand is a NaN Consequently, the implementation is identical to FMIN/FMAX with only the NaN-related tests changed. FROUND instruction rounds a floating-point number in floating-point register rs1 and writes that integer, represented as a floating-point number to floating-point register rd while: * Zero and infinite inputs are copied to rd unmodified. * NaN inputs cause the invalid operation exception flag to be set. FROUNDNX instruction is defined similarly, but also sets the inexact exception flag if the input differs from the rounded result and is not NaN. FMVH.X.D instruction is available for RV32 only and moves bits 63:32 of floating-point register rs1 into integer register rd. FMVP.D.X instruction is available for RV32 only and moves a double-precision number from a pair of integer registers into a floating-point register. Integer registers rs1 and rs2 supply bits 31:0 and 63:32, respectively. FLEQ and FLTQ instructions are defined like the FLE and FLT instructions, except that quiet NaN inputs do not cause the invalid operation exception flag to be set. The FCVTMOD.W.D instruction is defined similarly to the FCVT.W.D instruction, with the following differences: * FCVTMOD.W.D always rounds towards zero. * Bits 31:0 are taken from the rounded, unbounded two's complement result, then sign-extended to XLEN bits and written to integer register rd. * Positive infinity, negative infinity and NaN are converted to zero. Signed-off-by: Charalampos Mitrodimas <charalampos.mitrodimas@vrull.eu> Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
2023-05-29Add support for the Zicond extensionPhilipp Tomsich1-0/+2
This implements the Zicond (conditional integer operations) extension, as of version 1.0-draft-20230120. The Zicond extension acts as a building block for branchless sequences including conditional-arithmetic, conditional-logic and conditional-select/move. The following instructions constitute Zicond: - czero.eqz rd, rs1, rs2 => rd = (rs2 == 0) ? 0 : rs1 - czero.nez rd, rs1, rs2 => rd = (rs2 != 0) ? 0 : rs1 See https://github.com/riscv/riscv-zicond/releases/download/v1.0-draft-20230120/riscv-zicond_1.0-draft-20230120.pdf for the proposed specification and usage details. Co-authored-by: Jessica Clarke <jrtc27@jrtc27.com> Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
2023-02-23Remove duopodBrian Campbell1-20/+0
This can now be found in the Sail repository. Includes an update to sail-riscv.install
2022-08-24Revert "c emulator makefile tweak, as suggested by Thibaut"Alex Richardson1-1/+1
After the last commit -fcommon is no longer required. This reverts commit ffea7a39c32a210a446379aeda0eabcec4918ed6.
2022-08-09Minimal updates for Coq proof assistant outputBrian Campbell1-1/+1
2022-01-21Add support for Scalar Cryptography Zbkb, Zbkc and Zbkx Extensions (#135)Bilal Sakhawat1-0/+3
2022-01-19Add support for Zfh extension (#129)Bilal Sakhawat1-0/+3
2022-01-19Makefile: Sort files when generating sail-riscv.installJessica Clarke1-1/+1
The order used for wildcard is not deterministic and varies between systems. Sorting ensures the diffs are easy to inspect going forwards.
2021-12-05Support BitManip Zba, Zbb, Zbc and Zbs extensions (#116)Bilal Sakhawat1-0/+5
2021-10-26Makefile: Remove stale commentJessica Clarke1-1/+0
2021-10-22Recent rustc requires -lm for linking against the Sail coverage library (#118)Brian Campbell1-1/+1
Fixes rems-project/sail#152
2021-10-22Support D extension on RV32 (#108)Jessica Clarke1-4/+2
* Use bool for floating point comparison result Using bits_WU (bits(32)) or bits_LU (bits(64)) makes no sense, these are just boolean values, and having fixed-width types is a pain for suporting RV32D (since RV32D would need to truncate, but RV128D would need to extend). Instead represent these as an actual bool to match what the values really are. This could be done with bits(1) but the value is logically a boolean (like the built-in integer comparison operators) not a bit vector of length one so we convert to bool and back for a cleaner interface. * Support compiling RV32F with flen == 64 The code conflated flen and xlen; deconflating them and adding suitable assertions (rather than silently retiring as a no-op that doesn't bump instret) ensures that it can be compiled for RV32 with flen set to 64. Whilst here, add the extensions and truncations that would be needed for RV128F. Note that there are already suitable guards on the decode clauses to ensure these instructions are illegal on RV32. * Support compiling RV32D This copies various bits of XLEN generality from the F code. * Support RV32D loads/stores * Correctly initialise misa.D based on flen not xlen * Makefile: Enable D extension for RV32 This now works so can be enabled. * test: Enable RV32D tests
2021-10-18scalar-crypto: Initial commit of 1.0.0-rc2 spec work. (#99)Ben Marshall1-1/+4
Merged scalar-crypto pull request #99 of 1.0.0-rc2 spec work from Ben Marshall. See https://github.com/riscv/sail-riscv/pull/99.
2021-07-29Use headache to apply copyright header at request of Peter Sewell.Robert Norton1-0/+4
2021-07-26Update Coq snapshotBrian Campbell1-2/+2
Also tweak Makefile to remove new Coq generated files
2021-06-25Fix RVFI build by adding two more functions to c_preserve (#95)Alexander Richardson1-0/+2
2021-06-25Add comment explaining libgmp pkg-config workaround.Robert Norton1-0/+1
2021-06-25Merge pull request #88 from jrtc27/pkg-configRobert Norton1-6/+7
macOS build fixes (with added fix for Ubuntu 18.04)
2021-06-25Update MakefileRobert Norton1-1/+1
Add workaround for ubuntu 18.04 lack of pkg-config for libgmp.
2021-05-04Makefile: Generalise build to fix Arm-based MacsJessica Clarke1-6/+7
Homebrew on Arm-based Macs installs in /opt/homebrew, and hard-coding /opt/local was the wrong solution for MacPorts anyway. Instead, use pkg-config to query the right compiler and linker flags for gmp and zlib.
2021-03-16Update Makefile for the new trace formatAlex Richardson1-1/+15
I was building sail-cheri-riscv, so previously only updated that makefile.
2020-09-04Handle hints explicitly in order to not trap on them.Prashanth Mundkur1-1/+1
This currently maps their assembly renditions to non-standard instructions to preserve bidirectional mappings. Fixes #67 and #29.
2020-06-18Make duopod build in coq again, and fix locationBrian Campbell1-5/+5
2020-06-16Use an output file for generated branch information in the coverage build.Prashanth Mundkur1-2/+3
2020-06-15Update Coq part of the Makefile to use opam packages by defaultBrian Campbell1-5/+28
2020-06-15c emulator makefile tweak, as suggested by ThibautChristopher Pulte1-1/+1
2020-06-10Enable sailcov support in c_emulator if SAILCOV is set in the environment.Prashanth Mundkur1-1/+7
2020-06-04- upgrade to opam 2 packageChristopher Pulte1-1/+4
- make opam package include files required for building rmem
2020-05-22Add compressed F,D instructions.Prashanth Mundkur1-2/+2
Fixes #51.
2020-05-22Add a Makefile target for new Sail->C backendAlasdair1-0/+4
2020-04-02Fix a bug in the softfloat interface that caused exception flags not to get ↵Prashanth Mundkur1-2/+2
accrued into fcsr.
2020-02-26Add convenience 'osim' target for ocaml emulator.Robert Norton1-0/+2
2020-02-03Add softfloat fdext defs for rmem build.Prashanth Mundkur1-1/+1
2020-01-30Invoke recursive make using $(MAKE) as GNU recommendsScott Johnson1-2/+2
"Recursive make commands should always use the variable MAKE, not the explicit command name ‘make’" See: https://www.gnu.org/software/make/manual/make.html#MAKE-Variable
2020-01-29Fix rvfi build.Prashanth Mundkur1-1/+1