Skip to content

Commit 7c108a7

Browse files
committed
2 parents 0151a2c + 6287ff9 commit 7c108a7

File tree

178 files changed

+6235
-2313
lines changed

Some content is hidden

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

178 files changed

+6235
-2313
lines changed

.devcontainer/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu:24.04 AS spython-base
2+
RUN export DEBIAN_FRONTEND=noninteractive
3+
RUN apt-get update
4+
RUN apt-get install -y --no-install-recommends git
5+
RUN apt-get install -y --no-install-recommends python3
6+
RUN apt-get install -y --no-install-recommends python3.12-venv python3-pip
7+
RUN apt-get install -y --no-install-recommends build-essential
8+
RUN apt-get install -y --no-install-recommends ruby ruby-dev
9+
RUN apt-get install -y --no-install-recommends bundler
10+
RUN apt-get install -y --no-install-recommends nodejs
11+
RUN apt-get install -y --no-install-recommends npm
12+
RUN apt-get install -y --no-install-recommends ditaa
13+
RUN apt-get clean autoclean
14+
RUN apt-get autoremove -y
15+
RUN rm -rf /var/lib/{apt, dpkg, cache, log}

.devcontainer/devcontainer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "RISC-V UnifiedDB Dev",
3+
"build": { "dockerfile": "Dockerfile" },
4+
"updateContentCommand": "${containerWorkspaceFolder}/.devcontainer/updateContentCommand.sh",
5+
"onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/onCreateCommand.sh",
6+
"remoteEnv": {
7+
"DISPLAY": ":0"
8+
},
9+
"containerEnv": {
10+
"DEVCONTAINER_ENV": "true"
11+
},
12+
// vscode extensions
13+
"customizations": {
14+
"vscode": {
15+
"settings": {
16+
"solargraph.bundlerPath": "bundle",
17+
"solargraph.useBundler": true,
18+
"files.exclude": {
19+
"**/.home": true,
20+
"**/.yardoc": true
21+
},
22+
"files.watcherExclude": {
23+
"**/.home": true
24+
},
25+
"asciidoc.antora.showEnableAntoraPrompt": true
26+
},
27+
"extensions": [
28+
"castwide.solargraph",
29+
"redhat.vscode-yaml",
30+
"asciidoctor.asciidoctor-vscode",
31+
"zhwu95.riscv",
32+
"tomoki1207.pdf",
33+
"CraigMaslowski.erb",
34+
"HowerLimited.idl-vscode"
35+
]
36+
}
37+
},
38+
"forwardPorts": [
39+
8000, 8080
40+
]
41+
}

.devcontainer/onCreateCommand.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
npm i
4+
bundle install
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
bundle
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Data Entry
3+
about: Add new data into the database
4+
title: ''
5+
labels: data entry
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the data**

.github/workflows/pages.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,26 @@ jobs:
5757
run: mkdir -p _site/htmls
5858
- name: Copy cfg html
5959
run: cp -R gen/cfg_html_doc/generic_rv64/html _site/example_cfg
60-
- name: Create RVA Family PDF Spec
61-
run: ./do gen:profile_pdf[rva]
62-
- name: Copy RVA Family PDF
63-
run: cp gen/profile_doc/pdf/rva.pdf _site/pdfs/rva.pdf
64-
- name: Create MC-1 PDF Spec
65-
run: ./do gen:crd_pdf[MC-1]
66-
- name: Copy MC-1 PDF
67-
run: cp gen/crd_doc/pdf/MC-1.pdf _site/pdfs/MC-1.pdf
68-
- name: Create MC-1 HTML Spec
69-
run: ./do gen:crd_html[MC-1]
70-
- name: Copy MC-1 HTML
71-
run: cp gen/crd_doc/html/MC-1.html _site/htmls/MC-1.html
60+
- name: Create RVA20 Profile Release PDF Spec
61+
run: ./do gen:profile[RVA20]
62+
- name: Copy RVA20 Profile Release PDF
63+
run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVA20.pdf
64+
- name: Create RVA22 Profile Release PDF Spec
65+
run: ./do gen:profile[RVA22]
66+
- name: Copy RVA22 Profile Release PDF
67+
run: cp gen/profile_doc/pdf/RVA22.pdf _site/pdfs/RVA22.pdf
68+
- name: Create RVI20 Profile Release PDF Spec
69+
run: ./do gen:profile[RVI20]
70+
- name: Copy RVI20 Profile Release PDF
71+
run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVI20.pdf
72+
- name: Create MC100 PDF Spec
73+
run: ./do gen:cert_model_pdf[MC100]
74+
- name: Copy MC100 PDF
75+
run: cp gen/certificate_doc/pdf/MC100.pdf _site/pdfs/MC100.pdf
76+
- name: Create MC100 HTML Spec
77+
run: ./do gen:cert_model_html[MC100]
78+
- name: Copy MC100 HTML
79+
run: cp gen/certificate_doc/html/MC100.html _site/htmls/MC100.html
7280
- name: Copy manual html
7381
run: cp -R gen/manual/isa/top/all/html _site/manual
7482
- name: Setup Pages

.vscode/settings.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.adoc

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ The following artifacts have been generated from the top of the `main` branch:
88
* https://riscv-software-src.github.io/riscv-unified-db/example_cfg/html/index.html[configuration-specific documentation]
99
* https://riscv-software-src.github.io/riscv-unified-db/ruby/arch_def/index.html[Ruby API documentation (database interface)]
1010
* https://riscv-software-src.github.io/riscv-unified-db/ruby/idl/index.html[Ruby IDL API documentation (IDL compiler)]
11-
* https://riscv-software-src.github.io/riscv-unified-db/pdfs/rva.pdf[RVA Profile Family]
12-
* https://riscv-software-src.github.io/riscv-unified-db/pdfs/MC-1.pdf[MC-1 Certification Requirements Document]
11+
* https://riscv-software-src.github.io/riscv-unified-db/pdfs/RVI20.pdf[RVI20 Profile Release]
12+
* https://riscv-software-src.github.io/riscv-unified-db/pdfs/RVA20.pdf[RVA20 Profile Release]
13+
* https://riscv-software-src.github.io/riscv-unified-db/pdfs/RVA22.pdf[RVA22 Profile Release]
14+
* https://riscv-software-src.github.io/riscv-unified-db/pdfs/MC100.pdf[MC100 Certification Requirements Document]
1315

1416
== Overview
1517

@@ -28,7 +30,7 @@ This repository contains:
2830

2931
=== Working examples:
3032

31-
* Generate https://riscv-software-src.github.io/riscv-unified-db/manual/index.html[configuration-specific documentation] taylored to the set of implemented extensions and unnamed implementation options (_e.g._, `./do gen:html[generic_rv64]`).
33+
* Generate https://riscv-software-src.github.io/riscv-unified-db/manual/html/index.html[configuration-specific documentation] taylored to the set of implemented extensions and unnamed implementation options (_e.g._, `./do gen:html[generic_rv64]`).
3234
** Only implemented extensions/instructions/CSRs are included
3335
** Unreachable/unimplemented parts of the formal specification are pruned away
3436
** A dedicated documentation page for every implemented instruction, including its encoding, pruned execution behavior, and what types of exceptions it may cause.
@@ -51,9 +53,14 @@ This repository contains:
5153

5254
== Prerequisites
5355

54-
The only requirement is the `Singularity CE` (>= 3.3) or `Apptainer` (>= 1.0) container system. Either one will work (they are forks).
56+
There are two supported ways to run the RISC-V Unified Database,
57+
both of which are container-based.
5558

56-
If it is not installed, either as your IT admin or:
59+
=== Singularity/Apptainer
60+
61+
You can run within `Singularity CE` (>= 3.3) or `Apptainer` (>= 1.0) container system. Either one will work (they are forks).
62+
63+
If it is not installed, either ask your IT admin or:
5764

5865
* For Apptainer, see https://apptainer.org/docs/admin/main/installation.html[Apptainer Installation].
5966
* For Singularity CE, see https://docs.sylabs.io/guides/latest/admin-guide/installation.html[Singularity CE Installation].
@@ -62,35 +69,31 @@ If it is not installed, either as your IT admin or:
6269
You do *not* need root privileges to download or use the container. However, to modify/build the container,
6370
you will need either root privileges or the ability to run in `fakeroot` mode. See https://docs.sylabs.io/guides/4.1/user-guide/fakeroot.html[Singularity Fakeroot Documentation] for more information.
6471

65-
== Setup
72+
When you run with Singularity/Apptainer, the files under `bin/`
73+
will run within the container, _e.g._:
6674

67-
Do once:
75+
```bash
76+
./bin/ruby --version
77+
# => ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [x86_64-linux-gnu]
78+
```
6879

69-
[source,bash]
70-
----
71-
./bin/setup
80+
=== Devcontainer
7281

73-
# or, if you also want development tools (:development group in Gemfile) installed
74-
# DEVELOPMENT=1 ./bin/setup
75-
----
82+
You can also leverage https://containers.dev/[devcontainers] to run the RISC-V Unified Database.
7683

77-
[NOTE]
78-
If you forget, don't worry. Setup will be invoked by any program in bin/ if necessary.
84+
This is especially useful when using Visual Studio Code or GitHub codespaces, as it will setup up your IDE environment for you.
85+
86+
==== VS Code
7987

80-
=== VSCode
88+
To run the devcontainer locally, you will need to have https://docs.docker.com/engine/install[Docker installed].
8189

82-
If using Visual Studio Code and want to use development tools, you will need to restart the editor
83-
after setup.
90+
With Docker installed, install the https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers[Dev Containers] extension in VS Code.
8491

85-
Helpful extensions are
92+
You can then run `Dev Containers: Open Folder in Container...` from the Command Palette (Ctrl+Shift+P) and select the folder with this repository.
8693

87-
* https://marketplace.visualstudio.com/items?itemName=asciidoctor.asciidoctor-vscode[AsciiDoc]
88-
* https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml[YAML]
89-
* https://marketplace.visualstudio.com/items?itemName=castwide.solargraph[Solargraph] (for a Ruby Language Server)
90-
* https://marketplace.visualstudio.com/items?itemName=onnovalkering.vscode-singularity[Singularity] (if you plan on working on the container)
94+
==== GitHub Codespaces
9195

92-
The `.vscode/settings.json` file in the repo will ensure that Solargraph works without any additional
93-
configuration (assuming you've already run ./bin/setup).
96+
You can start a GitHub Codespace for this repository by clicking the "Code" button and selecting "Open with Codespaces".
9497

9598
== Tasks
9699

@@ -100,13 +103,18 @@ Quick start:
100103
----
101104
./do --tasks # list all documented tasks
102105
103-
# examples
104-
./do validate # validate against the schema
105-
./do gen:arch[generic_rv64] # generate arch spec for the 'generic_rv64' config
106+
## examples
107+
108+
# validate against the schema
109+
./do validate
110+
111+
# generate all versions of ISA manual, as an Antora static website
112+
./do gen:html_manual MANUAL_NAME=isa VERSIONS=all
113+
114+
# generate an implementation-specific spec for the 'generic_rv64' config
115+
./do gen:arch[generic_rv64]
106116
----
107117

108118
== More info
109119

110120
* xref:arch/README.adoc[Architecture specification format]
111-
* xref:_site/ruby/arch_def/index.html[Ruby database object model documentation]
112-
* xref:_site/ruby/idl/index.html[IDL Compiler documentation]

Rakefile

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

58-
Minitest::TestTask.create :idl_test do |t|
58+
desc "Run the IDL compiler test suite"
59+
task :idl_test do
60+
t = Minitest::TestTask.new(:lib_test)
5961
t.test_globs = ["#{$root}/lib/idl/tests/test_*.rb"]
62+
t.process_env
63+
ruby t.make_test_cmd
64+
end
65+
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
6072
end
6173

6274
desc "Clean up all generated files"
@@ -269,15 +281,60 @@ desc <<~DESC
269281
DESC
270282
task :regress do
271283
Rake::Task["idl_test"].invoke
284+
Rake::Task["lib_test"].invoke
272285
Rake::Task["validate"].invoke
273286
ENV["MANUAL_NAME"] = "isa"
274287
ENV["VERSIONS"] = "all"
275288
Rake::Task["gen:html_manual"].invoke
276289
Rake::Task["gen:html"].invoke("generic_rv64")
277-
Rake::Task["gen:crd_pdf"].invoke("MockCRD-1")
278-
Rake::Task["gen:crd_pdf"].invoke("MC-1")
279-
Rake::Task["gen:profile_pdf"].invoke("rva")
290+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
291+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
292+
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
293+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
294+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
295+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
280296

281297
puts
282298
puts "Regression test PASSED"
283299
end
300+
301+
desc <<~DESC
302+
Generate all certificates and profile PDFs.
303+
DESC
304+
task :cert_profile_pdfs do
305+
puts "==================================="
306+
puts "cert_profile_pdfs: Generating MC100"
307+
puts " 1st target"
308+
puts "==================================="
309+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MC100.pdf"].invoke
310+
311+
puts "=================================================="
312+
puts "cert_profile_pdfs: Generating MockCertificateModel"
313+
puts " 2nd target"
314+
puts "=================================================="
315+
Rake::Task["#{$root}/gen/certificate_doc/pdf/MockCertificateModel.pdf"].invoke
316+
317+
puts "==================================="
318+
puts "cert_profile_pdfs: Generating RVA20"
319+
puts " 3rd target"
320+
puts "==================================="
321+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
322+
323+
puts "==================================="
324+
puts "cert_profile_pdfs: Generating RVA22"
325+
puts " 4th target"
326+
puts "==================================="
327+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
328+
329+
puts "==================================="
330+
puts "cert_profile_pdfs: Generating RVI20"
331+
puts " 5th target"
332+
puts "==================================="
333+
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
334+
335+
puts "==================================="
336+
puts "cert_profile_pdfs: Generating MockProfileRelease"
337+
puts " 6th target"
338+
puts "==================================="
339+
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
340+
end

arch/certificate_class/MC.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
MC:
2+
name: MC
3+
long_name: Microcontroller Certificate Class
4+
5+
introduction: |
6+
This certification class specifies requirements for microcontrollers.
7+
It targets microcontrollers running low-level software on an RTOS or bare-metal.
8+
This CRD is not intended for the smallest possible microcontrollers but rather for applications
9+
benefiting from a standardized microcontroller.
10+
See the https://docs.google.com/document/d/133SZKc18tLsQcT1o6gEmBUkjwrtg2ow63me54RQ1jiY[RISC-V CRDs]
11+
document for information relevant to all RISC-V CRDs.
12+
13+
naming_scheme: |
14+
The MC (M = Microcontroller, C = Certificate) has the following naming scheme (suffixes after MC
15+
are optional but in the below order):
16+
17+
MC<model>[v<version>]
18+
19+
Where:
20+
21+
* Left & right square braces denote optional.
22+
* \<model> is a 3 digit integer. It is changed only when mandatory extensions are added to a CRD.
23+
** The one's digit is incremented when a small mandatory extension is added (e.g., Zicond)
24+
** The ten's digit is incremented when a medium mandatory extension is addded (e.g., PMP)
25+
** The hundreds's digit is incremented when a large mandatory extension is addded (e.g., V or H)
26+
* \<version> is a semantic version (see semver.org) formatted as <major>[.<minor>.[patch]]. If \<version> is omitted, the reference applies equally to all versions.
27+
** A <major> release indicates support for a new optional extension.
28+
** A <minor> release indicates one or more of the following changes to the certification tests associated with the CRD.
29+
*** Fix test bug or increase test coverage
30+
*** Add more allowed parameter values
31+
*** Support new extension version
32+
** A <patch> release indicates just CRD specification changes without any difference in functional behavior
33+
34+
mandatory_priv_modes:
35+
- M

0 commit comments

Comments
 (0)