Skip to content

Commit b9ae698

Browse files
Merge branch 'riscv-software-src:main' into Zclsd_extension
2 parents 02d3cc1 + dbaf530 commit b9ae698

File tree

1,174 files changed

+21152
-3726
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,174 files changed

+21152
-3726
lines changed

.clang-format

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
BasedOnStyle: Google
3+
IndentWidth: 2
4+
Language: Cpp
5+
# AlignConsecutiveAssignments: true
6+
# AlignConsecutiveDeclarations: true
7+
# AlignEscapedNewlines: Right
8+
# AlignOperands: true
9+
# AlignTrailingComments: true
10+
# AllowShortBlocksOnASingleLine: false
11+
# AllowShortCaseLabelsOnASingleLine: true
12+
# AlwaysBreakTemplateDeclarations: Yes
13+
14+
FixNamespaceComments: true
15+
NamespaceIndentation: All

.devcontainer/Dockerfile

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,35 @@ WORKDIR /workspace
66

77
RUN export DEBIAN_FRONTEND=noninteractive
88
RUN apt-get update
9-
RUN apt-get install -y --no-install-recommends git gh
10-
RUN apt-get install -y --no-install-recommends less
11-
RUN apt-get install -y --no-install-recommends python3
12-
RUN apt-get install -y --no-install-recommends python3.12-venv
13-
RUN apt-get install -y --no-install-recommends python3-pip
14-
RUN apt-get install -y --no-install-recommends build-essential
15-
RUN apt-get install -y --no-install-recommends ruby
16-
RUN apt-get install -y --no-install-recommends ruby-dev
17-
RUN apt-get install -y --no-install-recommends bundler
18-
RUN apt-get install -y --no-install-recommends nodejs
19-
RUN apt-get install -y --no-install-recommends npm
20-
RUN apt-get install -y --no-install-recommends ditaa
21-
RUN apt-get install -y --no-install-recommends libyaml-dev
9+
10+
# please keep pkgs sorted
11+
RUN apt-get install -y --no-install-recommends \
12+
build-essential \
13+
bundler \
14+
clang-format \
15+
clang-tidy \
16+
cmake \
17+
ditaa \
18+
g++ \
19+
gcc-riscv64-linux-gnu \
20+
gcc-riscv64-unknown-elf \
21+
gdb \
22+
gh \
23+
git \
24+
less \
25+
libc6-dev-riscv64-cross \
26+
libelf-dev \
27+
libgmp-dev \
28+
libyaml-dev \
29+
nodejs \
30+
npm \
31+
python3 \
32+
python3-pip \
33+
python3.12-venv \
34+
ruby \
35+
ruby-dev \
36+
shellcheck
37+
2238
RUN apt-get clean autoclean
2339
RUN apt-get autoremove -y
2440
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/*

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"zhwu95.riscv",
3232
"mathematic.vscode-pdf",
3333
"CraigMaslowski.erb",
34-
"HowerLimited.idl-vscode"
34+
"HowerLimited.udb-extension-pack-vscode"
3535
]
3636
}
3737
},

.github/workflows/container.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Publish container
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
jobs:
8+
publish-singularity-container:
9+
runs-on: ubuntu-latest
10+
env:
11+
SINGULARITY: 1
12+
steps:
13+
- name: Clone Github Repo Action
14+
uses: actions/checkout@v4
15+
16+
- name: Setup apptainer
17+
uses: eWaterCycle/[email protected]
18+
with:
19+
apptainer-version: 1.4.0
20+
21+
- name: Get container tag
22+
run: |
23+
TAG=$(cat bin/.container-tag)
24+
echo "TAG=$TAG" >> $GITHUB_ENV
25+
26+
- name: Get container from cache
27+
id: cache-sif
28+
uses: actions/cache@v4
29+
with:
30+
path: .singularity/image.sif
31+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
32+
33+
- name: Get gems and node files from cache
34+
id: cache-bundle-npm
35+
uses: actions/cache@v4
36+
with:
37+
path: |
38+
.home/.gems
39+
node_modules
40+
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
41+
42+
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
43+
name: Build container
44+
run: ./bin/build_container
45+
46+
- name: Upload singularity container
47+
run: |
48+
apptainer registry login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} oras://docker.io
49+
apptainer push .singularity/image.sif oras://docker.io/riscvintl/spec-generator:${{ env.TAG }}
50+
51+
publish-docker-container:
52+
runs-on: ubuntu-latest
53+
env:
54+
DOCKER: 1
55+
steps:
56+
- name: Clone Github Repo Action
57+
uses: actions/checkout@v4
58+
59+
- name: Get container tag
60+
run: |
61+
TAG=$(cat bin/.container-tag)
62+
echo "TAG=$TAG" >> $GITHUB_ENV
63+
64+
- name: Login to Docker Hub
65+
uses: docker/login-action@v3
66+
with:
67+
username: ${{ secrets.DOCKERHUB_USERNAME }}
68+
password: ${{ secrets.DOCKERHUB_TOKEN }}
69+
70+
- name: Set up QEMU
71+
uses: docker/setup-qemu-action@v3
72+
73+
- name: Set up Docker Buildx
74+
uses: docker/setup-buildx-action@v3
75+
76+
- name: Build and push
77+
uses: docker/build-push-action@v6
78+
with:
79+
push: true
80+
file: ./.devcontainer/Dockerfile
81+
platforms: linux/amd64,linux/arm64
82+
tags: riscvintl/udb:${{ env.TAG }}

.github/workflows/regress.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
name: Build container
104104
run: ./bin/build_container
105105
- name: Generate HTML ISA manual
106-
run: ./do gen:html[generic_rv64]
106+
run: ./do gen:html[example_rv64_with_overlay]
107107
regress-gen-ext-pdf:
108108
runs-on: ubuntu-latest
109109
env:
@@ -191,3 +191,31 @@ jobs:
191191
run: ./bin/build_container
192192
- name: Generate extension PDF
193193
run: ./do gen:profile[MockProfileRelease]
194+
regress-gen-go:
195+
runs-on: ubuntu-latest
196+
env:
197+
SINGULARITY: 1
198+
steps:
199+
- name: Clone Github Repo Action
200+
uses: actions/checkout@v4
201+
- name: Setup apptainer
202+
uses: eWaterCycle/[email protected]
203+
- name: Get container from cache
204+
id: cache-sif
205+
uses: actions/cache@v4
206+
with:
207+
path: .singularity/image.sif
208+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
209+
- name: Get gems and node files from cache
210+
id: cache-bundle-npm
211+
uses: actions/cache@v4
212+
with:
213+
path: |
214+
.home/.gems
215+
node_modules
216+
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
217+
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
218+
name: Build container
219+
run: ./bin/build_container
220+
- name: Generate Go code
221+
run: ./do gen:go

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
.stamps
88
.venv
99
.asciidoctor
10+
.vscode/*
11+
!.vscode/launch.json
1012
.container-type
1113
diag-ditaa-*
1214
arch/manual/isa/**/riscv-isa-manual

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "ext/riscv-isa-manual"]
88
path = ext/riscv-isa-manual
99
url = https://github.com/riscv/riscv-isa-manual
10+
[submodule "ext/riscv-tests"]
11+
path = ext/riscv-tests
12+
url = https://github.com/riscv-software-src/riscv-tests.git

.pre-commit-config.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
exclude: schemas/json-schema-draft-07.json
3131

3232
- repo: https://github.com/python-jsonschema/check-jsonschema
33-
rev: 0.31.3
33+
rev: 0.32.1
3434
hooks:
3535
- id: check-jsonschema
3636
alias: check-jsonschema-inst
@@ -58,6 +58,12 @@ repos:
5858
# files: ^arch/manual/.*\.(yaml|yml)$
5959
# args: ["--schemafile", "schemas/manual_version_schema.json"]
6060

61+
- repo: https://github.com/pre-commit/mirrors-clang-format
62+
rev: "v20.1.0"
63+
hooks:
64+
- id: clang-format
65+
types_or: [c++, c]
66+
files: \.(hpp|cpp)$
6167
- repo: https://github.com/psf/black-pre-commit-mirror
6268
rev: 25.1.0
6369
hooks:
@@ -68,11 +74,14 @@ repos:
6874
hooks:
6975
- id: pyupgrade
7076

71-
# - repo: https://github.com/koalaman/shellcheck-precommit
72-
# rev: v0.10.0
73-
# hooks:
74-
# - id: shellcheck
75-
# args: ["--severity=error"]
77+
- repo: local
78+
hooks:
79+
- id: shellcheck
80+
name: shellcheck
81+
types: [shell]
82+
language: system
83+
entry: shellcheck
84+
args: ["--severity=error"]
7685

7786
- repo: https://github.com/scop/pre-commit-shfmt
7887
rev: v3.11.0-1

.vscode/launch.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,46 @@
2727
"script": "gen:profile[RVA20]",
2828
"args": [],
2929
"askParameters": false
30+
},
31+
{
32+
"type": "cppdbg",
33+
"name": "Run MC100-32 iss",
34+
"request": "launch",
35+
"program": "${workspaceFolder}/gen/cpp_hart_gen/MC100-32_Debug/build/iss",
36+
"setupCommands": [
37+
{
38+
"text": "set output-radix 16",
39+
"description": "Display hex by default"
40+
}
41+
],
42+
"cwd": "${workspaceFolder}",
43+
"args": [
44+
"-m", "MC100-32", "-c",
45+
"${workspaceFolder}/cfgs/mc100-32-full-example.yaml",
46+
"ext/riscv-tests/isa/rv32mi-p-mcsr"
47+
],
48+
"linux": {
49+
"MIMode": "gdb",
50+
"miDebuggerPath": "${workspaceFolder}/bin/gdb"
51+
}
52+
},
53+
{
54+
"type": "cppdbg",
55+
"name": "Run MC100-32 coremark",
56+
"request": "launch",
57+
"program": "${workspaceFolder}/gen/cpp_hart_gen/MC100-32_Debug/build/iss",
58+
"setupCommands": [
59+
{
60+
"text": "set output-radix 16",
61+
"description": "Display hex by default"
62+
}
63+
],
64+
"cwd": "${workspaceFolder}",
65+
"args": ["-m", "MC100-32", "-c", "${workspaceFolder}/cfgs/mc100-32-full-example.yaml", "ext/riscv-coremark/coremark/coremark.bare.riscv"],
66+
"linux": {
67+
"MIMode": "gdb",
68+
"miDebuggerPath": "${workspaceFolder}/bin/gdb"
69+
}
3070
}
3171
]
3272
}

Gemfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ gem "asciidoctor-diagram", "~> 2.2"
99
gem "asciidoctor-pdf"
1010
gem "base64"
1111
gem "bigdecimal"
12+
gem "concurrent-ruby", require: "concurrent"
13+
gem "concurrent-ruby-ext"
1214
gem "json_schemer", "~> 1.0"
13-
gem "minitest"
1415
gem "pygments.rb"
1516
gem "rake", "~> 13.0"
1617
gem "rouge"
@@ -21,10 +22,12 @@ gem "webrick"
2122
gem "yard"
2223

2324
group :development do
25+
gem "awesome_print"
2426
gem "debug"
27+
gem "minitest"
2528
gem "rdbg"
2629
gem "rubocop-minitest"
2730
gem "ruby-prof"
28-
gem "ruby-prof-flamegraph"
31+
gem "ruby-prof-flamegraph", git: "https://github.com/oozou/ruby-prof-flamegraph.git", ref: "fc3c437", require: false
2932
gem "solargraph"
3033
end

0 commit comments

Comments
 (0)