Skip to content

Commit 9443b0d

Browse files
authored
Merge pull request #66 from dau-dev/tkp/548
Bump to 5.048
2 parents 3ee3631 + 9f8466c commit 9443b0d

7 files changed

Lines changed: 48 additions & 11 deletions

File tree

‎Makefile‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
#########
44
.PHONY: develop build build-verilator install dependencies-linux dependencies-macos dependencies-win copy-verilator copy-verilator-win update-verilator-config
55

6+
VERILATOR_CMAKE_ARGS := \
7+
-DCMAKE_CXX_STANDARD=23 \
8+
-DCMAKE_INSTALL_PREFIX=verilator
9+
10+
ifneq ($(OS),Windows_NT)
11+
VERILATOR_CMAKE_ARGS += \
12+
-DFLEX_EXECUTABLE=/usr/bin/flex \
13+
-DFLEX_INCLUDE_DIR=/Library/Developer/CommandLineTools/usr/include
14+
endif
15+
616
develop: ## install dependencies and build library
717
uv pip install -e .[develop]
818

@@ -26,7 +36,7 @@ dependencies-win:
2636

2737
build-verilator: ## build verilator
2838
git submodule update --init --recursive
29-
cmake -B build src -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=verilator
39+
cmake -B build src $(VERILATOR_CMAKE_ARGS)
3040
cmake --build build --config Release -j 3
3141
cmake --install build
3242

@@ -52,16 +62,16 @@ lint-py: ## lint python with ruff
5262
python -m ruff format --check verilator
5363

5464
lint-docs: ## lint docs with mdformat and codespell
55-
python -m mdformat --check README.md
56-
python -m codespell_lib README.md
65+
python -m mdformat --check README.md
66+
python -m codespell_lib README.md
5767

5868
fix-py: ## autoformat python code with ruff
5969
python -m ruff check --fix verilator
6070
python -m ruff format verilator
6171

6272
fix-docs: ## autoformat docs with mdformat and codespell
63-
python -m mdformat README.md
64-
python -m codespell_lib --write README.md
73+
python -m mdformat README.md
74+
python -m codespell_lib --write README.md
6575

6676
lint: lint-py lint-docs ## run all linters
6777
lints: lint

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ verilator-cli build sv/*.sv --includes sv --top-module top --exe sv/sim_sv.cpp
2020
```
2121

2222
## License
23+
2324
This software is licensed under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.
2425

2526
Verilator is Copyright 2003-2026 by Wilson Snyder. Verilator is free software subject to either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.

‎pyproject.toml‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build-system]
22
requires = [
33
"hatchling",
4+
"systemc",
45
]
56
build-backend = "hatchling.build"
67

@@ -12,7 +13,7 @@ authors = [
1213
description = "Python wrapping/binding for verilator"
1314
readme = "README.md"
1415
license = { text = "Apache-2.0" }
15-
version = "5.44.0"
16+
version = "5.48.0"
1617
requires-python = ">=3.10"
1718
keywords = []
1819

@@ -27,7 +28,9 @@ classifiers = [
2728
"Programming Language :: Python :: 3.14",
2829
]
2930

30-
dependencies = []
31+
dependencies = [
32+
"systemc",
33+
]
3134

3235
[project.optional-dependencies]
3336
cli = [
@@ -60,7 +63,7 @@ Repository = "https://github.com/dau-dev/verilator-python"
6063
Homepage = "https://github.com/dau-dev/verilator-python"
6164

6265
[tool.bumpversion]
63-
current_version = "5.44.0"
66+
current_version = "5.48.0"
6467
commit = true
6568
tag = true
6669
commit_args = "-s"
@@ -155,6 +158,11 @@ exclude = [
155158
"/pyproject.toml",
156159
]
157160

161+
[tool.hatch.build.targets.wheel.shared-data]
162+
"verilator/include" = "include/verilator"
163+
"verilator/lib" = "lib/verilator"
164+
"verilator/share" = "share/verilator"
165+
158166
[tool.pytest.ini_options]
159167
addopts = [
160168
"-vvv",

‎src‎

Submodule src updated 9197 files

‎verilator/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "5.44.0"
1+
__version__ = "5.48.0"

‎verilator/cli.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,27 @@ def _get_verilator() -> str:
2424
verilator_exe = str((verilator_root / "bin" / "verilator").resolve())
2525
environ["VERILATOR_ROOT"] = str(verilator_root.as_posix())
2626
environ["CXXFLAGS"] = environ.get("CXXFLAGS", "--std=c++20 -DVL_TIME_CONTEXT")
27+
_set_systemc_env()
2728
return verilator_exe
2829

2930

31+
def _set_systemc_env() -> None:
32+
"""Point Verilator at the bundled ``systemc`` Python package's headers/libs.
33+
34+
Resolved at runtime so the paths are correct regardless of where ``systemc``
35+
was installed during the build (build isolation, different venvs, etc.).
36+
Existing ``SYSTEMC_INCLUDE`` / ``SYSTEMC_LIBDIR`` env vars take precedence.
37+
"""
38+
if environ.get("SYSTEMC_INCLUDE") and environ.get("SYSTEMC_LIBDIR"):
39+
return
40+
try:
41+
import systemc
42+
except ImportError:
43+
return
44+
environ.setdefault("SYSTEMC_INCLUDE", systemc.include_path())
45+
environ.setdefault("SYSTEMC_LIBDIR", systemc.lib_path())
46+
47+
3048
def verilator(argv):
3149
build_cmd = [
3250
_get_verilator(),

‎verilator/tests/module/ff_tb.sv‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ program ff_tb(ff_ifc.bench ds);
2323

2424
/* begin testing */
2525
repeat(v.iter) begin
26-
int _ = v.randomize();
26+
static int _ = v.randomize();
2727

2828
ds.reset = 1'b0;
2929
ds.valid_i = 1'b1;

0 commit comments

Comments
 (0)