1. May 30, 2023
    • Philipp Tomsich's avatar
      3fca4c87
    • Philipp Tomsich's avatar
      80b4eaf4
    • Philipp Tomsich's avatar
      LICENSE: update copyright years · 2b0fb2fa
      Philipp Tomsich authored
      2b0fb2fa
    • Philipp Tomsich's avatar
      coding style: fix style issues from merge of PR #257 · 38dbfeab
      Philipp Tomsich authored
      PR #257 was aggressively merged before all coding-style issues had
      been commented on.  This addresses the issues that came up (except the
      drive-by whitespace cleanup that was contained in PR #257 and would
      require a force-push) in review.
      38dbfeab
    • Philipp Tomsich's avatar
      Add Zfa extension support (excl. quad-precision) · f2d8e1b9
      Philipp Tomsich authored
      
      
      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: default avatarCharalampos Mitrodimas <charalampos.mitrodimas@vrull.eu>
      Signed-off-by: default avatarPhilipp Tomsich <philipp.tomsich@vrull.eu>
      f2d8e1b9
    • Tim Hutt's avatar
      Fix minstret off-by-one when mcountinhibit is set · 3d9db22c
      Tim Hutt authored
      This fixes a small bug in `mcounthinhibit`. In the current code if you set `mcountinhibit=1` then it inhibits the count of that CSR write, whereas the spec says that it should only apply to future instructions:
      
      > Any CSR write takes effect after the writing instruction has otherwise completed.
      
      - From the priviledged spec, section 3.1.10 Hardware Performance Monitor.
      3d9db22c
    • Muhammad Bilal Sakhawat's avatar
      Changed the pmp initial misconfiguration check so that if the low and high... · 98e8bf7a
      Muhammad Bilal Sakhawat authored
      Changed the pmp initial misconfiguration check so that if the low and high range limit are the same then no pmp match
      98e8bf7a
    • Philipp Tomsich's avatar
      Add support for the Zicond extension · 136be16c
      Philipp Tomsich authored
      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: default avatarJessica Clarke <jrtc27@jrtc27.com>
      Signed-off-by: default avatarPhilipp Tomsich <philipp.tomsich@vrull.eu>
      136be16c
    • Alex Richardson's avatar
      RVFI: only report write data if the write succeeds · 5a8fb7da
      Alex Richardson authored
      Only reporting the address (without data) on failures matches QEMU.
      This also drops the call to rvfi_write from phys_mem_write since that
      would result in (harmless) duplicate trace value updates.
      5a8fb7da
  2. Apr 11, 2023
  3. Apr 04, 2023
  4. Mar 14, 2023
  5. Mar 07, 2023
  6. Feb 23, 2023
    • Brian Campbell's avatar
      Remove duopod · 5d0ed1b5
      Brian Campbell authored
      This can now be found in the Sail repository.
      Includes an update to sail-riscv.install
      5d0ed1b5
  7. Feb 14, 2023
  8. Jan 26, 2023
    • Alexander Richardson's avatar
      Increase flexibility of the decode hook (and simplify it) (#205) · 9547a30b
      Alexander Richardson authored
      Previously the decoding hook (`ext_post_decode_hook`) allowed models to
      override the decoded `ast`. However, this is not sufficient if model
      extension changes interpretation of fields. Additionally, the assembly
      printing would always print assembly for the "baseline decode" which
      resulted in incorrect trace output in the sail-cheri-riscv model.
      
      With the new hook models can implement ext_decode()/ext_decode_compressed()
      to return an `ast` and for encodings that are not adjusted fall back to
      the default `encdec`/`encdec_compressed`.
      9547a30b
  9. Jan 20, 2023
  10. Jan 17, 2023
  11. Nov 02, 2022
    • Jessica Clarke's avatar
      riscv_step: Fix -i/--mtval-has-illegal-inst-bits option (#174) · 4d05aa16
      Jessica Clarke authored
      This option causes handle_illegal to pass instbits as the value to set
      for xtval, but instbits is never set so it ends up being 0 just as if
      the option was never enabled. Fix this by initialising instbits during
      fetch; we could make this conditional on whether the option is enabled
      but that seems unnecessary and introduces tighter coupling.
      
      Note that this option appears to have always been broken; when it was
      originally added, instbits was only written two in two cases which were
      both dead code and later removed in eb176111.
      
      Closes: #173
      4d05aa16
  12. Aug 24, 2022
  13. Aug 09, 2022
  14. Jul 13, 2022
  15. Feb 16, 2022
    • Jessica Clarke's avatar
      Run ISA tests in CI (#134) · 50f4bbaa
      Jessica Clarke authored
      * test: Ignore generated XML output
      
      * run_tests: Build RVFI emulators too
      
      Can't run tests with them though as they're built for direct instruction
      injection (RVFI-DII) via an instruction stream over a network socket,
      not fetching instructions from memory, so this remains just a build
      test.
      
      * run_tests/run_fp_tests: Print summary and give meaningful exit code
      
      * run_tests/run_fp_tests: Include tests and failures in top-level XML entity
      
      * run_tests/run_fp_tests: Use failure not error for XML output
      
      The former is the standard tag for normal test failures, the latter is
      for catastrophic things like test harness errors.
      
      * Run ISA tests in CI
      50f4bbaa
  16. Feb 03, 2022
  17. Jan 31, 2022
  18. Jan 21, 2022
  19. Jan 20, 2022
  20. Dec 05, 2021
  21. Nov 23, 2021