Skip to content

Commit 13d18df

Browse files
committed
Bump pythondata_cpu_sentinel/sources subtree to 2dbf6cf
Updated using 0.0.post152 from https://github.com/litex-hub/litex-data-auto git-subtree-dir: pythondata_cpu_sentinel/sources git-subtree-mainline: 29e86a5 git-subtree-split: 2dbf6cf
2 parents 29e86a5 + 2dbf6cf commit 13d18df

File tree

196 files changed

+33385
-0
lines changed

Some content is hidden

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

196 files changed

+33385
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[build]
2+
target="riscv32i-unknown-none-elf"
3+
4+
[target.riscv32i-unknown-none-elf]
5+
rustflags = [
6+
"-C", "link-arg=--threads=1", # --threads=1 fixes Windows issue: https://github.com/rust-lang/rust/issues/115985
7+
"-C", "link-arg=-Tsentinel-rt/examples/device.x"
8+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
"schedule:weekly",
6+
"group:all",
7+
":approveMajorUpdates"
8+
],
9+
"baseBranches": ["main", "next"]
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
on:
2+
push:
3+
branches-ignore:
4+
- update-yosys-*
5+
- renovate/*
6+
tags:
7+
- v*
8+
pull_request:
9+
10+
name: CI
11+
12+
# TODO: Print outputs on failing steps. This can be done with something like:
13+
# gzip -c cover.vcd | base64 | base64 -d | gunzip > cover-out.vcd
14+
15+
jobs:
16+
ci-quickstart:
17+
name: Minimal Dependencies Check
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.11"
24+
- uses: pdm-project/setup-pdm@v4
25+
with:
26+
python-version: 3.11
27+
cache: false
28+
- uses: dtolnay/rust-toolchain@stable
29+
with:
30+
targets: riscv32i-unknown-none-elf
31+
# Simulate installing Amaranth with builtin-yosys outside of PDM.
32+
- name: Install Minimal Deps
33+
run: |
34+
pdm run python -m ensurepip
35+
pdm run python -m pip install amaranth[builtin-yosys]
36+
pdm install --prod
37+
# Test code gen both within and outside a PDM script.
38+
- name: Test Generate Verilog with Minimal Deps
39+
run: |
40+
pdm run python -m sentinel.gen -o sentinel-direct.v
41+
pdm gen -o sentinel-pdm.v
42+
- name: Test Import
43+
run: pdm run python -c 'from sentinel.top import Top'
44+
- name: Install PDM Demo Groups and Prepare YoWASP
45+
run: |
46+
pdm install -G examples -G yowasp
47+
pdm use-yowasp
48+
- name: Check Demo Bitstream Generation with Minimal Deps
49+
run: |
50+
pdm demo -i csr -p ice40_hx8k_b_evn
51+
pdm demo-rust -i csr -p ice40_hx8k_b_evn
52+
53+
ci-basic:
54+
name: Basic CI Check
55+
strategy:
56+
matrix:
57+
os: [ubuntu-latest]
58+
runs-on: ${{ matrix.os }}
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: actions/setup-python@v5
63+
with:
64+
python-version: "3.11"
65+
- uses: pdm-project/setup-pdm@v4
66+
with:
67+
python-version: 3.11
68+
cache: true
69+
- uses: dtolnay/rust-toolchain@stable
70+
with:
71+
targets: riscv32i-unknown-none-elf
72+
# GCC already installed.
73+
# - name: Install riscv64 GCC (for tests) and x64 GCC Linker Driver (for Rust)
74+
# run: sudo apt install -y gcc-riscv64-unknown-elf gcc
75+
- name: Install riscv64 GCC (for tests)
76+
run: sudo apt install -y gcc-riscv64-unknown-elf
77+
- name: Set oss-cad-suite vars (for cache)
78+
run: |
79+
echo >> $GITHUB_ENV OSS_CAD_SUITE_DATE=$(cat ci/oss-cad-suite-version)
80+
- name: Cache OSS CAD Suite
81+
id: cache-oss-cad-suite
82+
uses: actions/cache@v4
83+
with:
84+
path: ~/cache/
85+
key: ${{ runner.os }}-${{ env.OSS_CAD_SUITE_DATE }}
86+
- name: Download OSS CAD Suite
87+
if: steps.cache-oss-cad-suite.outputs.cache-hit != 'true'
88+
run: |
89+
mkdir -p ~/cache/oss-cad-suite-linux-x64
90+
wget https://github.com/YosysHQ/oss-cad-suite-build/releases/download/$OSS_CAD_SUITE_DATE/oss-cad-suite-linux-x64-$(echo $OSS_CAD_SUITE_DATE | sed s/-//g).tgz -nv -O oss-cad-suite-linux-x64.tar.gz
91+
tar -xzf oss-cad-suite-linux-x64.tar.gz -C ~/cache/oss-cad-suite-linux-x64
92+
- name: Set OSS CAD Suite path
93+
run: echo >> $GITHUB_PATH `echo ~/cache/oss-cad-suite-linux-x64/*/bin`
94+
- name: Install PDM dependencies
95+
run: pdm install -G examples -G dev
96+
- name: Lint
97+
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
98+
run: |
99+
pdm install -G lint
100+
pdm run lint
101+
- name: Build docs
102+
# ReadTheDocs handles docs, this is more of a lint than anything.
103+
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
104+
run: |
105+
pdm install -G doc
106+
pdm run doc
107+
pdm run doc-test
108+
- name: Check links
109+
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
110+
continue-on-error: true
111+
run: |
112+
pdm install -G doc
113+
pdm run doc-linkck
114+
- name: Run Pytest/Doc Tests
115+
run: |
116+
pdm test-quick
117+
- name: Test Generate Verilog
118+
# LD_PRELOAD, which GHA seems to set by default, interferes with
119+
# oss-cad-suite setup by mixing incompatible libcs, so unset it
120+
# for any commands requiring yosys/nextpnr.
121+
run: |
122+
LD_PRELOAD="" pdm gen -o sentinel.v
123+
# Test that the following generates correctly:
124+
# 1. IceStick, Wishbone Periphs, Default demo. This is also
125+
# benchmarked in the next step separately.
126+
# 2. HX8K Eval, CSR Periphs, Rust demo
127+
- name: Check Gateware Generation
128+
run: |
129+
LD_PRELOAD="" pdm demo -n
130+
LD_PRELOAD="" pdm demo-rust -n -p ice40_hx8k_b_evn -i csr
131+
# Get an idea of whether the full default prime-counting firmware
132+
# demo fits into 1280 LUTs or exceeds it a bit. This also
133+
# checks whether a demo bitstream build was successful.
134+
#
135+
# I will remove continue-on-error once I'm confident the demo
136+
# fits into 1280 LUTs on more than just my machines (*nix/Win).
137+
# HINT: abc compiled with clang seems to optimize worse than abc
138+
# compiled with gcc, regardless of OS.
139+
- name: Benchmark Demo Bitstream
140+
continue-on-error: true
141+
run: |
142+
LD_PRELOAD="" pdm bench-luts
143+
144+
ci-riscof:
145+
name: RISCOF Check
146+
runs-on: ubuntu-latest
147+
steps:
148+
- uses: actions/checkout@v4
149+
- uses: actions/setup-python@v5
150+
with:
151+
python-version: "3.11"
152+
- uses: pdm-project/setup-pdm@v4
153+
with:
154+
python-version: 3.11
155+
cache: true
156+
- name: Install riscv64 GCC (for tests)
157+
run: sudo apt install -y gcc-riscv64-unknown-elf
158+
- name: Set oss-cad-suite vars (for cache)
159+
run: |
160+
echo >> $GITHUB_ENV OSS_CAD_SUITE_DATE=$(cat ci/oss-cad-suite-version)
161+
- name: Cache OSS CAD Suite
162+
id: cache-oss-cad-suite
163+
uses: actions/cache@v4
164+
with:
165+
path: ~/cache/
166+
key: ${{ runner.os }}-${{ env.OSS_CAD_SUITE_DATE }}
167+
- name: Download OSS CAD Suite
168+
if: steps.cache-oss-cad-suite.outputs.cache-hit != 'true'
169+
run: |
170+
mkdir -p ~/cache/oss-cad-suite-linux-x64
171+
wget https://github.com/YosysHQ/oss-cad-suite-build/releases/download/$OSS_CAD_SUITE_DATE/oss-cad-suite-linux-x64-$(echo $OSS_CAD_SUITE_DATE | sed s/-//g).tgz -nv -O oss-cad-suite-linux-x64.tar.gz
172+
tar -xzf oss-cad-suite-linux-x64.tar.gz -C ~/cache/oss-cad-suite-linux-x64
173+
- name: Set OSS CAD Suite path
174+
run: echo >> $GITHUB_PATH `echo ~/cache/oss-cad-suite-linux-x64/*/bin`
175+
- name: Install PDM dependencies
176+
run: pdm install -G dev -G riscof
177+
- name: Run RISCOF Suite
178+
run: |
179+
LD_PRELOAD="" pdm riscof-all
180+
181+
ci-rvformal:
182+
name: RISC-V Formal Check
183+
runs-on: ubuntu-latest
184+
185+
steps:
186+
- uses: actions/checkout@v4
187+
- uses: actions/setup-python@v5
188+
with:
189+
python-version: "3.11"
190+
- uses: pdm-project/setup-pdm@v4
191+
with:
192+
python-version: 3.11
193+
cache: true
194+
- name: Install riscv64 GCC (for tests)
195+
run: sudo apt install -y gcc-riscv64-unknown-elf
196+
- name: Set oss-cad-suite vars (for cache)
197+
run: |
198+
echo >> $GITHUB_ENV OSS_CAD_SUITE_DATE=$(cat ci/oss-cad-suite-version)
199+
- name: Cache OSS CAD Suite
200+
id: cache-oss-cad-suite
201+
uses: actions/cache@v4
202+
with:
203+
path: ~/cache/
204+
key: ${{ runner.os }}-${{ env.OSS_CAD_SUITE_DATE }}
205+
- name: Download OSS CAD Suite
206+
if: steps.cache-oss-cad-suite.outputs.cache-hit != 'true'
207+
run: |
208+
mkdir -p ~/cache/oss-cad-suite-linux-x64
209+
wget https://github.com/YosysHQ/oss-cad-suite-build/releases/download/$OSS_CAD_SUITE_DATE/oss-cad-suite-linux-x64-$(echo $OSS_CAD_SUITE_DATE | sed s/-//g).tgz -nv -O oss-cad-suite-linux-x64.tar.gz
210+
tar -xzf oss-cad-suite-linux-x64.tar.gz -C ~/cache/oss-cad-suite-linux-x64
211+
- name: Set OSS CAD Suite path
212+
run: echo >> $GITHUB_PATH `echo ~/cache/oss-cad-suite-linux-x64/*/bin`
213+
- name: Install PDM dependencies
214+
run: pdm install -G dev
215+
- name: Run RISC-V Formal
216+
run: |
217+
LD_PRELOAD="" pdm rvformal-all
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
workflow_dispatch:
3+
schedule:
4+
- cron: '0 5 1 * *'
5+
6+
name: Update Yosys (and OSS Cad Suite)
7+
8+
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
9+
jobs:
10+
update:
11+
name: Update OSS Cad Suite Version
12+
strategy:
13+
matrix:
14+
branch: [main, next]
15+
os: [ubuntu-latest]
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
ref: ${{ matrix.branch }}
22+
23+
# Yesterday, because CAD suite versions are made at the end of the
24+
# night.
25+
- name: Update OSS CAD Suite version file (and save new value)
26+
run: |
27+
date -d today +%Y-%m-%d > ci/oss-cad-suite-version
28+
echo >> $GITHUB_ENV OSS_CAD_SUITE_DATE=$(cat ci/oss-cad-suite-version)
29+
if [ ${{ github.event_name }} = "workflow_dispatch" ]; then
30+
echo >> $GITHUB_ENV PR_REASON="Manual update"
31+
else
32+
echo >> $GITHUB_ENV PR_REASON="Monthly update"
33+
fi
34+
35+
- name: Create Pull Request
36+
id: cpr
37+
uses: peter-evans/create-pull-request@v6
38+
with:
39+
token: ${{ secrets.PAT }}
40+
commit-message: Update OSS CAD Suite version to ${{ env.OSS_CAD_SUITE_DATE }}.
41+
committer: GitHub <[email protected]>
42+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
43+
signoff: false
44+
branch: update-yosys-${{ env.OSS_CAD_SUITE_DATE }}-${{ matrix.branch }}
45+
delete-branch: true
46+
base: ${{ matrix.branch }}
47+
title: Update OSS CAD Suite version to ${{ env.OSS_CAD_SUITE_DATE }}.
48+
body: |
49+
${{ env.PR_REASON }}; auto-generated by [create-pull-request][1].
50+
51+
[1]: https://github.com/peter-evans/create-pull-request
52+
labels: |
53+
automated pr
54+
assignees: cr1901
55+
draft: false
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Python
2+
__pycache__/
3+
*.egg-info
4+
/dist
5+
6+
# pdm
7+
/.pdm-plugins
8+
/.pdm-python
9+
/.venv
10+
# Part of dynamic version generation.
11+
/src/sentinel/version.txt
12+
13+
# pytest
14+
/.pytest_cache
15+
16+
# Amaranth
17+
/build*
18+
19+
# GtkWave
20+
*.vcd
21+
*.gtkw
22+
23+
# Doit
24+
.doit.db.*
25+
26+
# logluts
27+
/LUTs.csv
28+
29+
# m5meta
30+
*.asm*.fdef
31+
*.asm*.hex
32+
33+
# Yosys
34+
/abc.history
35+
36+
# RVFormal disassembled counterexamples
37+
*.s
38+
39+
# YoWASP setup
40+
.env.toolchain
41+
42+
# Added by cargo
43+
44+
/target
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[submodule "tests/upstream/riscv-tests"]
2+
path = tests/upstream/riscv-tests
3+
url = https://github.com/riscv/riscv-tests
4+
[submodule "tests/formal/riscv-formal"]
5+
path = tests/formal/riscv-formal
6+
url = https://github.com/YosysHQ/riscv-formal
7+
[submodule "tests/riscof/sail-riscv"]
8+
path = tests/riscof/sail-riscv
9+
url = https://github.com/riscv/sail-riscv.git
10+
[submodule "tests/riscof/riscv-arch-test"]
11+
path = tests/riscof/riscv-arch-test
12+
url = https://github.com/riscv-non-isa/riscv-arch-test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.12"
12+
# You can also specify other tool versions:
13+
# nodejs: "20"
14+
# rust: "1.70"
15+
# golang: "1.20"
16+
jobs:
17+
post_checkout:
18+
# Reconstruct tags.
19+
- git fetch --unshallow --tags
20+
post_create_environment:
21+
# Install PDM
22+
- pip install -U pdm
23+
post_install:
24+
# See:
25+
# * https://github.com/readthedocs/readthedocs.org/pull/11152/
26+
# * https://github.com/pdm-project/pdm/pull/2736/files#diff-03efc769b870804394632e45d7885272b44c16939517fb31c9d7c614d2ffae57
27+
# * and https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
28+
# This replaces requirements.txt specified in: https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
29+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH pdm install -G doc -G examples
30+
31+
# Build documentation in the "docs/" directory with Sphinx
32+
sphinx:
33+
configuration: doc/conf.py
34+
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
35+
# builder: "dirhtml"
36+
# Fail on all warnings to avoid broken references
37+
# fail_on_warning: true
38+
39+
# Optionally build your docs in additional formats such as PDF and ePub
40+
# formats:
41+
# - pdf
42+
# - epub

0 commit comments

Comments
 (0)