peakrdl-busdecoder 0.4.0__tar.gz → 0.5.0__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.
Files changed (125) hide show
  1. peakrdl_busdecoder-0.5.0/.devcontainer/Dockerfile +22 -0
  2. peakrdl_busdecoder-0.5.0/.devcontainer/devcontainer.json +33 -0
  3. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/workflows/test.yml +9 -5
  4. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/PKG-INFO +2 -2
  5. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/pyproject.toml +3 -2
  6. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb3/apb3_cpuif_flat.py +10 -10
  7. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb4/apb4_cpuif_flat.py +12 -12
  8. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/interface.py +10 -1
  9. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/decode_logic_gen.py +3 -1
  10. peakrdl_busdecoder-0.5.0/src/peakrdl_busdecoder/sv_int.py +48 -0
  11. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder.egg-info/PKG-INFO +2 -2
  12. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder.egg-info/SOURCES.txt +2 -0
  13. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/uv.lock +1 -1
  14. peakrdl_busdecoder-0.4.0/src/peakrdl_busdecoder/sv_int.py +0 -21
  15. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  16. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  17. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/ISSUE_TEMPLATE/question.md +0 -0
  18. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/pull_request_template.md +0 -0
  19. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/workflows/build.yml +0 -0
  20. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/workflows/docs.yml +0 -0
  21. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/workflows/format.yml +0 -0
  22. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/workflows/lint.yml +0 -0
  23. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/workflows/release.yml +0 -0
  24. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.github/workflows/typecheck.yml +0 -0
  25. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.gitignore +0 -0
  26. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/.readthedocs.yaml +0 -0
  27. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/CONTRIBUTING.md +0 -0
  28. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/LICENSE +0 -0
  29. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/MANIFEST.in +0 -0
  30. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/README.md +0 -0
  31. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/Makefile +0 -0
  32. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/api.rst +0 -0
  33. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/architecture.rst +0 -0
  34. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/conf.py +0 -0
  35. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/configuring.rst +0 -0
  36. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/cpuif/apb.rst +0 -0
  37. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/cpuif/avalon.rst +0 -0
  38. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/cpuif/axi4lite.rst +0 -0
  39. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/cpuif/customizing.rst +0 -0
  40. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/cpuif/internal_protocol.rst +0 -0
  41. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/cpuif/introduction.rst +0 -0
  42. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/cpuif/passthrough.rst +0 -0
  43. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/Alpha-Beta Versioning +0 -0
  44. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/Hierarchy-and-Indexing +0 -0
  45. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/Program Flow +0 -0
  46. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/Resets +0 -0
  47. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/Signal Dereferencer +0 -0
  48. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/Validation Needed +0 -0
  49. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/template-layers/1-port-declaration +0 -0
  50. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/template-layers/1.1.hardware-interface +0 -0
  51. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/template-layers/2-CPUIF +0 -0
  52. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/template-layers/3-address-decode +0 -0
  53. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/template-layers/4-fields +0 -0
  54. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/template-layers/5-readback-mux +0 -0
  55. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/dev_notes/template-layers/6-output-port-mapping +0 -0
  56. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/diagrams/arch.png +0 -0
  57. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/diagrams/diagrams.odg +0 -0
  58. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/diagrams/rbuf.png +0 -0
  59. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/diagrams/readback.png +0 -0
  60. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/diagrams/wbuf.png +0 -0
  61. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/faq.rst +0 -0
  62. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/hwif.rst +0 -0
  63. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/img/err.svg +0 -0
  64. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/img/ok.svg +0 -0
  65. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/img/warn.svg +0 -0
  66. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/index.rst +0 -0
  67. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/licensing.rst +0 -0
  68. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/limitations.rst +0 -0
  69. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/props/addrmap.rst +0 -0
  70. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/props/field.rst +0 -0
  71. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/props/reg.rst +0 -0
  72. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/props/rhs_props.rst +0 -0
  73. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/props/signal.rst +0 -0
  74. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/rdl_features/external.rst +0 -0
  75. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/requirements.txt +0 -0
  76. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/docs/udps/intro.rst +0 -0
  77. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/hdl-src/README.md +0 -0
  78. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/hdl-src/apb3_intf.sv +0 -0
  79. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/hdl-src/apb4_intf.sv +0 -0
  80. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/hdl-src/avalon_mm_intf.sv +0 -0
  81. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/hdl-src/axi4lite_intf.sv +0 -0
  82. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/setup.cfg +0 -0
  83. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/__init__.py +0 -0
  84. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/__peakrdl__.py +0 -0
  85. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/body/__init__.py +0 -0
  86. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/body/body.py +0 -0
  87. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/body/combinational_body.py +0 -0
  88. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/body/for_loop_body.py +0 -0
  89. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/body/if_body.py +0 -0
  90. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/body/struct_body.py +0 -0
  91. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/__init__.py +0 -0
  92. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb3/__init__.py +0 -0
  93. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb3/apb3_cpuif.py +0 -0
  94. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb3/apb3_interface.py +0 -0
  95. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb3/apb3_tmpl.sv +0 -0
  96. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb4/__init__.py +0 -0
  97. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb4/apb4_cpuif.py +0 -0
  98. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb4/apb4_interface.py +0 -0
  99. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/apb4/apb4_tmpl.sv +0 -0
  100. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/axi4lite/__init__.py +0 -0
  101. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif.py +0 -0
  102. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif_flat.py +0 -0
  103. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_interface.py +0 -0
  104. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_tmpl.sv +0 -0
  105. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/base_cpuif.py +0 -0
  106. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/fanin_gen.py +0 -0
  107. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/fanin_intermediate_gen.py +0 -0
  108. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/cpuif/fanout_gen.py +0 -0
  109. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/design_scanner.py +0 -0
  110. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/design_state.py +0 -0
  111. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/exporter.py +0 -0
  112. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/identifier_filter.py +0 -0
  113. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/listener.py +0 -0
  114. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/module_tmpl.sv +0 -0
  115. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/package_tmpl.sv +0 -0
  116. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/py.typed +0 -0
  117. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/struct_gen.py +0 -0
  118. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/udps/__init__.py +0 -0
  119. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/utils.py +0 -0
  120. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder/validate_design.py +0 -0
  121. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder.egg-info/dependency_links.txt +0 -0
  122. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder.egg-info/entry_points.txt +0 -0
  123. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder.egg-info/requires.txt +0 -0
  124. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/src/peakrdl_busdecoder.egg-info/top_level.txt +0 -0
  125. {peakrdl_busdecoder-0.4.0 → peakrdl_busdecoder-0.5.0}/tools/shims/xargs +0 -0
@@ -0,0 +1,22 @@
1
+ FROM verilator/verilator:latest
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ RUN apt-get update && \
6
+ apt-get install -y --no-install-recommends \
7
+ python3 \
8
+ python3-venv \
9
+ python3-pip \
10
+ python3-dev \
11
+ build-essential \
12
+ pkg-config \
13
+ git \
14
+ curl \
15
+ ca-certificates && \
16
+ rm -rf /var/lib/apt/lists/*
17
+
18
+ ENV UV_INSTALL_DIR=/usr/local/bin
19
+ ENV UV_LINK_MODE=copy
20
+ # Install uv globally so both VS Code and terminals can use it
21
+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
22
+ RUN uv --version
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "PeakRDL BusDecoder",
3
+ "build": {
4
+ "dockerfile": "Dockerfile"
5
+ },
6
+ "runArgs": [
7
+ "--init"
8
+ ],
9
+ "features": {
10
+ "ghcr.io/devcontainers/features/common-utils:2": {
11
+ "username": "vscode",
12
+ "uid": "1000",
13
+ "gid": "1000",
14
+ "installZsh": "false",
15
+ "installOhMyZsh": "false"
16
+ }
17
+ },
18
+ "remoteUser": "vscode",
19
+ "postCreateCommand": "uv sync --frozen --all-extras --group tools --group test",
20
+ "customizations": {
21
+ "vscode": {
22
+ "settings": {
23
+ "python.defaultInterpreterPath": ".venv/bin/python",
24
+ "terminal.integrated.shell.linux": "/bin/bash"
25
+ },
26
+ "extensions": [
27
+ "ms-python.python",
28
+ "ms-python.vscode-pylance",
29
+ "ms-vscode.cpptools"
30
+ ]
31
+ }
32
+ }
33
+ }
@@ -14,6 +14,8 @@ on:
14
14
  jobs:
15
15
  test:
16
16
  runs-on: ubuntu-latest
17
+ container:
18
+ image: verilator/verilator:latest
17
19
  permissions:
18
20
  contents: read
19
21
  strategy:
@@ -27,19 +29,21 @@ jobs:
27
29
  uses: astral-sh/setup-uv@v3
28
30
  with:
29
31
  python-version: ${{ matrix.python-version }}
32
+ enable-cache: true
30
33
 
31
- - name: Install Verilator
34
+ - name: Check Verilator version
35
+ run: verilator --version
36
+
37
+ - name: Install Python development packages
32
38
  run: |
33
- sudo apt-get update
34
- sudo apt-get install -y verilator
35
- verilator --version
39
+ apt-get update && apt-get install -y python3-dev libpython3-dev
36
40
 
37
41
  - name: Install dependencies
38
42
  run: |
39
43
  uv sync --all-extras --group test
40
44
 
41
45
  - name: Run tests
42
- run: uv run pytest tests/ -v --cov=peakrdl_busdecoder --cov-report=xml --cov-report=term
46
+ run: uv run pytest tests/ --cov=peakrdl_busdecoder --cov-report=xml --cov-report=term
43
47
 
44
48
  - name: Upload coverage to Codecov
45
49
  uses: codecov/codecov-action@v4
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: peakrdl-busdecoder
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Generate a SystemVerilog bus decoder from SystemRDL for splitting CPU interfaces to multiple sub-address spaces
5
- Author: Alex Mykyta
5
+ Author: Arnav Sacheti
6
6
  License: LGPLv3
7
7
  Project-URL: Source, https://github.com/arnavsacheti/PeakRDL-BusDecoder
8
8
  Project-URL: Tracker, https://github.com/arnavsacheti/PeakRDL-BusDecoder/issues
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "peakrdl-busdecoder"
7
- version = "0.4.0"
7
+ version = "0.5.0"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = ["jinja2>=3.1.6", "systemrdl-compiler~=1.30.1"]
10
10
 
11
- authors = [{ name = "Alex Mykyta" }]
11
+ authors = [{ name = "Arnav Sacheti" }]
12
12
  description = "Generate a SystemVerilog bus decoder from SystemRDL for splitting CPU interfaces to multiple sub-address spaces"
13
13
  readme = "README.md"
14
14
  license = { text = "LGPLv3" }
@@ -114,3 +114,4 @@ markers = [
114
114
  "simulation: marks tests as requiring cocotb simulation (deselect with '-m \"not simulation\"')",
115
115
  "verilator: marks tests as requiring verilator simulator (deselect with '-m \"not verilator\"')",
116
116
  ]
117
+ filterwarnings = ["error", "ignore::UserWarning"]
@@ -35,15 +35,15 @@ class APB3CpuifFlat(BaseCpuif):
35
35
 
36
36
  def fanout(self, node: AddressableNode) -> str:
37
37
  fanout: dict[str, str] = {}
38
- fanout[self.signal("PSEL", node)] = (
39
- f"cpuif_wr_sel.{get_indexed_path(self.exp.ds.top_node, node, 'i')}|cpuif_rd_sel.{get_indexed_path(self.exp.ds.top_node, node, 'i')}"
38
+ fanout[self.signal("PSEL", node, "gi")] = (
39
+ f"cpuif_wr_sel.{get_indexed_path(self.exp.ds.top_node, node, 'gi')}|cpuif_rd_sel.{get_indexed_path(self.exp.ds.top_node, node, 'gi')}"
40
40
  )
41
- fanout[self.signal("PENABLE", node)] = self.signal("PENABLE")
42
- fanout[self.signal("PWRITE", node)] = (
43
- f"cpuif_wr_sel.{get_indexed_path(self.exp.ds.top_node, node, 'i')}"
41
+ fanout[self.signal("PENABLE", node, "gi")] = self.signal("PENABLE")
42
+ fanout[self.signal("PWRITE", node, "gi")] = (
43
+ f"cpuif_wr_sel.{get_indexed_path(self.exp.ds.top_node, node, 'gi')}"
44
44
  )
45
- fanout[self.signal("PADDR", node)] = self.signal("PADDR")
46
- fanout[self.signal("PWDATA", node)] = "cpuif_wr_data"
45
+ fanout[self.signal("PADDR", node, "gi")] = self.signal("PADDR")
46
+ fanout[self.signal("PWDATA", node, "gi")] = "cpuif_wr_data"
47
47
 
48
48
  return "\n".join(map(lambda kv: f"assign {kv[0]} = {kv[1]};", fanout.items()))
49
49
 
@@ -53,8 +53,8 @@ class APB3CpuifFlat(BaseCpuif):
53
53
  fanin["cpuif_rd_ack"] = "'0"
54
54
  fanin["cpuif_rd_err"] = "'0"
55
55
  else:
56
- fanin["cpuif_rd_ack"] = self.signal("PREADY", node)
57
- fanin["cpuif_rd_err"] = self.signal("PSLVERR", node)
56
+ fanin["cpuif_rd_ack"] = self.signal("PREADY", node, "i")
57
+ fanin["cpuif_rd_err"] = self.signal("PSLVERR", node, "i")
58
58
 
59
59
  return "\n".join(map(lambda kv: f"{kv[0]} = {kv[1]};", fanin.items()))
60
60
 
@@ -63,6 +63,6 @@ class APB3CpuifFlat(BaseCpuif):
63
63
  if node is None:
64
64
  fanin["cpuif_rd_data"] = "'0"
65
65
  else:
66
- fanin["cpuif_rd_data"] = self.signal("PRDATA", node)
66
+ fanin["cpuif_rd_data"] = self.signal("PRDATA", node, "i")
67
67
 
68
68
  return "\n".join(map(lambda kv: f"{kv[0]} = {kv[1]};", fanin.items()))
@@ -35,17 +35,17 @@ class APB4CpuifFlat(BaseCpuif):
35
35
 
36
36
  def fanout(self, node: AddressableNode) -> str:
37
37
  fanout: dict[str, str] = {}
38
- fanout[self.signal("PSEL", node)] = (
39
- f"cpuif_wr_sel.{get_indexed_path(self.exp.ds.top_node, node, 'i')}|cpuif_rd_sel.{get_indexed_path(self.exp.ds.top_node, node, 'i')}"
38
+ fanout[self.signal("PSEL", node, "gi")] = (
39
+ f"cpuif_wr_sel.{get_indexed_path(self.exp.ds.top_node, node, 'gi')}|cpuif_rd_sel.{get_indexed_path(self.exp.ds.top_node, node, 'gi')}"
40
40
  )
41
- fanout[self.signal("PENABLE", node)] = self.signal("PENABLE")
42
- fanout[self.signal("PWRITE", node)] = (
43
- f"cpuif_wr_sel.{get_indexed_path(self.exp.ds.top_node, node, 'i')}"
41
+ fanout[self.signal("PENABLE", node, "gi")] = self.signal("PENABLE")
42
+ fanout[self.signal("PWRITE", node, "gi")] = (
43
+ f"cpuif_wr_sel.{get_indexed_path(self.exp.ds.top_node, node, 'gi')}"
44
44
  )
45
- fanout[self.signal("PADDR", node)] = self.signal("PADDR")
46
- fanout[self.signal("PPROT", node)] = self.signal("PPROT")
47
- fanout[self.signal("PWDATA", node)] = "cpuif_wr_data"
48
- fanout[self.signal("PSTRB", node)] = "cpuif_wr_byte_en"
45
+ fanout[self.signal("PADDR", node, "gi")] = self.signal("PADDR")
46
+ fanout[self.signal("PPROT", node, "gi")] = self.signal("PPROT")
47
+ fanout[self.signal("PWDATA", node, "gi")] = "cpuif_wr_data"
48
+ fanout[self.signal("PSTRB", node, "gi")] = "cpuif_wr_byte_en"
49
49
 
50
50
  return "\n".join(map(lambda kv: f"assign {kv[0]} = {kv[1]};", fanout.items()))
51
51
 
@@ -55,8 +55,8 @@ class APB4CpuifFlat(BaseCpuif):
55
55
  fanin["cpuif_rd_ack"] = "'0"
56
56
  fanin["cpuif_rd_err"] = "'0"
57
57
  else:
58
- fanin["cpuif_rd_ack"] = self.signal("PREADY", node)
59
- fanin["cpuif_rd_err"] = self.signal("PSLVERR", node)
58
+ fanin["cpuif_rd_ack"] = self.signal("PREADY", node, "i")
59
+ fanin["cpuif_rd_err"] = self.signal("PSLVERR", node, "i")
60
60
 
61
61
  return "\n".join(map(lambda kv: f"{kv[0]} = {kv[1]};", fanin.items()))
62
62
 
@@ -65,6 +65,6 @@ class APB4CpuifFlat(BaseCpuif):
65
65
  if node is None:
66
66
  fanin["cpuif_rd_data"] = "'0"
67
67
  else:
68
- fanin["cpuif_rd_data"] = self.signal("PRDATA", node)
68
+ fanin["cpuif_rd_data"] = self.signal("PRDATA", node, "i")
69
69
 
70
70
  return "\n".join(map(lambda kv: f"{kv[0]} = {kv[1]};", fanin.items()))
@@ -1,10 +1,13 @@
1
1
  """Interface abstraction for handling flat and non-flat signal declarations."""
2
2
 
3
+ import re
3
4
  from abc import ABC, abstractmethod
4
5
  from typing import TYPE_CHECKING
5
6
 
6
7
  from systemrdl.node import AddressableNode
7
8
 
9
+ from ..utils import get_indexed_path
10
+
8
11
  if TYPE_CHECKING:
9
12
  from .base_cpuif import BaseCpuif
10
13
 
@@ -93,7 +96,6 @@ class SVInterface(Interface):
93
96
  indexer: str | int | None = None,
94
97
  ) -> str:
95
98
  """Generate SystemVerilog interface signal reference."""
96
- from ..utils import get_indexed_path
97
99
 
98
100
  # SVInterface only supports string indexers (loop variable names like "i", "gi")
99
101
  if indexer is not None and not isinstance(indexer, str):
@@ -166,6 +168,13 @@ class FlatInterface(Interface):
166
168
 
167
169
  # Is an array
168
170
  if indexer is not None:
171
+ if isinstance(indexer, str):
172
+ indexed_path = get_indexed_path(node.parent, node, indexer, skip_kw_filter=True)
173
+ pattern = r"\[.*?\]"
174
+ indexes = re.findall(pattern, indexed_path)
175
+
176
+ return f"{base}_{signal}{''.join(indexes)}"
177
+
169
178
  return f"{base}_{signal}[{indexer}]"
170
179
  return f"{base}_{signal}[N_{node.inst_name.upper()}S]"
171
180
 
@@ -70,7 +70,9 @@ class DecodeLogicGenerator(BusDecoderListener):
70
70
  # Avoid generating a redundant >= 0 comparison, which triggers Verilator warnings.
71
71
  if not (l_bound.value == 0 and len(l_bound_comp) == 1):
72
72
  predicates.append(lower_expr)
73
- predicates.append(upper_expr)
73
+ # Avoid generating a redundant full-width < max comparison, which triggers Verilator warnings.
74
+ if not (u_bound.value == (1 << addr_width) and len(u_bound_comp) == 1):
75
+ predicates.append(upper_expr)
74
76
 
75
77
  return predicates
76
78
 
@@ -0,0 +1,48 @@
1
+ from typing import Literal
2
+
3
+
4
+ class SVInt:
5
+ def __init__(self, value: int, width: int | None = None) -> None:
6
+ self.value = value
7
+ self.width = width
8
+
9
+ def __str__(self) -> str:
10
+ if self.width is not None:
11
+ # Explicit width
12
+ return f"{self.width}'h{self.value:x}"
13
+ elif self.value.bit_length() > 32:
14
+ # SV standard only enforces that unsized literals shall be at least 32-bits
15
+ # To support larger literals, they need to be sized explicitly
16
+ return f"{self.value.bit_length()}'h{self.value:x}"
17
+ else:
18
+ return f"'h{self.value:x}"
19
+
20
+ def __add__(self, other: "SVInt") -> "SVInt":
21
+ if self.width is not None and other.width is not None:
22
+ return SVInt(self.value + other.value, max(self.width, other.width))
23
+ else:
24
+ return SVInt(self.value + other.value, None)
25
+
26
+ def __sub__(self, other: "SVInt") -> "SVInt":
27
+ if self.width is not None and other.width is not None:
28
+ return SVInt(self.value - other.value, max(self.width, other.width))
29
+ else:
30
+ return SVInt(self.value - other.value, None)
31
+
32
+ def __len__(self) -> int:
33
+ if self.width is not None:
34
+ return self.width
35
+ else:
36
+ return self.value.bit_length()
37
+
38
+ def to_bytes(self, byteorder: Literal["little", "big"] = "little") -> bytes:
39
+ byte_length = (self.value.bit_length() + 7) // 8
40
+ return self.value.to_bytes(byte_length, byteorder)
41
+
42
+ def __eq__(self, other: object) -> bool:
43
+ if not isinstance(other, SVInt):
44
+ return NotImplemented
45
+ return self.value == other.value and self.width == other.width
46
+
47
+ def __hash__(self) -> int:
48
+ return hash((self.value, self.width))
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: peakrdl-busdecoder
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Generate a SystemVerilog bus decoder from SystemRDL for splitting CPU interfaces to multiple sub-address spaces
5
- Author: Alex Mykyta
5
+ Author: Arnav Sacheti
6
6
  License: LGPLv3
7
7
  Project-URL: Source, https://github.com/arnavsacheti/PeakRDL-BusDecoder
8
8
  Project-URL: Tracker, https://github.com/arnavsacheti/PeakRDL-BusDecoder/issues
@@ -6,6 +6,8 @@ MANIFEST.in
6
6
  README.md
7
7
  pyproject.toml
8
8
  uv.lock
9
+ .devcontainer/Dockerfile
10
+ .devcontainer/devcontainer.json
9
11
  .github/pull_request_template.md
10
12
  .github/ISSUE_TEMPLATE/bug_report.md
11
13
  .github/ISSUE_TEMPLATE/feature_request.md
@@ -608,7 +608,7 @@ wheels = [
608
608
 
609
609
  [[package]]
610
610
  name = "peakrdl-busdecoder"
611
- version = "0.4.0"
611
+ version = "0.5.0"
612
612
  source = { editable = "." }
613
613
  dependencies = [
614
614
  { name = "jinja2" },
@@ -1,21 +0,0 @@
1
- class SVInt:
2
- def __init__(self, value: int, width: int | None = None) -> None:
3
- self.value = value
4
- self.width = width
5
-
6
- def __str__(self) -> str:
7
- if self.width is not None:
8
- # Explicit width
9
- return f"{self.width}'h{self.value:x}"
10
- elif self.value.bit_length() > 32:
11
- # SV standard only enforces that unsized literals shall be at least 32-bits
12
- # To support larger literals, they need to be sized explicitly
13
- return f"{self.value.bit_length()}'h{self.value:x}"
14
- else:
15
- return f"'h{self.value:x}"
16
-
17
- def __add__(self, other: "SVInt") -> "SVInt":
18
- if self.width is not None and other.width is not None:
19
- return SVInt(self.value + other.value, max(self.width, other.width))
20
- else:
21
- return SVInt(self.value + other.value, None)