Skip to content

Commit

Permalink
Merge branch 'main' into ruby_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dhower-qc authored Oct 16, 2024
2 parents 7326e13 + 964567b commit c7d9303
Show file tree
Hide file tree
Showing 20 changed files with 420 additions and 367 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,5 @@ jobs:
run: ./bin/build_container
- name: Setup project
run: ./bin/setup
- name: Run IDL tests
run: ./do idl_test
- name: Run validator
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:crd_pdf[MC-1]
- name: Build PDF documentation for RVA Profile Family
run: ./do gen:profile_pdf[rva]
- name: Run regression
run: ./do regress
82 changes: 17 additions & 65 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,71 +98,6 @@ namespace :validate do

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 Expand Up @@ -326,3 +261,20 @@ namespace :gen do
end
end
end

desc <<~DESC
Run the regression tests
These tests must pass before a commit will be allowed in the main branch on GitHub
DESC
task :regress do
Rake::Task["idl_test"].invoke
Rake::Task["validate"].invoke
Rake::Task["gen:html"].invoke("generic_rv64")
Rake::Task["gen:crd_pdf"].invoke("MockCRD-1")
Rake::Task["gen:crd_pdf"].invoke("MC-1")
Rake::Task["gen:profile_pdf"].invoke("rva")

puts
puts "Regression test PASSED"
end
5 changes: 2 additions & 3 deletions arch/ext/Sm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,8 @@ Sm:
TODO: GitHub issue 53
schema:
type: integer
# GitHub issue 53
# when:
# version: ">= 1.12.0"
when:
version: ">= 1.12.0"
PMA_GRANULARITY:
description: |
log2 of the smallest supported PMA region.
Expand Down
2 changes: 1 addition & 1 deletion backends/crd_doc/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Dir.glob("#{$root}/arch/crd/*.yaml") do |f|
"#{$root}/arch/crd_family/#{crd_obj[crd_name]['family']}.yaml",
"#{CRD_DOC_DIR}/templates/crd.adoc.erb",
__FILE__,
"gen:arch"
"#{$root}/.stamps/arch-gen-_64.stamp"
] do |t|
# TODO: schema validation
arch_def = arch_def_for("_64")
Expand Down
Loading

0 comments on commit c7d9303

Please sign in to comment.