SimplHDL 0.13.6__tar.gz → 0.13.7__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 (160) hide show
  1. {simplhdl-0.13.6/src/simplhdl.egg-info → simplhdl-0.13.7}/PKG-INFO +4 -5
  2. {simplhdl-0.13.6 → simplhdl-0.13.7}/pyproject.toml +3 -4
  3. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/__init__.py +1 -1
  4. {simplhdl-0.13.6 → simplhdl-0.13.7/src/simplhdl.egg-info}/PKG-INFO +4 -5
  5. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl.egg-info/SOURCES.txt +3 -1
  6. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl.egg-info/requires.txt +3 -3
  7. simplhdl-0.13.7/src/simplhdl_peakrdl/compiler.py +26 -0
  8. simplhdl-0.13.7/src/simplhdl_peakrdl/systemrdl.py +470 -0
  9. simplhdl-0.13.7/tests/test_systemrdl.py +86 -0
  10. simplhdl-0.13.6/src/simplhdl_peakrdl/systemrdl.py +0 -325
  11. {simplhdl-0.13.6 → simplhdl-0.13.7}/LICENSE +0 -0
  12. {simplhdl-0.13.6 → simplhdl-0.13.7}/README.md +0 -0
  13. {simplhdl-0.13.6 → simplhdl-0.13.7}/setup.cfg +0 -0
  14. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/__main__.py +0 -0
  15. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/_compat.py +0 -0
  16. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/cli/arguments.py +0 -0
  17. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/cli/info.py +0 -0
  18. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/cli/run.py +0 -0
  19. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/cocotb.py +0 -0
  20. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/plugin/__init__.py +0 -0
  21. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/plugin/flow.py +0 -0
  22. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/plugin/generator.py +0 -0
  23. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/plugin/implementationflow.py +0 -0
  24. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/plugin/loader.py +0 -0
  25. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/plugin/parser.py +0 -0
  26. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/plugin/simulationflow.py +0 -0
  27. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/project/__init__.py +0 -0
  28. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/project/attributes.py +0 -0
  29. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/project/base.py +0 -0
  30. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/project/design.py +0 -0
  31. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/project/files.py +0 -0
  32. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/project/fileset.py +0 -0
  33. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/project/project.py +0 -0
  34. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/simplhdl.py +0 -0
  35. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/tools.py +0 -0
  36. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl/utils.py +0 -0
  37. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl.egg-info/dependency_links.txt +0 -0
  38. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl.egg-info/entry_points.txt +0 -0
  39. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl.egg-info/top_level.txt +0 -0
  40. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_chisel/chisel.py +0 -0
  41. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_encrypt/__init__.py +0 -0
  42. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_encrypt/encrypt/__init__.py +0 -0
  43. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_encrypt/encrypt/encryptflow.py +0 -0
  44. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_fusesocparser/__init__.py +0 -0
  45. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_fusesocparser/fusesocparser.py +0 -0
  46. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/__init__.py +0 -0
  47. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/icarusflow.py +0 -0
  48. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/resources/__init__.py +0 -0
  49. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/resources/templates/__init__.py +0 -0
  50. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/resources/templates/icarus/Makefile.j2 +0 -0
  51. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/resources/templates/icarus/__init__.py +0 -0
  52. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/resources/templates/icarus/cmds.f.j2 +0 -0
  53. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/resources/templates/icarus/cocotb.mk.j2 +0 -0
  54. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/resources/templates/icarus/simplhdl_iverilog_dump.v.j2 +0 -0
  55. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_icarus/resources/templates/icarus/sources.mk.j2 +0 -0
  56. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_jinja2/jinja2.py +0 -0
  57. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/__init__.py +0 -0
  58. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/flake8/flake8flow.py +0 -0
  59. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/lint/lintflow.py +0 -0
  60. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/__init__.py +0 -0
  61. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/templates/__init__.py +0 -0
  62. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/templates/flake8/__init__.py +0 -0
  63. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/templates/flake8/setup.cfg.j2 +0 -0
  64. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/templates/verible/__init__.py +0 -0
  65. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/templates/verible/rules.cfg.j2 +0 -0
  66. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/templates/vsg/__init__.py +0 -0
  67. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/templates/vsg/files.json.j2 +0 -0
  68. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/resources/templates/vsg/rules.yml.j2 +0 -0
  69. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/verible/__init__.py +0 -0
  70. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/verible/veribleflow.py +0 -0
  71. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/vsg/__init__.py +0 -0
  72. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_lint/vsg/vsgflow.py +0 -0
  73. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/__init__.py +0 -0
  74. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/modelsim/__init__.py +0 -0
  75. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/modelsim/modelsimflow.py +0 -0
  76. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/__init__.py +0 -0
  77. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/__init__.py +0 -0
  78. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/Makefile.j2 +0 -0
  79. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/__init__.py +0 -0
  80. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/cocotb.mk.j2 +0 -0
  81. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/dependencies.mk.j2 +0 -0
  82. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/files.j2 +0 -0
  83. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/fileset.j2 +0 -0
  84. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/modelsim.tcl.j2 +0 -0
  85. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/project.mk.j2 +0 -0
  86. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_modelsim/resources/templates/modelsim/run.do.j2 +0 -0
  87. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_parser/__init__.py +0 -0
  88. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_parser/simplhdlparser.py +0 -0
  89. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_peakrdl/__init__.py +0 -0
  90. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/quartusdse/__init__.py +0 -0
  91. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/quartusdse/quartusdseflow.py +0 -0
  92. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/quartusexport/__init__.py +0 -0
  93. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/quartusexport/quartusexportflow.py +0 -0
  94. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/quartusflow.py +0 -0
  95. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/resources/__init__.py +0 -0
  96. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/resources/templates/__init__.py +0 -0
  97. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/resources/templates/quartus/__init__.py +0 -0
  98. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/resources/templates/quartus/project.tcl.j2 +0 -0
  99. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/resources/templates/quartus/run.tcl.j2 +0 -0
  100. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_quartus/spd.py +0 -0
  101. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/questasim/__init__.py +0 -0
  102. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/questasim/questasimflow.py +0 -0
  103. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/resources/__init__.py +0 -0
  104. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/resources/templates/__init__.py +0 -0
  105. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/resources/templates/questasim/__init__.py +0 -0
  106. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/resources/templates/questasim/modelsim.tcl.j2 +0 -0
  107. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/resources/templates/questasim/project.qrun.j2 +0 -0
  108. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/resources/templates/questasim/visualizer.tcl.j2 +0 -0
  109. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_questasim/resources/templates/questasim/vsim-run.do.j2 +0 -0
  110. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/__init__.py +0 -0
  111. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/__init__.py +0 -0
  112. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/templates/__init__.py +0 -0
  113. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/templates/rivierapro/Makefile.j2 +0 -0
  114. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/templates/rivierapro/__init__.py +0 -0
  115. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/templates/rivierapro/cocotb.mk.j2 +0 -0
  116. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/templates/rivierapro/dependencies.mk.j2 +0 -0
  117. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/templates/rivierapro/files.j2 +0 -0
  118. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/templates/rivierapro/fileset.j2 +0 -0
  119. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/resources/templates/rivierapro/project.mk.j2 +0 -0
  120. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/rivierapro/__init__.py +0 -0
  121. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_rivierapro/rivierapro/rivieraproflow.py +0 -0
  122. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/__init__.py +0 -0
  123. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/__init__.py +0 -0
  124. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/__init__.py +0 -0
  125. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/Makefile.j2 +0 -0
  126. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/__init__.py +0 -0
  127. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/cocotb.mk.j2 +0 -0
  128. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/dependencies.mk.j2 +0 -0
  129. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/files.j2 +0 -0
  130. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/fileset.j2 +0 -0
  131. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/pli.tab.j2 +0 -0
  132. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/project.mk.j2 +0 -0
  133. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/simv-run.do.j2 +0 -0
  134. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/synopsys_sim.setup.j2 +0 -0
  135. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/resources/templates/vcs/vcs.parameters.j2 +0 -0
  136. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/vcs/__init__.py +0 -0
  137. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vcs/vcs/vcsflow.py +0 -0
  138. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/__init__.py +0 -0
  139. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/ipxact.py +0 -0
  140. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/__init__.py +0 -0
  141. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/__init__.py +0 -0
  142. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/vivado/__init__.py +0 -0
  143. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/vivado/project.tcl.j2 +0 -0
  144. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/vivado/run.tcl.j2 +0 -0
  145. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/vivado/steps.tcl.j2 +0 -0
  146. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/xsim/Makefile.j2 +0 -0
  147. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/xsim/__init__.py +0 -0
  148. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/xsim/cocotb.mk.j2 +0 -0
  149. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/xsim/dependencies.mk.j2 +0 -0
  150. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/xsim/files.j2 +0 -0
  151. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/xsim/fileset.j2 +0 -0
  152. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/resources/templates/xsim/project.mk.j2 +0 -0
  153. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/vivadoexport/__init__.py +0 -0
  154. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/vivadoexport/vivadoexportflow.py +0 -0
  155. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/vivadoflow.py +0 -0
  156. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/xsim/__init__.py +0 -0
  157. {simplhdl-0.13.6 → simplhdl-0.13.7}/src/simplhdl_vivado/xsim/xsimflow.py +0 -0
  158. {simplhdl-0.13.6 → simplhdl-0.13.7}/tests/test_design.py +0 -0
  159. {simplhdl-0.13.6 → simplhdl-0.13.7}/tests/test_files.py +0 -0
  160. {simplhdl-0.13.6 → simplhdl-0.13.7}/tests/test_fileset.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplhdl
3
- Version: 0.13.6
3
+ Version: 0.13.7
4
4
  Summary: A framework for simulating and implementing HDL designs
5
5
  Author-email: Rasmus Grøndahl Olsen <simplhdl@gmail.com>
6
6
  Maintainer-email: Rasmus Grøndahl Olsen <simplhdl@gmail.com>
@@ -35,31 +35,30 @@ Classifier: Intended Audience :: Developers
35
35
  Classifier: License :: OSI Approved :: MIT License
36
36
  Classifier: Operating System :: OS Independent
37
37
  Classifier: Programming Language :: Python :: 3 :: Only
38
- Classifier: Programming Language :: Python :: 3.8
39
38
  Classifier: Programming Language :: Python :: 3.9
40
39
  Classifier: Programming Language :: Python :: 3.10
41
40
  Classifier: Programming Language :: Python :: 3.11
42
41
  Classifier: Programming Language :: Python :: 3.12
43
42
  Classifier: Programming Language :: Python :: 3.13
44
43
  Classifier: Programming Language :: Python :: 3.14
45
- Requires-Python: >=3.8
44
+ Requires-Python: >=3.9
46
45
  Description-Content-Type: text/markdown
47
46
  License-File: LICENSE
48
47
  Requires-Dist: argcomplete
49
48
  Requires-Dist: black
50
49
  Requires-Dist: flake8
51
50
  Requires-Dist: gitpython
52
- Requires-Dist: importlib-resources; python_version < "3.9"
53
51
  Requires-Dist: jinja2
54
52
  Requires-Dist: matplotlib
55
53
  Requires-Dist: networkx
56
54
  Requires-Dist: peakrdl-html
57
- Requires-Dist: peakrdl-pyuvm
55
+ Requires-Dist: peakrdl-pyuvm>=0.9
58
56
  Requires-Dist: peakrdl-regblock>=1.2
59
57
  Requires-Dist: pyyaml
60
58
  Requires-Dist: rich
61
59
  Requires-Dist: singleton-decorator
62
60
  Requires-Dist: systemrdl-compiler
61
+ Requires-Dist: tomli; python_version < "3.11"
63
62
  Requires-Dist: types-pyyaml
64
63
  Requires-Dist: vsg
65
64
  Provides-Extra: dev
@@ -16,14 +16,13 @@ maintainers = [
16
16
  authors = [
17
17
  { name = "Rasmus Grøndahl Olsen", email = "simplhdl@gmail.com" },
18
18
  ]
19
- requires-python = ">=3.8"
19
+ requires-python = ">=3.9"
20
20
  classifiers = [
21
21
  "Development Status :: 4 - Beta",
22
22
  "Intended Audience :: Developers",
23
23
  "License :: OSI Approved :: MIT License",
24
24
  "Operating System :: OS Independent",
25
25
  "Programming Language :: Python :: 3 :: Only",
26
- "Programming Language :: Python :: 3.8",
27
26
  "Programming Language :: Python :: 3.9",
28
27
  "Programming Language :: Python :: 3.10",
29
28
  "Programming Language :: Python :: 3.11",
@@ -38,17 +37,17 @@ dependencies = [
38
37
  "black",
39
38
  "flake8",
40
39
  "gitpython",
41
- "importlib-resources; python_version<'3.9'",
42
40
  "jinja2",
43
41
  "matplotlib",
44
42
  "networkx",
45
43
  "peakrdl-html",
46
- "peakrdl-pyuvm",
44
+ "peakrdl-pyuvm>=0.9",
47
45
  "peakrdl-regblock>=1.2",
48
46
  "pyyaml",
49
47
  "rich",
50
48
  "singleton-decorator",
51
49
  "systemrdl-compiler",
50
+ "tomli; python_version<'3.11'",
52
51
  "types-pyyaml",
53
52
  "vsg",
54
53
  ]
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.13.6"
3
+ __version__ = "0.13.7"
4
4
 
5
5
  from .__main__ import parse_arguments
6
6
  from .project.design import *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplhdl
3
- Version: 0.13.6
3
+ Version: 0.13.7
4
4
  Summary: A framework for simulating and implementing HDL designs
5
5
  Author-email: Rasmus Grøndahl Olsen <simplhdl@gmail.com>
6
6
  Maintainer-email: Rasmus Grøndahl Olsen <simplhdl@gmail.com>
@@ -35,31 +35,30 @@ Classifier: Intended Audience :: Developers
35
35
  Classifier: License :: OSI Approved :: MIT License
36
36
  Classifier: Operating System :: OS Independent
37
37
  Classifier: Programming Language :: Python :: 3 :: Only
38
- Classifier: Programming Language :: Python :: 3.8
39
38
  Classifier: Programming Language :: Python :: 3.9
40
39
  Classifier: Programming Language :: Python :: 3.10
41
40
  Classifier: Programming Language :: Python :: 3.11
42
41
  Classifier: Programming Language :: Python :: 3.12
43
42
  Classifier: Programming Language :: Python :: 3.13
44
43
  Classifier: Programming Language :: Python :: 3.14
45
- Requires-Python: >=3.8
44
+ Requires-Python: >=3.9
46
45
  Description-Content-Type: text/markdown
47
46
  License-File: LICENSE
48
47
  Requires-Dist: argcomplete
49
48
  Requires-Dist: black
50
49
  Requires-Dist: flake8
51
50
  Requires-Dist: gitpython
52
- Requires-Dist: importlib-resources; python_version < "3.9"
53
51
  Requires-Dist: jinja2
54
52
  Requires-Dist: matplotlib
55
53
  Requires-Dist: networkx
56
54
  Requires-Dist: peakrdl-html
57
- Requires-Dist: peakrdl-pyuvm
55
+ Requires-Dist: peakrdl-pyuvm>=0.9
58
56
  Requires-Dist: peakrdl-regblock>=1.2
59
57
  Requires-Dist: pyyaml
60
58
  Requires-Dist: rich
61
59
  Requires-Dist: singleton-decorator
62
60
  Requires-Dist: systemrdl-compiler
61
+ Requires-Dist: tomli; python_version < "3.11"
63
62
  Requires-Dist: types-pyyaml
64
63
  Requires-Dist: vsg
65
64
  Provides-Extra: dev
@@ -81,6 +81,7 @@ src/simplhdl_modelsim/resources/templates/modelsim/run.do.j2
81
81
  src/simplhdl_parser/__init__.py
82
82
  src/simplhdl_parser/simplhdlparser.py
83
83
  src/simplhdl_peakrdl/__init__.py
84
+ src/simplhdl_peakrdl/compiler.py
84
85
  src/simplhdl_peakrdl/systemrdl.py
85
86
  src/simplhdl_quartus/quartusflow.py
86
87
  src/simplhdl_quartus/spd.py
@@ -152,4 +153,5 @@ src/simplhdl_vivado/xsim/__init__.py
152
153
  src/simplhdl_vivado/xsim/xsimflow.py
153
154
  tests/test_design.py
154
155
  tests/test_files.py
155
- tests/test_fileset.py
156
+ tests/test_fileset.py
157
+ tests/test_systemrdl.py
@@ -6,7 +6,7 @@ jinja2
6
6
  matplotlib
7
7
  networkx
8
8
  peakrdl-html
9
- peakrdl-pyuvm
9
+ peakrdl-pyuvm>=0.9
10
10
  peakrdl-regblock>=1.2
11
11
  pyyaml
12
12
  rich
@@ -15,8 +15,8 @@ systemrdl-compiler
15
15
  types-pyyaml
16
16
  vsg
17
17
 
18
- [:python_version < "3.9"]
19
- importlib-resources
18
+ [:python_version < "3.11"]
19
+ tomli
20
20
 
21
21
  [dev]
22
22
  flake8
@@ -0,0 +1,26 @@
1
+ from __future__ import annotations
2
+
3
+ from systemrdl import RDLCompiler
4
+ from systemrdl.component import Addrmap, Component
5
+ from systemrdl.node import RootNode
6
+
7
+
8
+ class SimplHDLRDLCompiler(RDLCompiler):
9
+ def elaborate_root_maps(self) -> list[RootNode]:
10
+ instantiated_map_ids: set[int] = set()
11
+
12
+ def collect_instantiated_maps(component: Component) -> None:
13
+ for child in component.children:
14
+ if isinstance(child.original_def, Addrmap):
15
+ instantiated_map_ids.add(id(child.original_def))
16
+ collect_instantiated_maps(child)
17
+
18
+ for definition in self.root.comp_defs.values():
19
+ collect_instantiated_maps(definition)
20
+
21
+ map_names: list[str] = [
22
+ name
23
+ for name, definition in self.root.comp_defs.items()
24
+ if isinstance(definition, Addrmap) and id(definition) not in instantiated_map_ids
25
+ ]
26
+ return [self.elaborate(name) for name in map_names]
@@ -0,0 +1,470 @@
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+ import os
5
+
6
+ import jinja2
7
+
8
+ try:
9
+ import tomllib
10
+ except ImportError:
11
+ import tomli as tomllib
12
+
13
+ from pathlib import Path
14
+
15
+ from peakrdl_html import HTMLExporter
16
+ from peakrdl_pyuvm.exporter import PyUVMExporter
17
+ from peakrdl_regblock.cpuif.apb3 import APB3_Cpuif, APB3_Cpuif_flattened
18
+ from peakrdl_regblock.cpuif.apb4 import APB4_Cpuif, APB4_Cpuif_flattened
19
+ from peakrdl_regblock.cpuif.avalon import Avalon_Cpuif, Avalon_Cpuif_flattened
20
+ from peakrdl_regblock.cpuif.axi4lite import AXI4Lite_Cpuif, AXI4Lite_Cpuif_flattened
21
+ from peakrdl_regblock.cpuif.obi import OBI_Cpuif, OBI_Cpuif_flattened
22
+ from peakrdl_regblock.cpuif.passthrough import PassthroughCpuif
23
+ from peakrdl_regblock.exporter import RegblockExporter
24
+ from peakrdl_regblock.udps import ALL_UDPS
25
+ from systemrdl import RDLCompileError, RDLListener, RDLWalker
26
+ from systemrdl.node import AddrmapNode, MemNode, RegNode, RootNode
27
+ from systemrdl.rdltypes import AccessType, OnReadType, OnWriteType
28
+
29
+ from simplhdl import FileOrder
30
+ from simplhdl.plugin import FlowBase, FlowCategory, GeneratorBase
31
+ from simplhdl.project.files import (
32
+ CocotbPythonFile,
33
+ SystemRdlFile,
34
+ SystemVerilogFile,
35
+ VerilogFile,
36
+ VhdlFile,
37
+ )
38
+
39
+ from .compiler import SimplHDLRDLCompiler
40
+
41
+ logger = logging.getLogger(__name__)
42
+
43
+ CPU_INTERFACES = {
44
+ "passthrough": PassthroughCpuif,
45
+ "apb3": APB3_Cpuif,
46
+ "apb3-flat": APB3_Cpuif_flattened,
47
+ "apb4": APB4_Cpuif,
48
+ "apb4-flat": APB4_Cpuif_flattened,
49
+ "axi4-lite": AXI4Lite_Cpuif,
50
+ "axi4-lite-flat": AXI4Lite_Cpuif_flattened,
51
+ "avalon-mm": Avalon_Cpuif,
52
+ "avalon-mm-flat": Avalon_Cpuif_flattened,
53
+ "obi": OBI_Cpuif,
54
+ "obi-flat": OBI_Cpuif_flattened,
55
+ }
56
+ RETIME_EXTERNAL_TYPES = ("reg", "regfile", "mem", "addrmap")
57
+ DEFAULT_RESET_SETTINGS = {
58
+ "rst": (False, False),
59
+ "rst_n": (True, False),
60
+ "arst": (False, True),
61
+ "arst_n": (True, True),
62
+ }
63
+
64
+
65
+ def _get_default_reset_settings(reset: str) -> tuple[bool, bool]:
66
+ try:
67
+ return DEFAULT_RESET_SETTINGS[reset]
68
+ except KeyError as exc:
69
+ raise ValueError(f"Unsupported default reset: {reset}") from exc
70
+
71
+
72
+ def _get_retime_external_settings(items: object) -> dict[str, bool]:
73
+ if not isinstance(items, list):
74
+ raise TypeError(f"retime_external must be an array {[*RETIME_EXTERNAL_TYPES, 'all']}")
75
+
76
+ valid_items = (*RETIME_EXTERNAL_TYPES, "all")
77
+ settings = {f"retime_external_{item}": False for item in RETIME_EXTERNAL_TYPES}
78
+ for item in items:
79
+ if item not in valid_items:
80
+ raise ValueError(f"Unsupported retime_external item: {item}, must be one of {list(valid_items)}")
81
+ if item == "all":
82
+ for setting in settings:
83
+ settings[setting] = True
84
+ else:
85
+ settings[f"retime_external_{item}"] = True
86
+ return settings
87
+
88
+
89
+ def unique_nodes_by_type(nodes: list[AddrmapNode]) -> list[AddrmapNode]:
90
+ """Return nodes de-duplicated by type_name while preserving first-seen order."""
91
+ seen: set[str] = set()
92
+ unique: list[AddrmapNode] = []
93
+ for node in nodes:
94
+ if node.type_name in seen:
95
+ continue
96
+ seen.add(node.type_name)
97
+ unique.append(node)
98
+ return unique
99
+
100
+
101
+ class Environment(jinja2.Environment):
102
+ def find_template(self, name):
103
+ matches = [template_name for template_name in self.list_templates() if template_name.startswith(name)]
104
+ if not matches:
105
+ raise jinja2.TemplateNotFound(name)
106
+ if len(matches) > 1:
107
+ logger.warning(f"Multiple templates found ({matches}) for {name}")
108
+ return self.get_template(matches[0])
109
+
110
+
111
+ class AddrmapCollector(RDLListener):
112
+ def __init__(self) -> None:
113
+ self.nodes: list[AddrmapNode] = []
114
+ self.leafnodes: list[AddrmapNode] = []
115
+ self.hierachynodes: list[AddrmapNode] = []
116
+
117
+ def exit_Addrmap(self, node: AddrmapNode):
118
+ self.nodes.append(node)
119
+ if is_leaf(node):
120
+ self.leafnodes.append(node)
121
+ else:
122
+ self.hierachynodes.append(node)
123
+
124
+
125
+ class AccessWidthExtractor(RDLListener):
126
+ def __init__(self):
127
+ self.bus_datawidth = 0
128
+
129
+ def enter_Reg(self, node: RegNode):
130
+ # 'accesswidth' reflects the actual bus transfer width
131
+ # (automatically defaults to 'regwidth' if not specified in RDL)
132
+ accesswidth = node.get_property("accesswidth")
133
+ self.bus_datawidth = max(self.bus_datawidth, accesswidth)
134
+
135
+ def enter_Mem(self, node: MemNode):
136
+ memwidth = node.get_property("memwidth")
137
+ self.bus_datawidth = max(self.bus_datawidth, memwidth)
138
+
139
+
140
+ def get_template_dirs() -> list[Path]:
141
+ string = os.getenv("SIMPLHDL_SYSTEMRDL_TEMPLATES")
142
+ if string:
143
+ templates = {Path(p).resolve() for p in string.split(":")}
144
+ for t in templates:
145
+ if not t.is_dir():
146
+ logger.error(f"Directory {t} does not exist")
147
+ raise SystemError
148
+ return list(templates)
149
+ else:
150
+ logger.debug("SIMPLHDL_SYSTEMRDL_TEMPLATES is not set, no templates found")
151
+ return []
152
+
153
+
154
+ def get_max_access_width(node: AddrmapNode) -> int:
155
+ extractor = AccessWidthExtractor()
156
+ RDLWalker(unroll=True).walk(node, extractor)
157
+ return extractor.bus_datawidth
158
+
159
+
160
+ def get_max_addr_width(node: AddrmapNode) -> int:
161
+ return max(1, (node.size - 1).bit_length())
162
+
163
+
164
+ def get_reg_access(reg) -> str:
165
+ if reg.has_sw_readable and reg.has_sw_writable:
166
+ return "RW"
167
+ elif reg.has_sw_writable:
168
+ return "WO"
169
+ elif reg.has_sw_readable:
170
+ return "RO"
171
+ else:
172
+ return "RW"
173
+
174
+
175
+ def get_field_access(field) -> str:
176
+ """
177
+ Get field's UVM access string
178
+ """
179
+ sw = field.get_property("sw")
180
+ onread = field.get_property("onread")
181
+ onwrite = field.get_property("onwrite")
182
+
183
+ if sw == AccessType.rw:
184
+ if (onwrite is None) and (onread is None):
185
+ return "RW"
186
+ elif (onread == OnReadType.rclr) and (onwrite == OnWriteType.woset):
187
+ return "W1SRC"
188
+ elif (onread == OnReadType.rclr) and (onwrite == OnWriteType.wzs):
189
+ return "W0SRC"
190
+ elif (onread == OnReadType.rclr) and (onwrite == OnWriteType.wset):
191
+ return "WSRC"
192
+ elif (onread == OnReadType.rset) and (onwrite == OnWriteType.woclr):
193
+ return "W1CRS"
194
+ elif (onread == OnReadType.rset) and (onwrite == OnWriteType.wzc):
195
+ return "W0CRS"
196
+ elif (onread == OnReadType.rset) and (onwrite == OnWriteType.wclr):
197
+ return "WCRS"
198
+ elif onwrite == OnWriteType.woclr:
199
+ return "W1C"
200
+ elif onwrite == OnWriteType.woset:
201
+ return "W1S"
202
+ elif onwrite == OnWriteType.wot:
203
+ return "W1T"
204
+ elif onwrite == OnWriteType.wzc:
205
+ return "W0C"
206
+ elif onwrite == OnWriteType.wzs:
207
+ return "W0S"
208
+ elif onwrite == OnWriteType.wzt:
209
+ return "W0T"
210
+ elif onwrite == OnWriteType.wclr:
211
+ return "WC"
212
+ elif onwrite == OnWriteType.wset:
213
+ return "WS"
214
+ elif onread == OnReadType.rclr:
215
+ return "WRC"
216
+ elif onread == OnReadType.rset:
217
+ return "WRS"
218
+ else:
219
+ return "RW"
220
+
221
+ elif sw == AccessType.r:
222
+ if onread is None:
223
+ return "RO"
224
+ elif onread == OnReadType.rclr:
225
+ return "RC"
226
+ elif onread == OnReadType.rset:
227
+ return "RS"
228
+ else:
229
+ return "RO"
230
+
231
+ elif sw == AccessType.w:
232
+ if onwrite is None:
233
+ return "WO"
234
+ elif onwrite == OnWriteType.wclr:
235
+ return "WOC"
236
+ elif onwrite == OnWriteType.wset:
237
+ return "WOS"
238
+ else:
239
+ return "WO"
240
+
241
+ elif sw == AccessType.rw1:
242
+ return "W1"
243
+
244
+ elif sw == AccessType.w1:
245
+ return "WO1"
246
+
247
+ else:
248
+ return "NOACCESS"
249
+
250
+
251
+ def is_leaf(node):
252
+ """
253
+ Check if node is leaf, meaning it has no children address maps
254
+ """
255
+ return not any(isinstance(child, AddrmapNode) for child in node.children())
256
+
257
+
258
+ def mask(node):
259
+ m = ~(node.size - 1) & 0xFFFFFFFF
260
+ return m
261
+
262
+
263
+ class PeakRdlGenerator(GeneratorBase):
264
+ def render_template(self, template: jinja2.Template, node: AddrmapNode, outputdir: Path) -> Path | None:
265
+ if not template.filename.endswith(".j2"):
266
+ return None
267
+ context = template.render(node=node)
268
+ outputdir.mkdir(parents=True, exist_ok=True)
269
+ outputfile: Path = outputdir.joinpath(f"{node.type_name}__{Path(template.filename).name[:-3]}").resolve()
270
+ with outputfile.open("w") as f:
271
+ f.write(context)
272
+ rdlfile = self.project.defaultDesign.get_file(node.inst.def_src_ref.path)
273
+ fileset = rdlfile.parent
274
+ if outputfile.suffix == ".sv":
275
+ fileset.insert_file_after(rdlfile, SystemVerilogFile(outputfile))
276
+ if outputfile.suffix == ".v":
277
+ fileset.insert_file_after(rdlfile, VerilogFile(outputfile))
278
+ if outputfile.suffix == ".vhd":
279
+ fileset.insert_file_after(rdlfile, VhdlFile(outputfile))
280
+ return outputfile
281
+
282
+ def peakrdl_regblock(self, node, outputdir, config) -> None:
283
+ cpuif_name = config.get("cpuif", "apb3")
284
+ try:
285
+ cpuif_cls = CPU_INTERFACES[cpuif_name]
286
+ except KeyError as exc:
287
+ raise ValueError(f"Unsupported CPU interface: {cpuif_name}, must be one of {list(CPU_INTERFACES)}") from exc
288
+
289
+ default_reset_activelow, default_reset_async = _get_default_reset_settings(config.get("default_reset", "rst"))
290
+
291
+ module_name = config.get("module_name", f"{node.type_name}").replace("%", node.type_name)
292
+ package_name = config.get("package_name", f"{node.type_name}_pkg").replace("%", node.type_name)
293
+
294
+ type_style = config.get("type_style", "lexical")
295
+ if type_style == "lexical":
296
+ reuse_hwif_typedefs = True
297
+ elif type_style == "hier":
298
+ reuse_hwif_typedefs = False
299
+ else:
300
+ raise ValueError(f"Unsupported type style: {type_style}")
301
+
302
+ retime_external_settings = _get_retime_external_settings(config.get("retime_external", []))
303
+
304
+ RegblockExporter().export(
305
+ node=node,
306
+ output_dir=str(outputdir.resolve()),
307
+ cpuif_cls=cpuif_cls,
308
+ module_name=module_name,
309
+ package_name=package_name,
310
+ reuse_hwif_typedefs=reuse_hwif_typedefs,
311
+ retime_read_fanin=config.get("retime_read_fanin", False),
312
+ retime_read_response=config.get("retime_read_response", False),
313
+ **retime_external_settings,
314
+ generate_hwif_report=config.get("generate_hwif_report", False),
315
+ address_width=config.get("address_width", None),
316
+ default_reset_activelow=default_reset_activelow,
317
+ default_reset_async=default_reset_async,
318
+ err_if_bad_addr=config.get("err_if_bad_addr", False),
319
+ err_if_bad_rw=config.get("err_if_bad_rw", False),
320
+ )
321
+ modulefile: Path = outputdir.joinpath(f"{module_name}.sv").resolve()
322
+ packetfile: Path = outputdir.joinpath(f"{package_name}.sv").resolve()
323
+ rdlfile = self.project.defaultDesign.get_file(node.inst.def_src_ref.path)
324
+ fileset = rdlfile.parent
325
+ fileset.insert_file_after(rdlfile, SystemVerilogFile(packetfile))
326
+ fileset.insert_file_after(rdlfile, SystemVerilogFile(modulefile))
327
+
328
+ def _load_config(self) -> dict:
329
+ config: dict = {}
330
+ config_path = os.getenv("SIMPLHDL_CONFIG")
331
+ if config_path:
332
+ tomlfile = Path(config_path)
333
+ try:
334
+ with tomlfile.open("rb") as f:
335
+ config = tomllib.load(f)
336
+ except FileNotFoundError:
337
+ raise FileNotFoundError(
338
+ f"SimplHDL config file set by environment 'SIMPLHDL_CONFIG={tomlfile}' does not exist"
339
+ )
340
+ return config
341
+
342
+ def _compile_roots(self, rdlfiles) -> list[RootNode]:
343
+ rdlc = SimplHDLRDLCompiler()
344
+ for udp in ALL_UDPS:
345
+ rdlc.register_udp(udp)
346
+ try:
347
+ for rdlfile in rdlfiles:
348
+ rdlc.compile_file(rdlfile.path, defines=self.project.defines)
349
+ roots = rdlc.elaborate_root_maps()
350
+ except RDLCompileError as e:
351
+ logger.error(str(e))
352
+ raise SystemError
353
+ return roots
354
+
355
+ def _collect_root_nodes(
356
+ self, roots: list[RootNode]
357
+ ) -> tuple[list[tuple[RootNode, AddrmapCollector]], list[AddrmapNode]]:
358
+ root_collectors: list[tuple[RootNode, AddrmapCollector]] = []
359
+ walker = RDLWalker()
360
+ for root in roots:
361
+ collector = AddrmapCollector()
362
+ walker.walk(root, collector)
363
+ root_collectors.append((root, collector))
364
+
365
+ unique_leaf_nodes = unique_nodes_by_type(
366
+ [node for _, collector in root_collectors for node in collector.leafnodes]
367
+ )
368
+ return root_collectors, unique_leaf_nodes
369
+
370
+ def _generate_hierarchy_templates(
371
+ self,
372
+ root_collectors: list[tuple[RootNode, AddrmapCollector]],
373
+ output_dir: Path,
374
+ config: dict,
375
+ ) -> None:
376
+ for template_dir in get_template_dirs():
377
+ logger.info(f"Generate from template {template_dir}")
378
+ sub_dir = output_dir.joinpath(template_dir.name)
379
+
380
+ env = Environment(loader=jinja2.FileSystemLoader(template_dir), trim_blocks=True)
381
+ env.globals["hex"] = hex
382
+ env.globals["len"] = len
383
+ env.globals["get_field_access"] = get_field_access
384
+ env.globals["get_reg_access"] = get_reg_access
385
+ env.globals["is_leaf"] = is_leaf
386
+ env.globals["mask"] = mask
387
+
388
+ template = env.find_template("hierachymap")
389
+ for root, collector in root_collectors:
390
+ env.globals["nodes"] = collector.nodes
391
+ env.globals["leafnodes"] = collector.leafnodes
392
+ env.globals["hierachynodes"] = collector.hierachynodes
393
+ env.globals["max_access_width"] = get_max_access_width(root.top)
394
+ env.globals["max_addr_width"] = max(get_max_addr_width(root.top), config.get("address_width", 1))
395
+ self.render_template(template=template, node=root.top, outputdir=sub_dir)
396
+
397
+ def _generate_regblocks(self, leaf_nodes: list[AddrmapNode], output_dir: Path, config: dict) -> None:
398
+ if not config.get("enable", True):
399
+ return
400
+
401
+ logger.info("Generate PeakRDL Register Block")
402
+ for node in leaf_nodes:
403
+ self.peakrdl_regblock(
404
+ node=node,
405
+ outputdir=output_dir.joinpath("peakrdl-regblock"),
406
+ config=config,
407
+ )
408
+
409
+ def _generate_pyuvm(
410
+ self,
411
+ flow: FlowBase,
412
+ roots: list[RootNode],
413
+ rdlfiles,
414
+ output_dir: Path,
415
+ config: dict,
416
+ ) -> None:
417
+ if not config.get("enable", True) or flow.category != FlowCategory.SIMULATION:
418
+ return
419
+ if not list(self.project.defaultDesign.files(CocotbPythonFile)):
420
+ return
421
+
422
+ logger.info("Generate PeakRDL PyUVM Register Model")
423
+ output = output_dir.joinpath("peakrdl-pyuvm", "ralmodel.py")
424
+ output.parent.mkdir(parents=True, exist_ok=True)
425
+ type_style = config.get("type_style", "lexical")
426
+ if type_style == "lexical":
427
+ reuse_class_definitions = True
428
+ elif type_style == "hier":
429
+ reuse_class_definitions = False
430
+ else:
431
+ raise ValueError(f"Unsupported type style: {type_style}")
432
+
433
+ rdlfile = rdlfiles[-1]
434
+ fileset = rdlfile.parent
435
+ for root in roots:
436
+ PyUVMExporter().export(
437
+ node=root,
438
+ path=str(output),
439
+ export_as_package=config.get("export_as_package", True),
440
+ reuse_class_definitions=reuse_class_definitions,
441
+ use_uvm_factory=config.get("use_uvm_factory", False),
442
+ )
443
+ fileset.insert_file_after(rdlfile, CocotbPythonFile(output))
444
+
445
+ def _generate_html(self, roots: list[RootNode], output_dir: Path, config: dict) -> None:
446
+ if not config.get("enable", True):
447
+ return
448
+
449
+ logger.info("Generate HTML Documentation")
450
+ HTMLExporter().export(
451
+ roots,
452
+ output_dir.joinpath("peakrdl-docs"),
453
+ skip_not_present=config.get("skip_not_present", False),
454
+ )
455
+
456
+ def run(self, flow: FlowBase):
457
+ rdlfiles = self.project.defaultDesign.files(type=SystemRdlFile, order=FileOrder.COMPILE)
458
+ output_dir = self.builddir.joinpath("systemrdl")
459
+ config = self._load_config()
460
+
461
+ peakrdl_config = config.get("peakrdl", {})
462
+ if not rdlfiles:
463
+ return
464
+
465
+ roots = self._compile_roots(rdlfiles)
466
+ root_collectors, leaf_nodes = self._collect_root_nodes(roots)
467
+ self._generate_hierarchy_templates(root_collectors, output_dir, peakrdl_config.get("regblock", {}))
468
+ self._generate_regblocks(leaf_nodes, output_dir, peakrdl_config.get("regblock", {}))
469
+ self._generate_pyuvm(flow, roots, rdlfiles, output_dir, peakrdl_config.get("pyuvm", {}))
470
+ self._generate_html(roots, output_dir, peakrdl_config.get("html", {}))