Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bb6a2f8
test(idl): test:idl task takes config from enviornment
dhower-qc Apr 4, 2025
f8a7b59
idl: add indirect csr access; do direct csr access with functions
dhower-qc Apr 4, 2025
54b5f3a
schema(csr): add writeable field
dhower-qc Apr 4, 2025
bffee3f
fix(ruby): corrects adoc generation for CSR read expressions
dhower-qc Apr 4, 2025
60addff
test(idl): test:idl task takes config from enviornment
dhower-qc Apr 4, 2025
716b515
idl: add indirect csr access; do direct csr access with functions
dhower-qc Apr 4, 2025
fe3dc19
schema(csr): add writeable field
dhower-qc Apr 4, 2025
7222654
fix(ruby): corrects adoc generation for CSR read expressions
dhower-qc Apr 4, 2025
ca1cdd5
correct(csr): Fixes the layout file for hpmcounterXh
dhower-qc Apr 8, 2025
9d10541
Merge remote-tracking branch 'origin/indirect-csr' into indirect-csr
dhower-qc Apr 8, 2025
4095177
fix: buggy last commit
dhower-qc Apr 8, 2025
f13a222
refactor: small comment cleanup
dhower-qc Apr 8, 2025
a2a49a9
fix: make csr address at most MXLEN bits
dhower-qc Apr 15, 2025
e98d4b2
Merge remote-tracking branch 'origin/main' into indirect-csr
dhower-qc Apr 15, 2025
6340f6a
fix: XLEN -> MXLEN in builtin_functions
dhower-qc Apr 15, 2025
b9e1407
feat: add window slot for indirect csrs
dhower-qc Apr 29, 2025
fc4cc5e
Merge remote-tracking branch 'origin/main' into indirect-csr
dhower-qc Apr 29, 2025
9959661
fix: add indirect_address/slot to Csr model
dhower-qc Apr 29, 2025
03e86af
Merge branch 'main' into indirect-csr
dhower-qc Apr 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 11 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,15 @@ namespace :test do
puts "All files validate against their schema"
end

task idl: ["#{$root}/.stamps/resolve-rv32.stamp", "#{$root}/.stamps/resolve-rv64.stamp"] do
print "Parsing IDL code for RV32..."
cfg_arch32 = cfg_arch_for("rv32")
puts "done"

cfg_arch32.type_check
task :idl do
cfg = ENV["CFG"]
raise "Missing CFG enviornment variable" if cfg.nil?

print "Parsing IDL code for RV64..."
cfg_arch64 = cfg_arch_for("rv64")
print "Parsing IDL code for #{cfg}..."
cfg_arch = cfg_arch_for(cfg)
puts "done"

cfg_arch64.type_check
cfg_arch.type_check

puts "All IDL passed type checking"
end
Expand Down Expand Up @@ -410,6 +407,11 @@ namespace :test do
Rake::Task["test:idl_compiler"].invoke
Rake::Task["test:lib"].invoke
Rake::Task["test:schema"].invoke
ENV["CFG"] = "rv32"
Rake::Task["test:idl"].invoke
ENV["CFG"] = "rv64"
Rake::Task["test:idl"].invoke
ENV["CFG"] = "qc_iu"
Rake::Task["test:idl"].invoke
Rake::Task["test:inst_encodings"].invoke
end
Expand Down
1 change: 1 addition & 0 deletions arch/csr/F/fcsr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ kind: csr
name: fcsr
long_name: Floating-point control and status register (`frm` + `fflags`)
address: 0x003
writeable: true
description: |
The floating-point control and status register, `fcsr`, is a RISC-V
control and status register (CSR). It is a 32-bit read/write register
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/hcounteren.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ kind: csr
name: hcounteren
long_name: Hypervisor Counter Enable
address: 0x606
writeable: true
priv_mode: S
length: 32
description: |
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/henvcfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $schema: "csr_schema.json#"
kind: csr
name: henvcfg
address: 0x60A
writeable: true
long_name: Hypervisor Environment Configuration
description: |
The henvcfg CSR is a 64-bit read/write register that controls certain characteristics of the
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/henvcfgh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $schema: "csr_schema.json#"
kind: csr
name: henvcfgh
address: 0x61A
writeable: true
base: 32
long_name: most-significant 32 bits of Hypervisor Environment Configuration
description: |
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/hgatp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ description: |
HFENCE.GVMA instruction (see <<hfence.vma>>) before or
after writing `hgatp`.
address: 0x680
writeable: true
priv_mode: S
definedBy: H
length: SXLEN
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/htimedelta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ description: |
`htimedelta` may be used to represent negative time offsets.

address: 0x605
writeable: true
priv_mode: S
definedBy: H
length: 64
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/htimedeltah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: |
Upper half of the `htimedelta` CSR.

address: 0x615
writeable: true
priv_mode: S
definedBy: H
length: 32
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/htinst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $schema: "csr_schema.json#"
kind: csr
name: htinst
address: 0x64a
writeable: true
long_name: Hypervisor Trap Instruction Register
description: |
When a trap is taken into HS-mode, mtinst is written with a value that, if nonzero,
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/htval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $schema: "csr_schema.json#"
kind: csr
name: htval
address: 0x643
writeable: true
long_name: Hypervisor Trap Value Register
description: |
When a trap is taken into HS-mode, htval is written with additional exception-specific information, alongside stval, to assist software in handling the trap.
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/mtinst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $schema: "csr_schema.json#"
kind: csr
name: mtinst
address: 0x34a
writeable: true
long_name: Machine Trap Instruction Register
description: |
When a trap is taken into M-mode, mtinst is written with a value that, if nonzero,
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/mtval2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $schema: "csr_schema.json#"
kind: csr
name: mtval2
address: 0x34b
writeable: true
long_name: Machine Second Trap Value Register
description: |
When a trap is taken into M-mode from a virtual mode, mtval2 is written with additional exception-specific information,
Expand Down
1 change: 1 addition & 0 deletions arch/csr/H/vsatp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $schema: "csr_schema.json#"
kind: csr
name: vsatp
address: 0x280
writeable: true
virtual_address: 0x180
long_name: Virtual Supervisor Address Translation and Protection
description: |
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/mcounteren.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ kind: csr
name: mcounteren
long_name: Machine Counter Enable
address: 0x306
writeable: true
priv_mode: M
length: 32
description: |
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr0
long_name: PMP Address 0
address: 0x3B0
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr1
long_name: PMP Address 1
address: 0x3B1
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr10
long_name: PMP Address 10
address: 0x3BA
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr11
long_name: PMP Address 11
address: 0x3BB
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr12
long_name: PMP Address 12
address: 0x3BC
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr13.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr13
long_name: PMP Address 13
address: 0x3BD
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr14.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr14
long_name: PMP Address 14
address: 0x3BE
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr15
long_name: PMP Address 15
address: 0x3BF
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr16
long_name: PMP Address 16
address: 0x3C0
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr17
long_name: PMP Address 17
address: 0x3C1
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr18
long_name: PMP Address 18
address: 0x3C2
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr19.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr19
long_name: PMP Address 19
address: 0x3C3
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr2
long_name: PMP Address 2
address: 0x3B2
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr20.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr20
long_name: PMP Address 20
address: 0x3C4
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr21.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr21
long_name: PMP Address 21
address: 0x3C5
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr22.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr22
long_name: PMP Address 22
address: 0x3C6
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr23.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr23
long_name: PMP Address 23
address: 0x3C7
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr24.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr24
long_name: PMP Address 24
address: 0x3C8
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr25.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr25
long_name: PMP Address 25
address: 0x3C9
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr26.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr26
long_name: PMP Address 26
address: 0x3CA
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr27.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr27
long_name: PMP Address 27
address: 0x3CB
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr28.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr28
long_name: PMP Address 28
address: 0x3CC
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr29.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr29
long_name: PMP Address 29
address: 0x3CD
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr3
long_name: PMP Address 3
address: 0x3B3
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr30.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr30
long_name: PMP Address 30
address: 0x3CE
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr31.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr31
long_name: PMP Address 31
address: 0x3CF
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr32
long_name: PMP Address 32
address: 0x3D0
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr33.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr33
long_name: PMP Address 33
address: 0x3D1
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr34.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr34
long_name: PMP Address 34
address: 0x3D2
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr35.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr35
long_name: PMP Address 35
address: 0x3D3
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr36
long_name: PMP Address 36
address: 0x3D4
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
1 change: 1 addition & 0 deletions arch/csr/I/pmpaddr37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kind: csr
name: pmpaddr37
long_name: PMP Address 37
address: 0x3D5
writeable: true
priv_mode: M
length: MXLEN
description: PMP entry address
Expand Down
Loading
Loading