SimplHDL 0.13.4__tar.gz → 0.13.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. {simplhdl-0.13.4/src/simplhdl.egg-info → simplhdl-0.13.6}/PKG-INFO +1 -1
  2. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/__init__.py +1 -1
  3. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/cocotb.py +56 -26
  4. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/plugin/simulationflow.py +24 -11
  5. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/project/files.py +5 -2
  6. {simplhdl-0.13.4 → simplhdl-0.13.6/src/simplhdl.egg-info}/PKG-INFO +1 -1
  7. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/cocotb.mk.j2 +1 -1
  8. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_peakrdl/systemrdl.py +38 -18
  9. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/cocotb.mk.j2 +4 -3
  10. {simplhdl-0.13.4 → simplhdl-0.13.6}/LICENSE +0 -0
  11. {simplhdl-0.13.4 → simplhdl-0.13.6}/README.md +0 -0
  12. {simplhdl-0.13.4 → simplhdl-0.13.6}/pyproject.toml +0 -0
  13. {simplhdl-0.13.4 → simplhdl-0.13.6}/setup.cfg +0 -0
  14. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/__main__.py +0 -0
  15. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/_compat.py +0 -0
  16. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/cli/arguments.py +0 -0
  17. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/cli/info.py +0 -0
  18. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/cli/run.py +0 -0
  19. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/plugin/__init__.py +0 -0
  20. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/plugin/flow.py +0 -0
  21. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/plugin/generator.py +0 -0
  22. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/plugin/implementationflow.py +0 -0
  23. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/plugin/loader.py +0 -0
  24. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/plugin/parser.py +0 -0
  25. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/project/__init__.py +0 -0
  26. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/project/attributes.py +0 -0
  27. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/project/base.py +0 -0
  28. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/project/design.py +0 -0
  29. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/project/fileset.py +0 -0
  30. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/project/project.py +0 -0
  31. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/simplhdl.py +0 -0
  32. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/tools.py +0 -0
  33. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl/utils.py +0 -0
  34. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl.egg-info/SOURCES.txt +0 -0
  35. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl.egg-info/dependency_links.txt +0 -0
  36. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl.egg-info/entry_points.txt +0 -0
  37. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl.egg-info/requires.txt +0 -0
  38. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl.egg-info/top_level.txt +0 -0
  39. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_chisel/chisel.py +0 -0
  40. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_encrypt/__init__.py +0 -0
  41. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_encrypt/encrypt/__init__.py +0 -0
  42. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_encrypt/encrypt/encryptflow.py +0 -0
  43. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_fusesocparser/__init__.py +0 -0
  44. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_fusesocparser/fusesocparser.py +0 -0
  45. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/__init__.py +0 -0
  46. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/icarusflow.py +0 -0
  47. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/resources/__init__.py +0 -0
  48. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/resources/templates/__init__.py +0 -0
  49. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/resources/templates/icarus/Makefile.j2 +0 -0
  50. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/resources/templates/icarus/__init__.py +0 -0
  51. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/resources/templates/icarus/cmds.f.j2 +0 -0
  52. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/resources/templates/icarus/cocotb.mk.j2 +0 -0
  53. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/resources/templates/icarus/simplhdl_iverilog_dump.v.j2 +0 -0
  54. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_icarus/resources/templates/icarus/sources.mk.j2 +0 -0
  55. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_jinja2/jinja2.py +0 -0
  56. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/__init__.py +0 -0
  57. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/flake8/flake8flow.py +0 -0
  58. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/lint/lintflow.py +0 -0
  59. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/__init__.py +0 -0
  60. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/templates/__init__.py +0 -0
  61. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/templates/flake8/__init__.py +0 -0
  62. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/templates/flake8/setup.cfg.j2 +0 -0
  63. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/templates/verible/__init__.py +0 -0
  64. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/templates/verible/rules.cfg.j2 +0 -0
  65. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/templates/vsg/__init__.py +0 -0
  66. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/templates/vsg/files.json.j2 +0 -0
  67. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/resources/templates/vsg/rules.yml.j2 +0 -0
  68. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/verible/__init__.py +0 -0
  69. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/verible/veribleflow.py +0 -0
  70. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/vsg/__init__.py +0 -0
  71. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_lint/vsg/vsgflow.py +0 -0
  72. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/__init__.py +0 -0
  73. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/modelsim/__init__.py +0 -0
  74. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/modelsim/modelsimflow.py +0 -0
  75. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/__init__.py +0 -0
  76. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/__init__.py +0 -0
  77. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/Makefile.j2 +0 -0
  78. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/__init__.py +0 -0
  79. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/dependencies.mk.j2 +0 -0
  80. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/files.j2 +0 -0
  81. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/fileset.j2 +0 -0
  82. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/modelsim.tcl.j2 +0 -0
  83. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/project.mk.j2 +0 -0
  84. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_modelsim/resources/templates/modelsim/run.do.j2 +0 -0
  85. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_parser/__init__.py +0 -0
  86. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_parser/simplhdlparser.py +0 -0
  87. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_peakrdl/__init__.py +0 -0
  88. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/quartusdse/__init__.py +0 -0
  89. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/quartusdse/quartusdseflow.py +0 -0
  90. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/quartusexport/__init__.py +0 -0
  91. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/quartusexport/quartusexportflow.py +0 -0
  92. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/quartusflow.py +0 -0
  93. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/resources/__init__.py +0 -0
  94. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/resources/templates/__init__.py +0 -0
  95. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/resources/templates/quartus/__init__.py +0 -0
  96. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/resources/templates/quartus/project.tcl.j2 +0 -0
  97. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/resources/templates/quartus/run.tcl.j2 +0 -0
  98. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_quartus/spd.py +0 -0
  99. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/questasim/__init__.py +0 -0
  100. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/questasim/questasimflow.py +0 -0
  101. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/resources/__init__.py +0 -0
  102. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/resources/templates/__init__.py +0 -0
  103. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/resources/templates/questasim/__init__.py +0 -0
  104. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/resources/templates/questasim/modelsim.tcl.j2 +0 -0
  105. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/resources/templates/questasim/project.qrun.j2 +0 -0
  106. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/resources/templates/questasim/visualizer.tcl.j2 +0 -0
  107. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_questasim/resources/templates/questasim/vsim-run.do.j2 +0 -0
  108. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/__init__.py +0 -0
  109. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/__init__.py +0 -0
  110. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/templates/__init__.py +0 -0
  111. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/templates/rivierapro/Makefile.j2 +0 -0
  112. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/templates/rivierapro/__init__.py +0 -0
  113. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/templates/rivierapro/cocotb.mk.j2 +0 -0
  114. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/templates/rivierapro/dependencies.mk.j2 +0 -0
  115. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/templates/rivierapro/files.j2 +0 -0
  116. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/templates/rivierapro/fileset.j2 +0 -0
  117. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/resources/templates/rivierapro/project.mk.j2 +0 -0
  118. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/rivierapro/__init__.py +0 -0
  119. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_rivierapro/rivierapro/rivieraproflow.py +0 -0
  120. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/__init__.py +0 -0
  121. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/__init__.py +0 -0
  122. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/__init__.py +0 -0
  123. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/Makefile.j2 +0 -0
  124. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/__init__.py +0 -0
  125. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/dependencies.mk.j2 +0 -0
  126. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/files.j2 +0 -0
  127. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/fileset.j2 +0 -0
  128. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/pli.tab.j2 +0 -0
  129. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/project.mk.j2 +0 -0
  130. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/simv-run.do.j2 +0 -0
  131. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/synopsys_sim.setup.j2 +0 -0
  132. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/resources/templates/vcs/vcs.parameters.j2 +0 -0
  133. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/vcs/__init__.py +0 -0
  134. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vcs/vcs/vcsflow.py +0 -0
  135. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/__init__.py +0 -0
  136. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/ipxact.py +0 -0
  137. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/__init__.py +0 -0
  138. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/__init__.py +0 -0
  139. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/vivado/__init__.py +0 -0
  140. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/vivado/project.tcl.j2 +0 -0
  141. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/vivado/run.tcl.j2 +0 -0
  142. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/vivado/steps.tcl.j2 +0 -0
  143. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/xsim/Makefile.j2 +0 -0
  144. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/xsim/__init__.py +0 -0
  145. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/xsim/cocotb.mk.j2 +0 -0
  146. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/xsim/dependencies.mk.j2 +0 -0
  147. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/xsim/files.j2 +0 -0
  148. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/xsim/fileset.j2 +0 -0
  149. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/resources/templates/xsim/project.mk.j2 +0 -0
  150. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/vivadoexport/__init__.py +0 -0
  151. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/vivadoexport/vivadoexportflow.py +0 -0
  152. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/vivadoflow.py +0 -0
  153. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/xsim/__init__.py +0 -0
  154. {simplhdl-0.13.4 → simplhdl-0.13.6}/src/simplhdl_vivado/xsim/xsimflow.py +0 -0
  155. {simplhdl-0.13.4 → simplhdl-0.13.6}/tests/test_design.py +0 -0
  156. {simplhdl-0.13.4 → simplhdl-0.13.6}/tests/test_files.py +0 -0
  157. {simplhdl-0.13.4 → simplhdl-0.13.6}/tests/test_fileset.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplhdl
3
- Version: 0.13.4
3
+ Version: 0.13.6
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>
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.13.4"
3
+ __version__ = "0.13.6"
4
4
 
5
5
  from .__main__ import parse_arguments
6
6
  from .project.design import *
@@ -27,6 +27,50 @@ if TYPE_CHECKING:
27
27
  logger = logging.getLogger(__name__)
28
28
 
29
29
 
30
+ def get_lib_name_path(interface: str, simulator: str) -> Path:
31
+ output = sh(["cocotb-config", "--lib-name-path", interface, simulator]).strip()
32
+ path = Path(output)
33
+ if not path.exists():
34
+ raise FileNotFoundError(f"{path}: not found")
35
+ return path
36
+
37
+
38
+ def get_lib_entry(interface: str, simulator: str) -> str:
39
+ output = sh(["cocotb-config", "--lib-entry", interface, simulator]).strip()
40
+ return output
41
+
42
+
43
+ def get_libpython() -> str:
44
+ output = sh(["cocotb-config", "--libpython"]).strip()
45
+ path = Path(output)
46
+ if not path.exists():
47
+ raise FileNotFoundError(f"{path}: not found")
48
+ return path
49
+
50
+
51
+ def get_pygpi_entry_point() -> str:
52
+ if Version(version("cocotb")) >= Version("2.1.0"):
53
+ output = sh(["cocotb-config", "--pygpi-entry-point"]).strip()
54
+ return output
55
+ return ""
56
+
57
+
58
+ def get_pythonbin() -> str:
59
+ output = sh(["cocotb-config", "--python-bin"]).strip()
60
+ path = Path(output)
61
+ if not path.exists():
62
+ raise FileNotFoundError(f"{path}: not found")
63
+ return path
64
+
65
+
66
+ def get_gpi_users() -> str:
67
+ return f"{get_libpython()};{get_pygpi_entry_point()}"
68
+
69
+
70
+ def get_gpi_extra(interface: str, simulator: str) -> str:
71
+ return f"{get_lib_name_path(interface, simulator)}:cocotb{interface}_entry_point"
72
+
73
+
30
74
  class Cocotb:
31
75
  def __init__(self, project: Project, seed: int) -> None:
32
76
  self.project = project
@@ -41,29 +85,16 @@ class Cocotb:
41
85
  self.has_vhdl = project.defaultDesign.files(type=VhdlFile, usedin=UsedIn.SIMULATION) != []
42
86
 
43
87
  def lib_name_path(self, simulator: str, interface: str) -> Path:
44
- output = sh(["cocotb-config", "--lib-name-path", interface, simulator])
45
- path = Path(output)
46
- if not path.exists():
47
- raise FileNotFoundError(f"{path}: not found")
48
- return path
88
+ return get_lib_name_path(interface, simulator)
49
89
 
50
90
  def libpython(self) -> str:
51
- output = sh(["cocotb-config", "--libpython"])
52
- path = Path(output)
53
- if not path.exists():
54
- raise FileNotFoundError(f"{path}: not found")
55
- return path
91
+ return get_libpython()
56
92
 
57
93
  def pygpi_entry_point(self) -> str:
58
- output = sh(["cocotb-config", "--pygpi-entry-point"])
59
- return output.strip()
94
+ return get_pygpi_entry_point()
60
95
 
61
96
  def pythonbin(self) -> str:
62
- output = sh(["cocotb-config", "--python-bin"])
63
- path = Path(output)
64
- if not path.exists():
65
- raise FileNotFoundError(f"{path}: not found")
66
- return path
97
+ return get_pythonbin()
67
98
 
68
99
  def module(self) -> str | None:
69
100
  if not self.enabled:
@@ -174,28 +205,27 @@ class Cocotb:
174
205
  if cocotb_version >= Version("2.1.0"):
175
206
  e["COCOTB_TEST_MODULES"] = self.top
176
207
  e["COCOTB_TOPLEVEL"] = self.dut
177
- e["PYGPI_PYTHON_BIN"] = self.pythonbin()
208
+ e["PYGPI_PYTHON_BIN"] = get_pythonbin()
178
209
  e["COCOTB_RANDOM_SEED"] = str(self.seed)
179
- e["GPI_USERS"] = f"{self.libpython()};{self.pygpi_entry_point()}"
210
+ e["GPI_USERS"] = get_gpi_users()
180
211
  elif cocotb_version >= Version("2.0.0"):
181
212
  e["COCOTB_TEST_MODULES"] = self.top
182
213
  e["COCOTB_TOPLEVEL"] = self.dut
183
- e["PYGPI_PYTHON_BIN"] = self.pythonbin()
214
+ e["PYGPI_PYTHON_BIN"] = get_pythonbin()
184
215
  e["COCOTB_RANDOM_SEED"] = str(self.seed)
185
- e["LIBPYTHON_LOC"] = self.libpython()
216
+ e["LIBPYTHON_LOC"] = get_libpython()
186
217
  else:
187
218
  e["MODULE"] = self.top
188
219
  e["TOPLEVEL"] = self.dut
189
- e["LIBPYTHON_LOC"] = self.libpython()
220
+ e["LIBPYTHON_LOC"] = get_libpython()
190
221
  e["PYTHONPYCACHEPREFIX"] = "./pycache"
191
222
  e["GPI_EXTRA"] = ""
192
223
  if self.has_verilog and self.has_vhdl:
193
224
  if self.duttype == VhdlFile:
194
- lib_name_path = self.lib_name_path("questa", "vpi")
195
- e["GPI_EXTRA"] = f"{lib_name_path}:cocotbvpi_entry_point"
225
+ interface = "vpi"
196
226
  elif self.duttype == VerilogFile:
197
- lib_name_path = self.lib_name_path("questa", "fli")
198
- e["GPI_EXTRA"] = f"{lib_name_path}:cocotbfli_entry_point"
227
+ interface = "fli"
228
+ e["GPI_EXTRA"] = get_gpi_extra(interface, "questa")
199
229
  if "PYTHONPATH" in e:
200
230
  e["PYTHONPATH"] = self.pythonpath + os.pathsep + e.get("PYTHONPATH")
201
231
  else:
@@ -1,9 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- try:
4
- from importlib.resources import files as resources_files
5
- except ImportError:
6
- from importlib_resources import files as resources_files
7
3
  import logging
8
4
  import os
9
5
  import shutil
@@ -13,20 +9,30 @@ from typing import Any, Callable, Generator, Tuple
13
9
 
14
10
  from jinja2 import Environment, FileSystemLoader
15
11
 
16
- from ..cocotb import Cocotb
12
+ from .._compat import resources_files
13
+ from ..cocotb import (
14
+ Cocotb,
15
+ get_gpi_extra,
16
+ get_gpi_users,
17
+ get_lib_entry,
18
+ get_lib_name_path,
19
+ get_libpython,
20
+ get_pygpi_entry_point,
21
+ get_pythonbin,
22
+ )
17
23
  from ..project.files import (
24
+ CFile,
25
+ CppFile,
18
26
  File,
19
27
  HdlSearchPath,
20
- MemoryHexFile,
28
+ MemoryFile,
21
29
  SystemVerilogFile,
30
+ UsedIn,
22
31
  VerilogFile,
23
32
  VerilogIncludeFile,
24
33
  VhdlFile,
25
- CFile,
26
- CppFile,
27
- UsedIn,
28
34
  )
29
- from ..project.fileset import Fileset, FilesetOrder, FileOrder
35
+ from ..project.fileset import FileOrder, Fileset, FilesetOrder
30
36
  from ..project.project import Project
31
37
  from ..utils import (
32
38
  append_suffix,
@@ -81,6 +87,13 @@ class SimulationFlow(FlowBase):
81
87
  globals["defaultlib"] = "work"
82
88
  globals["toplevels"] = " ".join(self.cocotb.toplevels)
83
89
  globals["pythonpath"] = self.cocotb.pythonpath
90
+ globals["get_gpi_users"] = get_gpi_users
91
+ globals["get_gpi_extra"] = get_gpi_extra
92
+ globals["get_lib_entry"] = get_lib_entry
93
+ globals["get_lib_name_path"] = get_lib_name_path
94
+ globals["get_libpython"] = get_libpython
95
+ globals["get_pythonbin"] = get_pythonbin
96
+ globals["get_pygpi_entry_point"] = get_pygpi_entry_point
84
97
  globals["cocotbtop"] = self.cocotb.top
85
98
  globals["cocotbhdltype"] = self.cocotb.duttype
86
99
  globals["cocotbdut"] = self.cocotb.dut
@@ -185,7 +198,7 @@ class SimulationFlow(FlowBase):
185
198
  return generated
186
199
 
187
200
  def copy_memory_files(self):
188
- for file in self.project.defaultDesign.files(MemoryHexFile):
201
+ for file in self.project.defaultDesign.files(MemoryFile):
189
202
  shutil.copy(file.path.absolute(), self.builddir.absolute())
190
203
 
191
204
  def is_uvm(self):
@@ -325,6 +325,9 @@ class SimulationFile(File):
325
325
  class IPSpecificationFile(File): ...
326
326
 
327
327
 
328
+ class MemoryFile(File): ...
329
+
330
+
328
331
  @FileFactory.register(extension=".sdc")
329
332
  class SdcFile(ConstraintFile): ...
330
333
 
@@ -431,11 +434,11 @@ class HdlSearchPath(VerilogIncludeFile):
431
434
 
432
435
 
433
436
  @FileFactory.register(extension=".hex")
434
- class MemoryHexFile(File): ...
437
+ class MemoryHexFile(MemoryFile): ...
435
438
 
436
439
 
437
440
  @FileFactory.register(extension=".mif")
438
- class MemoryInitFile(File): ...
441
+ class MemoryInitFile(MemoryFile): ...
439
442
 
440
443
 
441
444
  @FileFactory.register(extension="modelsim.ini")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplhdl
3
- Version: 0.13.4
3
+ Version: 0.13.6
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>
@@ -21,7 +21,7 @@ else
21
21
  export PYTHONPATH := {{pythonpath}}:$(PYTHONPATH)
22
22
  endif
23
23
  export LIBPYTHON_LOC := $(shell cocotb-config --libpython)
24
-
24
+ export GPI_USERS := {{get_gpi_users()}}
25
25
  export PYGPI_PYTHON_BIN := $(shell cocotb-config --python-bin)
26
26
  export COCOTB_TEST_MODULES := {{cocotbtop}}
27
27
  export COCOTB_TOPLEVEL := {{cocotbdut}}
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import logging
2
4
  import os
3
5
 
@@ -9,11 +11,15 @@ except ImportError:
9
11
  import tomli as tomllib
10
12
 
11
13
  from pathlib import Path
12
- from typing import List
13
14
 
14
15
  from peakrdl_html import HTMLExporter
15
16
  from peakrdl_pyuvm.exporter import PyUVMExporter
16
- from peakrdl_regblock.cpuif.axi4lite import AXI4Lite_Cpuif_flattened
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
17
23
  from peakrdl_regblock.exporter import RegblockExporter
18
24
  from peakrdl_regblock.udps import ALL_UDPS
19
25
  from systemrdl import RDLCompileError, RDLCompiler, RDLListener, RDLWalker
@@ -32,12 +38,12 @@ from simplhdl.project.files import (
32
38
 
33
39
  logger = logging.getLogger(__name__)
34
40
 
35
- seennodetypes: List[AddrmapNode] = []
36
- leafnodetypes: List[AddrmapNode] = []
37
- hierachynodetypes: List[AddrmapNode] = []
38
- leafnodes: List[AddrmapNode] = []
39
- hierachynodes: List[AddrmapNode] = []
40
- nodes: List[AddrmapNode] = []
41
+ seennodetypes: list[AddrmapNode] = []
42
+ leafnodetypes: list[AddrmapNode] = []
43
+ hierachynodetypes: list[AddrmapNode] = []
44
+ leafnodes: list[AddrmapNode] = []
45
+ hierachynodes: list[AddrmapNode] = []
46
+ nodes: list[AddrmapNode] = []
41
47
 
42
48
 
43
49
  class Environment(jinja2.Environment):
@@ -66,7 +72,7 @@ class Listener(RDLListener):
66
72
  hierachynodetypes.append(node)
67
73
 
68
74
 
69
- def get_template_dirs() -> List[Path]:
75
+ def get_template_dirs() -> list[Path]:
70
76
  string = os.getenv("SIMPLHDL_SYSTEMRDL_TEMPLATES")
71
77
  if string:
72
78
  templates = {Path(p).resolve() for p in string.split(":")}
@@ -74,10 +80,10 @@ def get_template_dirs() -> List[Path]:
74
80
  if not t.is_dir():
75
81
  logger.error(f"Directory {t} does not exist")
76
82
  raise SystemError
83
+ return list(templates)
77
84
  else:
78
- logger.error("SIMPLHDL_SYSTEMRDL_TEMPLATES is not set, no templates found")
79
- raise SystemError
80
- return list(templates)
85
+ logger.debug("SIMPLHDL_SYSTEMRDL_TEMPLATES is not set, no templates found")
86
+ return []
81
87
 
82
88
 
83
89
  def get_reg_access(reg) -> str:
@@ -171,10 +177,7 @@ def is_leaf(node):
171
177
  """
172
178
  Check if node is leaf, meaning it has no children address maps
173
179
  """
174
- if AddrmapNode not in [type(c) for c in node.children()]:
175
- return True
176
- else:
177
- return False
180
+ return AddrmapNode not in [type(c) for c in node.children()]
178
181
 
179
182
 
180
183
  def mask(node):
@@ -201,10 +204,27 @@ class PeakRdlGenerator(GeneratorBase):
201
204
  fileset.insert_file_after(rdlfile, VhdlFile(outputfile))
202
205
 
203
206
  def peakrdl_regblock(self, node, outputdir, config) -> None:
207
+ cpuif_dict = {
208
+ "passthrough": PassthroughCpuif,
209
+ "apb3": APB3_Cpuif,
210
+ "apb3-flat": APB3_Cpuif_flattened,
211
+ "apb4": APB4_Cpuif,
212
+ "apb4-flat": APB4_Cpuif_flattened,
213
+ "axi4-lite": AXI4Lite_Cpuif,
214
+ "axi4-lite-flat": AXI4Lite_Cpuif_flattened,
215
+ "avalon-mm": Avalon_Cpuif,
216
+ "avalon-mm-flat": Avalon_Cpuif_flattened,
217
+ "obi": OBI_Cpuif,
218
+ "obi-flat": OBI_Cpuif_flattened,
219
+ }
220
+ cpuif_name = config.get("cpuif", "apb3")
221
+ if cpuif_name not in cpuif_dict:
222
+ raise ValueError(f"Unsupported CPU interface: {cpuif_name}, must be one of {list(cpuif_dict.keys())}")
223
+
204
224
  RegblockExporter().export(
205
225
  node=node,
206
226
  output_dir=str(outputdir.resolve()),
207
- cpuif_cls=AXI4Lite_Cpuif_flattened,
227
+ cpuif_cls=cpuif_dict.get(cpuif_name),
208
228
  module_name=config.get("module_name", f"{node.type_name}_addrmap"),
209
229
  package_name=config.get("package_name", f"{node.type_name}_pkg"),
210
230
  address_width=config.get("address_width", 32),
@@ -222,7 +242,7 @@ class PeakRdlGenerator(GeneratorBase):
222
242
  def run(self, flow: FlowBase): # noqa: C901
223
243
  rdlfiles = self.project.defaultDesign.files(type=SystemRdlFile, order=FileOrder.COMPILE)
224
244
  output_dir = self.builddir.joinpath("systemrdl")
225
- config = dict()
245
+ config: dict = {}
226
246
  if os.getenv("SIMPLHDL_CONFIG"):
227
247
  tomlfile = Path(os.getenv("SIMPLHDL_CONFIG"))
228
248
  try:
@@ -4,13 +4,14 @@ ifndef PYTHONPATH
4
4
  else
5
5
  export PYTHONPATH := {{pythonpath}}:$(PYTHONPATH)
6
6
  endif
7
- export LIBPYTHON_LOC := $(shell cocotb-config --libpython)
7
+ export LIBPYTHON_LOC := {{get_libpython()}}
8
8
 
9
- VCS_FLAGS += +warn=noVPI-CT-NS +vpi -P pli.tab -load $(shell cocotb-config --lib-name-path vpi vcs)
9
+ VCS_FLAGS += +warn=noVPI-CT-NS +vpi -P pli.tab -load {{get_lib_name_path("vpi", "vcs")}}
10
10
  VCS_FLAGS += -debug_access+r+w+nomemcbk -debug_region+cell+encrypt -debug_acc+pp+f+dmptf
11
11
 
12
- export PYGPI_PYTHON_BIN := $(shell cocotb-config --python-bin)
12
+ export PYGPI_PYTHON_BIN := {{get_pythonbin()}}
13
13
  export COCOTB_TEST_MODULES := {{cocotbtop}}
14
14
  export COCOTB_TOPLEVEL := {{cocotbdut}}
15
15
  export MODULE := {{cocotbtop}}
16
16
  export TOPLEVEL := {{cocotbdut}}
17
+ export GPI_USERS := {{get_gpi_users()}}
File without changes
File without changes
File without changes
File without changes
File without changes