# yaml-language-server: $schema=https://raw.githubusercontent.com/riscv/riscv-unified-db/main/spec/schemas/config_schema.json
---
$schema: config_schema.json#
kind: architecture configuration
type: fully configured
name: vexii-rv64
description: VexiiRiscv RV64I TestBench configuration for the ACT/Sail flow
implemented_extensions:
  - { name: I, version: "= 2.1" }
  - { name: A, version: "= 2.1.0" }
  - { name: M, version: "= 2.0" }
  - { name: F, version: "= 2.2.0" }
  - { name: D, version: "= 2.2.0" }
  - { name: C, version: "= 2.0" }
  - { name: B, version: "= 1.0.0" }
  - { name: Zicntr, version: "= 2.0" }
  - { name: Zicsr, version: "= 2.0" }
  - { name: Zifencei, version: "= 2.0.0" }
  - { name: Zihpm, version: "= 2.0.0" }
  - { name: Zmmul, version: "= 1.0.0" }
  - { name: Zaamo, version: "= 1.0.0" }
  - { name: Zalrsc, version: "= 1.0.0" }
  - { name: Zca, version: "= 1.0.0" }
  - { name: Zcd, version: "= 1.0.0" }
  - { name: Zba, version: "= 1.0.0" }
  - { name: Zbb, version: "= 1.0.0" }
  - { name: Zbs, version: "= 1.0.0" }
  - { name: Zbc, version: "= 1.0.0" }
  - { name: Zbkb, version: "= 1.0.0" }
  - { name: Zbkc, version: "= 1.0.0" }
  - { name: Zbkx, version: "= 1.0.0" }
  - { name: Zknd, version: "= 1.0.0" }
  - { name: Zkne, version: "= 1.0.0" }
  - { name: Zknh, version: "= 1.0.0" }
  - { name: Zksed, version: "= 1.0.0" }
  - { name: Zksh, version: "= 1.0.0" }
  - { name: U, version: "= 1.0.0" }
  - { name: S, version: "= 1.13.0" }
  - { name: Sscounterenw, version: "= 1.0.0" }
  - { name: Sscofpmf, version: "= 1.0.0" }
  - { name: Sstvala, version: "= 1.0.0" }
  - { name: Sstvecd, version: "= 1.0.0" }
  - { name: Sv39, version: "= 1.0.0" }
  - { name: Svade, version: "= 1.0.0" }
  - { name: Svbare, version: "= 1.0.0" }
  - { name: Sm, version: "= 1.13.0" }
  - { name: Smcntrpmf, version: "= 1.0.0" }

params:
  # A params
  MISALIGNED_AMO: false
  LRSC_RESERVATION_STRATEGY: "reserve exactly enough to cover the access" # XLEN size reservation
  LRSC_FAIL_ON_VA_SYNONYM: false
  LRSC_MISALIGNED_BEHAVIOR: "always raise access fault"
  LRSC_FAIL_ON_NON_EXACT_LRSC: true
  MUTABLE_MISA_A: false
  # M params
  MUTABLE_MISA_M: false
  # F params
  MUTABLE_MISA_F: false
  HW_MSTATUS_FS_DIRTY_UPDATE: precise
  MSTATUS_FS_LEGAL_VALUES: [0, 1, 2, 3]
  # D params
  MUTABLE_MISA_D: false
  # C params
  MUTABLE_MISA_C: false
  # B params
  MUTABLE_MISA_B: false
  # CBO params
  # CACHE_BLOCK_SIZE: 64
  # FORCE_UPGRADE_CBO_INVAL_TO_FLUSH: false
  # Zicntr params
  TIME_CSR_IMPLEMENTED: true
  # U params
  MUTABLE_MISA_U: false
  U_MODE_ENDIANNESS: little
  UXLEN: [64]
  TRAP_ON_ECALL_FROM_U: true
  # S params
  MUTABLE_MISA_S: false
  # Sail models all architecturally defined Sv39 ASID bits.
  ASID_WIDTH: 16
  S_MODE_ENDIANNESS: little
  SXLEN: [64]
  REPORT_VA_IN_MTVAL_ON_LOAD_PAGE_FAULT: true
  REPORT_VA_IN_MTVAL_ON_STORE_AMO_PAGE_FAULT: true
  REPORT_VA_IN_MTVAL_ON_INSTRUCTION_PAGE_FAULT: true
  REPORT_VA_IN_STVAL_ON_BREAKPOINT: true
  REPORT_VA_IN_STVAL_ON_LOAD_MISALIGNED: true
  REPORT_VA_IN_STVAL_ON_STORE_AMO_MISALIGNED: true
  REPORT_VA_IN_STVAL_ON_INSTRUCTION_MISALIGNED: true
  REPORT_VA_IN_STVAL_ON_LOAD_ACCESS_FAULT: true
  REPORT_VA_IN_STVAL_ON_STORE_AMO_ACCESS_FAULT: true
  REPORT_VA_IN_STVAL_ON_INSTRUCTION_ACCESS_FAULT: true
  REPORT_VA_IN_STVAL_ON_LOAD_PAGE_FAULT: true
  REPORT_VA_IN_STVAL_ON_STORE_AMO_PAGE_FAULT: true
  REPORT_VA_IN_STVAL_ON_INSTRUCTION_PAGE_FAULT: true
  REPORT_ENCODING_IN_STVAL_ON_ILLEGAL_INSTRUCTION: true
  STVAL_WIDTH: 64
  SCOUNTENABLE_EN:
    [
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
    ]
  STVEC_MODES: [0]
  SATP_MODE_BARE: true
  TRAP_ON_ECALL_FROM_S: true
  MSTATUS_VS_LEGAL_VALUES: [0]
  # Sm params
  MXLEN: 64
  PRECISE_SYNCHRONOUS_EXCEPTIONS: true
  TRAP_ON_ECALL_FROM_M: true
  TRAP_ON_EBREAK: true
  MARCHID_IMPLEMENTED: true
  ARCH_ID_VALUE: 0x24
  MIMPID_IMPLEMENTED: true
  IMP_ID_VALUE: 0x100
  VENDOR_ID_BANK: 0xC
  VENDOR_ID_OFFSET: 0x2
  MISALIGNED_LDST: false
  MISALIGNED_LDST_EXCEPTION_PRIORITY: high
  TRAP_ON_ILLEGAL_WLRL: false
  TRAP_ON_UNIMPLEMENTED_INSTRUCTION: true
  TRAP_ON_RESERVED_INSTRUCTION: true
  TRAP_ON_UNIMPLEMENTED_CSR: true
  REPORT_VA_IN_MTVAL_ON_BREAKPOINT: true
  REPORT_VA_IN_MTVAL_ON_LOAD_MISALIGNED: true
  REPORT_VA_IN_MTVAL_ON_STORE_AMO_MISALIGNED: true
  REPORT_VA_IN_MTVAL_ON_INSTRUCTION_MISALIGNED: true
  REPORT_VA_IN_MTVAL_ON_LOAD_ACCESS_FAULT: true
  REPORT_VA_IN_MTVAL_ON_STORE_AMO_ACCESS_FAULT: true
  REPORT_VA_IN_MTVAL_ON_INSTRUCTION_ACCESS_FAULT: true
  REPORT_ENCODING_IN_MTVAL_ON_ILLEGAL_INSTRUCTION: true
  MTVAL_WIDTH: 64
  CONFIG_PTR_ADDRESS: 0
  PMA_GRANULARITY: 3 # Not explicit in config
  PHYS_ADDR_WIDTH: 32
  M_MODE_ENDIANNESS: little
  MISA_CSR_IMPLEMENTED: true
  MTVEC_ACCESS: rw
  MTVEC_MODES: [0]
  MTVEC_BASE_ALIGNMENT_DIRECT: 4
  MTVEC_ILLEGAL_WRITE_BEHAVIOR: retain
  NUM_PMP_ENTRIES: 16
  NUM_USABLE_PMP_ENTRIES: 16
  PMP_TOR_SUPPORTED: true
  PMP_NA4_SUPPORTED: false
  PMP_NAPOT_SUPPORTED: true
  PMP_GRANULARITY: 12
  HPM_COUNTER_EN:
    [
      false,
      false,
      false,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
    ]
  HPM_EVENTS: [0]
  MCOUNTINHIBIT_IMPLEMENTED: true
  COUNTINHIBIT_EN:
    [
      true,
      false,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
    ]
  MCOUNTENABLE_EN:
    [
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
    ]
