bust 0.14.0.dev0__tar.gz → 1.0.0a0__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 (115) hide show
  1. bust-1.0.0a0/LICENSE +201 -0
  2. bust-1.0.0a0/NOTICE +5 -0
  3. bust-1.0.0a0/PKG-INFO +108 -0
  4. bust-1.0.0a0/README.md +83 -0
  5. bust-1.0.0a0/bust/__init__.py +65 -0
  6. {bust-0.14.0.dev0 → bust-1.0.0a0}/bust/__main__.py +48 -56
  7. bust-1.0.0a0/bust/_version.py +1 -0
  8. bust-1.0.0a0/bust/bus.py +9 -0
  9. bust-1.0.0a0/bust/config_wrapper.py +9 -0
  10. bust-1.0.0a0/bust/core/__init__.py +27 -0
  11. bust-1.0.0a0/bust/core/bus.py +180 -0
  12. bust-1.0.0a0/bust/core/enums.py +168 -0
  13. bust-1.0.0a0/bust/core/field.py +674 -0
  14. bust-1.0.0a0/bust/core/legacy_schema.py +79 -0
  15. bust-1.0.0a0/bust/core/module.py +343 -0
  16. bust-1.0.0a0/bust/core/register.py +940 -0
  17. bust-1.0.0a0/bust/documentation.py +12 -0
  18. {bust-0.14.0.dev0 → bust-1.0.0a0}/bust/editor.py +80 -47
  19. bust-1.0.0a0/bust/enums.py +19 -0
  20. bust-1.0.0a0/bust/exceptions.py +198 -0
  21. bust-1.0.0a0/bust/field.py +9 -0
  22. bust-1.0.0a0/bust/generation.py +229 -0
  23. bust-1.0.0a0/bust/generator_factory.py +9 -0
  24. bust-1.0.0a0/bust/generators/__init__.py +20 -0
  25. bust-1.0.0a0/bust/generators/documentation_generator.py +70 -0
  26. bust-1.0.0a0/bust/generators/factory.py +256 -0
  27. bust-1.0.0a0/bust/generators/header_generator.py +87 -0
  28. bust-1.0.0a0/bust/generators/vhdl/__init__.py +12 -0
  29. bust-1.0.0a0/bust/generators/vhdl/module_generator.py +95 -0
  30. bust-1.0.0a0/bust/header.py +9 -0
  31. bust-1.0.0a0/bust/interaction.py +74 -0
  32. bust-1.0.0a0/bust/jinja_utils/environment.py +86 -0
  33. bust-1.0.0a0/bust/jinja_utils/filters.py +82 -0
  34. bust-1.0.0a0/bust/module.py +9 -0
  35. bust-1.0.0a0/bust/module_vhdl_gen.py +13 -0
  36. bust-1.0.0a0/bust/register.py +9 -0
  37. {bust-0.14.0.dev0 → bust-1.0.0a0}/bust/settings.py +67 -43
  38. bust-1.0.0a0/bust/templates/header/c_header.j2 +47 -0
  39. bust-1.0.0a0/bust/templates/header/cpp_header.j2 +53 -0
  40. bust-1.0.0a0/bust/templates/header/python_header.j2 +49 -0
  41. bust-1.0.0a0/bust/templates/ipbus/addr_table.j2 +14 -0
  42. bust-1.0.0a0/bust/templates/latex/documentation.j2 +87 -0
  43. bust-1.0.0a0/bust/templates/vhdl/module/apb_endpoint.j2 +105 -0
  44. bust-1.0.0a0/bust/templates/vhdl/module/avalon_endpoint.j2 +84 -0
  45. bust-1.0.0a0/bust/templates/vhdl/module/axi_endpoint.j2 +188 -0
  46. bust-1.0.0a0/bust/templates/vhdl/module/ipb_endpoint.j2 +73 -0
  47. bust-1.0.0a0/bust/templates/vhdl/module/localbus_pkg.j2 +50 -0
  48. bust-1.0.0a0/bust/templates/vhdl/module/module_top.j2 +189 -0
  49. bust-1.0.0a0/bust/templates/vhdl/module/regfile.j2 +266 -0
  50. bust-1.0.0a0/bust/templates/vhdl/module/regfile_pkg.j2 +181 -0
  51. bust-1.0.0a0/bust/templates/vhdl/module/sbi_endpoint.j2 +80 -0
  52. bust-1.0.0a0/bust/templates/vhdl/module/wishbone_endpoint.j2 +83 -0
  53. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_apb_tb.j2 +154 -0
  54. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_avalon_tb.j2 +115 -0
  55. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_axi_tb.j2 +121 -0
  56. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_ipbus_tb.j2 +117 -0
  57. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_sbi_tb.j2 +110 -0
  58. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_tb/hw_signals.j2 +15 -0
  59. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_tb/monitor_process.j2 +29 -0
  60. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_tb/monitor_signals.j2 +21 -0
  61. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_tb/snapshot_vars.j2 +11 -0
  62. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_tb/test_sequence.j2 +129 -0
  63. bust-1.0.0a0/bust/templates/vhdl/testbench/localbus_wishbone_tb.j2 +149 -0
  64. bust-1.0.0a0/bust/utils/__init__.py +59 -0
  65. bust-1.0.0a0/bust/utils/file_utils.py +191 -0
  66. bust-1.0.0a0/bust/utils/formatting.py +106 -0
  67. bust-1.0.0a0/bust/utils/json_utils.py +47 -0
  68. bust-1.0.0a0/bust/utils.py +53 -0
  69. bust-1.0.0a0/bust/validation/__init__.py +27 -0
  70. bust-1.0.0a0/bust/validation/config_validator.py +84 -0
  71. bust-0.14.0.dev0/bust/vhdl.py → bust-1.0.0a0/bust/validation/vhdl_validator.py +128 -128
  72. bust-1.0.0a0/bust/vhdl_util.py +33 -0
  73. bust-1.0.0a0/bust.egg-info/PKG-INFO +108 -0
  74. bust-1.0.0a0/bust.egg-info/SOURCES.txt +91 -0
  75. {bust-0.14.0.dev0 → bust-1.0.0a0}/bust.egg-info/entry_points.txt +0 -1
  76. {bust-0.14.0.dev0 → bust-1.0.0a0}/bust.egg-info/requires.txt +4 -0
  77. bust-1.0.0a0/bust.egg-info/top_level.txt +1 -0
  78. bust-1.0.0a0/pyproject.toml +83 -0
  79. bust-1.0.0a0/tests/test_access_mode_combinations.py +283 -0
  80. bust-1.0.0a0/tests/test_access_modes.py +480 -0
  81. bust-1.0.0a0/tests/test_editor.py +53 -0
  82. bust-1.0.0a0/tests/test_file_utils.py +101 -0
  83. bust-1.0.0a0/tests/test_generation.py +110 -0
  84. bust-1.0.0a0/tests/test_interaction.py +45 -0
  85. bust-1.0.0a0/tests/test_ipbus.py +145 -0
  86. bust-1.0.0a0/tests/test_json_roundtrip.py +165 -0
  87. bust-1.0.0a0/tests/test_module.py +107 -0
  88. bust-1.0.0a0/tests/test_prototype_example.py +116 -0
  89. bust-1.0.0a0/tests/test_regfile_package.py +752 -0
  90. bust-1.0.0a0/tests/test_suite.py +366 -0
  91. bust-0.14.0.dev0/LICENSE +0 -21
  92. bust-0.14.0.dev0/PKG-INFO +0 -103
  93. bust-0.14.0.dev0/README.md +0 -88
  94. bust-0.14.0.dev0/bust/_version.py +0 -1
  95. bust-0.14.0.dev0/bust/bus.py +0 -62
  96. bust-0.14.0.dev0/bust/bus_vhdl_gen.py +0 -1415
  97. bust-0.14.0.dev0/bust/documentation.py +0 -165
  98. bust-0.14.0.dev0/bust/exceptions.py +0 -107
  99. bust-0.14.0.dev0/bust/field.py +0 -69
  100. bust-0.14.0.dev0/bust/generation.py +0 -205
  101. bust-0.14.0.dev0/bust/header.py +0 -207
  102. bust-0.14.0.dev0/bust/module.py +0 -264
  103. bust-0.14.0.dev0/bust/module_vhdl_gen.py +0 -431
  104. bust-0.14.0.dev0/bust/register.py +0 -212
  105. bust-0.14.0.dev0/bust/testbench.py +0 -776
  106. bust-0.14.0.dev0/bust/utils.py +0 -308
  107. bust-0.14.0.dev0/bust.egg-info/PKG-INFO +0 -103
  108. bust-0.14.0.dev0/bust.egg-info/SOURCES.txt +0 -29
  109. bust-0.14.0.dev0/bust.egg-info/top_level.txt +0 -2
  110. bust-0.14.0.dev0/setup.py +0 -56
  111. bust-0.14.0.dev0/tests/__init__.py +0 -0
  112. bust-0.14.0.dev0/tests/test_suite.py +0 -228
  113. {bust-0.14.0.dev0/bust → bust-1.0.0a0/bust/jinja_utils}/__init__.py +0 -0
  114. {bust-0.14.0.dev0 → bust-1.0.0a0}/bust.egg-info/dependency_links.txt +0 -0
  115. {bust-0.14.0.dev0 → bust-1.0.0a0}/setup.cfg +0 -0
bust-1.0.0a0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
bust-1.0.0a0/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ bust
2
+ Copyright 2017-2026 Ola Grottvik
3
+
4
+ This product is licensed under the Apache License, Version 2.0.
5
+ See the LICENSE file for the full license text.
bust-1.0.0a0/PKG-INFO ADDED
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: bust
3
+ Version: 1.0.0a0
4
+ Summary: Utility for simply creating and modifying VHDL bus slave modules
5
+ Author-email: Ola Groettvik <olagrottvik@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/logvik-org/bust
8
+ Keywords: vhdl,bus,axi,ipbus,slave,generator
9
+ Requires-Python: >=3.9.0
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ License-File: NOTICE
13
+ Requires-Dist: docopt>=0.6.2
14
+ Requires-Dist: pylatexenc>=2.1
15
+ Requires-Dist: curses-menu>=0.9.0
16
+ Requires-Dist: prettytable>=2.5.0
17
+ Requires-Dist: Jinja2<4.0,>=3.1.5
18
+ Provides-Extra: dev
19
+ Requires-Dist: pytest; extra == "dev"
20
+ Requires-Dist: pytest-cov; extra == "dev"
21
+ Requires-Dist: pylint; extra == "dev"
22
+ Requires-Dist: mypy; extra == "dev"
23
+ Requires-Dist: pydocstyle; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ ![Workflow status](https://github.com/logvik-org/bust/actions/workflows/python_tests.yml/badge.svg)
27
+
28
+ # bust bus tool
29
+
30
+ Utility for simply creating and modifying VHDL bus slave modules.
31
+
32
+ ## Concept
33
+
34
+ The main goal of the project is to able to automatically create and modify VHDL bus slave modules based on a simple definition format.
35
+ By employing VHDL records the handling of the registers can be completely hidden in a module separate from the rest of the design.
36
+ Every supported bus protocol is a thin wrapper (an "endpoint") around a small protocol-agnostic local bus, so the register-map logic stays the same regardless of bus. The hardware side references each field by name through `to_hw`/`from_hw` records, with software/hardware access modes and side effects (read/write clear/set, single-pulse, hardware set/clear, enumerated values) described in the JSON.
37
+
38
+ ## Bus support
39
+
40
+ bust currently supports these bus standards:
41
+
42
+ - [AXI4-lite](https://en.wikipedia.org/wiki/Advanced_eXtensible_Interface#AXI4-Lite)
43
+ - [IPBus](https://ipbus.web.cern.ch/ipbus/)
44
+ - [SBI](https://github.com/UVVM/UVVM) (Simple Bus Interface, as used by UVVM)
45
+ - [Avalon-MM](https://www.intel.com/content/www/us/en/docs/programmable/683091/current/introduction-to-the-interface-specifications.html)
46
+ - [Wishbone](https://wishbone-interconnect.readthedocs.io/)
47
+ - [APB](https://developer.arm.com/documentation/ihi0024/latest/) (AMBA APB)
48
+
49
+ ## Requirements
50
+
51
+ bust is tested on python 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14.
52
+
53
+ bust does NOT support python 2.7 and neither should you!
54
+
55
+ ## Getting Started
56
+
57
+ Install the latest release by using pip:
58
+
59
+ `pip install bust`
60
+
61
+ pip skips pre-releases (alpha, beta and release candidates) unless you ask for
62
+ them. To try the newest pre-release:
63
+
64
+ `pip install --pre bust`
65
+
66
+ ### Usage
67
+
68
+ `bust FILE [-o DIR]`
69
+
70
+ `bust --version`
71
+
72
+ `bust -h | --help`
73
+
74
+ ## Examples
75
+
76
+ The examples folder contains JSON files for the bus types supported.
77
+ The files are human-readable to the point that you can create your own from this template alone.
78
+ The folder also contains the output files generated based on the JSON files.
79
+
80
+ ### Simulation
81
+ bust does not generate simulator-specific run scripts. There are too many simulators and flows to pick a one-size-fits-all approach, so compiling and running the output is left to you. The repository's own simulation (under `sim/`) exists only to verify that bust itself works and that the generated example designs simulate; it is not a user-facing flow.
82
+
83
+ The generated testbenches use UVVM - which can be cloned from their [GitHub page](https://github.com/UVVM/UVVM) - and, for IPBus, the vip_ipbus VIP.
84
+
85
+ ### IPBus
86
+ IPBus requires the bus package file from the [IPBus firmware repo](https://github.com/ipbus/ipbus-firmware) and the custom [IPBus BFM repo](https://github.com/olagrottvik/vip_ipbus).
87
+
88
+ See the example files for how you point to the specific folders.
89
+
90
+ ## Latest Development Version (Bleeding Edge)
91
+
92
+ To run bust from a clone of the repository, see the development setup in
93
+ [CONTRIBUTING.md](CONTRIBUTING.md).
94
+
95
+
96
+ ## Release Notes
97
+
98
+ Release notes are in [CHANGELOG.md](CHANGELOG.md), and each release is on the [Releases page](https://github.com/logvik-org/bust/releases).
99
+
100
+
101
+ ## Contributing
102
+
103
+ If you have ideas on how to improve the project, please review [CONTRIBUTING.md](CONTRIBUTING.md) for details. Note that we also have a [Code of Conduct](CODE_OF_CONDUCT.md).
104
+
105
+
106
+ ## License
107
+
108
+ This project is licensed under the Apache License, Version 2.0 - see [LICENSE](LICENSE) for details.
bust-1.0.0a0/README.md ADDED
@@ -0,0 +1,83 @@
1
+ ![Workflow status](https://github.com/logvik-org/bust/actions/workflows/python_tests.yml/badge.svg)
2
+
3
+ # bust bus tool
4
+
5
+ Utility for simply creating and modifying VHDL bus slave modules.
6
+
7
+ ## Concept
8
+
9
+ The main goal of the project is to able to automatically create and modify VHDL bus slave modules based on a simple definition format.
10
+ By employing VHDL records the handling of the registers can be completely hidden in a module separate from the rest of the design.
11
+ Every supported bus protocol is a thin wrapper (an "endpoint") around a small protocol-agnostic local bus, so the register-map logic stays the same regardless of bus. The hardware side references each field by name through `to_hw`/`from_hw` records, with software/hardware access modes and side effects (read/write clear/set, single-pulse, hardware set/clear, enumerated values) described in the JSON.
12
+
13
+ ## Bus support
14
+
15
+ bust currently supports these bus standards:
16
+
17
+ - [AXI4-lite](https://en.wikipedia.org/wiki/Advanced_eXtensible_Interface#AXI4-Lite)
18
+ - [IPBus](https://ipbus.web.cern.ch/ipbus/)
19
+ - [SBI](https://github.com/UVVM/UVVM) (Simple Bus Interface, as used by UVVM)
20
+ - [Avalon-MM](https://www.intel.com/content/www/us/en/docs/programmable/683091/current/introduction-to-the-interface-specifications.html)
21
+ - [Wishbone](https://wishbone-interconnect.readthedocs.io/)
22
+ - [APB](https://developer.arm.com/documentation/ihi0024/latest/) (AMBA APB)
23
+
24
+ ## Requirements
25
+
26
+ bust is tested on python 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14.
27
+
28
+ bust does NOT support python 2.7 and neither should you!
29
+
30
+ ## Getting Started
31
+
32
+ Install the latest release by using pip:
33
+
34
+ `pip install bust`
35
+
36
+ pip skips pre-releases (alpha, beta and release candidates) unless you ask for
37
+ them. To try the newest pre-release:
38
+
39
+ `pip install --pre bust`
40
+
41
+ ### Usage
42
+
43
+ `bust FILE [-o DIR]`
44
+
45
+ `bust --version`
46
+
47
+ `bust -h | --help`
48
+
49
+ ## Examples
50
+
51
+ The examples folder contains JSON files for the bus types supported.
52
+ The files are human-readable to the point that you can create your own from this template alone.
53
+ The folder also contains the output files generated based on the JSON files.
54
+
55
+ ### Simulation
56
+ bust does not generate simulator-specific run scripts. There are too many simulators and flows to pick a one-size-fits-all approach, so compiling and running the output is left to you. The repository's own simulation (under `sim/`) exists only to verify that bust itself works and that the generated example designs simulate; it is not a user-facing flow.
57
+
58
+ The generated testbenches use UVVM - which can be cloned from their [GitHub page](https://github.com/UVVM/UVVM) - and, for IPBus, the vip_ipbus VIP.
59
+
60
+ ### IPBus
61
+ IPBus requires the bus package file from the [IPBus firmware repo](https://github.com/ipbus/ipbus-firmware) and the custom [IPBus BFM repo](https://github.com/olagrottvik/vip_ipbus).
62
+
63
+ See the example files for how you point to the specific folders.
64
+
65
+ ## Latest Development Version (Bleeding Edge)
66
+
67
+ To run bust from a clone of the repository, see the development setup in
68
+ [CONTRIBUTING.md](CONTRIBUTING.md).
69
+
70
+
71
+ ## Release Notes
72
+
73
+ Release notes are in [CHANGELOG.md](CHANGELOG.md), and each release is on the [Releases page](https://github.com/logvik-org/bust/releases).
74
+
75
+
76
+ ## Contributing
77
+
78
+ If you have ideas on how to improve the project, please review [CONTRIBUTING.md](CONTRIBUTING.md) for details. Note that we also have a [Code of Conduct](CODE_OF_CONDUCT.md).
79
+
80
+
81
+ ## License
82
+
83
+ This project is licensed under the Apache License, Version 2.0 - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,65 @@
1
+ """bust - Bus Utility for Simplified VHDL.
2
+
3
+ bust is a Python tool for creating and modifying VHDL bus slave modules.
4
+ It generates complete VHDL code including register interfaces, testbenches,
5
+ documentation, and language-specific header files from simple JSON configuration.
6
+
7
+ Supported bus standards:
8
+ - AXI4-Lite
9
+ - IPBus
10
+
11
+ Main components:
12
+ - Module: Bus slave module definition
13
+ - Register: Individual register configuration
14
+ - Field: Bitfield within a register
15
+ - Bus: Bus interface configuration
16
+ - Header: Language header file generation
17
+ - Documentation: LaTeX documentation generation
18
+
19
+ Package structure:
20
+ - core: Domain models (Module, Bus, Register, Field, Enums)
21
+ - generators: Code generation (VHDL, headers, documentation, testbenches)
22
+ - validation: VHDL identifier and configuration validation
23
+ - utils: File I/O, JSON parsing, and string formatting utilities
24
+ - jinja_utils: Jinja2 template utilities
25
+ """
26
+
27
+ # Import core domain classes for convenience
28
+ from bust.core import (
29
+ Module,
30
+ Bus,
31
+ Register,
32
+ Field,
33
+ RegisterMode,
34
+ RegisterType,
35
+ FieldType,
36
+ )
37
+
38
+ # Import generator classes
39
+ from bust.generators import (
40
+ HeaderGenerator,
41
+ DocumentationGenerator,
42
+ GeneratorFactory,
43
+ )
44
+
45
+ # Backward compatibility aliases
46
+ Header = HeaderGenerator
47
+ Documentation = DocumentationGenerator
48
+
49
+ __all__ = [
50
+ # Core domain classes
51
+ "Module",
52
+ "Bus",
53
+ "Register",
54
+ "Field",
55
+ "RegisterMode",
56
+ "RegisterType",
57
+ "FieldType",
58
+ # Generator classes
59
+ "HeaderGenerator",
60
+ "DocumentationGenerator",
61
+ "GeneratorFactory",
62
+ # Backward compatibility
63
+ "Header",
64
+ "Documentation",
65
+ ]
@@ -1,22 +1,18 @@
1
1
  #!/usr/bin/env python3
2
- """bust register tool
2
+ """bust register tool.
3
3
 
4
4
  Usage:
5
- bust.py FILE [-o DIR] [[[-F | -f] [-u] [-d | -p] [-b] [-t] [-i] [-m]] | [-a] | [-c | -e]]
6
- bust.py --version
7
- bust.py -h | --help
5
+ bust FILE [-o DIR] [[[-F | -f] [-d | -p] [-i]] | [-a] | [-c | -e]]
6
+ bust --version
7
+ bust -h | --help
8
8
 
9
9
  Options:
10
10
  -o DIR Specify output directory. Overrides settings (either JSON dir, or specified project dir in JSON)
11
- -f Force overwrite of existing files except module top level VHDL file
12
- -F Force overwrite of ALL existing files
13
- -u Try to update top-level file - MAY OVERWRITE USER EDITS!
11
+ -f Force overwrite of existing files (the top-level wrapper is a fixed, regenerated file)
12
+ -F Alias for -f, kept for compatibility
14
13
  -d Do not generate documentation (neither LaTeX nor PDF)
15
14
  -p Do not generate PDF from LaTeX
16
- -b Do not generate the bus VHDL package file
17
- -t Do not generate the testbench VHDL file and the simulation scripts
18
15
  -i Do not generate the include header files (.h, .hpp & .py)
19
- -m Do not generate the module VHDL files
20
16
  -a Update register addresses and save JSON file
21
17
  -e Edit the JSON file
22
18
  -c Create a new JSON file
@@ -31,14 +27,15 @@ Arguments:
31
27
  from docopt import docopt
32
28
  import sys
33
29
  import logging
34
-
35
- from bust.utils import json_parser, write_string_to_file
36
- from bust.module import Module
37
- from bust.bus import Bus
38
- from bust.header import Header
39
- from bust.documentation import Documentation
30
+ from typing import Dict, Union
31
+
32
+ from bust.utils.json_utils import json_parser
33
+ from bust.utils.file_utils import write_string_to_file
34
+ from bust.core.module import Module
35
+ from bust.core.bus import Bus
36
+ from bust.generators.header_generator import Header
37
+ from bust.generators.documentation_generator import Documentation
40
38
  from bust.settings import Settings
41
- from bust.testbench import Testbench
42
39
  from bust.generation import generate_output
43
40
  from bust.exceptions import (
44
41
  FormatError,
@@ -75,13 +72,25 @@ def main():
75
72
  json_file = args["FILE"]
76
73
 
77
74
  if args["-c"] and json_file is not None:
78
- e = Editor(False, json_file)
79
- e.show_menu()
75
+ try:
76
+ e = Editor(False, json_file)
77
+ e.show_menu()
78
+ except Exception as e:
79
+ logger.error("Failed to create new JSON file: " + json_file)
80
+ logger.error(f"{type(e).__name__}: {e}")
81
+ logger.debug("Detailed traceback:", exc_info=True)
82
+ exit(1)
80
83
  exit()
81
84
 
82
85
  if args["-e"] and json_file is not None:
83
- e = Editor(True, json_file)
84
- e.show_menu()
86
+ try:
87
+ editor = Editor(True, json_file)
88
+ editor.show_menu()
89
+ except Exception as e:
90
+ logger.error("Failed to open editor for " + json_file)
91
+ logger.error(f"{type(e).__name__}: {e}")
92
+ logger.debug("Detailed traceback:", exc_info=True)
93
+ exit(1)
85
94
  exit()
86
95
 
87
96
  logger.info("Parsing file: " + json_file + "...")
@@ -93,7 +102,6 @@ def main():
93
102
  module = Module(json_dict["module"], bus, settings)
94
103
  header = Header(module)
95
104
  documentation = Documentation(module)
96
- testbench = Testbench(module, bus.get_VHDL_generator(), settings)
97
105
 
98
106
  except (
99
107
  FormatError,
@@ -104,15 +112,19 @@ def main():
104
112
  NotImplementedError,
105
113
  ) as e:
106
114
  logger.error(str(e))
115
+ if hasattr(e, "__cause__") and isinstance(e.__cause__, ValueError):
116
+ logger.error(str(e.__cause__))
117
+ logger.debug("Detailed traceback:", exc_info=True)
107
118
  exit(1)
108
119
 
109
120
  except Exception as e:
110
- logger.error("\nERROR:\nAn unknown error has occurred...")
111
- logger.debug(str(e))
121
+ logger.error("An unknown error has occurred...")
122
+ logger.error(f"{type(e).__name__}: {e}")
123
+ logger.debug("Detailed traceback:", exc_info=True)
112
124
  exit(1)
113
125
 
114
126
  # File generation settings
115
- gs = {}
127
+ gs: Dict[str, Union[bool, str]] = {}
116
128
 
117
129
  if args["-o"] is None:
118
130
  gs["dir"] = settings.project_path
@@ -120,26 +132,7 @@ def main():
120
132
  gs["dir"] = args["-o"]
121
133
 
122
134
  # Check if force overwrite is set
123
- gs["force_ow"] = False
124
- gs["force_ow_top"] = False
125
- if args["-F"]:
126
- gs["force_ow"] = True
127
- gs["force_ow_top"] = True
128
- elif args["-f"]:
129
- gs["force_ow"] = True
130
-
131
- # Check if top-level are to be updated
132
- gs["update_top"] = False
133
- if args["-u"]:
134
- gs["update_top"] = True
135
- gs["force_ow_top"] = True
136
-
137
- if bus.bus_type == "axi":
138
- gs["gen_bus"] = True
139
- else:
140
- gs["gen_bus"] = False
141
- if args["-b"]:
142
- gs["gen_bus"] = False
135
+ gs["force_ow"] = bool(args["-F"] or args["-f"])
143
136
 
144
137
  gs["gen_doc"] = True
145
138
  gs["gen_pdf"] = True
@@ -149,21 +142,15 @@ def main():
149
142
  elif args["-p"]:
150
143
  gs["gen_pdf"] = False
151
144
 
152
- gs["gen_tb"] = True
153
- if args["-t"]:
154
- gs["gen_tb"] = False
155
-
156
145
  gs["gen_header"] = True
157
146
  if args["-i"]:
158
147
  gs["gen_header"] = False
159
148
 
160
- gs["gen_mod"] = True
161
- if args["-m"]:
162
- gs["gen_mod"] = False
149
+ gs["gen_localbus"] = True
163
150
 
164
151
  if args["-a"]:
165
152
  module.update_addresses()
166
- json = module.return_JSON(True)
153
+ json = module.to_json(True)
167
154
  try:
168
155
  write_string_to_file(json, json_file, ".")
169
156
  except Exception as e:
@@ -171,12 +158,17 @@ def main():
171
158
  print(e)
172
159
  return
173
160
  else:
174
- generate_output(
175
- settings, bus, module, header, documentation, testbench, gs
176
- )
161
+ try:
162
+ generate_output(settings, bus, module, header, documentation, gs)
163
+ except Exception as e:
164
+ logger.error("An error occurred during output generation...")
165
+ logger.error(f"{type(e).__name__}: {e}")
166
+ logger.debug("Detailed traceback:", exc_info=True)
167
+ exit(1)
177
168
 
178
169
  except Exception:
179
170
  logger.exception("An unresolvable error has occurred...")
171
+ logger.debug("Detailed traceback:", exc_info=True)
180
172
  exit(1)
181
173
 
182
174
  sys.exit(0)
@@ -0,0 +1 @@
1
+ __VERSION__ = "1.0.0a0"
@@ -0,0 +1,9 @@
1
+ """Bus module for bust.
2
+
3
+ This module is a backward compatibility shim. Import from bust.core.bus instead.
4
+ """
5
+
6
+ # Re-export from new location for backward compatibility
7
+ from bust.core.bus import Bus
8
+
9
+ __all__ = ["Bus"]
@@ -0,0 +1,9 @@
1
+ """Configuration validation utilities for bust.
2
+
3
+ This module is a backward compatibility shim. Import from bust.validation.config_validator instead.
4
+ """
5
+
6
+ # Re-export from new location for backward compatibility
7
+ from bust.validation.config_validator import ConfigWrapper
8
+
9
+ __all__ = ["ConfigWrapper"]