peakrdl-busdecoder 0.6.6__tar.gz → 0.6.8__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.6 → peakrdl_busdecoder-0.6.8}/PKG-INFO +1 -1
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/api.rst +4 -7
- peakrdl_busdecoder-0.6.8/docs/architecture.rst +54 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/conf.py +1 -3
- peakrdl_busdecoder-0.6.8/docs/configuring.rst +38 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/cpuif/apb.rst +6 -6
- peakrdl_busdecoder-0.6.8/docs/cpuif/axi4lite.rst +33 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/cpuif/customizing.rst +4 -4
- peakrdl_busdecoder-0.6.8/docs/cpuif/internal_protocol.rst +71 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/cpuif/introduction.rst +10 -8
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/index.rst +29 -35
- peakrdl_busdecoder-0.6.8/docs/limitations.rst +47 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/requirements.txt +0 -1
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/pyproject.toml +1 -2
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb3/apb3_tmpl.sv +1 -1
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb4/apb4_tmpl.sv +1 -1
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif.py +14 -2
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_tmpl.sv +19 -5
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/base_cpuif.py +4 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/fanin_gen.py +2 -2
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/fanin_intermediate_gen.py +3 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/design_scanner.py +11 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder.egg-info/PKG-INFO +1 -1
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder.egg-info/SOURCES.txt +0 -11
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/uv.lock +1 -382
- peakrdl_busdecoder-0.6.6/docs/architecture.rst +0 -64
- peakrdl_busdecoder-0.6.6/docs/configuring.rst +0 -45
- peakrdl_busdecoder-0.6.6/docs/cpuif/avalon.rst +0 -33
- peakrdl_busdecoder-0.6.6/docs/cpuif/axi4lite.rst +0 -32
- peakrdl_busdecoder-0.6.6/docs/cpuif/internal_protocol.rst +0 -232
- peakrdl_busdecoder-0.6.6/docs/cpuif/passthrough.rst +0 -10
- peakrdl_busdecoder-0.6.6/docs/faq.rst +0 -131
- peakrdl_busdecoder-0.6.6/docs/hwif.rst +0 -61
- peakrdl_busdecoder-0.6.6/docs/limitations.rst +0 -53
- peakrdl_busdecoder-0.6.6/docs/props/addrmap.rst +0 -28
- peakrdl_busdecoder-0.6.6/docs/props/field.rst +0 -491
- peakrdl_busdecoder-0.6.6/docs/props/reg.rst +0 -14
- peakrdl_busdecoder-0.6.6/docs/props/rhs_props.rst +0 -182
- peakrdl_busdecoder-0.6.6/docs/props/signal.rst +0 -28
- peakrdl_busdecoder-0.6.6/docs/rdl_features/external.rst +0 -155
- peakrdl_busdecoder-0.6.6/docs/udps/intro.rst +0 -79
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.devcontainer/Dockerfile +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.devcontainer/devcontainer.json +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/ISSUE_TEMPLATE/question.md +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/pull_request_template.md +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/workflows/build.yml +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/workflows/docs.yml +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/workflows/format.yml +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/workflows/lint.yml +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/workflows/release.yml +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/workflows/test.yml +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.github/workflows/typecheck.yml +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.gitignore +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/.readthedocs.yaml +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/CONTRIBUTING.md +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/LICENSE +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/MANIFEST.in +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/README.md +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/Makefile +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/Alpha-Beta Versioning +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/Hierarchy-and-Indexing +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/Program Flow +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/Resets +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/Signal Dereferencer +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/Validation Needed +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/template-layers/1-port-declaration +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/template-layers/1.1.hardware-interface +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/template-layers/2-CPUIF +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/template-layers/3-address-decode +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/template-layers/4-fields +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/template-layers/5-readback-mux +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/dev_notes/template-layers/6-output-port-mapping +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/diagrams/arch.png +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/diagrams/diagrams.odg +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/diagrams/rbuf.png +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/diagrams/readback.png +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/diagrams/wbuf.png +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/img/err.svg +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/img/ok.svg +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/img/warn.svg +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/docs/licensing.rst +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/hdl-src/README.md +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/hdl-src/apb3_intf.sv +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/hdl-src/apb4_intf.sv +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/hdl-src/avalon_mm_intf.sv +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/hdl-src/axi4lite_intf.sv +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/setup.cfg +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/__peakrdl__.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/body/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/body/body.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/body/combinational_body.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/body/for_loop_body.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/body/if_body.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/body/struct_body.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb3/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb3/apb3_cpuif.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb3/apb3_cpuif_flat.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb3/apb3_interface.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb4/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb4/apb4_cpuif.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb4/apb4_cpuif_flat.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb4/apb4_interface.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/axi4lite/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif_flat.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_interface.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/fanout_gen.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/interface.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/decode_logic_gen.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/design_state.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/exporter.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/identifier_filter.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/listener.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/module_tmpl.sv +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/package_tmpl.sv +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/py.typed +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/struct_gen.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/sv_int.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/udps/__init__.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/utils.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/validate_design.py +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder.egg-info/dependency_links.txt +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder.egg-info/entry_points.txt +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder.egg-info/requires.txt +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder.egg-info/top_level.txt +0 -0
- {peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/tools/shims/xargs +0 -0
|
@@ -15,10 +15,11 @@ implementation from SystemRDL source.
|
|
|
15
15
|
.. code-block:: python
|
|
16
16
|
:emphasize-lines: 2-4, 29-33
|
|
17
17
|
|
|
18
|
+
import sys
|
|
19
|
+
|
|
18
20
|
from systemrdl import RDLCompiler, RDLCompileError
|
|
19
21
|
from peakrdl_busdecoder import BusDecoderExporter
|
|
20
|
-
from peakrdl_busdecoder.cpuif.axi4lite import
|
|
21
|
-
from peakrdl_busdecoder.udps import ALL_UDPS
|
|
22
|
+
from peakrdl_busdecoder.cpuif.axi4lite import AXI4LiteCpuif
|
|
22
23
|
|
|
23
24
|
input_files = [
|
|
24
25
|
"PATH/TO/my_register_block.rdl"
|
|
@@ -27,10 +28,6 @@ implementation from SystemRDL source.
|
|
|
27
28
|
# Create an instance of the compiler
|
|
28
29
|
rdlc = RDLCompiler()
|
|
29
30
|
|
|
30
|
-
# Register all UDPs that 'busdecoder' requires
|
|
31
|
-
for udp in ALL_UDPS:
|
|
32
|
-
rdlc.register_udp(udp)
|
|
33
|
-
|
|
34
31
|
try:
|
|
35
32
|
# Compile your RDL files
|
|
36
33
|
for input_file in input_files:
|
|
@@ -46,5 +43,5 @@ implementation from SystemRDL source.
|
|
|
46
43
|
exporter = BusDecoderExporter()
|
|
47
44
|
exporter.export(
|
|
48
45
|
root, "path/to/output_dir",
|
|
49
|
-
cpuif_cls=
|
|
46
|
+
cpuif_cls=AXI4LiteCpuif
|
|
50
47
|
)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Bus Decoder Architecture
|
|
2
|
+
========================
|
|
3
|
+
|
|
4
|
+
The generated RTL is a pure bus-routing layer. It accepts a single CPU interface
|
|
5
|
+
on the slave side and fans transactions out to a set of child interfaces on the
|
|
6
|
+
master side. No register storage or field logic is generated.
|
|
7
|
+
|
|
8
|
+
Although you do not need to know the inner workings to use the exporter, the
|
|
9
|
+
sections below explain the structure of the generated module and how it maps to
|
|
10
|
+
SystemRDL hierarchy.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
CPU Interface Adapter
|
|
14
|
+
---------------------
|
|
15
|
+
Each supported CPU interface protocol (APB3, APB4, AXI4-Lite) provides a small
|
|
16
|
+
adapter that translates the external bus protocol into internal request/response
|
|
17
|
+
signals. These internal signals are then used by the address decoder and fanout
|
|
18
|
+
logic.
|
|
19
|
+
|
|
20
|
+
If you write a custom CPU interface, it must implement the internal signals
|
|
21
|
+
described in :ref:`cpuif_protocol`.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Address Decode
|
|
25
|
+
--------------
|
|
26
|
+
The address decoder computes per-child select signals based on address ranges.
|
|
27
|
+
The decode boundary is controlled by ``max_decode_depth``:
|
|
28
|
+
|
|
29
|
+
* ``0``: Decode all the way down to leaf registers
|
|
30
|
+
* ``1`` (default): Decode only top-level children
|
|
31
|
+
* ``N``: Decode down to depth ``N`` from the top-level
|
|
32
|
+
|
|
33
|
+
This allows you to choose whether the bus decoder routes to large blocks (e.g.,
|
|
34
|
+
child addrmaps) or to smaller sub-blocks.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
Fanout to Child Interfaces
|
|
38
|
+
--------------------------
|
|
39
|
+
For each decoded child, the bus decoder drives a master-side CPU interface.
|
|
40
|
+
All address, data, and control signals are forwarded to the selected child.
|
|
41
|
+
|
|
42
|
+
Arrayed children can be kept as arrays or unrolled into discrete interfaces using
|
|
43
|
+
``--unroll``. This only affects port structure and naming; decode semantics are
|
|
44
|
+
unchanged.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
Fanin and Error Handling
|
|
48
|
+
------------------------
|
|
49
|
+
Read and write responses are muxed back from the selected child to the slave
|
|
50
|
+
interface. If no child is selected for a transaction, the decoder generates an
|
|
51
|
+
error response on the slave interface.
|
|
52
|
+
|
|
53
|
+
The exact error signaling depends on the chosen CPU interface protocol (e.g.,
|
|
54
|
+
``PSLVERR`` for APB, ``RRESP/BRESP`` for AXI4-Lite).
|
|
@@ -32,9 +32,7 @@ author = "Arnav Sacheti"
|
|
|
32
32
|
extensions = [
|
|
33
33
|
"sphinx.ext.autodoc",
|
|
34
34
|
"sphinx.ext.napoleon",
|
|
35
|
-
"sphinxcontrib.wavedrom",
|
|
36
35
|
]
|
|
37
|
-
render_using_wavedrompy = True
|
|
38
36
|
|
|
39
37
|
# Add any paths that contain templates here, relative to this directory.
|
|
40
38
|
templates_path = ["_templates"]
|
|
@@ -42,7 +40,7 @@ templates_path = ["_templates"]
|
|
|
42
40
|
# List of patterns, relative to source directory, that match files and
|
|
43
41
|
# directories to ignore when looking for source files.
|
|
44
42
|
# This pattern also affects html_static_path and html_extra_path.
|
|
45
|
-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
43
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "dev_notes", "dev_notes/**"]
|
|
46
44
|
|
|
47
45
|
|
|
48
46
|
# -- Options for HTML output -------------------------------------------------
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.. _peakrdl_cfg:
|
|
2
|
+
|
|
3
|
+
Configuring PeakRDL-BusDecoder
|
|
4
|
+
==============================
|
|
5
|
+
|
|
6
|
+
If using the `PeakRDL command line tool <https://peakrdl.readthedocs.io/>`_,
|
|
7
|
+
some aspects of the ``busdecoder`` command can be configured via the PeakRDL
|
|
8
|
+
TOML file.
|
|
9
|
+
|
|
10
|
+
All busdecoder-specific options are defined under the ``[busdecoder]`` heading.
|
|
11
|
+
|
|
12
|
+
.. data:: cpuifs
|
|
13
|
+
|
|
14
|
+
Mapping of additional CPU Interface implementation classes to load.
|
|
15
|
+
The mapping's key indicates the cpuif's name.
|
|
16
|
+
The value is a string that describes the import path and cpuif class to
|
|
17
|
+
load.
|
|
18
|
+
|
|
19
|
+
For example:
|
|
20
|
+
|
|
21
|
+
.. code-block:: toml
|
|
22
|
+
|
|
23
|
+
[busdecoder]
|
|
24
|
+
cpuifs.my-cpuif-name = "my_cpuif_module:MyCPUInterfaceClass"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Command-Line Options
|
|
28
|
+
--------------------
|
|
29
|
+
|
|
30
|
+
The following options are available on the ``peakrdl busdecoder`` command:
|
|
31
|
+
|
|
32
|
+
* ``--cpuif``: Select the CPU interface (``apb3``, ``apb3-flat``, ``apb4``,
|
|
33
|
+
``apb4-flat``, ``axi4-lite``, ``axi4-lite-flat``)
|
|
34
|
+
* ``--module-name``: Override the generated module name
|
|
35
|
+
* ``--package-name``: Override the generated package name
|
|
36
|
+
* ``--addr-width``: Override the slave address width
|
|
37
|
+
* ``--unroll``: Unroll arrayed children into discrete interfaces
|
|
38
|
+
* ``--max-decode-depth``: Control how far the decoder descends into hierarchy
|
|
@@ -20,7 +20,7 @@ Both APB3 and APB4 standards are supported.
|
|
|
20
20
|
APB3
|
|
21
21
|
----
|
|
22
22
|
|
|
23
|
-
Implements the
|
|
23
|
+
Implements the bus decoder using an
|
|
24
24
|
`AMBA 3 APB <https://developer.arm.com/documentation/ihi0024/b/Introduction/About-the-AMBA-3-APB>`_
|
|
25
25
|
CPU interface.
|
|
26
26
|
|
|
@@ -29,19 +29,19 @@ The APB3 CPU interface comes in two i/o port flavors:
|
|
|
29
29
|
SystemVerilog Interface
|
|
30
30
|
* Command line: ``--cpuif apb3``
|
|
31
31
|
* Interface Definition: :download:`apb3_intf.sv <../../hdl-src/apb3_intf.sv>`
|
|
32
|
-
* Class: :class:`peakrdl_busdecoder.cpuif.apb3.
|
|
32
|
+
* Class: :class:`peakrdl_busdecoder.cpuif.apb3.APB3Cpuif`
|
|
33
33
|
|
|
34
34
|
Flattened inputs/outputs
|
|
35
35
|
Flattens the interface into discrete input and output ports.
|
|
36
36
|
|
|
37
37
|
* Command line: ``--cpuif apb3-flat``
|
|
38
|
-
* Class: :class:`peakrdl_busdecoder.cpuif.apb3.
|
|
38
|
+
* Class: :class:`peakrdl_busdecoder.cpuif.apb3.APB3CpuifFlat`
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
APB4
|
|
42
42
|
----
|
|
43
43
|
|
|
44
|
-
Implements the
|
|
44
|
+
Implements the bus decoder using an
|
|
45
45
|
`AMBA 4 APB <https://developer.arm.com/documentation/ihi0024/d/?lang=en>`_
|
|
46
46
|
CPU interface.
|
|
47
47
|
|
|
@@ -50,10 +50,10 @@ The APB4 CPU interface comes in two i/o port flavors:
|
|
|
50
50
|
SystemVerilog Interface
|
|
51
51
|
* Command line: ``--cpuif apb4``
|
|
52
52
|
* Interface Definition: :download:`apb4_intf.sv <../../hdl-src/apb4_intf.sv>`
|
|
53
|
-
* Class: :class:`peakrdl_busdecoder.cpuif.apb4.
|
|
53
|
+
* Class: :class:`peakrdl_busdecoder.cpuif.apb4.APB4Cpuif`
|
|
54
54
|
|
|
55
55
|
Flattened inputs/outputs
|
|
56
56
|
Flattens the interface into discrete input and output ports.
|
|
57
57
|
|
|
58
58
|
* Command line: ``--cpuif apb4-flat``
|
|
59
|
-
* Class: :class:`peakrdl_busdecoder.cpuif.apb4.
|
|
59
|
+
* Class: :class:`peakrdl_busdecoder.cpuif.apb4.APB4CpuifFlat`
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.. _cpuif_axi4lite:
|
|
2
|
+
|
|
3
|
+
AMBA AXI4-Lite
|
|
4
|
+
==============
|
|
5
|
+
|
|
6
|
+
Implements the bus decoder using an
|
|
7
|
+
`AMBA AXI4-Lite <https://developer.arm.com/documentation/ihi0022/e/AMBA-AXI4-Lite-Interface-Specification>`_
|
|
8
|
+
CPU interface.
|
|
9
|
+
|
|
10
|
+
The AXI4-Lite CPU interface comes in two i/o port flavors:
|
|
11
|
+
|
|
12
|
+
SystemVerilog Interface
|
|
13
|
+
* Command line: ``--cpuif axi4-lite``
|
|
14
|
+
* Interface Definition: :download:`axi4lite_intf.sv <../../hdl-src/axi4lite_intf.sv>`
|
|
15
|
+
* Class: :class:`peakrdl_busdecoder.cpuif.axi4lite.AXI4LiteCpuif`
|
|
16
|
+
|
|
17
|
+
Flattened inputs/outputs
|
|
18
|
+
Flattens the interface into discrete input and output ports.
|
|
19
|
+
|
|
20
|
+
* Command line: ``--cpuif axi4-lite-flat``
|
|
21
|
+
* Class: :class:`peakrdl_busdecoder.cpuif.axi4lite.AXI4LiteCpuifFlat`
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Protocol Notes
|
|
25
|
+
--------------
|
|
26
|
+
The AXI4-Lite adapter is intentionally simplified:
|
|
27
|
+
|
|
28
|
+
* AW and W channels must be asserted together for writes. The adapter does not
|
|
29
|
+
support decoupled address/data for writes.
|
|
30
|
+
* Only a single outstanding transaction is supported. Masters should wait for
|
|
31
|
+
the corresponding response before issuing the next request.
|
|
32
|
+
* Burst transfers are not supported (single-beat transfers only), consistent
|
|
33
|
+
with AXI4-Lite.
|
|
@@ -29,15 +29,15 @@ Rather than rewriting a new CPU interface definition, you can extend and adjust
|
|
|
29
29
|
|
|
30
30
|
.. code-block:: python
|
|
31
31
|
|
|
32
|
-
from peakrdl_busdecoder.cpuif.axi4lite import
|
|
32
|
+
from peakrdl_busdecoder.cpuif.axi4lite import AXI4LiteCpuif
|
|
33
33
|
|
|
34
|
-
class My_AXI4Lite(
|
|
34
|
+
class My_AXI4Lite(AXI4LiteCpuif):
|
|
35
35
|
@property
|
|
36
36
|
def port_declaration(self) -> str:
|
|
37
37
|
# Override the port declaration text to use the alternate interface name and modport style
|
|
38
38
|
return "axi4_lite_interface.Slave_mp s_axil"
|
|
39
39
|
|
|
40
|
-
def signal(self, name:str) -> str:
|
|
40
|
+
def signal(self, name: str, node=None, indexer=None) -> str:
|
|
41
41
|
# Override the signal names to be lowercase instead
|
|
42
42
|
return "s_axil." + name.lower()
|
|
43
43
|
|
|
@@ -72,7 +72,7 @@ you can define your own.
|
|
|
72
72
|
|
|
73
73
|
2. Create a Python class that defines your CPUIF
|
|
74
74
|
|
|
75
|
-
Extend your class from :class:`peakrdl_busdecoder.cpuif.
|
|
75
|
+
Extend your class from :class:`peakrdl_busdecoder.cpuif.BaseCpuif`.
|
|
76
76
|
Define the port declaration string, and provide a reference to your template file.
|
|
77
77
|
|
|
78
78
|
3. Use your new CPUIF definition when exporting.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
.. _cpuif_protocol:
|
|
2
|
+
|
|
3
|
+
Internal CPUIF Protocol
|
|
4
|
+
=======================
|
|
5
|
+
|
|
6
|
+
Internally, the bus decoder uses a small set of common request/response signals
|
|
7
|
+
that each CPU interface adapter must drive. This protocol is intentionally simple
|
|
8
|
+
and supports a single outstanding transaction at a time. The CPU interface logic
|
|
9
|
+
is responsible for holding request signals stable until the transaction completes.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Signal Descriptions
|
|
13
|
+
-------------------
|
|
14
|
+
|
|
15
|
+
Request
|
|
16
|
+
^^^^^^^
|
|
17
|
+
cpuif_req
|
|
18
|
+
When asserted, a read or write transfer is in progress. Request signals must
|
|
19
|
+
remain stable until the transfer completes.
|
|
20
|
+
|
|
21
|
+
cpuif_wr_en
|
|
22
|
+
When asserted alongside ``cpuif_req``, denotes a write transfer.
|
|
23
|
+
|
|
24
|
+
cpuif_rd_en
|
|
25
|
+
When asserted alongside ``cpuif_req``, denotes a read transfer.
|
|
26
|
+
|
|
27
|
+
cpuif_wr_addr / cpuif_rd_addr
|
|
28
|
+
Byte address of the write or read transfer, respectively.
|
|
29
|
+
|
|
30
|
+
cpuif_wr_data
|
|
31
|
+
Data to be written for the write transfer.
|
|
32
|
+
|
|
33
|
+
cpuif_wr_byte_en
|
|
34
|
+
Active-high byte-enable strobes for writes. Some CPU interfaces do not
|
|
35
|
+
provide byte enables and may drive this as all-ones.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
Read Response
|
|
39
|
+
^^^^^^^^^^^^^
|
|
40
|
+
cpuif_rd_ack
|
|
41
|
+
Single-cycle strobe indicating a read transfer has completed.
|
|
42
|
+
Qualifies ``cpuif_rd_err`` and ``cpuif_rd_data``.
|
|
43
|
+
|
|
44
|
+
cpuif_rd_err
|
|
45
|
+
Indicates that the read transaction failed. The CPU interface should return
|
|
46
|
+
an error response if possible.
|
|
47
|
+
|
|
48
|
+
cpuif_rd_data
|
|
49
|
+
Read data. Sampled on the same cycle that ``cpuif_rd_ack`` is asserted.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
Write Response
|
|
53
|
+
^^^^^^^^^^^^^^
|
|
54
|
+
cpuif_wr_ack
|
|
55
|
+
Single-cycle strobe indicating a write transfer has completed.
|
|
56
|
+
Qualifies ``cpuif_wr_err``.
|
|
57
|
+
|
|
58
|
+
cpuif_wr_err
|
|
59
|
+
Indicates that the write transaction failed. The CPU interface should return
|
|
60
|
+
an error response if possible.
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
Transfers
|
|
64
|
+
---------
|
|
65
|
+
|
|
66
|
+
Transfers have the following characteristics:
|
|
67
|
+
|
|
68
|
+
* Only one outstanding transaction is supported.
|
|
69
|
+
* The CPU interface must hold ``cpuif_req`` and request parameters stable until
|
|
70
|
+
the corresponding ``cpuif_*_ack`` is asserted.
|
|
71
|
+
* Responses shall arrive in the same order as requests.
|
|
@@ -2,16 +2,17 @@ Introduction
|
|
|
2
2
|
============
|
|
3
3
|
|
|
4
4
|
The CPU interface logic layer provides an abstraction between the
|
|
5
|
-
application-specific bus protocol and the internal
|
|
6
|
-
When exporting a design, you can select from
|
|
7
|
-
|
|
5
|
+
application-specific bus protocol and the internal bus decoder logic.
|
|
6
|
+
When exporting a design, you can select from supported CPU interface protocols.
|
|
7
|
+
These are described in more detail in the pages that follow.
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Bus Width
|
|
11
11
|
^^^^^^^^^
|
|
12
|
-
The CPU interface bus width is
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
The CPU interface bus width is inferred from the contents of the design.
|
|
13
|
+
It is intended to be equal to the widest ``accesswidth`` encountered in the
|
|
14
|
+
design. If the exported addrmap contains only external components, the width
|
|
15
|
+
cannot be inferred and will default to 32 bits.
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
Addressing
|
|
@@ -32,5 +33,6 @@ For example, consider a fictional AXI4-Lite device that:
|
|
|
32
33
|
- If care is taken to align the global address offset to the size of the device,
|
|
33
34
|
creating a relative address is as simple as pruning down address bits.
|
|
34
35
|
|
|
35
|
-
By default, the bit-width of the address bus will be the minimum size to span the
|
|
36
|
-
of the
|
|
36
|
+
By default, the bit-width of the address bus will be the minimum size to span the
|
|
37
|
+
contents of the decoded address space. If needed, the address width can be
|
|
38
|
+
overridden to a larger range using ``--addr-width``.
|
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
Introduction
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
-
PeakRDL-BusDecoder is a free and open-source bus decoder generator for hierarchical
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
PeakRDL-BusDecoder is a free and open-source bus decoder generator for hierarchical
|
|
5
|
+
SystemRDL address maps. It produces a synthesizable SystemVerilog RTL module that
|
|
6
|
+
accepts a single CPU interface (slave side) and fans transactions out to multiple
|
|
7
|
+
child address spaces (master side).
|
|
8
|
+
|
|
9
|
+
This tool **does not** generate register storage or field logic. It is strictly a
|
|
10
|
+
bus-routing layer that decodes addresses and forwards requests to child blocks.
|
|
11
|
+
|
|
12
|
+
This is particularly useful for:
|
|
8
13
|
|
|
9
14
|
* Creating hierarchical register maps with multiple sub-components
|
|
10
15
|
* Splitting a single CPU interface bus to serve multiple independent register blocks
|
|
11
|
-
* Organizing large
|
|
16
|
+
* Organizing large address spaces into logical sub-regions
|
|
12
17
|
* Implementing address decode logic for multi-drop bus architectures
|
|
13
18
|
|
|
14
19
|
The generated bus decoder provides:
|
|
15
20
|
|
|
16
21
|
* Fully synthesizable SystemVerilog RTL (IEEE 1800-2012)
|
|
17
|
-
*
|
|
22
|
+
* A top-level slave CPU interface and per-child master CPU interfaces
|
|
18
23
|
* Address decode logic that routes transactions to child address maps
|
|
19
|
-
*
|
|
20
|
-
*
|
|
24
|
+
* Support for APB3, APB4, and AXI4-Lite (plus plugin-defined CPU interfaces)
|
|
25
|
+
* Configurable decode depth and array unrolling
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Quick Start
|
|
24
29
|
-----------
|
|
25
|
-
The easiest way to use PeakRDL-BusDecoder is via the
|
|
30
|
+
The easiest way to use PeakRDL-BusDecoder is via the
|
|
31
|
+
`PeakRDL command line tool <https://peakrdl.readthedocs.io/>`_:
|
|
26
32
|
|
|
27
33
|
.. code-block:: bash
|
|
28
34
|
|
|
@@ -32,6 +38,20 @@ The easiest way to use PeakRDL-BusDecoder is via the `PeakRDL command line tool
|
|
|
32
38
|
# Export!
|
|
33
39
|
peakrdl busdecoder atxmega_spi.rdl -o busdecoder/ --cpuif axi4-lite
|
|
34
40
|
|
|
41
|
+
The exporter writes two files:
|
|
42
|
+
|
|
43
|
+
* A SystemVerilog module (the bus decoder)
|
|
44
|
+
* A SystemVerilog package (constants like data width and per-child address widths)
|
|
45
|
+
|
|
46
|
+
Key command-line options:
|
|
47
|
+
|
|
48
|
+
* ``--cpuif``: Select the CPU interface (``apb3``, ``apb3-flat``, ``apb4``, ``apb4-flat``, ``axi4-lite``, ``axi4-lite-flat``)
|
|
49
|
+
* ``--module-name``: Override the generated module name
|
|
50
|
+
* ``--package-name``: Override the generated package name
|
|
51
|
+
* ``--addr-width``: Override the slave address width
|
|
52
|
+
* ``--unroll``: Unroll arrayed children into discrete interfaces
|
|
53
|
+
* ``--max-decode-depth``: Control how far the decoder descends into hierarchy
|
|
54
|
+
|
|
35
55
|
|
|
36
56
|
Looking for VHDL?
|
|
37
57
|
-----------------
|
|
@@ -55,10 +75,8 @@ Links
|
|
|
55
75
|
|
|
56
76
|
self
|
|
57
77
|
architecture
|
|
58
|
-
hwif
|
|
59
78
|
configuring
|
|
60
79
|
limitations
|
|
61
|
-
faq
|
|
62
80
|
licensing
|
|
63
81
|
api
|
|
64
82
|
|
|
@@ -69,29 +87,5 @@ Links
|
|
|
69
87
|
cpuif/introduction
|
|
70
88
|
cpuif/apb
|
|
71
89
|
cpuif/axi4lite
|
|
72
|
-
cpuif/avalon
|
|
73
|
-
cpuif/passthrough
|
|
74
90
|
cpuif/internal_protocol
|
|
75
91
|
cpuif/customizing
|
|
76
|
-
|
|
77
|
-
.. toctree::
|
|
78
|
-
:hidden:
|
|
79
|
-
:caption: SystemRDL Properties
|
|
80
|
-
|
|
81
|
-
props/field
|
|
82
|
-
props/reg
|
|
83
|
-
props/addrmap
|
|
84
|
-
props/signal
|
|
85
|
-
props/rhs_props
|
|
86
|
-
|
|
87
|
-
.. toctree::
|
|
88
|
-
:hidden:
|
|
89
|
-
:caption: Other SystemRDL Features
|
|
90
|
-
|
|
91
|
-
rdl_features/external
|
|
92
|
-
|
|
93
|
-
.. toctree::
|
|
94
|
-
:hidden:
|
|
95
|
-
:caption: Extended Properties
|
|
96
|
-
|
|
97
|
-
udps/intro
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Known Limitations
|
|
2
|
+
=================
|
|
3
|
+
|
|
4
|
+
The busdecoder exporter intentionally focuses on address decode and routing.
|
|
5
|
+
Some SystemRDL features are ignored, and a few are explicitly disallowed.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Address Alignment
|
|
9
|
+
-----------------
|
|
10
|
+
All address offsets and array strides must be aligned to the CPU interface data
|
|
11
|
+
bus width (in bytes). Misaligned offsets/strides are rejected.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
Wide Registers
|
|
15
|
+
--------------
|
|
16
|
+
If a register is wider than its ``accesswidth`` (a multi-word register), its
|
|
17
|
+
``accesswidth`` must match the CPU interface data width. Multi-word registers
|
|
18
|
+
with a smaller accesswidth are not supported.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Fields Spanning Sub-Words
|
|
22
|
+
-------------------------
|
|
23
|
+
If a field spans multiple sub-words of a wide register:
|
|
24
|
+
|
|
25
|
+
* Software-writable fields must have write buffering enabled
|
|
26
|
+
* Fields with ``onread`` side-effects must have read buffering enabled
|
|
27
|
+
|
|
28
|
+
These rules are enforced to avoid ambiguous multi-word access behavior.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
External Boundary References
|
|
32
|
+
----------------------------
|
|
33
|
+
Property references are not allowed to cross the internal/external boundary of
|
|
34
|
+
the exported addrmap. References must point to components that are internal to
|
|
35
|
+
the busdecoder being generated.
|
|
36
|
+
|
|
37
|
+
CPU Interface Reset Location
|
|
38
|
+
----------------------------
|
|
39
|
+
Only ``cpuif_reset`` signals instantiated at the top-level addrmap (or above)
|
|
40
|
+
are honored. Nested ``cpuif_reset`` signals are ignored.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Unsupported Properties
|
|
44
|
+
----------------------
|
|
45
|
+
The following SystemRDL properties are explicitly rejected:
|
|
46
|
+
|
|
47
|
+
* ``sharedextbus`` on addrmap/regfile components
|
|
@@ -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.8"
|
|
8
8
|
requires-python = ">=3.10"
|
|
9
9
|
dependencies = [
|
|
10
10
|
"jinja2~=3.1",
|
|
@@ -55,7 +55,6 @@ Documentation = "https://peakrdl-busdecoder.readthedocs.io/"
|
|
|
55
55
|
docs = [
|
|
56
56
|
"pygments-systemrdl>=1.3.0",
|
|
57
57
|
"sphinx-book-theme>=1.1.4",
|
|
58
|
-
"sphinxcontrib-wavedrom>=3.0.4",
|
|
59
58
|
]
|
|
60
59
|
test = [
|
|
61
60
|
"parameterized>=0.9.0",
|
{peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb3/apb3_tmpl.sv
RENAMED
|
@@ -37,4 +37,4 @@ assign {{cpuif.signal("PSLVERR")}} = cpuif_rd_err | cpuif_wr_err;
|
|
|
37
37
|
//--------------------------------------------------------------------------
|
|
38
38
|
// Fanin CPU Bus interface signals
|
|
39
39
|
//--------------------------------------------------------------------------
|
|
40
|
-
{{fanin|walk(cpuif=cpuif)}}
|
|
40
|
+
{{fanin|walk(cpuif=cpuif)}}
|
{peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/apb4/apb4_tmpl.sv
RENAMED
|
@@ -38,4 +38,4 @@ assign {{cpuif.signal("PSLVERR")}} = cpuif_rd_err | cpuif_wr_err;
|
|
|
38
38
|
//--------------------------------------------------------------------------
|
|
39
39
|
// Fanin CPU Bus interface signals
|
|
40
40
|
//--------------------------------------------------------------------------
|
|
41
|
-
{{fanin|walk(cpuif=cpuif)}}
|
|
41
|
+
{{fanin|walk(cpuif=cpuif)}}
|
|
@@ -77,8 +77,8 @@ class AXI4LiteCpuif(BaseCpuif):
|
|
|
77
77
|
if self.is_interface and node.is_array and node.array_dimensions:
|
|
78
78
|
# Generate array index string [i0][i1]... for the intermediate signal
|
|
79
79
|
array_idx = "".join(f"[i{i}]" for i in range(len(node.array_dimensions)))
|
|
80
|
-
fanin["cpuif_wr_ack"] = f"{node.inst_name}
|
|
81
|
-
fanin["cpuif_wr_err"] = f"{node.inst_name}
|
|
80
|
+
fanin["cpuif_wr_ack"] = f"{node.inst_name}_fanin_wr_valid{array_idx}"
|
|
81
|
+
fanin["cpuif_wr_err"] = f"{node.inst_name}_fanin_wr_err{array_idx}"
|
|
82
82
|
else:
|
|
83
83
|
# Read side: ack comes from RVALID; err if RRESP[1] is set (SLVERR/DECERR)
|
|
84
84
|
fanin["cpuif_wr_ack"] = self.signal("BVALID", node, "i")
|
|
@@ -119,4 +119,16 @@ class AXI4LiteCpuif(BaseCpuif):
|
|
|
119
119
|
f"assign {inst_name}_fanin_ready{array_idx} = {master_prefix}{indexed_path}.RVALID;",
|
|
120
120
|
f"assign {inst_name}_fanin_err{array_idx} = {master_prefix}{indexed_path}.RRESP[1];",
|
|
121
121
|
f"assign {inst_name}_fanin_data{array_idx} = {master_prefix}{indexed_path}.RDATA;",
|
|
122
|
+
f"assign {inst_name}_fanin_wr_valid{array_idx} = {master_prefix}{indexed_path}.BVALID;",
|
|
123
|
+
f"assign {inst_name}_fanin_wr_err{array_idx} = {master_prefix}{indexed_path}.BRESP[1];",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
def fanin_intermediate_declarations(self, node: AddressableNode) -> list[str]:
|
|
127
|
+
if not node.array_dimensions:
|
|
128
|
+
return []
|
|
129
|
+
|
|
130
|
+
array_str = "".join(f"[{dim}]" for dim in node.array_dimensions)
|
|
131
|
+
return [
|
|
132
|
+
f"logic {node.inst_name}_fanin_wr_valid{array_str};",
|
|
133
|
+
f"logic {node.inst_name}_fanin_wr_err{array_str};",
|
|
122
134
|
]
|
|
@@ -26,9 +26,21 @@
|
|
|
26
26
|
`endif
|
|
27
27
|
{% endif -%}
|
|
28
28
|
|
|
29
|
+
logic axi_wr_valid;
|
|
30
|
+
logic axi_wr_invalid;
|
|
31
|
+
logic cpuif_wr_ack_int;
|
|
32
|
+
logic cpuif_rd_ack_int;
|
|
33
|
+
|
|
34
|
+
assign axi_wr_valid = {{cpuif.signal("AWVALID")}} & {{cpuif.signal("WVALID")}};
|
|
35
|
+
assign axi_wr_invalid = {{cpuif.signal("AWVALID")}} ^ {{cpuif.signal("WVALID")}};
|
|
36
|
+
|
|
37
|
+
// Ready/acceptance follows the simplified single-beat requirement
|
|
38
|
+
assign {{cpuif.signal("AWREADY")}} = axi_wr_valid;
|
|
39
|
+
assign {{cpuif.signal("WREADY")}} = axi_wr_valid;
|
|
40
|
+
assign {{cpuif.signal("ARREADY")}} = {{cpuif.signal("ARVALID")}};
|
|
29
41
|
|
|
30
42
|
assign cpuif_req = {{cpuif.signal("AWVALID")}} | {{cpuif.signal("ARVALID")}};
|
|
31
|
-
assign cpuif_wr_en =
|
|
43
|
+
assign cpuif_wr_en = axi_wr_valid;
|
|
32
44
|
assign cpuif_rd_en = {{cpuif.signal("ARVALID")}};
|
|
33
45
|
|
|
34
46
|
assign cpuif_wr_addr = {{cpuif.signal("AWADDR")}};
|
|
@@ -42,12 +54,14 @@ assign cpuif_wr_byte_en = {{cpuif.signal("WSTRB")}};
|
|
|
42
54
|
// Read: ack=RVALID, err=RRESP[1] (SLVERR/DECERR), data=RDATA
|
|
43
55
|
//
|
|
44
56
|
assign {{cpuif.signal("RDATA")}} = cpuif_rd_data;
|
|
45
|
-
assign
|
|
57
|
+
assign cpuif_rd_ack_int = cpuif_rd_ack | cpuif_rd_sel.cpuif_err;
|
|
58
|
+
assign {{cpuif.signal("RVALID")}} = cpuif_rd_ack_int;
|
|
46
59
|
assign {{cpuif.signal("RRESP")}} = (cpuif_rd_err | cpuif_rd_sel.cpuif_err | cpuif_wr_sel.cpuif_err) ? 2'b10 : 2'b00;
|
|
47
60
|
|
|
48
61
|
// Write: ack=BVALID, err=BRESP[1]
|
|
49
|
-
assign
|
|
50
|
-
assign {{cpuif.signal("
|
|
62
|
+
assign cpuif_wr_ack_int = cpuif_wr_ack | cpuif_wr_sel.cpuif_err | axi_wr_invalid;
|
|
63
|
+
assign {{cpuif.signal("BVALID")}} = cpuif_wr_ack_int;
|
|
64
|
+
assign {{cpuif.signal("BRESP")}} = (cpuif_wr_err | cpuif_wr_sel.cpuif_err | cpuif_rd_sel.cpuif_err | axi_wr_invalid) ? 2'b10 : 2'b00;
|
|
51
65
|
|
|
52
66
|
//--------------------------------------------------------------------------
|
|
53
67
|
// Fanout CPU Bus interface signals
|
|
@@ -64,4 +78,4 @@ assign {{cpuif.signal("BRESP")}} = (cpuif_wr_err | cpuif_wr_sel.cpuif_err | cpu
|
|
|
64
78
|
//--------------------------------------------------------------------------
|
|
65
79
|
// Fanin CPU Bus interface signals
|
|
66
80
|
//--------------------------------------------------------------------------
|
|
67
|
-
{{fanin|walk(cpuif=cpuif)}}
|
|
81
|
+
{{fanin|walk(cpuif=cpuif)}}
|
{peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/base_cpuif.py
RENAMED
|
@@ -136,3 +136,7 @@ class BaseCpuif:
|
|
|
136
136
|
List of assignment strings
|
|
137
137
|
"""
|
|
138
138
|
return [] # Default: no intermediate assignments needed
|
|
139
|
+
|
|
140
|
+
def fanin_intermediate_declarations(self, node: AddressableNode) -> list[str]:
|
|
141
|
+
"""Optional extra intermediate signal declarations for interface arrays."""
|
|
142
|
+
return []
|
{peakrdl_busdecoder-0.6.6 → peakrdl_busdecoder-0.6.8}/src/peakrdl_busdecoder/cpuif/fanin_gen.py
RENAMED
|
@@ -72,12 +72,12 @@ class FaninGenerator(BusDecoderListener):
|
|
|
72
72
|
def __str__(self) -> str:
|
|
73
73
|
wr_ifb = IfBody()
|
|
74
74
|
with wr_ifb.cm("cpuif_wr_sel.cpuif_err") as b:
|
|
75
|
-
self._cpuif.fanin_wr(error=True)
|
|
75
|
+
b += self._cpuif.fanin_wr(error=True)
|
|
76
76
|
self._stack[-1] += wr_ifb
|
|
77
77
|
|
|
78
78
|
rd_ifb = IfBody()
|
|
79
79
|
with rd_ifb.cm("cpuif_rd_sel.cpuif_err") as b:
|
|
80
|
-
self._cpuif.fanin_rd(error=True)
|
|
80
|
+
b += self._cpuif.fanin_rd(error=True)
|
|
81
81
|
self._stack[-1] += rd_ifb
|
|
82
82
|
|
|
83
83
|
return "\n".join(map(str, self._stack))
|