-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
123 lines (112 loc) · 4.17 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[project]
name = "sentinel"
description = "Embedded RISC-V implementation written in Amaranth"
authors = [
{name = "William D. Jones", email = "[email protected]"},
]
dependencies = [
"m5meta>=1.0.4",
"m5pre>=1.0.3",
"amaranth @ git+https://github.com/amaranth-lang/amaranth",
]
requires-python = ">=3.11"
readme = "README.md"
license = {text = "MIT"}
dynamic = ["version"]
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pytest.ini_options]
pythonpath = [
"src/",
]
markers = [
"clks: tuple of clocks to register for simulator.",
"module: top-level module to simulate.",
"soc: run SoC simulations."
]
addopts="--ignore=tests/upstream/binaries"
[tool.pyright]
reportInvalidTypeForm = false
[tool.pdm.version]
source = "scm"
write_to = "sentinel/version.txt"
[tool.pdm.dev-dependencies]
dev = [
"amaranth-soc @ git+https://github.com/amaranth-lang/amaranth-soc",
"bronzebeard>=0.2.1",
"flake8>=6.1.0",
"pytest>=7.4.2",
"doit>=0.36.0",
"Verilog-VCD>=1.11",
"logLUTs @ git+https://github.com/mattvenn/logLUTs@a7fa902",
"click>=8.1.7", # Though I expect users to provide sby, sby requires
# this module and doesn't opt-in to PEP 517. So provide
# it here.
]
examples = [
"amaranth-soc @ git+https://github.com/amaranth-lang/amaranth-soc",
"bronzebeard>=0.2.1",
"amaranth-boards @ git+https://github.com/amaranth-lang/amaranth-boards",
"tabulate>=0.9.0",
"pyelftools>=0.26",
]
riscof = [
"riscof>=1.25.3",
]
remote = [
"amaranth[remote-build] @ git+https://github.com/amaranth-lang/amaranth",
"paramiko~=2.7"
]
[tool.pdm.scripts]
lint = { cmd = "flake8", help="lint python sources" }
# Most Tests
test = { cmd = "pytest", help="run all pytest tests" }
# Generate
gen = { call = "sentinel.gen:generate", help="generate Sentinel Verilog file" }
# Demo
# PDM "does the right thing" here; specifying "python " interpreter not required:
# https://github.com/pdm-project/pdm/blob/73651b7a948679d31f4d00e8b14c8a51009126e8/src/pdm/cli/commands/run.py#L179
demo = { cmd = "examples/attosoc.py", help="create AttoSoC Sentinel demo bitstream" }
demo-rust = { composite = [
"_rust-firmware",
"demo -g target/riscv32i-unknown-none-elf/release/examples/attosoc -b build-rust {args}"
], help = "create AttoSoC Sentinel demo bitstream (Rust version)"}
# DoIt wrappers. Prefer using these over running DoIt directly.
doit = { cmd = "doit", help="escape hatch to call doit directly" }
ucode = { cmd = "doit ucode", help="generate supplementary microcode files" }
# LUTs
bench-luts = { cmd = "doit bench_luts", help="add stats to LUTs.csv" }
plot-luts = { cmd = "doit plot_luts", help="plot LUTs.csv" }
# Upstream
compile-upstream = { cmd = "doit compile_upstream", help="regnerate riscv-test binaries" }
# RISC-V Formal
rvformal = { cmd = "doit run_sby:{args}", help="run a single RISC-V Formal test" }
# Not clear to me that this is still required after refactors.
rvformal-force = { composite = [
"doit forget run_sby:{args}",
"rvformal {args}"
], help="force-run a single RISC-V Formal test"}
rvformal-all = { composite = [
"doit run_sby:setup", # serially generate RISC-V Formal files to avoid race condition
"doit {args:-n 2} run_sby"
], help="run all RISC-V Formal tests" }
# RISCOF
riscof-all = { cmd = "doit run_riscof", help="run all RISCOF tests"}
[tool.pdm.scripts.test-quick]
cmd = "pytest -k \"test_top or test_upstream or test_witness\""
help = "run quick subset of pytest tests"
[tool.pdm.scripts._rust-firmware]
cmd = "cargo build -p sentinel-rt --release --target=riscv32i-unknown-none-elf --example=attosoc"
# --threads=1 fixes Windows issue: https://github.com/rust-lang/rust/issues/115985
env = { RUSTFLAGS="-C link-arg=--threads=1 -C link-arg=-Tsentinel-rt/examples/device.x" }
help = "compile sentinel-rt demo firmware for AttoSoC"
[tool.pdm.scripts.rvformal-status]
cmd = "doit list_sby_status:{args}"
help="list a single RISC-V Formal test's status"
[tool.pdm.scripts.rvformal-status-all]
cmd = "doit list_sby_status"
help="list all RISC-V Formal tests' status"
[tool.pdm.scripts.riscof-override]
cmd = "doit run_riscof -t {args}"
help = "run RISCOF with custom testfile"