Skip to content

Commit 667c999

Browse files
author
Derek Hower
committed
Merge remote-tracking branch 'origin/main' into refactor
2 parents 5c9e0a9 + f91ce90 commit 667c999

File tree

1,380 files changed

+11101
-4869
lines changed

Some content is hidden

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

1,380 files changed

+11101
-4869
lines changed

.devcontainer/onCreateCommand.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

3-
npm i
3+
npm i
44
bundle install

.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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup project
3333
run: ./bin/setup
3434
- name: Run smoke
35-
run: ./do smoke
35+
run: ./do test:smoke
3636
regress-gen-isa-manual:
3737
runs-on: ubuntu-latest
3838
needs: regress-smoke
@@ -146,4 +146,4 @@ jobs:
146146
name: Build container
147147
run: ./bin/build_container
148148
- name: Generate extension PDF
149-
run: ./do gen:profile[MockProfileRelease]
149+
run: ./do gen:profile[MockProfileRelease]

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
exclude: ^docs/ruby/ # All generated code
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v5.0.0
7+
hooks:
8+
- id: check-symlinks
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
args: [--markdown-linebreak-ext=md]
12+
- id: check-merge-conflict
13+
args: ["--assume-in-merge"]
14+
exclude: \.adoc$ # sections titles Level 6 "=======" get flagged otherwise

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ met:
1818
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS
1919
SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
2020
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21-
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
21+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
2222
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2323
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
2424
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN

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: 112 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,22 @@ namespace :serve do
8383
end
8484
end
8585

86-
desc "Run the IDL compiler test suite"
87-
task :idl_test do
88-
t = Minitest::TestTask.new(:lib_test)
89-
t.test_globs = ["#{$root}/lib/idl/tests/test_*.rb"]
90-
t.process_env
91-
ruby t.make_test_cmd
92-
end
86+
namespace :test do
87+
# "Run the IDL compiler test suite"
88+
task :idl_compiler do
89+
t = Minitest::TestTask.new(:lib_test)
90+
t.test_globs = ["#{$root}/lib/idl/tests/test_*.rb"]
91+
t.process_env
92+
ruby t.make_test_cmd
93+
end
9394

94-
desc "Run the Ruby library test suite"
95-
task :lib_test do
96-
t = Minitest::TestTask.new(:lib_test)
97-
t.test_globs = ["#{$root}/lib/test/test_*.rb"]
98-
t.process_env
99-
ruby t.make_test_cmd
95+
# "Run the Ruby library test suite"
96+
task :lib do
97+
t = Minitest::TestTask.new(:lib_test)
98+
t.test_globs = ["#{$root}/lib/test/test_*.rb"]
99+
t.process_env
100+
ruby t.make_test_cmd
101+
end
100102
end
101103

102104
desc "Clean up all generated files"
@@ -105,7 +107,7 @@ task :clean do
105107
FileUtils.rm_rf $root / ".stamps"
106108
end
107109

108-
namespace :validate do
110+
namespace :test do
109111
task :insts do
110112
puts "Checking instruction encodings..."
111113
inst_paths = Dir.glob("#{$root}/arch/inst/**/*.yaml").map { |f| Pathname.new(f) }
@@ -136,9 +138,6 @@ namespace :validate do
136138
end
137139
end
138140

139-
desc "Validate the arch docs"
140-
task validate: ["validate:schema", "validate:idl", "validate:insts"]
141-
142141
def insert_warning(str, from)
143142
# insert a warning on the second line
144143
lines = str.lines
@@ -284,70 +283,101 @@ namespace :gen do
284283
end
285284
end
286285

287-
desc <<~DESC
288-
Run the regression tests
289-
290-
These tests must pass before a commit will be allowed in the main branch on GitHub
291-
DESC
292-
task :regress do
293-
Rake::Task["idl_test"].invoke
294-
Rake::Task["lib_test"].invoke
295-
Rake::Task["validate"].invoke
296-
ENV["MANUAL_NAME"] = "isa"
297-
ENV["VERSIONS"] = "all"
298-
Rake::Task["gen:html_manual"].invoke
299-
Rake::Task["gen:html"].invoke("generic_rv64")
300-
ENV["EXT"] = "B"
301-
ENV["VERSION"] = "latest"
302-
Rake::Task["gen:ext_pdf"].invoke
303-
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
304-
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
305-
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
306-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
307-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
308-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
309-
310-
puts
311-
puts "Regression test PASSED"
286+
namespace :test do
287+
desc <<~DESC
288+
Run smoke tests
289+
290+
These are basic but fast-running tests to check the database and tools
291+
DESC
292+
task :smoke do
293+
Rake::Task["test:idl_compiler"].invoke
294+
Rake::Task["test:lib"].invoke
295+
Rake::Task["test:schema"].invoke
296+
Rake::Task["test:idl_model"].invoke
297+
end
298+
299+
desc <<~DESC
300+
Run the regression tests
301+
302+
These tests must pass before a commit will be allowed in the main branch on GitHub
303+
DESC
304+
task :regress do
305+
Rake::Task["test:smoke"].invoke
306+
307+
ENV["MANUAL_NAME"] = "isa"
308+
ENV["VERSIONS"] = "all"
309+
Rake::Task["gen:html_manual"].invoke
310+
311+
ENV["EXT"] = "B"
312+
ENV["VERSION"] = "latest"
313+
Rake::Task["gen:ext_pdf"].invoke
314+
315+
Rake::Task["gen:html"].invoke("generic_rv64")
316+
317+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
318+
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
319+
320+
puts
321+
puts "Regression test PASSED"
322+
end
323+
324+
desc <<~DESC
325+
Run the nightly regression tests
326+
327+
Generally, this tries to build all artifacts
328+
DESC
329+
task :nightly do
330+
Rake::Task["regress"].invoke
331+
332+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
333+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
334+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
335+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
336+
337+
puts
338+
puts "Nightly regression test PASSED"
339+
end
312340
end
313341

314-
desc <<~DESC
315-
Generate all certificates and profile PDFs.
316-
DESC
317-
task :cert_profile_pdfs do
318-
puts "==================================="
319-
puts "cert_profile_pdfs: Generating MC100"
320-
puts " 1st target"
321-
puts "==================================="
322-
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
323-
324-
puts "=================================================="
325-
puts "cert_profile_pdfs: Generating MockCertificateModel"
326-
puts " 2nd target"
327-
puts "=================================================="
328-
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
329-
330-
puts "==================================="
331-
puts "cert_profile_pdfs: Generating RVA20"
332-
puts " 3rd target"
333-
puts "==================================="
334-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
335-
336-
puts "==================================="
337-
puts "cert_profile_pdfs: Generating RVA22"
338-
puts " 4th target"
339-
puts "==================================="
340-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
341-
342-
puts "==================================="
343-
puts "cert_profile_pdfs: Generating RVI20"
344-
puts " 5th target"
345-
puts "==================================="
346-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
347-
348-
puts "==================================="
349-
puts "cert_profile_pdfs: Generating MockProfileRelease"
350-
puts " 6th target"
351-
puts "==================================="
352-
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
353-
end
342+
namespace :gen do
343+
desc <<~DESC
344+
Generate all certificates and profile PDFs.
345+
DESC
346+
task :cert_profile_pdfs do
347+
puts "==================================="
348+
puts "cert_profile_pdfs: Generating MC100"
349+
puts " 1st target"
350+
puts "==================================="
351+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
352+
353+
puts "=================================================="
354+
puts "cert_profile_pdfs: Generating MockCertificateModel"
355+
puts " 2nd target"
356+
puts "=================================================="
357+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
358+
359+
puts "==================================="
360+
puts "cert_profile_pdfs: Generating RVA20"
361+
puts " 3rd target"
362+
puts "==================================="
363+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
364+
365+
puts "==================================="
366+
puts "cert_profile_pdfs: Generating RVA22"
367+
puts " 4th target"
368+
puts "==================================="
369+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
370+
371+
puts "==================================="
372+
puts "cert_profile_pdfs: Generating RVI20"
373+
puts " 5th target"
374+
puts "==================================="
375+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
376+
377+
puts "==================================="
378+
puts "cert_profile_pdfs: Generating MockProfileRelease"
379+
puts " 6th target"
380+
puts "==================================="
381+
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
382+
end
383+
end

arch/README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To tame this challenge, this specification generator takes the following approac
2121

2222
The architecture is specified in a series of https://en.wikipedia.org/wiki/YAML[YAML]
2323
files for _Extensions_, _Instructions_, and _Control and Status Registers (CSRs)_.
24-
Each extension/instruction/CSR has its own file.
24+
Each extension/instruction/CSR has its own file.
2525

2626
== Flow
2727

arch/certificate_class/MC.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ naming_scheme: |
2121
2222
Where:
2323
24-
* Left & right square braces denote optional.
24+
* Left & right square braces denote optional.
2525
* \<model> is a 3 digit integer. It is changed only when mandatory extensions are added to a CRD.
2626
** The one's digit is incremented when a small mandatory extension is added (e.g., Zicond)
2727
** The ten's digit is incremented when a medium mandatory extension is addded (e.g., PMP)
2828
** The hundreds's digit is incremented when a large mandatory extension is addded (e.g., V or H)
29-
* \<version> is a semantic version (see semver.org) formatted as <major>[.<minor>.[patch]]. If \<version> is omitted, the reference applies equally to all versions.
29+
* \<version> is a semantic version (see semver.org) formatted as <major>[.<minor>.[patch]]. If \<version> is omitted, the reference applies equally to all versions.
3030
** A <major> release indicates support for a new optional extension.
3131
** A <minor> release indicates one or more of the following changes to the certification tests associated with the CRD.
3232
*** Fix test bug or increase test coverage
@@ -35,4 +35,4 @@ naming_scheme: |
3535
** A <patch> release indicates just CRD specification changes without any difference in functional behavior
3636
3737
mandatory_priv_modes:
38-
- M
38+
- M

arch/certificate_model/MC100.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class:
88
$ref: certificate_class/MC.yaml#
99

1010
# Semantic versions within the model
11-
versions:
11+
versions:
1212
- version: "1.0.0"
1313

1414
# XLEN used by rakefile
@@ -139,4 +139,4 @@ extensions:
139139
const: little
140140
XLEN:
141141
schema:
142-
const: 32
142+
const: 32

0 commit comments

Comments
 (0)