Skip to content

Commit f14798e

Browse files
Merge branch 'main' into 332-create-better-profile-comparisons
Signed-off-by: james-ball-qualcomm <[email protected]>
2 parents c59841d + db49639 commit f14798e

File tree

277 files changed

+8085
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

277 files changed

+8085
-66
lines changed

.github/workflows/nightly.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Regression test
2+
3+
on:
4+
schedule:
5+
- cron: '30 2 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
# check_date from: https://stackoverflow.com/questions/63014786/how-to-schedule-a-github-actions-nightly-build-but-run-it-only-when-there-where
10+
check_date:
11+
runs-on: ubuntu-latest
12+
name: Check latest commit
13+
outputs:
14+
should_run: ${{ steps.should_run.outputs.should_run }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: print latest_commit
18+
run: echo ${{ github.sha }}
19+
20+
- id: should_run
21+
continue-on-error: true
22+
name: check latest commit is less than a day
23+
if: ${{ github.event_name == 'schedule' }}
24+
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
25+
nightly:
26+
needs: check_date
27+
if: ${{ needs.check_date.outputs.should_run != 'false' }}
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Clone Github Repo Action
31+
uses: actions/checkout@v4
32+
- name: Setup apptainer
33+
uses: eWaterCycle/[email protected]
34+
- name: Get container from cache
35+
id: cache-sif
36+
uses: actions/cache@v3
37+
with:
38+
path: .singularity/image.sif
39+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
40+
- name: Get gems and node files from cache
41+
id: cache-bundle-npm
42+
uses: actions/cache@v3
43+
with:
44+
path: |
45+
.home/.gems
46+
node_modules
47+
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
48+
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
49+
name: Build container
50+
run: ./bin/build_container
51+
- name: Setup project
52+
run: ./bin/setup
53+
- name: Run regression
54+
run: ./do test:nightly

.github/workflows/regress.yml

Lines changed: 119 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,124 @@ on:
55
- main
66
workflow_dispatch:
77
jobs:
8-
regress:
8+
regress-smoke:
99
runs-on: ubuntu-latest
10+
steps:
11+
- name: Clone Github Repo Action
12+
uses: actions/checkout@v4
13+
- name: Setup apptainer
14+
uses: eWaterCycle/[email protected]
15+
- name: Get container from cache
16+
id: cache-sif
17+
uses: actions/cache@v3
18+
with:
19+
path: .singularity/image.sif
20+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
21+
- name: Get gems and node files from cache
22+
id: cache-bundle-npm
23+
uses: actions/cache@v3
24+
with:
25+
path: |
26+
.home/.gems
27+
node_modules
28+
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
29+
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
30+
name: Build container
31+
run: ./bin/build_container
32+
- name: Setup project
33+
run: ./bin/setup
34+
- name: Run smoke
35+
run: ./do test:smoke
36+
regress-gen-isa-manual:
37+
runs-on: ubuntu-latest
38+
needs: regress-smoke
39+
env:
40+
MANUAL_NAME: isa
41+
VERSIONS: all
42+
steps:
43+
- name: Clone Github Repo Action
44+
uses: actions/checkout@v4
45+
- name: Setup apptainer
46+
uses: eWaterCycle/[email protected]
47+
- name: Get container from cache
48+
id: cache-sif
49+
uses: actions/cache@v3
50+
with:
51+
path: .singularity/image.sif
52+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
53+
- name: Get gems and node files from cache
54+
id: cache-bundle-npm
55+
uses: actions/cache@v3
56+
with:
57+
path: |
58+
.home/.gems
59+
node_modules
60+
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
61+
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
62+
name: Build container
63+
run: ./bin/build_container
64+
- name: Generate HTML ISA manual
65+
run: ./do gen:html_manual
66+
regress-gen-ext-pdf:
67+
runs-on: ubuntu-latest
68+
needs: regress-smoke
69+
env:
70+
EXT: B
71+
VERSION: latest
72+
steps:
73+
- name: Clone Github Repo Action
74+
uses: actions/checkout@v4
75+
- name: Setup apptainer
76+
uses: eWaterCycle/[email protected]
77+
- name: Get container from cache
78+
id: cache-sif
79+
uses: actions/cache@v3
80+
with:
81+
path: .singularity/image.sif
82+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
83+
- name: Get gems and node files from cache
84+
id: cache-bundle-npm
85+
uses: actions/cache@v3
86+
with:
87+
path: |
88+
.home/.gems
89+
node_modules
90+
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
91+
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
92+
name: Build container
93+
run: ./bin/build_container
94+
- name: Generate extension PDF
95+
run: ./do gen:ext_pdf
96+
regress-gen-certificate:
97+
runs-on: ubuntu-latest
98+
needs: regress-smoke
99+
steps:
100+
- name: Clone Github Repo Action
101+
uses: actions/checkout@v4
102+
- name: Setup apptainer
103+
uses: eWaterCycle/[email protected]
104+
- name: Get container from cache
105+
id: cache-sif
106+
uses: actions/cache@v3
107+
with:
108+
path: .singularity/image.sif
109+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
110+
- name: Get gems and node files from cache
111+
id: cache-bundle-npm
112+
uses: actions/cache@v3
113+
with:
114+
path: |
115+
.home/.gems
116+
node_modules
117+
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
118+
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
119+
name: Build container
120+
run: ./bin/build_container
121+
- name: Generate extension PDF
122+
run: ./do gen:cert_model_pdf[MockCertificateModel]
123+
regress-gen-profile:
124+
runs-on: ubuntu-latest
125+
needs: regress-smoke
10126
steps:
11127
- name: Clone Github Repo Action
12128
uses: actions/checkout@v4
@@ -29,7 +145,5 @@ jobs:
29145
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
30146
name: Build container
31147
run: ./bin/build_container
32-
- name: Setup project
33-
run: ./bin/setup
34-
- name: Run regression
35-
run: ./do regress
148+
- name: Generate extension PDF
149+
run: ./do gen:profile[MockProfileRelease]

README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ Quick start:
105105
106106
## examples
107107
108-
# validate against the schema
109-
./do validate
108+
# run smoke tests
109+
./do test:smoke
110110
111111
# generate all versions of ISA manual, as an Antora static website
112112
./do gen:html_manual MANUAL_NAME=isa VERSIONS=all

Rakefile

Lines changed: 71 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,22 @@ namespace :serve do
5555
end
5656
end
5757

58-
desc "Run the IDL compiler test suite"
59-
task :idl_test do
60-
t = Minitest::TestTask.new(:lib_test)
61-
t.test_globs = ["#{$root}/lib/idl/tests/test_*.rb"]
62-
t.process_env
63-
ruby t.make_test_cmd
64-
end
58+
namespace :test do
59+
# "Run the IDL compiler test suite"
60+
task :idl_compiler do
61+
t = Minitest::TestTask.new(:lib_test)
62+
t.test_globs = ["#{$root}/lib/idl/tests/test_*.rb"]
63+
t.process_env
64+
ruby t.make_test_cmd
65+
end
6566

66-
desc "Run the Ruby library test suite"
67-
task :lib_test do
68-
t = Minitest::TestTask.new(:lib_test)
69-
t.test_globs = ["#{$root}/lib/test/test_*.rb"]
70-
t.process_env
71-
ruby t.make_test_cmd
67+
# "Run the Ruby library test suite"
68+
task :lib do
69+
t = Minitest::TestTask.new(:lib_test)
70+
t.test_globs = ["#{$root}/lib/test/test_*.rb"]
71+
t.process_env
72+
ruby t.make_test_cmd
73+
end
7274
end
7375

7476
desc "Clean up all generated files"
@@ -77,7 +79,7 @@ task :clean do
7779
FileUtils.rm_rf $root / ".stamps"
7880
end
7981

80-
namespace :validate do
82+
namespace :test do
8183
task :insts do
8284
puts "Checking instruction encodings..."
8385
inst_paths = Dir.glob("#{$root}/arch/inst/**/*.yaml").map { |f| Pathname.new(f) }
@@ -95,9 +97,10 @@ namespace :validate do
9597
progressbar.increment
9698
validator.validate(f)
9799
end
100+
Rake::Task["test:insts"].invoke
98101
puts "All files validate against their schema"
99102
end
100-
task idl: ["gen:arch", "#{$root}/.stamps/arch-gen-_32.stamp", "#{$root}/.stamps/arch-gen-_64.stamp"] do
103+
task idl_model: ["gen:arch", "#{$root}/.stamps/arch-gen-_32.stamp", "#{$root}/.stamps/arch-gen-_64.stamp"] do
101104
print "Parsing IDL code for RV32..."
102105
arch_def_32 = arch_def_for("_32")
103106
puts "done"
@@ -114,9 +117,6 @@ namespace :validate do
114117
end
115118
end
116119

117-
desc "Validate the arch docs"
118-
task validate: ["validate:schema", "validate:idl", "validate:insts"]
119-
120120
def insert_warning(str, from)
121121
# insert a warning on the second line
122122
lines = str.lines
@@ -274,31 +274,60 @@ namespace :gen do
274274
end
275275
end
276276

277-
desc <<~DESC
278-
Run the regression tests
277+
namespace :test do
278+
desc <<~DESC
279+
Run smoke tests
279280
280-
These tests must pass before a commit will be allowed in the main branch on GitHub
281-
DESC
282-
task :regress do
283-
Rake::Task["idl_test"].invoke
284-
Rake::Task["lib_test"].invoke
285-
Rake::Task["validate"].invoke
286-
ENV["MANUAL_NAME"] = "isa"
287-
ENV["VERSIONS"] = "all"
288-
Rake::Task["gen:html_manual"].invoke
289-
Rake::Task["gen:html"].invoke("generic_rv64")
290-
ENV["EXT"] = "B"
291-
ENV["VERSION"] = "latest"
292-
Rake::Task["gen:ext_pdf"].invoke
293-
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
294-
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
295-
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
296-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
297-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
298-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
281+
These are basic but fast-running tests to check the database and tools
282+
DESC
283+
task :smoke do
284+
Rake::Task["test:idl_compiler"].invoke
285+
Rake::Task["test:lib"].invoke
286+
Rake::Task["test:schema"].invoke
287+
Rake::Task["test:idl_model"].invoke
288+
end
299289

300-
puts
301-
puts "Regression test PASSED"
290+
desc <<~DESC
291+
Run the regression tests
292+
293+
These tests must pass before a commit will be allowed in the main branch on GitHub
294+
DESC
295+
task :regress do
296+
Rake::Task["test:smoke"].invoke
297+
298+
ENV["MANUAL_NAME"] = "isa"
299+
ENV["VERSIONS"] = "all"
300+
Rake::Task["gen:html_manual"].invoke
301+
302+
ENV["EXT"] = "B"
303+
ENV["VERSION"] = "latest"
304+
Rake::Task["gen:ext_pdf"].invoke
305+
306+
Rake::Task["gen:html"].invoke("generic_rv64")
307+
308+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
309+
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
310+
311+
puts
312+
puts "Regression test PASSED"
313+
end
314+
315+
desc <<~DESC
316+
Run the nightly regression tests
317+
318+
Generally, this tries to build all artifacts
319+
DESC
320+
task :nightly do
321+
Rake::Task["regress"].invoke
322+
323+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
324+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
325+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
326+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
327+
328+
puts
329+
puts "Nightly regression test PASSED"
330+
end
302331
end
303332

304333
desc <<~DESC
@@ -354,4 +383,4 @@ task MockCertificateModel: "#{$root}/gen/certificate_doc/pdf/MockCertificateMode
354383
task RVI20: "#{$root}/gen/profile_doc/pdf/RVI20.pdf"
355384
task RVA20: "#{$root}/gen/profile_doc/pdf/RVA20.pdf"
356385
task RVA22: "#{$root}/gen/profile_doc/pdf/RVA22.pdf"
357-
task MockProfileRelease: "#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"
386+
task MockProfileRelease: "#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"

arch/csr/H/htinst.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ fields:
4040
return CsrFieldType::RO;
4141
}
4242
description: |
43-
Exception-speicific information for a trap into HS-mode.
43+
Exception-specific information for a trap into HS-mode.
4444
reset_value: UNDEFINED_LEGAL

arch/csr/H/htval.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ fields:
3232
return CsrFieldType::RO;
3333
}
3434
description: |
35-
Exception-speicific information for a trap into M-mode.
35+
Exception-specific information for a trap into M-mode.
3636
reset_value: UNDEFINED_LEGAL

arch/csr/H/mtinst.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ fields:
4040
return CsrFieldType::RO;
4141
}
4242
description: |
43-
Exception-speicific information for a trap into M-mode.
43+
Exception-specific information for a trap into M-mode.
4444
reset_value: UNDEFINED_LEGAL

arch/csr/H/mtval2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ fields:
3333
return CsrFieldType::RO;
3434
}
3535
description: |
36-
Exception-speicific information for a trap into M-mode.
36+
Exception-specific information for a trap into M-mode.
3737
reset_value: UNDEFINED_LEGAL

0 commit comments

Comments
 (0)