riscv-formal-nmigen/rvfi/insns
Donald Sebastian Leung fe5e73b6cb Add RV64I Base ISA 2020-08-27 16:21:53 +08:00
..
README.md Update README.md 2020-08-27 13:53:49 +08:00
__init__.py Modularize codebase 2020-08-17 11:50:53 +08:00
insn.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_add.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_addi.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_addiw.py Add ADDIW instruction 2020-08-27 13:11:23 +08:00
insn_addw.py Add ADDW instruction 2020-08-27 15:48:11 +08:00
insn_and.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_andi.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_auipc.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_beq.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_bge.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_bgeu.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_blt.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_bltu.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_bne.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_div.py Add DIV instruction 2020-08-26 16:58:50 +08:00
insn_divu.py Add DIVU instruction 2020-08-26 17:03:49 +08:00
insn_jal.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_jalr.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_lb.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_lbu.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_ld.py Add LD instruction 2020-08-27 12:28:19 +08:00
insn_lh.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_lhu.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_lui.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_lw.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_lwu.py Add LWU instruction 2020-08-27 12:25:19 +08:00
insn_mul.py Add MUL instruction 2020-08-26 15:57:32 +08:00
insn_mulh.py Add MULHSU instruction 2020-08-26 16:39:17 +08:00
insn_mulhsu.py Add MULHSU instruction 2020-08-26 16:39:17 +08:00
insn_mulhu.py Add MULHU instruction 2020-08-26 16:43:21 +08:00
insn_or.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_ori.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_rem.py Add REM instruction 2020-08-26 17:11:03 +08:00
insn_remu.py Add REMU instruction 2020-08-26 17:15:27 +08:00
insn_rv32i_i_type.py Modularize codebase 2020-08-17 11:50:53 +08:00
insn_rv32i_i_type_arith.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_rv32i_i_type_load.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_rv32i_i_type_shift.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_rv32i_r_type.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_rv32i_s_type.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_rv32i_sb_type.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_rv32i_u_type.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_rv32m_r_type.py Add RV32M R-Type Instruction 2020-08-26 15:48:55 +08:00
insn_rv64i_i_type.py Add RV64I I-Type Instruction 2020-08-27 11:46:04 +08:00
insn_rv64i_i_type_load.py Add RV64I I-Type Instruction (Load Variation) 2020-08-27 12:20:17 +08:00
insn_rv64i_i_type_shift.py Add RV64I I-Type Instruction (Shift Variation) 2020-08-27 13:28:29 +08:00
insn_rv64i_r_type.py Add RV64I R-Type Instruction 2020-08-27 15:39:09 +08:00
insn_sb.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_sd.py Add SD instruction 2020-08-27 12:53:07 +08:00
insn_sh.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_sll.py Reduce code duplication in Minerva verification script 2020-08-21 11:43:20 +08:00
insn_slli.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_slliw.py Add SRLIW instruction 2020-08-27 13:42:38 +08:00
insn_sllw.py Add SLLW instruction 2020-08-27 15:54:01 +08:00
insn_slt.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_slti.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_sltiu.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_sltu.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_sra.py Reduce code duplication in Minerva verification script 2020-08-21 11:43:20 +08:00
insn_srai.py Reduce code duplication in Minerva verification script 2020-08-21 11:43:20 +08:00
insn_sraiw.py Add SRAIW instruction 2020-08-27 13:52:20 +08:00
insn_sraw.py Add SRAW instruction 2020-08-27 16:04:00 +08:00
insn_srl.py Reduce code duplication in Minerva verification script 2020-08-21 11:43:20 +08:00
insn_srli.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_srliw.py Add SRLIW instruction 2020-08-27 13:42:38 +08:00
insn_srlw.py Add SRLW instruction 2020-08-27 15:56:36 +08:00
insn_sub.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_subw.py Add SUBW instruction 2020-08-27 15:50:30 +08:00
insn_sw.py Refactor instructions to use NamedTuple 2020-08-20 17:28:09 +08:00
insn_xor.py Refactor insns directory 2020-08-21 10:33:02 +08:00
insn_xori.py Refactor insns directory 2020-08-21 10:33:02 +08:00
isa_rv32i.py Refactor insns directory 2020-08-21 10:33:02 +08:00
isa_rv32m.py Add RV32M Standard Extension 2020-08-27 10:32:49 +08:00
isa_rv64i.py Add RV64I Base ISA 2020-08-27 16:21:53 +08:00

README.md

RISC-V Instructions

Instructions

Below is a table of RISC-V instructions supported by the original riscv-formal framework at the time of writing, categorized by instruction type.

Instruction type Instructions
R-type ADD, ADDW, AND, DIV, DIVU, DIVUW, DIVW, MUL, MULH, MULHSU, MULHU, MULW, OR, REM, REMU, REMUW, REMW, SLL, SLLW, SLT, SLTU, SRA, SRAW, SRL, SRLW, SUB, SUBW, XOR
I-type ADDI, ADDIW, ANDI, JALR, LB, LBU, LD, LH, LHU, LW, LWU, ORI, SLTI, SLTIU, XORI
I-type (shift variation) SLLI, SLLIW, SRAI, SRAIW, SRLI, SRLIW
S-type SB, SD, SH, SW
SB-type BEQ, BGE, BGEU, BLT, BLTU, BNE
U-type AUIPC, LUI
UJ-type JAL
CI-type C_ADD, C_ADDI, C_ADDIW, C_JALR, C_JR, C_LI, C_MV
CI-type (SP variation) C_ADDI16SP
CI-type (ANDI variation) C_ANDI
CI-type (LSP variation, 32 bit version) C_LWSP
CI-type (LSP variation, 64 bit version) C_LDSP
CI-type (LUI variation) C_LUI
CI-type (SLI variation) C_SLLI
CI-type (SRI variation) C_SRAI, C_SRLI
CIW-type C_ADDI4SPN
CS-type (ALU version) C_ADDW, C_AND, C_OR, C_SUB, C_SUBW, C_XOR
CS-type (32 bit version) C_SW
CS-type (64 bit version) C_SD
CSS-type (32 bit version) C_SWSP
CSS-type (64 bit version) C_SDSP
CB-type C_BEQZ, C_BNEZ
CJ-type C_J, C_JAL
CL-type (32 bit version) C_LW
CL-type (64 bit version) C_LD

Class Synopsis

Instructions

Below is a list of instructions currently supported by this port of the riscv-formal framework and is expected to grow over time. The instructions are roughly grouped by instruction type but sometimes with further specializations - the hierarchy of the lists reflects the hierarchy of inheritance in the classes used to represent various instructions.

  • Insn: General RISC-V instruction
    • InsnRV32IRType: RV32I R-Type Instruction
      • InsnAdd: ADD instruction
      • InsnSub: SUB instruction
      • InsnSll: SLL instruction
      • InsnSlt: SLT instruction
      • InsnSltu: SLTU instruction
      • InsnXor: XOR instruction
      • InsnSrl: SRL instruction
      • InsnSra: SRA instruction
      • InsnOr: OR instruction
      • InsnAnd: AND instruction
    • InsnRV32IITypeShift: RV32I I-Type Instruction (Shift Variation)
      • InsnSlli: SLLI instruction
      • InsnSrli: SRLI instruction
      • InsnSrai: SRAI instruction
    • InsnRV32IIType: RV32I I-Type Instruction
      • InsnJalr: JALR instruction
      • InsnRV32IITypeLoad: RV32I I-Type Instruction (Load Variation)
        • InsnLb: LB instruction
        • InsnLh: LH instruction
        • InsnLw: LW instruction
        • InsnLbu: LBU instruction
        • InsnLhu: LHU instruction
      • InsnRV32IITypeArith: RV32I I-Type Instruction (Arithmetic Variation)
        • InsnAddi: ADDI instruction
        • InsnSlti: SLTI instruction
        • InsnSltiu: SLTIU instruction
        • InsnXori: XORI instruction
        • InsnOri: ORI instruction
        • InsnAndi: ANDI instruction
    • InsnRV32ISType: RV32I S-Type Instruction
      • InsnSb: SB instruction
      • InsnSh: SH instruction
      • InsnSw: SW instruction
    • InsnRV32ISBType: RV32I SB-Type Instruction
      • InsnBeq: BEQ instruction
      • InsnBne: BNE instruction
      • InsnBlt: BLT instruction
      • InsnBge: BGE instruction
      • InsnBltu: BLTU instruction
      • InsnBgeu: BGEU instruction
    • InsnJal: JAL instruction
    • InsnRV32IUType: RV32I U-Type Instruction
      • InsnLui: LUI instruction
      • InsnAuipc: AUIPC instruction
    • InsnRV32MRType: RV32M R-Type Instruction
      • InsnMul: MUL instruction
      • InsnMulh: MULH instruction
      • InsnMulhsu: MULHSU instruction
      • InsnMulhu: MULHU instruction
      • InsnDiv: DIV instruction
      • InsnDivu: DIVU instruction
      • InsnRem: REM instruction
      • InsnRemu: REMU instruction
    • InsnRV64IIType: RV64I I-Type Instruction
      • InsnRV64IITypeLoad: RV64I I-Type Instruction (Load Variation)
        • InsnLwu: LWU instruction
        • InsnLd: LD instruction
      • InsnAddiw: ADDIW instruction
      • InsnRV64IITypeShift: RV64I I-Type Instruction (Shift Variation)
        • InsnSlliw: SLLIW instruction
        • InsnSrliw: SRLIW instruction
        • InsnSraiw: SRAIW instruction
    • InsnSd: SD instruction

ISAs

  • IsaRV32I: RV32I Base ISA
  • IsaRV32M: RV32M Standard Extension

Core-specific parameters

The following core-specific parameters are currently supported:

Parameter Description Valid value(s)
params.ilen Max length of instruction retired by core 32
params.xlen Width of integer registers 32
params.csr_misa Support for MISA CSRs enabled True, False
params.compressed Support for compressed instructions True, False
params.aligned_mem Require aligned memory accesses True, False
params.altops Use alternative operations for multiplication/division True, False