peakrdl-busdecoder 0.6.4__tar.gz → 0.6.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/workflows/typecheck.yml +2 -2
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/PKG-INFO +1 -1
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/configuring.rst +1 -1
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/licensing.rst +1 -1
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/pyproject.toml +6 -9
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/__peakrdl__.py +4 -2
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb3/apb3_cpuif.py +23 -12
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb3/apb3_cpuif_flat.py +19 -9
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb3/apb3_tmpl.sv +2 -2
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb4/apb4_cpuif.py +23 -11
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb4/apb4_cpuif_flat.py +19 -10
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb4/apb4_tmpl.sv +2 -2
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif.py +20 -8
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif_flat.py +16 -6
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/base_cpuif.py +11 -11
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/fanin_gen.py +15 -7
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/interface.py +1 -1
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/exporter.py +5 -5
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/utils.py +0 -1
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/validate_design.py +3 -1
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder.egg-info/PKG-INFO +1 -1
- peakrdl_busdecoder-0.6.6/uv.lock +1429 -0
- peakrdl_busdecoder-0.6.4/uv.lock +0 -1328
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.devcontainer/Dockerfile +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.devcontainer/devcontainer.json +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/ISSUE_TEMPLATE/question.md +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/pull_request_template.md +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/workflows/build.yml +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/workflows/docs.yml +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/workflows/format.yml +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/workflows/lint.yml +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/workflows/release.yml +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.github/workflows/test.yml +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.gitignore +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/.readthedocs.yaml +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/CONTRIBUTING.md +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/LICENSE +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/MANIFEST.in +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/README.md +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/Makefile +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/api.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/architecture.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/conf.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/cpuif/apb.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/cpuif/avalon.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/cpuif/axi4lite.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/cpuif/customizing.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/cpuif/internal_protocol.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/cpuif/introduction.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/cpuif/passthrough.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/Alpha-Beta Versioning +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/Hierarchy-and-Indexing +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/Program Flow +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/Resets +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/Signal Dereferencer +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/Validation Needed +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/template-layers/1-port-declaration +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/template-layers/1.1.hardware-interface +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/template-layers/2-CPUIF +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/template-layers/3-address-decode +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/template-layers/4-fields +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/template-layers/5-readback-mux +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/dev_notes/template-layers/6-output-port-mapping +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/diagrams/arch.png +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/diagrams/diagrams.odg +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/diagrams/rbuf.png +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/diagrams/readback.png +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/diagrams/wbuf.png +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/faq.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/hwif.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/img/err.svg +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/img/ok.svg +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/img/warn.svg +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/index.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/limitations.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/props/addrmap.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/props/field.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/props/reg.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/props/rhs_props.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/props/signal.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/rdl_features/external.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/requirements.txt +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/docs/udps/intro.rst +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/hdl-src/README.md +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/hdl-src/apb3_intf.sv +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/hdl-src/apb4_intf.sv +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/hdl-src/avalon_mm_intf.sv +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/hdl-src/axi4lite_intf.sv +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/setup.cfg +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/body/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/body/body.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/body/combinational_body.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/body/for_loop_body.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/body/if_body.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/body/struct_body.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb3/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb3/apb3_interface.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb4/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb4/apb4_interface.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/axi4lite/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_interface.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_tmpl.sv +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/fanin_intermediate_gen.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/fanout_gen.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/decode_logic_gen.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/design_scanner.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/design_state.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/identifier_filter.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/listener.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/module_tmpl.sv +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/package_tmpl.sv +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/py.typed +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/struct_gen.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/sv_int.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/udps/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder.egg-info/SOURCES.txt +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder.egg-info/dependency_links.txt +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder.egg-info/entry_points.txt +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder.egg-info/requires.txt +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder.egg-info/top_level.txt +0 -0
- {peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/tools/shims/xargs +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.. _peakrdl_cfg:
|
|
2
2
|
|
|
3
3
|
Configuring PeakRDL-BusDecoder
|
|
4
|
-
|
|
4
|
+
==============================
|
|
5
5
|
|
|
6
6
|
If using the `PeakRDL command line tool <https://peakrdl.readthedocs.io/>`_,
|
|
7
7
|
some aspects of the ``busdecoder`` command have additional configuration options
|
|
@@ -15,7 +15,7 @@ be contrary to this project's philosophy.
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
What is covered by the LGPL v3 license?
|
|
18
|
-
|
|
18
|
+
---------------------------------------
|
|
19
19
|
The LGPL license is intended for the code generator itself. This includes all
|
|
20
20
|
Python sources, Jinja template files, as well as testcase infrastructure not
|
|
21
21
|
explicitly mentioned in the exemptions below.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "peakrdl-busdecoder"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.6"
|
|
8
8
|
requires-python = ">=3.10"
|
|
9
9
|
dependencies = [
|
|
10
10
|
"jinja2~=3.1",
|
|
@@ -65,7 +65,7 @@ test = [
|
|
|
65
65
|
"cocotb>=1.8.0",
|
|
66
66
|
"cocotb-bus>=0.2.1",
|
|
67
67
|
]
|
|
68
|
-
tools = ["
|
|
68
|
+
tools = ["ty>=0.0.7", "ruff>=0.14.0"]
|
|
69
69
|
|
|
70
70
|
[project.entry-points."peakrdl.exporters"]
|
|
71
71
|
busdecoder = "peakrdl_busdecoder.__peakrdl__:Exporter"
|
|
@@ -100,15 +100,12 @@ ignore = [
|
|
|
100
100
|
quote-style = "double"
|
|
101
101
|
indent-style = "space"
|
|
102
102
|
|
|
103
|
-
# ----------------------
|
|
104
|
-
[tool.
|
|
103
|
+
# ---------------------- TY ----------------------
|
|
104
|
+
[tool.ty.environment]
|
|
105
105
|
python-version = "3.10"
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
project-includes = ["src/**/*"]
|
|
111
|
-
project-excludes = ["**/__pycache__", "**/*venv/**/*"]
|
|
107
|
+
[tool.ty.src]
|
|
108
|
+
include = ["src"]
|
|
112
109
|
|
|
113
110
|
# ---------------------- PYTEST ----------------------
|
|
114
111
|
[tool.pytest.ini_options]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import functools
|
|
2
4
|
from typing import TYPE_CHECKING, Any
|
|
3
5
|
|
|
@@ -69,7 +71,7 @@ class Exporter(ExporterSubcommandPlugin):
|
|
|
69
71
|
def get_cpuifs(self) -> dict[str, type[BaseCpuif]]:
|
|
70
72
|
return get_cpuifs(map(tuple, self.cfg["cpuifs"].items()))
|
|
71
73
|
|
|
72
|
-
def add_exporter_arguments(self, arg_group:
|
|
74
|
+
def add_exporter_arguments(self, arg_group: argparse._ActionsContainer) -> None:
|
|
73
75
|
cpuifs = self.get_cpuifs()
|
|
74
76
|
|
|
75
77
|
arg_group.add_argument(
|
|
@@ -122,7 +124,7 @@ class Exporter(ExporterSubcommandPlugin):
|
|
|
122
124
|
""",
|
|
123
125
|
)
|
|
124
126
|
|
|
125
|
-
def do_export(self, top_node:
|
|
127
|
+
def do_export(self, top_node: AddrmapNode, options: argparse.Namespace) -> None:
|
|
126
128
|
cpuifs = self.get_cpuifs()
|
|
127
129
|
|
|
128
130
|
x = BusDecoderExporter()
|
|
@@ -45,42 +45,53 @@ class APB3Cpuif(BaseCpuif):
|
|
|
45
45
|
fanout[self.signal("PADDR", node, "gi")] = self.signal("PADDR")
|
|
46
46
|
fanout[self.signal("PWDATA", node, "gi")] = "cpuif_wr_data"
|
|
47
47
|
|
|
48
|
-
return "\n".join(
|
|
48
|
+
return "\n".join(f"assign {kv[0]} = {kv[1]};" for kv in fanout.items())
|
|
49
49
|
|
|
50
|
-
def
|
|
50
|
+
def fanin_wr(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
51
51
|
fanin: dict[str, str] = {}
|
|
52
52
|
if node is None:
|
|
53
|
-
fanin["
|
|
54
|
-
fanin["
|
|
53
|
+
fanin["cpuif_wr_ack"] = "'0"
|
|
54
|
+
fanin["cpuif_wr_err"] = "'0"
|
|
55
|
+
if error:
|
|
56
|
+
fanin["cpuif_wr_ack"] = "'1"
|
|
57
|
+
fanin["cpuif_wr_err"] = "cpuif_wr_sel.cpuif_err"
|
|
55
58
|
else:
|
|
56
59
|
# Use intermediate signals for interface arrays to avoid
|
|
57
60
|
# non-constant indexing of interface arrays in procedural blocks
|
|
58
61
|
if self.is_interface and node.is_array and node.array_dimensions:
|
|
59
62
|
# Generate array index string [i0][i1]... for the intermediate signal
|
|
60
63
|
array_idx = "".join(f"[i{i}]" for i in range(len(node.array_dimensions)))
|
|
61
|
-
fanin["
|
|
62
|
-
fanin["
|
|
64
|
+
fanin["cpuif_wr_ack"] = f"{node.inst_name}_fanin_ready{array_idx}"
|
|
65
|
+
fanin["cpuif_wr_err"] = f"{node.inst_name}_fanin_err{array_idx}"
|
|
63
66
|
else:
|
|
64
|
-
fanin["
|
|
65
|
-
fanin["
|
|
66
|
-
|
|
67
|
-
return "\n".join(map(lambda kv: f"{kv[0]} = {kv[1]};", fanin.items()))
|
|
67
|
+
fanin["cpuif_wr_ack"] = self.signal("PREADY", node, "i")
|
|
68
|
+
fanin["cpuif_wr_err"] = self.signal("PSLVERR", node, "i")
|
|
69
|
+
return "\n".join(f"{kv[0]} = {kv[1]};" for kv in fanin.items())
|
|
68
70
|
|
|
69
|
-
def
|
|
71
|
+
def fanin_rd(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
70
72
|
fanin: dict[str, str] = {}
|
|
71
73
|
if node is None:
|
|
74
|
+
fanin["cpuif_rd_ack"] = "'0"
|
|
75
|
+
fanin["cpuif_rd_err"] = "'0"
|
|
72
76
|
fanin["cpuif_rd_data"] = "'0"
|
|
77
|
+
if error:
|
|
78
|
+
fanin["cpuif_rd_ack"] = "'1"
|
|
79
|
+
fanin["cpuif_rd_err"] = "cpuif_rd_sel.cpuif_err"
|
|
73
80
|
else:
|
|
74
81
|
# Use intermediate signals for interface arrays to avoid
|
|
75
82
|
# non-constant indexing of interface arrays in procedural blocks
|
|
76
83
|
if self.is_interface and node.is_array and node.array_dimensions:
|
|
77
84
|
# Generate array index string [i0][i1]... for the intermediate signal
|
|
78
85
|
array_idx = "".join(f"[i{i}]" for i in range(len(node.array_dimensions)))
|
|
86
|
+
fanin["cpuif_rd_ack"] = f"{node.inst_name}_fanin_ready{array_idx}"
|
|
87
|
+
fanin["cpuif_rd_err"] = f"{node.inst_name}_fanin_err{array_idx}"
|
|
79
88
|
fanin["cpuif_rd_data"] = f"{node.inst_name}_fanin_data{array_idx}"
|
|
80
89
|
else:
|
|
90
|
+
fanin["cpuif_rd_ack"] = self.signal("PREADY", node, "i")
|
|
91
|
+
fanin["cpuif_rd_err"] = self.signal("PSLVERR", node, "i")
|
|
81
92
|
fanin["cpuif_rd_data"] = self.signal("PRDATA", node, "i")
|
|
82
93
|
|
|
83
|
-
return "\n".join(
|
|
94
|
+
return "\n".join(f"{kv[0]} = {kv[1]};" for kv in fanin.items())
|
|
84
95
|
|
|
85
96
|
def fanin_intermediate_assignments(
|
|
86
97
|
self, node: AddressableNode, inst_name: str, array_idx: str, master_prefix: str, indexed_path: str
|
|
@@ -51,24 +51,34 @@ class APB3CpuifFlat(BaseCpuif):
|
|
|
51
51
|
fanout[self.signal("PADDR", node, "gi")] = f"{{{'-'.join(addr_comp)}}}[{clog2(node.size) - 1}:0]"
|
|
52
52
|
fanout[self.signal("PWDATA", node, "gi")] = "cpuif_wr_data"
|
|
53
53
|
|
|
54
|
-
return "\n".join(
|
|
54
|
+
return "\n".join(f"assign {kv[0]} = {kv[1]};" for kv in fanout.items())
|
|
55
55
|
|
|
56
|
-
def
|
|
56
|
+
def fanin_wr(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
57
57
|
fanin: dict[str, str] = {}
|
|
58
58
|
if node is None:
|
|
59
|
-
fanin["
|
|
60
|
-
fanin["
|
|
59
|
+
fanin["cpuif_wr_ack"] = "'0"
|
|
60
|
+
fanin["cpuif_wr_err"] = "'0"
|
|
61
|
+
if error:
|
|
62
|
+
fanin["cpuif_wr_ack"] = "'1"
|
|
63
|
+
fanin["cpuif_wr_err"] = "cpuif_wr_sel.cpuif_err"
|
|
61
64
|
else:
|
|
62
|
-
fanin["
|
|
63
|
-
fanin["
|
|
65
|
+
fanin["cpuif_wr_ack"] = self.signal("PREADY", node, "i")
|
|
66
|
+
fanin["cpuif_wr_err"] = self.signal("PSLVERR", node, "i")
|
|
64
67
|
|
|
65
|
-
return "\n".join(
|
|
68
|
+
return "\n".join(f"{kv[0]} = {kv[1]};" for kv in fanin.items())
|
|
66
69
|
|
|
67
|
-
def
|
|
70
|
+
def fanin_rd(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
68
71
|
fanin: dict[str, str] = {}
|
|
69
72
|
if node is None:
|
|
73
|
+
fanin["cpuif_rd_ack"] = "'0"
|
|
74
|
+
fanin["cpuif_rd_err"] = "'0"
|
|
70
75
|
fanin["cpuif_rd_data"] = "'0"
|
|
76
|
+
if error:
|
|
77
|
+
fanin["cpuif_rd_ack"] = "'1"
|
|
78
|
+
fanin["cpuif_rd_err"] = "cpuif_rd_sel.cpuif_err"
|
|
71
79
|
else:
|
|
80
|
+
fanin["cpuif_rd_ack"] = self.signal("PREADY", node, "i")
|
|
81
|
+
fanin["cpuif_rd_err"] = self.signal("PSLVERR", node, "i")
|
|
72
82
|
fanin["cpuif_rd_data"] = self.signal("PRDATA", node, "i")
|
|
73
83
|
|
|
74
|
-
return "\n".join(
|
|
84
|
+
return "\n".join(f"{kv[0]} = {kv[1]};" for kv in fanin.items())
|
{peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb3/apb3_tmpl.sv
RENAMED
|
@@ -19,8 +19,8 @@ assign cpuif_rd_addr = {{cpuif.signal("PADDR")}};
|
|
|
19
19
|
assign cpuif_wr_data = {{cpuif.signal("PWDATA")}};
|
|
20
20
|
|
|
21
21
|
assign {{cpuif.signal("PRDATA")}} = cpuif_rd_data;
|
|
22
|
-
assign {{cpuif.signal("PREADY")}} = cpuif_rd_ack;
|
|
23
|
-
assign {{cpuif.signal("PSLVERR")}} = cpuif_rd_err |
|
|
22
|
+
assign {{cpuif.signal("PREADY")}} = cpuif_rd_ack | cpuif_wr_ack;
|
|
23
|
+
assign {{cpuif.signal("PSLVERR")}} = cpuif_rd_err | cpuif_wr_err;
|
|
24
24
|
|
|
25
25
|
//--------------------------------------------------------------------------
|
|
26
26
|
// Fanout CPU Bus interface signals
|
|
@@ -48,42 +48,54 @@ class APB4Cpuif(BaseCpuif):
|
|
|
48
48
|
fanout[self.signal("PWDATA", node, "gi")] = "cpuif_wr_data"
|
|
49
49
|
fanout[self.signal("PSTRB", node, "gi")] = "cpuif_wr_byte_en"
|
|
50
50
|
|
|
51
|
-
return "\n".join(
|
|
51
|
+
return "\n".join(f"assign {kv[0]} = {kv[1]};" for kv in fanout.items())
|
|
52
52
|
|
|
53
|
-
def
|
|
53
|
+
def fanin_wr(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
54
54
|
fanin: dict[str, str] = {}
|
|
55
55
|
if node is None:
|
|
56
|
-
fanin["
|
|
57
|
-
fanin["
|
|
56
|
+
fanin["cpuif_wr_ack"] = "'0"
|
|
57
|
+
fanin["cpuif_wr_err"] = "'0"
|
|
58
|
+
if error:
|
|
59
|
+
fanin["cpuif_wr_ack"] = "'1"
|
|
60
|
+
fanin["cpuif_wr_err"] = "cpuif_wr_sel.cpuif_err"
|
|
58
61
|
else:
|
|
59
62
|
# Use intermediate signals for interface arrays to avoid
|
|
60
63
|
# non-constant indexing of interface arrays in procedural blocks
|
|
61
64
|
if self.is_interface and node.is_array and node.array_dimensions:
|
|
62
65
|
# Generate array index string [i0][i1]... for the intermediate signal
|
|
63
66
|
array_idx = "".join(f"[i{i}]" for i in range(len(node.array_dimensions)))
|
|
64
|
-
fanin["
|
|
65
|
-
fanin["
|
|
67
|
+
fanin["cpuif_wr_ack"] = f"{node.inst_name}_fanin_ready{array_idx}"
|
|
68
|
+
fanin["cpuif_wr_err"] = f"{node.inst_name}_fanin_err{array_idx}"
|
|
66
69
|
else:
|
|
67
|
-
fanin["
|
|
68
|
-
fanin["
|
|
70
|
+
fanin["cpuif_wr_ack"] = self.signal("PREADY", node, "i")
|
|
71
|
+
fanin["cpuif_wr_err"] = self.signal("PSLVERR", node, "i")
|
|
69
72
|
|
|
70
|
-
return "\n".join(
|
|
73
|
+
return "\n".join(f"{kv[0]} = {kv[1]};" for kv in fanin.items())
|
|
71
74
|
|
|
72
|
-
def
|
|
75
|
+
def fanin_rd(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
73
76
|
fanin: dict[str, str] = {}
|
|
74
77
|
if node is None:
|
|
78
|
+
fanin["cpuif_rd_ack"] = "'0"
|
|
79
|
+
fanin["cpuif_rd_err"] = "'0"
|
|
75
80
|
fanin["cpuif_rd_data"] = "'0"
|
|
81
|
+
if error:
|
|
82
|
+
fanin["cpuif_rd_ack"] = "'1"
|
|
83
|
+
fanin["cpuif_rd_err"] = "cpuif_rd_sel.cpuif_err"
|
|
76
84
|
else:
|
|
77
85
|
# Use intermediate signals for interface arrays to avoid
|
|
78
86
|
# non-constant indexing of interface arrays in procedural blocks
|
|
79
87
|
if self.is_interface and node.is_array and node.array_dimensions:
|
|
80
88
|
# Generate array index string [i0][i1]... for the intermediate signal
|
|
81
89
|
array_idx = "".join(f"[i{i}]" for i in range(len(node.array_dimensions)))
|
|
90
|
+
fanin["cpuif_rd_ack"] = f"{node.inst_name}_fanin_ready{array_idx}"
|
|
91
|
+
fanin["cpuif_rd_err"] = f"{node.inst_name}_fanin_err{array_idx}"
|
|
82
92
|
fanin["cpuif_rd_data"] = f"{node.inst_name}_fanin_data{array_idx}"
|
|
83
93
|
else:
|
|
94
|
+
fanin["cpuif_rd_ack"] = self.signal("PREADY", node, "i")
|
|
95
|
+
fanin["cpuif_rd_err"] = self.signal("PSLVERR", node, "i")
|
|
84
96
|
fanin["cpuif_rd_data"] = self.signal("PRDATA", node, "i")
|
|
85
97
|
|
|
86
|
-
return "\n".join(
|
|
98
|
+
return "\n".join(f"{kv[0]} = {kv[1]};" for kv in fanin.items())
|
|
87
99
|
|
|
88
100
|
def fanin_intermediate_assignments(
|
|
89
101
|
self, node: AddressableNode, inst_name: str, array_idx: str, master_prefix: str, indexed_path: str
|
|
@@ -53,24 +53,33 @@ class APB4CpuifFlat(BaseCpuif):
|
|
|
53
53
|
fanout[self.signal("PWDATA", node, "gi")] = "cpuif_wr_data"
|
|
54
54
|
fanout[self.signal("PSTRB", node, "gi")] = "cpuif_wr_byte_en"
|
|
55
55
|
|
|
56
|
-
return "\n".join(
|
|
56
|
+
return "\n".join(f"assign {kv[0]} = {kv[1]};" for kv in fanout.items())
|
|
57
57
|
|
|
58
|
-
def
|
|
58
|
+
def fanin_wr(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
59
59
|
fanin: dict[str, str] = {}
|
|
60
60
|
if node is None:
|
|
61
|
-
fanin["
|
|
62
|
-
fanin["
|
|
61
|
+
fanin["cpuif_wr_ack"] = "'0"
|
|
62
|
+
fanin["cpuif_wr_err"] = "'0"
|
|
63
|
+
if error:
|
|
64
|
+
fanin["cpuif_wr_ack"] = "'1"
|
|
65
|
+
fanin["cpuif_wr_err"] = "cpuif_wr_sel.cpuif_err"
|
|
63
66
|
else:
|
|
64
|
-
fanin["
|
|
65
|
-
fanin["
|
|
66
|
-
|
|
67
|
-
return "\n".join(map(lambda kv: f"{kv[0]} = {kv[1]};", fanin.items()))
|
|
67
|
+
fanin["cpuif_wr_ack"] = self.signal("PREADY", node, "i")
|
|
68
|
+
fanin["cpuif_wr_err"] = self.signal("PSLVERR", node, "i")
|
|
69
|
+
return "\n".join(f"{kv[0]} = {kv[1]};" for kv in fanin.items())
|
|
68
70
|
|
|
69
|
-
def
|
|
71
|
+
def fanin_rd(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
70
72
|
fanin: dict[str, str] = {}
|
|
71
73
|
if node is None:
|
|
74
|
+
fanin["cpuif_rd_ack"] = "'0"
|
|
75
|
+
fanin["cpuif_rd_err"] = "'0"
|
|
72
76
|
fanin["cpuif_rd_data"] = "'0"
|
|
77
|
+
if error:
|
|
78
|
+
fanin["cpuif_rd_ack"] = "'1"
|
|
79
|
+
fanin["cpuif_rd_err"] = "cpuif_rd_sel.cpuif_err"
|
|
73
80
|
else:
|
|
81
|
+
fanin["cpuif_rd_ack"] = self.signal("PREADY", node, "i")
|
|
82
|
+
fanin["cpuif_rd_err"] = self.signal("PSLVERR", node, "i")
|
|
74
83
|
fanin["cpuif_rd_data"] = self.signal("PRDATA", node, "i")
|
|
75
84
|
|
|
76
|
-
return "\n".join(
|
|
85
|
+
return "\n".join(f"{kv[0]} = {kv[1]};" for kv in fanin.items())
|
{peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/apb4/apb4_tmpl.sv
RENAMED
|
@@ -20,8 +20,8 @@ assign cpuif_wr_data = {{cpuif.signal("PWDATA")}};
|
|
|
20
20
|
assign cpuif_wr_byte_en = {{cpuif.signal("PSTRB")}};
|
|
21
21
|
|
|
22
22
|
assign {{cpuif.signal("PRDATA")}} = cpuif_rd_data;
|
|
23
|
-
assign {{cpuif.signal("PREADY")}} = cpuif_rd_ack;
|
|
24
|
-
assign {{cpuif.signal("PSLVERR")}} = cpuif_rd_err |
|
|
23
|
+
assign {{cpuif.signal("PREADY")}} = cpuif_rd_ack | cpuif_wr_ack;
|
|
24
|
+
assign {{cpuif.signal("PSLVERR")}} = cpuif_rd_err | cpuif_wr_err;
|
|
25
25
|
|
|
26
26
|
//--------------------------------------------------------------------------
|
|
27
27
|
// Fanout CPU Bus interface signals
|
|
@@ -63,38 +63,50 @@ class AXI4LiteCpuif(BaseCpuif):
|
|
|
63
63
|
|
|
64
64
|
return "\n".join(f"assign {lhs} = {rhs};" for lhs, rhs in fanout.items())
|
|
65
65
|
|
|
66
|
-
def
|
|
66
|
+
def fanin_wr(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
67
67
|
fanin: dict[str, str] = {}
|
|
68
68
|
if node is None:
|
|
69
|
-
fanin["
|
|
70
|
-
fanin["
|
|
69
|
+
fanin["cpuif_wr_ack"] = "'0"
|
|
70
|
+
fanin["cpuif_wr_err"] = "'0"
|
|
71
|
+
if error:
|
|
72
|
+
fanin["cpuif_wr_ack"] = "'1"
|
|
73
|
+
fanin["cpuif_wr_err"] = "cpuif_wr_sel.cpuif_err"
|
|
71
74
|
else:
|
|
72
75
|
# Use intermediate signals for interface arrays to avoid
|
|
73
76
|
# non-constant indexing of interface arrays in procedural blocks
|
|
74
77
|
if self.is_interface and node.is_array and node.array_dimensions:
|
|
75
78
|
# Generate array index string [i0][i1]... for the intermediate signal
|
|
76
79
|
array_idx = "".join(f"[i{i}]" for i in range(len(node.array_dimensions)))
|
|
77
|
-
fanin["
|
|
78
|
-
fanin["
|
|
80
|
+
fanin["cpuif_wr_ack"] = f"{node.inst_name}_fanin_ready{array_idx}"
|
|
81
|
+
fanin["cpuif_wr_err"] = f"{node.inst_name}_fanin_err{array_idx}"
|
|
79
82
|
else:
|
|
80
83
|
# Read side: ack comes from RVALID; err if RRESP[1] is set (SLVERR/DECERR)
|
|
81
|
-
fanin["
|
|
82
|
-
fanin["
|
|
84
|
+
fanin["cpuif_wr_ack"] = self.signal("BVALID", node, "i")
|
|
85
|
+
fanin["cpuif_wr_err"] = f"{self.signal('BRESP', node, 'i')}[1]"
|
|
83
86
|
|
|
84
87
|
return "\n".join(f"{lhs} = {rhs};" for lhs, rhs in fanin.items())
|
|
85
88
|
|
|
86
|
-
def
|
|
89
|
+
def fanin_rd(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
87
90
|
fanin: dict[str, str] = {}
|
|
88
91
|
if node is None:
|
|
92
|
+
fanin["cpuif_rd_ack"] = "'0"
|
|
93
|
+
fanin["cpuif_rd_err"] = "'0"
|
|
89
94
|
fanin["cpuif_rd_data"] = "'0"
|
|
95
|
+
if error:
|
|
96
|
+
fanin["cpuif_rd_ack"] = "'1"
|
|
97
|
+
fanin["cpuif_rd_err"] = "cpuif_rd_sel.cpuif_err"
|
|
90
98
|
else:
|
|
91
99
|
# Use intermediate signals for interface arrays to avoid
|
|
92
100
|
# non-constant indexing of interface arrays in procedural blocks
|
|
93
101
|
if self.is_interface and node.is_array and node.array_dimensions:
|
|
94
102
|
# Generate array index string [i0][i1]... for the intermediate signal
|
|
95
103
|
array_idx = "".join(f"[i{i}]" for i in range(len(node.array_dimensions)))
|
|
104
|
+
fanin["cpuif_rd_ack"] = f"{node.inst_name}_fanin_ready{array_idx}"
|
|
105
|
+
fanin["cpuif_rd_err"] = f"{node.inst_name}_fanin_err{array_idx}"
|
|
96
106
|
fanin["cpuif_rd_data"] = f"{node.inst_name}_fanin_data{array_idx}"
|
|
97
107
|
else:
|
|
108
|
+
fanin["cpuif_rd_ack"] = self.signal("RVALID", node, "i")
|
|
109
|
+
fanin["cpuif_rd_err"] = f"{self.signal('RRESP', node, 'i')}[1]"
|
|
98
110
|
fanin["cpuif_rd_data"] = self.signal("RDATA", node, "i")
|
|
99
111
|
|
|
100
112
|
return "\n".join(f"{lhs} = {rhs};" for lhs, rhs in fanin.items())
|
|
@@ -72,23 +72,33 @@ class AXI4LiteCpuifFlat(BaseCpuif):
|
|
|
72
72
|
|
|
73
73
|
return "\n".join(f"assign {lhs} = {rhs};" for lhs, rhs in fanout.items())
|
|
74
74
|
|
|
75
|
-
def
|
|
75
|
+
def fanin_wr(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
76
76
|
fanin: dict[str, str] = {}
|
|
77
77
|
if node is None:
|
|
78
|
-
fanin["
|
|
79
|
-
fanin["
|
|
78
|
+
fanin["cpuif_wr_ack"] = "'0"
|
|
79
|
+
fanin["cpuif_wr_err"] = "'0"
|
|
80
|
+
if error:
|
|
81
|
+
fanin["cpuif_wr_ack"] = "'1"
|
|
82
|
+
fanin["cpuif_wr_err"] = "cpuif_wr_sel.cpuif_err"
|
|
80
83
|
else:
|
|
81
84
|
# Read side: ack comes from RVALID; err if RRESP[1] is set (SLVERR/DECERR)
|
|
82
|
-
fanin["
|
|
83
|
-
fanin["
|
|
85
|
+
fanin["cpuif_wr_ack"] = self.signal("BVALID", node, "i")
|
|
86
|
+
fanin["cpuif_wr_err"] = f"{self.signal('BRESP', node, 'i')}[1]"
|
|
84
87
|
|
|
85
88
|
return "\n".join(f"{lhs} = {rhs};" for lhs, rhs in fanin.items())
|
|
86
89
|
|
|
87
|
-
def
|
|
90
|
+
def fanin_rd(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
88
91
|
fanin: dict[str, str] = {}
|
|
89
92
|
if node is None:
|
|
93
|
+
fanin["cpuif_rd_ack"] = "'0"
|
|
94
|
+
fanin["cpuif_rd_err"] = "'0"
|
|
90
95
|
fanin["cpuif_rd_data"] = "'0"
|
|
96
|
+
if error:
|
|
97
|
+
fanin["cpuif_rd_ack"] = "'1"
|
|
98
|
+
fanin["cpuif_rd_err"] = "cpuif_rd_sel.cpuif_err"
|
|
91
99
|
else:
|
|
100
|
+
fanin["cpuif_rd_ack"] = self.signal("RVALID", node, "i")
|
|
101
|
+
fanin["cpuif_rd_err"] = f"{self.signal('RRESP', node, 'i')}[1]"
|
|
92
102
|
fanin["cpuif_rd_data"] = self.signal("RDATA", node, "i")
|
|
93
103
|
|
|
94
104
|
return "\n".join(f"{lhs} = {rhs};" for lhs, rhs in fanin.items())
|
{peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/base_cpuif.py
RENAMED
|
@@ -82,15 +82,15 @@ class BaseCpuif:
|
|
|
82
82
|
loader=loader,
|
|
83
83
|
undefined=jj.StrictUndefined,
|
|
84
84
|
)
|
|
85
|
-
jj_env.tests["array"] = self.check_is_array
|
|
86
|
-
jj_env.filters["clog2"] = clog2
|
|
87
|
-
jj_env.filters["is_pow2"] = is_pow2
|
|
88
|
-
jj_env.filters["roundup_pow2"] = roundup_pow2
|
|
89
|
-
jj_env.filters["address_slice"] = self.get_address_slice
|
|
90
|
-
jj_env.filters["get_path"] = lambda x: get_indexed_path(self.exp.ds.top_node, x, "i")
|
|
91
|
-
jj_env.filters["walk"] = self.exp.walk
|
|
92
|
-
|
|
93
|
-
context = {
|
|
85
|
+
jj_env.tests["array"] = self.check_is_array
|
|
86
|
+
jj_env.filters["clog2"] = clog2
|
|
87
|
+
jj_env.filters["is_pow2"] = is_pow2
|
|
88
|
+
jj_env.filters["roundup_pow2"] = roundup_pow2
|
|
89
|
+
jj_env.filters["address_slice"] = self.get_address_slice
|
|
90
|
+
jj_env.filters["get_path"] = lambda x: get_indexed_path(self.exp.ds.top_node, x, "i")
|
|
91
|
+
jj_env.filters["walk"] = self.exp.walk
|
|
92
|
+
|
|
93
|
+
context = {
|
|
94
94
|
"cpuif": self,
|
|
95
95
|
"ds": self.exp.ds,
|
|
96
96
|
"fanout": FanoutGenerator,
|
|
@@ -110,10 +110,10 @@ class BaseCpuif:
|
|
|
110
110
|
def fanout(self, node: AddressableNode, array_stack: deque[int]) -> str:
|
|
111
111
|
raise NotImplementedError
|
|
112
112
|
|
|
113
|
-
def
|
|
113
|
+
def fanin_wr(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
114
114
|
raise NotImplementedError
|
|
115
115
|
|
|
116
|
-
def
|
|
116
|
+
def fanin_rd(self, node: AddressableNode | None = None, *, error: bool = False) -> str:
|
|
117
117
|
raise NotImplementedError
|
|
118
118
|
|
|
119
119
|
def fanin_intermediate_assignments(
|
{peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/fanin_gen.py
RENAMED
|
@@ -20,8 +20,8 @@ class FaninGenerator(BusDecoderListener):
|
|
|
20
20
|
|
|
21
21
|
self._stack: deque[Body] = deque()
|
|
22
22
|
cb = CombinationalBody()
|
|
23
|
-
cb += cpuif.
|
|
24
|
-
cb += cpuif.
|
|
23
|
+
cb += cpuif.fanin_wr()
|
|
24
|
+
cb += cpuif.fanin_rd()
|
|
25
25
|
self._stack.append(cb)
|
|
26
26
|
|
|
27
27
|
def enter_AddressableComponent(self, node: AddressableNode) -> WalkerAction | None:
|
|
@@ -48,15 +48,13 @@ class FaninGenerator(BusDecoderListener):
|
|
|
48
48
|
self._stack.append(fb)
|
|
49
49
|
|
|
50
50
|
ifb = IfBody()
|
|
51
|
-
with ifb.cm(
|
|
52
|
-
|
|
53
|
-
) as b:
|
|
54
|
-
b += self._cpuif.fanin(node)
|
|
51
|
+
with ifb.cm(f"cpuif_wr_sel.{get_indexed_path(self._cpuif.exp.ds.top_node, node)}") as b:
|
|
52
|
+
b += self._cpuif.fanin_wr(node)
|
|
55
53
|
self._stack[-1] += ifb
|
|
56
54
|
|
|
57
55
|
ifb = IfBody()
|
|
58
56
|
with ifb.cm(f"cpuif_rd_sel.{get_indexed_path(self._cpuif.exp.ds.top_node, node)}") as b:
|
|
59
|
-
b += self._cpuif.
|
|
57
|
+
b += self._cpuif.fanin_rd(node)
|
|
60
58
|
self._stack[-1] += ifb
|
|
61
59
|
|
|
62
60
|
return action
|
|
@@ -72,4 +70,14 @@ class FaninGenerator(BusDecoderListener):
|
|
|
72
70
|
super().exit_AddressableComponent(node)
|
|
73
71
|
|
|
74
72
|
def __str__(self) -> str:
|
|
73
|
+
wr_ifb = IfBody()
|
|
74
|
+
with wr_ifb.cm("cpuif_wr_sel.cpuif_err") as b:
|
|
75
|
+
self._cpuif.fanin_wr(error=True)
|
|
76
|
+
self._stack[-1] += wr_ifb
|
|
77
|
+
|
|
78
|
+
rd_ifb = IfBody()
|
|
79
|
+
with rd_ifb.cm("cpuif_rd_sel.cpuif_err") as b:
|
|
80
|
+
self._cpuif.fanin_rd(error=True)
|
|
81
|
+
self._stack[-1] += rd_ifb
|
|
82
|
+
|
|
75
83
|
return "\n".join(map(str, self._stack))
|
{peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/cpuif/interface.py
RENAMED
|
@@ -78,7 +78,7 @@ class SVInterface(Interface):
|
|
|
78
78
|
|
|
79
79
|
# When unrolled, current_idx is set - append it to the name
|
|
80
80
|
if child.current_idx is not None:
|
|
81
|
-
base = f"{base}_{'_'.join(map(str, child.current_idx))}"
|
|
81
|
+
base = f"{base}_{'_'.join(map(str, child.current_idx))}" # ty: ignore
|
|
82
82
|
|
|
83
83
|
# Only add array dimensions if this should be treated as an array
|
|
84
84
|
if self.cpuif.check_is_array(child):
|
|
@@ -58,9 +58,9 @@ class BusDecoderExporter:
|
|
|
58
58
|
loader=c_loader,
|
|
59
59
|
undefined=jj.StrictUndefined,
|
|
60
60
|
)
|
|
61
|
-
self.jj_env.filters["kwf"] = kwf
|
|
62
|
-
self.jj_env.filters["walk"] = self.walk
|
|
63
|
-
self.jj_env.filters["clog2"] = clog2
|
|
61
|
+
self.jj_env.filters["kwf"] = kwf
|
|
62
|
+
self.jj_env.filters["walk"] = self.walk
|
|
63
|
+
self.jj_env.filters["clog2"] = clog2
|
|
64
64
|
|
|
65
65
|
def export(self, node: RootNode | AddrmapNode, output_dir: str, **kwargs: Unpack[ExporterKwargs]) -> None:
|
|
66
66
|
"""
|
|
@@ -98,7 +98,7 @@ class BusDecoderExporter:
|
|
|
98
98
|
else:
|
|
99
99
|
top_node = node
|
|
100
100
|
|
|
101
|
-
self.ds = DesignState(top_node, kwargs)
|
|
101
|
+
self.ds = DesignState(top_node, kwargs) # ty: ignore
|
|
102
102
|
|
|
103
103
|
cpuif_cls: type[BaseCpuif] = kwargs.pop("cpuif_cls", None) or APB4Cpuif
|
|
104
104
|
|
|
@@ -113,7 +113,7 @@ class BusDecoderExporter:
|
|
|
113
113
|
DesignValidator(self).do_validate()
|
|
114
114
|
|
|
115
115
|
# Build Jinja template context
|
|
116
|
-
context = {
|
|
116
|
+
context = {
|
|
117
117
|
"version": version("peakrdl-busdecoder"),
|
|
118
118
|
"cpuif": self.cpuif,
|
|
119
119
|
"cpuif_decode": DecodeLogicGenerator,
|
|
@@ -62,7 +62,6 @@ def ref_is_internal(top_node: AddrmapNode, ref: Node | PropertyReference) -> boo
|
|
|
62
62
|
else:
|
|
63
63
|
current_node = ref
|
|
64
64
|
|
|
65
|
-
# pyrefly: ignore[bad-assignment] - false positive due to circular type checking
|
|
66
65
|
while current_node is not None:
|
|
67
66
|
if current_node == top_node:
|
|
68
67
|
# reached top node without finding any external components
|
{peakrdl_busdecoder-0.6.4 → peakrdl_busdecoder-0.6.6}/src/peakrdl_busdecoder/validate_design.py
RENAMED
|
@@ -74,7 +74,9 @@ class DesignValidator(RDLListener):
|
|
|
74
74
|
f"instance '{node.inst_name}' must be a multiple of {alignment}",
|
|
75
75
|
node.inst.inst_src_ref,
|
|
76
76
|
)
|
|
77
|
-
if node.is_array and (
|
|
77
|
+
if node.is_array and (
|
|
78
|
+
node.array_stride is not None and (node.array_stride % alignment) != 0
|
|
79
|
+
): # is_array implies stride is not none
|
|
78
80
|
self.msg.error(
|
|
79
81
|
"Unaligned registers are not supported. Address stride of "
|
|
80
82
|
f"instance array '{node.inst_name}' must be a multiple of {alignment}",
|