Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1d7d8fe
Fix misa length
Oct 3, 2024
027d0a5
Add git common directory as a bind to the container if using workspaces
Oct 3, 2024
e4cb70d
Make three types of ArchDef: unconfigured, partially configured, full…
Oct 3, 2024
be5575c
Merge remote-tracking branch 'rvi/main' into dhower/iss
Oct 3, 2024
85ea0fe
Add missing mock methods for IDL test
Oct 3, 2024
884ffe4
Add smpmp extension and fixed typo in csr.adoc.erb (Softare)
james-ball-qualcomm Oct 3, 2024
0e81036
Merge remote-tracking branch 'origin/dhower/partial_config' into crd-…
james-ball-qualcomm Oct 3, 2024
67d9fc0
Add some more parameters to reflects options in mstatus
Oct 3, 2024
e416e55
Fix spelling error
Oct 3, 2024
182fbf1
Handle case where CSR field type isn't known from an unconfiguuredarc…
Oct 3, 2024
f09c674
Add new parameters to generic_rv64 params
Oct 3, 2024
5683423
Merge remote-tracking branch 'origin/dhower/partial_config' into crd-…
james-ball-qualcomm Oct 3, 2024
5bc239d
Added Smpmp extension.
james-ball-qualcomm Oct 3, 2024
68a47d9
Added Smpmp extension to generic_64 configuration since it has PMP pa…
james-ball-qualcomm Oct 4, 2024
10430e1
Adding Smhpm and Smcntr
james-ball-qualcomm Oct 4, 2024
c060781
Check that object keys match file names in validate
Oct 4, 2024
1dd5ef0
Fix long_name for hpmcounters
Oct 4, 2024
37a0948
Make definedBy consistent across objects, with full boolean schema
Oct 4, 2024
4057a11
Adding parameter summary and Mock CRD for testing.
james-ball-qualcomm Oct 4, 2024
3454f9d
Merge branch 'crd-james' of https://github.com/riscv-software-src/ris…
james-ball-qualcomm Oct 4, 2024
674db85
Renamed CSC CRD to just CRD for improved reasbility and consistency w…
james-ball-qualcomm Oct 6, 2024
8e305fb
Added summary table for out-of-scope parameters.
james-ball-qualcomm Oct 7, 2024
ec9f5c3
Must of forgot to stage this.
james-ball-qualcomm Oct 7, 2024
f2d75e4
Rename ahchors in CRD to follow -def RVI convention to reduce number …
james-ball-qualcomm Oct 8, 2024
e1936b1
Fixes to CRD with Derek's help
james-ball-qualcomm Oct 9, 2024
a1cfc49
Added printing of arrays in parameters
james-ball-qualcomm Oct 11, 2024
9d60670
Forgot to stage
james-ball-qualcomm Oct 11, 2024
e5904ea
Changed profile YAML to add "presence" to extensions instead of havin…
james-ball-qualcomm Oct 14, 2024
412b09c
Fixed definedBy should be using defined_by due to partial constraint …
james-ball-qualcomm Oct 14, 2024
6cf862b
Multiple changes:
Oct 15, 2024
6cb9c2b
Merge remote-tracking branch 'rvi/crd-james' into crd-james
Oct 15, 2024
2e7079c
Better display of CRD parameters
james-ball-qualcomm Oct 15, 2024
066b99e
Merge branch 'crd-james' of https://github.com/riscv-software-src/ris…
james-ball-qualcomm Oct 15, 2024
0c6bbf0
Fix merge issues
Oct 15, 2024
486e58f
Merge remote-tracking branch 'rvi/crd-james' into crd-james
Oct 15, 2024
44a9f06
Fix crd_doc generator to match changes in arch def
Oct 15, 2024
c1d46f7
Fix profile_doc gen to reflext archdef changes
Oct 15, 2024
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
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ jobs:
- name: Copy RVA Family PDF
run: cp gen/profile_doc/pdf/rva.pdf _site/pdfs/rva.pdf
- name: Create MC-1 PDF Spec
run: ./do gen:csc_crd_pdf[MC-1]
run: ./do gen:crd_pdf[MC-1]
- name: Copy MC-1 PDF
run: cp gen/csc_crd_doc/pdf/MC-1.pdf _site/pdfs/MC-1.pdf
run: cp gen/crd_doc/pdf/MC-1.pdf _site/pdfs/MC-1.pdf
- name: Create MC-1 HTML Spec
run: ./do gen:csc_crd_html[MC-1]
run: ./do gen:crd_html[MC-1]
- name: Copy MC-1 HTML
run: cp gen/csc_crd_doc/html/MC-1.html _site/htmls/MC-1.html
run: cp gen/crd_doc/html/MC-1.html _site/htmls/MC-1.html
- name: Copy manual html
run: cp -R gen/manual/isa/top/all/html _site/manual
- name: Setup Pages
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:
run: ./do validate
- name: Build html documentation for generic_rv64
run: ./do gen:html[generic_rv64]
- name: Build PDF documentation for MockCRD-1
run: ./do gen:crd_pdf[MockCRD-1]
- name: Build PDF documentation for MC-1
run: ./do gen:csc_crd_pdf[MC-1]
run: ./do gen:crd_pdf[MC-1]
- name: Build PDF documentation for RVA Profile Family
run: ./do gen:profile_pdf[rva]
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ group :development do
gem "solargraph"
gem 'rubocop-minitest'
gem 'ruby-prof'
gem "ruby-prof-flamegraph"
end
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ GEM
rubocop-minitest (0.35.1)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-prof (1.7.0)
ruby-prof (0.18.0)
ruby-prof-flamegraph (0.3.0)
ruby-prof (~> 0.13)
ruby-progressbar (1.13.0)
ruby-rc4 (0.1.5)
simpleidn (0.2.3)
Expand Down Expand Up @@ -152,6 +154,7 @@ DEPENDENCIES
rouge
rubocop-minitest
ruby-prof
ruby-prof-flamegraph
ruby-progressbar (~> 1.13)
solargraph
treetop (= 1.6.12)
Expand Down
119 changes: 80 additions & 39 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "etc"

$root = Pathname.new(__FILE__).dirname.realpath
$lib = $root / "lib"

Expand Down Expand Up @@ -82,45 +84,84 @@ namespace :validate do
end
puts "All files validate against their schema"
end
task idl: "gen:arch" do
puts "Type checking IDL code..."
arch_def = arch_def_for("_")
progressbar = ProgressBar.create(title: "Instructions", total: arch_def.instructions.size)
arch_def.instructions.each do |inst|
progressbar.increment
inst.type_checked_operation_ast(arch_def.idl_compiler, arch_def.sym_table_32, 32) if inst.rv32?
inst.type_checked_operation_ast(arch_def.idl_compiler, arch_def.sym_table_64, 64) if inst.rv64?
# also need to check for an RV64 machine running with effective XLEN of 32
inst.type_checked_operation_ast(arch_def.idl_compiler, arch_def.sym_table_64, 32) if inst.rv64? && inst.rv32?
end
progressbar = ProgressBar.create(title: "CSRs", total: arch_def.csrs.size)
arch_def.csrs.each do |csr|
progressbar.increment
if csr.has_custom_sw_read?
csr.type_checked_sw_read_ast(arch_def.sym_table_32) if csr.defined_in_base32?
csr.type_checked_sw_read_ast(arch_def.sym_table_64) if csr.defined_in_base64?
end
csr.fields.each do |field|
unless field.type_ast(arch_def.idl_compiler).nil?
field.type_checked_type_ast(arch_def.sym_table_32) if csr.defined_in_base32? && field.defined_in_base32?
field.type_checked_type_ast(arch_def.sym_table_64) if csr.defined_in_base64? && field.defined_in_base64?
end
unless field.reset_value_ast(arch_def.idl_compiler).nil?
field.type_checked_reset_value_ast(arch_def.sym_table_32) if csr.defined_in_base32? && field.defined_in_base32?
field.type_checked_reset_value_ast(arch_def.sym_table_64) if csr.defined_in_base64? && field.defined_in_base64?
end
unless field.sw_write_ast(arch_def.idl_compiler).nil?
field.type_checked_sw_write_ast(arch_def.sym_table_32, 32) if csr.defined_in_base32? && field.defined_in_base32?
field.type_checked_sw_write_ast(arch_def.sym_table_64, 64) if csr.defined_in_base64? && field.defined_in_base64?
end
end
end
progressbar = ProgressBar.create(title: "Functions", total: arch_def.functions.size)
arch_def.functions.each do |func|
progressbar.increment
func.type_check_body(arch_def.sym_table_32)
func.type_check_body(arch_def.sym_table_64)
end
task idl: ["gen:arch", "#{$root}/.stamps/arch-gen-_32.stamp", "#{$root}/.stamps/arch-gen-_64.stamp"] do
print "Parsing IDL code for RV32..."
arch_def_32 = arch_def_for("_32")
puts "done"

arch_def_32.type_check

print "Parsing IDL code for RV64..."
arch_def_64 = arch_def_for("_64")
puts "done"

arch_def_64.type_check

# arch_def_64 = arch_def_for("_64")
# arch_def_64.type_check

# puts "Type checking IDL code..."
# progressbar = ProgressBar.create(title: "Instructions", total: arch_def_32.instructions.size + arch_def_64.instructions.size)
# arch_def_32.instructions.each do |inst|
# progressbar.increment
# inst.type_checked_operation_ast(arch_def_32.idl_compiler, arch_def_32.symtab, 32) if inst.rv32?
# end
# arch_def_64.instructions.each do |inst|
# progressbar.increment
# inst.type_checked_operation_ast(arch_def_64.idl_compiler, arch_def_64.symtab, 64) if inst.rv64?
# # also need to check for an RV64 machine running with effective XLEN of 32
# inst.type_checked_operation_ast(arch_def_64.idl_compiler, arch_def_64.symtab, 32) if inst.rv64? && inst.rv32?
# end

# progressbar = ProgressBar.create(title: "CSRs", total: arch_def_32.csrs.size + arch_def_64.csrs.size)
# arch_def_32.csrs.each do |csr|
# progressbar.increment
# profile = RubyProf::Profile.new
# result = profile.profile do
# if csr.has_custom_sw_read?
# csr.type_checked_sw_read_ast(arch_def_32.symtab) if csr.defined_in_base32?
# end
# csr.fields.each do |field|
# unless field.type_ast(arch_def_32.symtab).nil?
# field.type_checked_type_ast(arch_def_32.symtab) if csr.defined_in_base32? && field.defined_in_base32?
# end
# unless field.reset_value_ast(arch_def_32.symtab).nil?
# field.type_checked_reset_value_ast(arch_def_32.symtab) if csr.defined_in_base32? && field.defined_in_base32?
# end
# unless field.sw_write_ast(arch_def_32.symtab).nil?
# field.type_checked_sw_write_ast(arch_def_32.symtab, 32) if csr.defined_in_base32? && field.defined_in_base32?
# end
# end
# end
# RubyProf::GraphHtmlPrinter.new(result).print(File.open("#{csr.name}-prof.html", "w+"), {})
# end
# arch_def_64.csrs.each do |csr|
# progressbar.increment
# if csr.has_custom_sw_read?
# csr.type_checked_sw_read_ast(arch_def_64.symtab) if csr.defined_in_base64?
# end
# csr.fields.each do |field|
# unless field.type_ast(arch_def_64.symtab).nil?
# field.type_checked_type_ast(arch_def_64.symtab) if csr.defined_in_base64? && field.defined_in_base64?
# end
# unless field.reset_value_ast(arch_def_64.symtab).nil?
# field.type_checked_reset_value_ast(arch_def_64.symtab) if csr.defined_in_base64? && field.defined_in_base64?
# end
# unless field.sw_write_ast(arch_def_64.symtab).nil?
# field.type_checked_sw_write_ast(arch_def_64.symtab, 32) if csr.defined_in_base32? && field.defined_in_base32?
# field.type_checked_sw_write_ast(arch_def_64.symtab, 64) if csr.defined_in_base64? && field.defined_in_base64?
# end
# end
# end
# progressbar = ProgressBar.create(title: "Functions", total: arch_def_32.functions.size + arch_def_64.functions.size)
# arch_def_32.functions.each do |func|
# progressbar.increment
# func.type_check(arch_def_32.symtab)
# end
# arch_def_64.functions.each do |func|
# progressbar.increment
# func.type_check(arch_def_64.symtab)
# end
puts "All IDL passed type checking"
end
end
Expand Down
115 changes: 50 additions & 65 deletions arch/csc_crd/MC-1.yaml → arch/crd/MC-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,71 +29,56 @@ MC-1:

# XXX - Remove version information since specifying priv/unpriv ISA manual should imply this.
extensions:
mandatory:
- name: I
version: "~> 2.1"
- name: C
version: "~> 2.2"
param_constraints:
MUTABLE_MISA_C:
schema:
const: false
- name: M
version: "~> 2.0"
- name: Zicsr
version: "~> 2.0"
- name: Zicntr
version: "~> 2.0"
- name: Sm
version: "~> 1.11"
param_constraints:
MTVEC_BASE_ALIGNMENT_DIRECT: {} # Unconstrained
MTVEC_BASE_ALIGNMENT_VECTORED: {} # Unconstrained
ARCH_ID: {} # Unconstrained
IMP_ID: {} # Unconstrained
VENDOR_ID_BANK: {} # Unconstrained
VENDOR_ID_OFFSET: {} # Unconstrained
MISA_CSR_IMPLEMENTED: {} # Unconstrained
TIME_CSR_IMPLEMENTED: {} # Unconstrained
MTVAL_WIDTH: {} # Unconstrained
PHYS_ADDR_WIDTH: {} # Unconstrained
PRECISE_SYNCHRONOUS_EXCEPTIONS:
schema:
const: true
TRAP_ON_ECALL_FROM_M:
schema:
const: true
TRAP_ON_EBREAK:
schema:
const: true
REPORT_VA_IN_MTVAL_ON_BREAKPOINT:
schema:
const: true
REPORT_VA_IN_MTVAL_ON_INSTRUCTION_ACCESS_FAULT:
schema:
const: true
REPORT_VA_IN_MTVAL_ON_LOAD_ACCESS_FAULT:
schema:
const: true
REPORT_VA_IN_MTVAL_ON_STORE_AMO_ACCESS_FAULT:
schema:
const: true
REPORT_ENCODING_IN_MTVAL_ON_ILLEGAL_INSTRUCTION:
schema:
const: true
M_MODE_ENDIANESS:
schema:
const: little
XLEN:
schema:
const: 32
CONFIG_PTR_ADDRESS:
schema:
const: 0
#XXX optional: {} # None
optional:
- name: Zifencei
note: "This is just for testing. Zifencei extension isn't really optional for MC-1."
- name: I
version: "~> 2.1"
presence: mandatory
- name: C
version: "~> 2.2"
presence: mandatory
- name: M
version: "~> 2.0"
presence: mandatory
- name: Zicsr
version: "~> 2.0"
presence: mandatory
- name: Zicntr
version: "~> 2.0"
presence: mandatory
parameters:
TIME_CSR_IMPLEMENTED: {} # Unconstrained
- name: Sm
version: "~> 1.11"
presence: mandatory
parameters:
MTVEC_BASE_ALIGNMENT_DIRECT: {} # Unconstrained
MTVEC_BASE_ALIGNMENT_VECTORED: {} # Unconstrained
ARCH_ID: {} # Unconstrained
IMP_ID: {} # Unconstrained
VENDOR_ID_BANK: {} # Unconstrained
VENDOR_ID_OFFSET: {} # Unconstrained
MISA_CSR_IMPLEMENTED: {} # Unconstrained
MTVAL_WIDTH: {} # Unconstrained
MTVEC_MODES: {} # Unconstrained
PHYS_ADDR_WIDTH: {} # Unconstrained
CONFIG_PTR_ADDRESS:
schema:
const: 0xdeadbeef
note: "This parameter and its associated CSR shouldn't be here. See GitHub issue #53."
PRECISE_SYNCHRONOUS_EXCEPTIONS:
schema:
const: true
TRAP_ON_ECALL_FROM_M:
schema:
const: true
TRAP_ON_EBREAK:
schema:
const: true
M_MODE_ENDIANESS:
schema:
const: little
XLEN:
schema:
const: 32

requirement_groups:
- name: MC-Unpriv
Expand Down
Loading
Loading