uc-xcomm 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. uc_xcomm-1.1.0/.clang-format +73 -0
  2. uc_xcomm-1.1.0/.github/README.md +29 -0
  3. uc_xcomm-1.1.0/.github/workflows/build-python.yml +89 -0
  4. uc_xcomm-1.1.0/.github/workflows/docs.yml +59 -0
  5. uc_xcomm-1.1.0/.github/workflows/python-wheel.yml +48 -0
  6. uc_xcomm-1.1.0/.github/workflows/release.yml +109 -0
  7. uc_xcomm-1.1.0/.github/workflows/version.yml +155 -0
  8. uc_xcomm-1.1.0/.gitignore +41 -0
  9. uc_xcomm-1.1.0/CMakeLists.txt +37 -0
  10. uc_xcomm-1.1.0/LICENSE +127 -0
  11. uc_xcomm-1.1.0/Makefile +62 -0
  12. uc_xcomm-1.1.0/PKG-INFO +45 -0
  13. uc_xcomm-1.1.0/README.cn.md +29 -0
  14. uc_xcomm-1.1.0/README.en.md +29 -0
  15. uc_xcomm-1.1.0/cmake/Sources.cmake +28 -0
  16. uc_xcomm-1.1.0/cmake/StageHeaders.cmake +6 -0
  17. uc_xcomm-1.1.0/cmake/xcomm.cmake +104 -0
  18. uc_xcomm-1.1.0/docs/APIs.cn.md +6 -0
  19. uc_xcomm-1.1.0/docs/architecture.md +6 -0
  20. uc_xcomm-1.1.0/docs/en/development/contributing.md +44 -0
  21. uc_xcomm-1.1.0/docs/en/development/documentation.md +56 -0
  22. uc_xcomm-1.1.0/docs/en/development/releases.md +59 -0
  23. uc_xcomm-1.1.0/docs/en/explanation/architecture.md +58 -0
  24. uc_xcomm-1.1.0/docs/en/explanation/performance.md +34 -0
  25. uc_xcomm-1.1.0/docs/en/guides/events-coverage.md +63 -0
  26. uc_xcomm-1.1.0/docs/en/guides/installation.md +75 -0
  27. uc_xcomm-1.1.0/docs/en/guides/typed-expressions.md +61 -0
  28. uc_xcomm-1.1.0/docs/en/index.md +32 -0
  29. uc_xcomm-1.1.0/docs/en/reference/api-index.md +47 -0
  30. uc_xcomm-1.1.0/docs/en/reference/bindings.md +72 -0
  31. uc_xcomm-1.1.0/docs/en/reference/compatibility.md +53 -0
  32. uc_xcomm-1.1.0/docs/en/reference/coverage.md +113 -0
  33. uc_xcomm-1.1.0/docs/en/reference/engine.md +65 -0
  34. uc_xcomm-1.1.0/docs/en/reference/expressions.md +69 -0
  35. uc_xcomm-1.1.0/docs/en/reference/monitors.md +102 -0
  36. uc_xcomm-1.1.0/docs/en/reference/signal-config.md +72 -0
  37. uc_xcomm-1.1.0/docs/en/reference/tlm.md +40 -0
  38. uc_xcomm-1.1.0/docs/en/reference/triggers.md +91 -0
  39. uc_xcomm-1.1.0/docs/en/reference/troubleshooting.md +33 -0
  40. uc_xcomm-1.1.0/docs/en/reference/utilities.md +78 -0
  41. uc_xcomm-1.1.0/docs/en/reference/xclock.md +66 -0
  42. uc_xcomm-1.1.0/docs/en/reference/xdata.md +96 -0
  43. uc_xcomm-1.1.0/docs/en/reference/xport.md +40 -0
  44. uc_xcomm-1.1.0/docs/en/tutorials/first-simulation.md +87 -0
  45. uc_xcomm-1.1.0/docs/maintainer-guidance.md +6 -0
  46. uc_xcomm-1.1.0/docs/xdata_xclock_optimizations.md +6 -0
  47. uc_xcomm-1.1.0/docs/zh/development/contributing.md +44 -0
  48. uc_xcomm-1.1.0/docs/zh/development/documentation.md +56 -0
  49. uc_xcomm-1.1.0/docs/zh/development/releases.md +45 -0
  50. uc_xcomm-1.1.0/docs/zh/explanation/architecture.md +58 -0
  51. uc_xcomm-1.1.0/docs/zh/explanation/performance.md +34 -0
  52. uc_xcomm-1.1.0/docs/zh/guides/events-coverage.md +63 -0
  53. uc_xcomm-1.1.0/docs/zh/guides/installation.md +75 -0
  54. uc_xcomm-1.1.0/docs/zh/guides/typed-expressions.md +61 -0
  55. uc_xcomm-1.1.0/docs/zh/index.md +32 -0
  56. uc_xcomm-1.1.0/docs/zh/reference/api-index.md +47 -0
  57. uc_xcomm-1.1.0/docs/zh/reference/bindings.md +72 -0
  58. uc_xcomm-1.1.0/docs/zh/reference/compatibility.md +53 -0
  59. uc_xcomm-1.1.0/docs/zh/reference/coverage.md +113 -0
  60. uc_xcomm-1.1.0/docs/zh/reference/engine.md +67 -0
  61. uc_xcomm-1.1.0/docs/zh/reference/expressions.md +69 -0
  62. uc_xcomm-1.1.0/docs/zh/reference/monitors.md +102 -0
  63. uc_xcomm-1.1.0/docs/zh/reference/signal-config.md +72 -0
  64. uc_xcomm-1.1.0/docs/zh/reference/tlm.md +40 -0
  65. uc_xcomm-1.1.0/docs/zh/reference/triggers.md +91 -0
  66. uc_xcomm-1.1.0/docs/zh/reference/troubleshooting.md +33 -0
  67. uc_xcomm-1.1.0/docs/zh/reference/utilities.md +78 -0
  68. uc_xcomm-1.1.0/docs/zh/reference/xclock.md +66 -0
  69. uc_xcomm-1.1.0/docs/zh/reference/xdata.md +96 -0
  70. uc_xcomm-1.1.0/docs/zh/reference/xport.md +40 -0
  71. uc_xcomm-1.1.0/docs/zh/tutorials/first-simulation.md +87 -0
  72. uc_xcomm-1.1.0/include/xspcomm/common/callback_storage.h +12 -0
  73. uc_xcomm-1.1.0/include/xspcomm/common/compare.h +100 -0
  74. uc_xcomm-1.1.0/include/xspcomm/common/compare_op.h +10 -0
  75. uc_xcomm-1.1.0/include/xspcomm/common/lifetime.h +20 -0
  76. uc_xcomm-1.1.0/include/xspcomm/common/memory.h +117 -0
  77. uc_xcomm-1.1.0/include/xspcomm/common/memory_access.h +79 -0
  78. uc_xcomm-1.1.0/include/xspcomm/monitor/callback.h +70 -0
  79. uc_xcomm-1.1.0/include/xspcomm/monitor/condition.h +109 -0
  80. uc_xcomm-1.1.0/include/xspcomm/monitor/expr.h +40 -0
  81. uc_xcomm-1.1.0/include/xspcomm/monitor/fsm.h +70 -0
  82. uc_xcomm-1.1.0/include/xspcomm/monitor/range.h +61 -0
  83. uc_xcomm-1.1.0/include/xspcomm/runtime/types.h +74 -0
  84. uc_xcomm-1.1.0/include/xspcomm/tlm/message.h +68 -0
  85. uc_xcomm-1.1.0/include/xspcomm/tlm/pubsub.h +71 -0
  86. uc_xcomm-1.1.0/include/xspcomm/xcallback.h +93 -0
  87. uc_xcomm-1.1.0/include/xspcomm/xclock.h +201 -0
  88. uc_xcomm-1.1.0/include/xspcomm/xcomm.h +14 -0
  89. uc_xcomm-1.1.0/include/xspcomm/xconfig.h.in +10 -0
  90. uc_xcomm-1.1.0/include/xspcomm/xcoroutine.h +158 -0
  91. uc_xcomm-1.1.0/include/xspcomm/xcoverage.h +52 -0
  92. uc_xcomm-1.1.0/include/xspcomm/xdata.h +361 -0
  93. uc_xcomm-1.1.0/include/xspcomm/xengine.h +130 -0
  94. uc_xcomm-1.1.0/include/xspcomm/xexpr.h +139 -0
  95. uc_xcomm-1.1.0/include/xspcomm/xmonitor.h +12 -0
  96. uc_xcomm-1.1.0/include/xspcomm/xpattern.h +55 -0
  97. uc_xcomm-1.1.0/include/xspcomm/xport.h +55 -0
  98. uc_xcomm-1.1.0/include/xspcomm/xsignal_cfg.h +70 -0
  99. uc_xcomm-1.1.0/include/xspcomm/xtrigger.h +12 -0
  100. uc_xcomm-1.1.0/include/xspcomm/xutil.h +345 -0
  101. uc_xcomm-1.1.0/include/xspcomm/xvpi.h +127 -0
  102. uc_xcomm-1.1.0/integrations/tlm/CMakeLists.txt +41 -0
  103. uc_xcomm-1.1.0/integrations/tlm/pubsub.cpp +101 -0
  104. uc_xcomm-1.1.0/integrations/tlm/python.i +125 -0
  105. uc_xcomm-1.1.0/integrations/tlm/uvmc_bridge.h +175 -0
  106. uc_xcomm-1.1.0/mkdocs.yml +117 -0
  107. uc_xcomm-1.1.0/pyproject.toml +51 -0
  108. uc_xcomm-1.1.0/requirements-docs.txt +4 -0
  109. uc_xcomm-1.1.0/scripts/docs.py +217 -0
  110. uc_xcomm-1.1.0/scripts/release/check_build.py +36 -0
  111. uc_xcomm-1.1.0/scripts/release/check_distributions.py +47 -0
  112. uc_xcomm-1.1.0/scripts/release/check_wheel.py +82 -0
  113. uc_xcomm-1.1.0/scripts/release/prepare_manylinux2014.py +48 -0
  114. uc_xcomm-1.1.0/scripts/release/tag_policy.py +77 -0
  115. uc_xcomm-1.1.0/src/CMakeLists.txt +34 -0
  116. uc_xcomm-1.1.0/src/common/lifetime.cpp +8 -0
  117. uc_xcomm-1.1.0/src/common/memory.cpp +49 -0
  118. uc_xcomm-1.1.0/src/core/clock.cpp +534 -0
  119. uc_xcomm-1.1.0/src/core/coroutine.cpp +117 -0
  120. uc_xcomm-1.1.0/src/core/port.cpp +209 -0
  121. uc_xcomm-1.1.0/src/core/signal_cfg.cpp +362 -0
  122. uc_xcomm-1.1.0/src/core/util.cpp +33 -0
  123. uc_xcomm-1.1.0/src/coverage/registration.cpp +56 -0
  124. uc_xcomm-1.1.0/src/coverage/state.cpp +370 -0
  125. uc_xcomm-1.1.0/src/coverage/state.h +84 -0
  126. uc_xcomm-1.1.0/src/data/backends.cpp +208 -0
  127. uc_xcomm-1.1.0/src/data/data.cpp +708 -0
  128. uc_xcomm-1.1.0/src/data/native_memory.h +70 -0
  129. uc_xcomm-1.1.0/src/data/pin.cpp +107 -0
  130. uc_xcomm-1.1.0/src/data/value.cpp +537 -0
  131. uc_xcomm-1.1.0/src/data/vpi.cpp +127 -0
  132. uc_xcomm-1.1.0/src/expr/bits.cpp +275 -0
  133. uc_xcomm-1.1.0/src/expr/engine.cpp +748 -0
  134. uc_xcomm-1.1.0/src/expr/parser.cpp +638 -0
  135. uc_xcomm-1.1.0/src/monitor/callback.cpp +103 -0
  136. uc_xcomm-1.1.0/src/monitor/condition.cpp +266 -0
  137. uc_xcomm-1.1.0/src/monitor/expr.cpp +75 -0
  138. uc_xcomm-1.1.0/src/monitor/fsm.cpp +533 -0
  139. uc_xcomm-1.1.0/src/monitor/range.cpp +49 -0
  140. uc_xcomm-1.1.0/src/runtime/engine.cpp +638 -0
  141. uc_xcomm-1.1.0/src/runtime/registration.h +24 -0
  142. uc_xcomm-1.1.0/src/trigger/executor.cpp +118 -0
  143. uc_xcomm-1.1.0/src/trigger/executor.h +77 -0
  144. uc_xcomm-1.1.0/src/trigger/matcher.cpp +92 -0
  145. uc_xcomm-1.1.0/src/trigger/matcher.h +61 -0
  146. uc_xcomm-1.1.0/src/trigger/registration.h +104 -0
  147. uc_xcomm-1.1.0/swig/CMakeLists.txt +123 -0
  148. uc_xcomm-1.1.0/swig/StageSharedLibrary.cmake +63 -0
  149. uc_xcomm-1.1.0/swig/golang/CMakeLists.txt +74 -0
  150. uc_xcomm-1.1.0/swig/golang/go.mod +4 -0
  151. uc_xcomm-1.1.0/swig/golang/golang.i +392 -0
  152. uc_xcomm-1.1.0/swig/java/CMakeLists.txt +96 -0
  153. uc_xcomm-1.1.0/swig/java/CbXClockEval.java +27 -0
  154. uc_xcomm-1.1.0/swig/java/CbXClockStep.java +26 -0
  155. uc_xcomm-1.1.0/swig/java/MANIFEST.MF +2 -0
  156. uc_xcomm-1.1.0/swig/java/java.i +168 -0
  157. uc_xcomm-1.1.0/swig/java/xspcomm.java +67 -0
  158. uc_xcomm-1.1.0/swig/javascript/CMakeLists.txt +65 -0
  159. uc_xcomm-1.1.0/swig/javascript/extend.h +71 -0
  160. uc_xcomm-1.1.0/swig/javascript/javascript.i +54 -0
  161. uc_xcomm-1.1.0/swig/javascript/test_index.html +68 -0
  162. uc_xcomm-1.1.0/swig/javascript/xspcomm.js +114 -0
  163. uc_xcomm-1.1.0/swig/lua/CMakeLists.txt +70 -0
  164. uc_xcomm-1.1.0/swig/lua/lua.i +84 -0
  165. uc_xcomm-1.1.0/swig/lua/xspcomm.lua +13 -0
  166. uc_xcomm-1.1.0/swig/python/CMakeLists.txt +131 -0
  167. uc_xcomm-1.1.0/swig/python/info.py +54 -0
  168. uc_xcomm-1.1.0/swig/python/python.i +33 -0
  169. uc_xcomm-1.1.0/swig/python/thirdcall.cpp +132 -0
  170. uc_xcomm-1.1.0/swig/python/thirdcall.h +15 -0
  171. uc_xcomm-1.1.0/swig/python/xcomm.py +377 -0
  172. uc_xcomm-1.1.0/swig/scala/CMakeLists.txt +118 -0
  173. uc_xcomm-1.1.0/swig/scala/CbXClockEval.scala +15 -0
  174. uc_xcomm-1.1.0/swig/scala/CbXClockStep.scala +14 -0
  175. uc_xcomm-1.1.0/swig/scala/MANIFEST.MF +2 -0
  176. uc_xcomm-1.1.0/swig/scala/chisel.scala +247 -0
  177. uc_xcomm-1.1.0/swig/scala/scala.i +133 -0
  178. uc_xcomm-1.1.0/swig/scala/xsp.scala +85 -0
  179. uc_xcomm-1.1.0/swig/scala/xspcommLoader.java +65 -0
  180. uc_xcomm-1.1.0/swig/xcomm.i +164 -0
  181. uc_xcomm-1.1.0/tests/CMakeLists.txt +18 -0
  182. uc_xcomm-1.1.0/tests/bindings/golang/test_golang.go +42 -0
  183. uc_xcomm-1.1.0/tests/bindings/java/test_java.java +76 -0
  184. uc_xcomm-1.1.0/tests/bindings/lua/test_lua.lua +34 -0
  185. uc_xcomm-1.1.0/tests/bindings/python/test_pythirdcall.py +16 -0
  186. uc_xcomm-1.1.0/tests/bindings/python/test_python.py +215 -0
  187. uc_xcomm-1.1.0/tests/bindings/python/test_python_exception.py +14 -0
  188. uc_xcomm-1.1.0/tests/bindings/scala/test_scala.scala +37 -0
  189. uc_xcomm-1.1.0/tests/fixtures/signal_cfg.yaml +21 -0
  190. uc_xcomm-1.1.0/tests/fixtures/signal_cfg_map.yaml +22 -0
  191. uc_xcomm-1.1.0/tests/integration/tlm/Makefile +10 -0
  192. uc_xcomm-1.1.0/tests/integration/tlm/Makefile.vcs +61 -0
  193. uc_xcomm-1.1.0/tests/integration/tlm/consumer.sv +70 -0
  194. uc_xcomm-1.1.0/tests/integration/tlm/producer.sv +100 -0
  195. uc_xcomm-1.1.0/tests/integration/tlm/test.py +44 -0
  196. uc_xcomm-1.1.0/tests/integration/tlm/tlm.sv +70 -0
  197. uc_xcomm-1.1.0/tests/release/test_tag_policy.py +84 -0
  198. uc_xcomm-1.1.0/tests/unit/test_coverage_core.cpp +80 -0
  199. uc_xcomm-1.1.0/tests/unit/test_expr_allocations.cpp +53 -0
  200. uc_xcomm-1.1.0/tests/unit/test_trigger_matcher.cpp +133 -0
  201. uc_xcomm-1.1.0/tests/unit/test_xclock.cpp +84 -0
  202. uc_xcomm-1.1.0/tests/unit/test_xcoverage.cpp +435 -0
  203. uc_xcomm-1.1.0/tests/unit/test_xdata.cpp +203 -0
  204. uc_xcomm-1.1.0/tests/unit/test_xexpr.cpp +285 -0
  205. uc_xcomm-1.1.0/tests/unit/test_xfsm.cpp +88 -0
  206. uc_xcomm-1.1.0/tests/unit/test_xmonitor.cpp +496 -0
  207. uc_xcomm-1.1.0/tests/unit/test_xtrigger.cpp +567 -0
  208. uc_xcomm-1.1.0/tests/unit/test_xvpi.cpp +92 -0
  209. uc_xcomm-1.1.0/tests/unit/xdata_cases.cpp +380 -0
  210. uc_xcomm-1.1.0/third_party/catch2/catch.hpp +17976 -0
  211. uc_xcomm-1.1.0/third_party/fkyaml/node.hpp +14685 -0
@@ -0,0 +1,73 @@
1
+ Language: Cpp
2
+ BasedOnStyle: LLVM
3
+ AccessModifierOffset: -4
4
+ AlignAfterOpenBracket: Align
5
+ AlignConsecutiveAssignments: true
6
+ AlignConsecutiveDeclarations: false
7
+ AlignEscapedNewlines: Right
8
+ AlignOperands: true
9
+ AlignTrailingComments: true
10
+ AllowAllParametersOfDeclarationOnNextLine: false
11
+ AllowShortBlocksOnASingleLine: true
12
+ AllowShortCaseLabelsOnASingleLine: true
13
+ AllowShortFunctionsOnASingleLine: Inline
14
+ AllowShortIfStatementsOnASingleLine: true
15
+ AllowShortLoopsOnASingleLine: true
16
+ AlwaysBreakAfterReturnType: None
17
+ AlwaysBreakBeforeMultilineStrings: false
18
+ AlwaysBreakTemplateDeclarations: true
19
+ BinPackArguments: true
20
+ BinPackParameters: true
21
+ BreakBeforeBraces: Custom
22
+ BraceWrapping:
23
+ AfterClass: true
24
+ AfterControlStatement: false
25
+ AfterEnum: false
26
+ AfterFunction: true
27
+ AfterNamespace: false
28
+ AfterStruct: false
29
+ AfterUnion: false
30
+ AfterExternBlock: false
31
+ BeforeCatch: false
32
+ BeforeElse: false
33
+ IndentBraces: false
34
+ SplitEmptyFunction: false
35
+ SplitEmptyRecord: false
36
+ SplitEmptyNamespace: false
37
+ BreakBeforeBinaryOperators: NonAssignment
38
+ BreakBeforeTernaryOperators: false
39
+ BreakConstructorInitializers: AfterColon
40
+ BreakStringLiterals: false
41
+ ColumnLimit: 80
42
+ CompactNamespaces: true
43
+ ConstructorInitializerAllOnOneLineOrOnePerLine: true
44
+ ConstructorInitializerIndentWidth: 4
45
+ ContinuationIndentWidth: 4
46
+ Cpp11BracedListStyle: true
47
+ DerivePointerAlignment: false
48
+ FixNamespaceComments: true
49
+ IndentCaseLabels: false
50
+ IndentPPDirectives: None
51
+ IndentWidth: 4
52
+ IndentWrappedFunctionNames: false
53
+ KeepEmptyLinesAtTheStartOfBlocks: false
54
+ MaxEmptyLinesToKeep: 1
55
+ NamespaceIndentation: Inner
56
+ PointerAlignment: Right
57
+ ReflowComments: true
58
+ SortIncludes: false
59
+ SortUsingDeclarations: false
60
+ SpaceAfterCStyleCast: false
61
+ SpaceAfterTemplateKeyword: true
62
+ SpaceBeforeAssignmentOperators: true
63
+ SpaceBeforeParens: ControlStatements
64
+ SpaceInEmptyParentheses: false
65
+ SpacesBeforeTrailingComments: 1
66
+ SpacesInAngles: false
67
+ SpacesInCStyleCastParentheses: false
68
+ SpacesInContainerLiterals: true
69
+ SpacesInParentheses: false
70
+ SpacesInSquareBrackets: false
71
+ Standard: Auto
72
+ TabWidth: 4
73
+ UseTab: Never
@@ -0,0 +1,29 @@
1
+ # xcomm
2
+
3
+ English | [中文](README.cn.md)
4
+
5
+ xcomm is a C++20 library for hardware simulation, providing four-state signals, port collections, clocks, expressions, temporal events, and functional coverage. Install the Python distribution as `uc-xcomm` and import it as `xspcomm`; bindings are also available for Java, Scala, Go, Lua, and JavaScript.
6
+
7
+ ## Get started
8
+
9
+ After [installation](docs/en/guides/installation.md), create and read a wide signal:
10
+
11
+ ```python
12
+ import xspcomm as xs
13
+
14
+ signal = xs.XData(128, xs.XData.InOut)
15
+ signal.value = (1 << 96) + 3
16
+ print(hex(signal.value))
17
+ ```
18
+
19
+ The output is `0x1000000000000000000000003`. Continue with the [tutorial](docs/en/tutorials/first-simulation.md) to advance a clock and wait for an event.
20
+
21
+ ## Documentation
22
+
23
+ [English documentation](docs/en/index.md) · [完整中文文档](docs/zh/index.md)
24
+
25
+ - Use the library: [events and coverage](docs/en/guides/events-coverage.md), [typed expressions](docs/en/guides/typed-expressions.md).
26
+ - Look up an interface: [API index](docs/en/reference/api-index.md), [language bindings](docs/en/reference/bindings.md), [migration](docs/en/reference/compatibility.md), [troubleshooting](docs/en/reference/troubleshooting.md).
27
+ - Develop the library: [architecture](docs/en/explanation/architecture.md), [performance](docs/en/explanation/performance.md), [tests](docs/en/development/contributing.md), [documentation and Wiki](docs/en/development/documentation.md).
28
+
29
+ Report issues and suggestions through [GitHub Issues](https://github.com/XS-MLVP/xcomm/issues). See [LICENSE](LICENSE) for licensing.
@@ -0,0 +1,89 @@
1
+ name: Build Python distributions
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ ref:
7
+ type: string
8
+ default: ""
9
+ artifact-prefix:
10
+ type: string
11
+ default: xspcomm
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ sdist:
18
+ runs-on: ubuntu-24.04
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ with:
22
+ fetch-depth: 0
23
+ ref: ${{ inputs.ref }}
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12"
27
+ - run: python -m pip install 'build>=1,<2' 'twine>=6,<7'
28
+ - run: python -m build --sdist
29
+ - run: python -m twine check --strict dist/*
30
+ - uses: actions/upload-artifact@v4
31
+ with:
32
+ name: ${{ inputs.artifact-prefix }}-sdist
33
+ path: dist/*.tar.gz
34
+ if-no-files-found: error
35
+
36
+ wheel:
37
+ needs: sdist
38
+ runs-on: ubuntu-24.04
39
+ strategy:
40
+ fail-fast: false
41
+ matrix:
42
+ python: [cp311, cp312]
43
+ policy: [manylinux_2_17, manylinux_2_28]
44
+ include:
45
+ - policy: manylinux_2_17
46
+ image: quay.io/pypa/manylinux2014_x86_64@sha256:3a591c1109773dbd79f16c038588fd1867d9f2f708b360dab5715852c7f96ef0
47
+ ldflags: -static-libstdc++
48
+ prepare: python {project}/scripts/release/prepare_manylinux2014.py
49
+ sdk-flags: --static-libstdcxx
50
+ - policy: manylinux_2_28
51
+ image: quay.io/pypa/manylinux_2_28_x86_64@sha256:076b19ef6e698f28649fa817c49d14443201e01da85240e8e52f93e8daa49bff
52
+ ldflags: ""
53
+ prepare: ""
54
+ sdk-flags: ""
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ with:
58
+ ref: ${{ inputs.ref }}
59
+ - uses: actions/setup-python@v5
60
+ with:
61
+ python-version: ${{ matrix.python == 'cp311' && '3.11' || '3.12' }}
62
+ - uses: actions/download-artifact@v4
63
+ with:
64
+ name: ${{ inputs.artifact-prefix }}-sdist
65
+ path: source
66
+ - run: python -m pip install 'cibuildwheel==3.4.1' 'twine>=6,<7'
67
+ - name: Build, audit and test wheel from sdist
68
+ env:
69
+ CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.image }}
70
+ # CentOS 7's default libstdc++ ABI is 0. Use ABI 1 consistently with
71
+ # modern Picker/DUT compilers and bundle its runtime on GLIBC 2.17.
72
+ CIBW_ENVIRONMENT_LINUX: >-
73
+ CMAKE_BUILD_PARALLEL_LEVEL=4 CMAKE_GENERATOR="Unix Makefiles"
74
+ CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=1" LDFLAGS="${{ matrix.ldflags }}"
75
+ CIBW_BEFORE_ALL_LINUX: ${{ matrix.prepare }}
76
+ CIBW_TEST_COMMAND: python {project}/scripts/release/check_wheel.py --cxx11-abi=1 ${{ matrix.sdk-flags }}
77
+ CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair --only-plat --plat ${{ matrix.policy }}_x86_64 -w {dest_dir} {wheel}
78
+ run: python -m cibuildwheel --only '${{ matrix.python }}-manylinux_x86_64' --output-dir wheelhouse source/*.tar.gz
79
+ - name: Check SDK with the host compiler
80
+ run: |
81
+ python -m pip install --no-index wheelhouse/*.whl
82
+ python -m pip check
83
+ python scripts/release/check_wheel.py
84
+ - run: python -m twine check --strict wheelhouse/*
85
+ - uses: actions/upload-artifact@v4
86
+ with:
87
+ name: ${{ inputs.artifact-prefix }}-${{ matrix.policy }}-${{ matrix.python }}
88
+ path: wheelhouse/*.whl
89
+ if-no-files-found: error
@@ -0,0 +1,59 @@
1
+ name: Documentation
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [master]
6
+ paths:
7
+ - "docs/**"
8
+ - "README*"
9
+ - "CONTRIBUTING.md"
10
+ - "mkdocs.yml"
11
+ - "requirements-docs.txt"
12
+ - "scripts/docs.py"
13
+ - ".github/workflows/docs.yml"
14
+ push:
15
+ branches: [master, "docs/**"]
16
+ paths:
17
+ - "docs/**"
18
+ - "README*"
19
+ - "CONTRIBUTING.md"
20
+ - "mkdocs.yml"
21
+ - "requirements-docs.txt"
22
+ - "scripts/docs.py"
23
+ - ".github/workflows/docs.yml"
24
+ workflow_dispatch:
25
+
26
+ permissions:
27
+ contents: read
28
+
29
+ concurrency:
30
+ group: documentation-${{ github.event.pull_request.number || github.ref }}
31
+ cancel-in-progress: true
32
+
33
+ jobs:
34
+ documentation:
35
+ runs-on: ubuntu-24.04
36
+ timeout-minutes: 15
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: actions/setup-python@v5
40
+ with:
41
+ python-version: "3.12"
42
+ cache: pip
43
+ cache-dependency-path: requirements-docs.txt
44
+ - name: Install documentation tools
45
+ run: python -m pip install -r requirements-docs.txt
46
+ - name: Check translations, links and example syntax
47
+ run: python scripts/docs.py check
48
+ - name: Build documentation site
49
+ run: python -m mkdocs build --strict
50
+ - name: Export Wiki pages
51
+ run: python scripts/docs.py wiki --output build/wiki-export
52
+ - name: Upload documentation preview
53
+ uses: actions/upload-artifact@v4
54
+ with:
55
+ name: xcomm-documentation
56
+ if-no-files-found: error
57
+ path: |
58
+ build/docs-site
59
+ build/wiki-export
@@ -0,0 +1,48 @@
1
+ name: Python wheel
2
+
3
+ on:
4
+ push:
5
+ branches: ["**"]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ distributions:
14
+ uses: ./.github/workflows/build-python.yml
15
+
16
+ source-install:
17
+ runs-on: ubuntu-24.04
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ python: ["3.11", "3.12"]
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 0
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: ${{ matrix.python }}
29
+ - name: Install system build tools
30
+ run: |
31
+ sudo apt-get update
32
+ sudo apt-get install -y --no-install-recommends build-essential cmake ninja-build
33
+ - run: python -m unittest discover -s tests/release -v
34
+ - run: python -m pip install 'build>=1,<2'
35
+ - run: python -m build --sdist
36
+ - name: Install sdist with default native optimization
37
+ env:
38
+ CMAKE_BUILD_PARALLEL_LEVEL: "4"
39
+ run: |
40
+ python -m venv /tmp/xspcomm-source-test
41
+ /tmp/xspcomm-source-test/bin/python -m pip install --no-cache-dir dist/*.tar.gz \
42
+ -Ccmake.define.BUILD_TESTING=ON \
43
+ -Ccmake.define.CMAKE_EXPORT_COMPILE_COMMANDS=ON \
44
+ -Cbuild-dir=/tmp/xspcomm-source-build
45
+ ctest --test-dir /tmp/xspcomm-source-build --output-on-failure
46
+ python scripts/release/check_build.py /tmp/xspcomm-source-build
47
+ /tmp/xspcomm-source-test/bin/python -m pip check
48
+ /tmp/xspcomm-source-test/bin/python scripts/release/check_wheel.py
@@ -0,0 +1,109 @@
1
+ name: Release Python distributions
2
+
3
+ on:
4
+ repository_dispatch:
5
+ types: [version-tagged]
6
+ workflow_dispatch:
7
+ inputs:
8
+ tag:
9
+ description: "Existing version tag to publish (vX.Y.Z)"
10
+ required: true
11
+ type: string
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ concurrency:
17
+ group: xspcomm-release
18
+ queue: max
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ validate:
23
+ runs-on: ubuntu-24.04
24
+ permissions:
25
+ contents: read
26
+ pull-requests: read
27
+ outputs:
28
+ tag: ${{ steps.version.outputs.tag }}
29
+ version: ${{ steps.version.outputs.version }}
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ with:
33
+ fetch-depth: 0
34
+ ref: ${{ github.event.client_payload.tag || inputs.tag }}
35
+ - uses: actions/setup-python@v5
36
+ with:
37
+ python-version: "3.12"
38
+ - name: Validate existing tag
39
+ id: version
40
+ env:
41
+ TAG: ${{ github.event.client_payload.tag || inputs.tag }}
42
+ GH_TOKEN: ${{ github.token }}
43
+ run: |
44
+ set -euo pipefail
45
+ [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]
46
+ test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/${TAG}^{commit}")"
47
+ git fetch origin master:refs/remotes/origin/master --tags
48
+ python scripts/release/tag_policy.py verify HEAD
49
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
50
+ echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
51
+
52
+ distributions:
53
+ needs: validate
54
+ uses: ./.github/workflows/build-python.yml
55
+ with:
56
+ ref: ${{ needs.validate.outputs.tag }}
57
+ artifact-prefix: xspcomm-release
58
+
59
+ github-release:
60
+ needs: [validate, distributions]
61
+ runs-on: ubuntu-24.04
62
+ permissions:
63
+ contents: write
64
+ steps:
65
+ - uses: actions/checkout@v4
66
+ with:
67
+ ref: ${{ needs.validate.outputs.tag }}
68
+ - uses: actions/setup-python@v5
69
+ with:
70
+ python-version: "3.12"
71
+ - uses: actions/download-artifact@v4
72
+ with:
73
+ pattern: xspcomm-release-*
74
+ merge-multiple: true
75
+ path: dist
76
+ - run: python -m pip install 'packaging>=24' 'twine>=6,<7'
77
+ - name: Check complete release matrix
78
+ env:
79
+ VERSION: ${{ needs.validate.outputs.version }}
80
+ run: |
81
+ python scripts/release/check_distributions.py dist "$VERSION"
82
+ python -m twine check --strict dist/*
83
+ - uses: softprops/action-gh-release@v2
84
+ with:
85
+ tag_name: ${{ needs.validate.outputs.tag }}
86
+ files: |
87
+ dist/*.whl
88
+ dist/*.tar.gz
89
+ fail_on_unmatched_files: true
90
+ overwrite_files: false
91
+
92
+ pypi:
93
+ needs: github-release
94
+ runs-on: ubuntu-24.04
95
+ environment:
96
+ name: pypi
97
+ url: https://pypi.org/p/uc-xcomm
98
+ permissions:
99
+ id-token: write
100
+ steps:
101
+ - uses: actions/download-artifact@v4
102
+ with:
103
+ pattern: xspcomm-release-*
104
+ merge-multiple: true
105
+ path: dist
106
+ - name: Publish to PyPI with Trusted Publishing
107
+ uses: pypa/gh-action-pypi-publish@release/v1
108
+ with:
109
+ skip-existing: true
@@ -0,0 +1,155 @@
1
+ name: Version policy
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [master]
6
+ types: [opened, reopened, synchronize, ready_for_review, labeled, unlabeled]
7
+ push:
8
+ branches: [master]
9
+ workflow_dispatch:
10
+ inputs:
11
+ bump:
12
+ description: "Version component to bump (recovery/manual tag)"
13
+ required: true
14
+ type: choice
15
+ options: [patch, minor, major]
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ release-label:
22
+ if: github.event_name == 'pull_request'
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Require exactly one version label
26
+ env:
27
+ LABELS_JSON: ${{ toJSON(github.event.pull_request.labels.*.name) }}
28
+ run: |
29
+ python - <<'PY'
30
+ import json
31
+ import os
32
+
33
+ labels = json.loads(os.environ["LABELS_JSON"])
34
+ selected = sorted(set(labels) & {"release:patch", "release:minor", "release:major"})
35
+ if len(selected) != 1:
36
+ raise SystemExit(f"Expected exactly one release label; found: {selected}")
37
+ print(f"Version bump: {selected[0]}")
38
+ PY
39
+
40
+ resolve:
41
+ if: github.event_name != 'pull_request'
42
+ runs-on: ubuntu-latest
43
+ permissions:
44
+ contents: read
45
+ pull-requests: read
46
+ outputs:
47
+ publish: ${{ steps.pr.outputs.publish }}
48
+ bump: ${{ steps.pr.outputs.bump }}
49
+ steps:
50
+ - name: Resolve merged PR release label
51
+ id: pr
52
+ env:
53
+ GH_TOKEN: ${{ github.token }}
54
+ run: |
55
+ set -euo pipefail
56
+ if [[ "$GITHUB_EVENT_NAME" == workflow_dispatch ]]; then
57
+ echo 'publish=true' >> "$GITHUB_OUTPUT"
58
+ exit 0
59
+ fi
60
+ gh api "repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/pulls" > /tmp/associated-prs.json
61
+ python - <<'PY'
62
+ import json
63
+ import os
64
+
65
+ with open("/tmp/associated-prs.json") as source:
66
+ prs = json.load(source)
67
+ merged = [pr for pr in prs if pr["merged_at"] and pr["base"]["ref"] == "master" and pr["merge_commit_sha"] == os.environ["GITHUB_SHA"]]
68
+ if not merged:
69
+ print("No merged PR for push; no version tag")
70
+ exit()
71
+ if len(merged) != 1:
72
+ raise SystemExit(f"Expected one merged PR for commit; found {len(merged)}")
73
+ labels = {label["name"] for label in merged[0]["labels"]}
74
+ selected = labels & {"release:patch", "release:minor", "release:major"}
75
+ if len(selected) != 1:
76
+ raise SystemExit(f"Expected exactly one release label; found {sorted(selected)}")
77
+ with open(os.environ["GITHUB_OUTPUT"], "a") as output:
78
+ print("publish=true", file=output)
79
+ print(f"bump={selected.pop().split(':', 1)[1]}", file=output)
80
+ PY
81
+
82
+ tag:
83
+ needs: resolve
84
+ if: needs.resolve.outputs.publish == 'true' && github.ref == 'refs/heads/master'
85
+ runs-on: ubuntu-24.04
86
+ concurrency:
87
+ group: xspcomm-version-tag
88
+ queue: max
89
+ cancel-in-progress: false
90
+ permissions:
91
+ contents: write
92
+ pull-requests: read
93
+ steps:
94
+ - uses: actions/checkout@v4
95
+ with:
96
+ fetch-depth: 0
97
+ ref: ${{ github.sha }}
98
+ - name: Calculate and push version tag
99
+ id: version
100
+ env:
101
+ GH_TOKEN: ${{ github.token }}
102
+ MANUAL_BUMP: ${{ inputs.bump }}
103
+ PR_BUMP: ${{ needs.resolve.outputs.bump }}
104
+ run: |
105
+ set -euo pipefail
106
+ git fetch origin master:refs/remotes/origin/master --tags
107
+ python scripts/release/tag_policy.py verify HEAD
108
+ python - <<'PY'
109
+ import os
110
+ import re
111
+ import subprocess
112
+ import sys
113
+ import tomllib
114
+
115
+ bump = os.environ["PR_BUMP"] or os.environ["MANUAL_BUMP"]
116
+ if bump not in {"patch", "minor", "major"}:
117
+ raise SystemExit(f"Invalid bump: {bump}")
118
+ current_tag = subprocess.check_output(
119
+ [sys.executable, "scripts/release/tag_policy.py", "latest"], text=True
120
+ ).strip()
121
+ if current_tag:
122
+ current = tuple(map(int, re.fullmatch(r"v(\d+)\.(\d+)\.(\d+)", current_tag).groups()))
123
+ subprocess.run(["git", "merge-base", "--is-ancestor", current_tag, "HEAD"], check=True)
124
+ else:
125
+ with open("pyproject.toml", "rb") as config:
126
+ fallback = tomllib.load(config)["tool"]["setuptools_scm"]["fallback_version"]
127
+ current = tuple(map(int, re.fullmatch(r"(\d+)\.(\d+)\.(\d+)\.dev0", fallback).groups()))
128
+ major, minor, patch = current
129
+ next_version = {
130
+ "patch": (major, minor, patch + 1),
131
+ "minor": (major, minor + 1, 0),
132
+ "major": (major + 1, 0, 0),
133
+ }[bump]
134
+ version = ".".join(map(str, next_version))
135
+ with open(os.environ["GITHUB_OUTPUT"], "a") as output:
136
+ print(f"tag=v{version}", file=output)
137
+ print(f"Tag v{version} ({bump})")
138
+ PY
139
+ TAG="$(sed -n 's/^tag=//p' "$GITHUB_OUTPUT")"
140
+ if git rev-parse "refs/tags/${TAG}" >/dev/null 2>&1; then
141
+ echo "Tag ${TAG} already exists" >&2
142
+ exit 1
143
+ fi
144
+ git config user.name github-actions[bot]
145
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
146
+ git tag -a "$TAG" -m "xspcomm ${TAG#v}"
147
+ git push origin "refs/tags/${TAG}"
148
+ - name: Announce version tag
149
+ env:
150
+ GH_TOKEN: ${{ github.token }}
151
+ TAG: ${{ steps.version.outputs.tag }}
152
+ run: |
153
+ set -euo pipefail
154
+ python -c 'import json, os; print(json.dumps({"event_type": "version-tagged", "client_payload": {"tag": os.environ["TAG"]}}))' |
155
+ gh api -X POST "repos/${GITHUB_REPOSITORY}/dispatches" --input -
@@ -0,0 +1,41 @@
1
+ # Prerequisites
2
+ *.d
3
+ build/
4
+ .vscode/
5
+ dist/
6
+ *.pyc
7
+ .pyodide-xbuildenv/
8
+ node_modules/
9
+ .bsp/
10
+ .scala-build/
11
+ # Compiled Object files
12
+ *.slo
13
+ *.lo
14
+ *.o
15
+ *.obj
16
+ .metals
17
+
18
+ # Precompiled Headers
19
+ *.gch
20
+ *.pch
21
+
22
+ # Compiled Dynamic libraries
23
+ *.so
24
+ *.dylib
25
+ *.dll
26
+
27
+ # Fortran module files
28
+ *.mod
29
+ !swig/golang/go.mod
30
+ *.smod
31
+
32
+ # Compiled Static libraries
33
+ *.lai
34
+ *.la
35
+ *.a
36
+ *.lib
37
+
38
+ # Executables
39
+ *.exe
40
+ *.out
41
+ *.app
@@ -0,0 +1,37 @@
1
+ cmake_minimum_required(VERSION 3.15)
2
+ set(XSPCOMM_CMAKE_VERSION "0.1.0")
3
+ if(DEFINED SKBUILD_PROJECT_VERSION)
4
+ set(XSPCOMM_CMAKE_VERSION "${SKBUILD_PROJECT_VERSION}")
5
+ endif()
6
+ project(xspcomm VERSION ${XSPCOMM_CMAKE_VERSION})
7
+ if(DEFINED SKBUILD_PROJECT_VERSION_FULL)
8
+ set(XSPCOMM_PACKAGE_VERSION "${SKBUILD_PROJECT_VERSION_FULL}")
9
+ else()
10
+ set(XSPCOMM_PACKAGE_VERSION "${PROJECT_VERSION}")
11
+ endif()
12
+
13
+ # Increment for incompatibility with master / published native ABIs.
14
+ # Unreleased changes on this branch share one ABI transition.
15
+ set(XSPCOMM_ABI_VERSION 3)
16
+
17
+ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
18
+
19
+ include(xcomm)
20
+ init_xspcomm()
21
+
22
+ # Source headers must win over copies left in the build-tree install staging
23
+ # directory. Otherwise an incremental build can compile against yesterday's
24
+ # public API before copy_xspcomm_include refreshes that directory.
25
+ include_directories(BEFORE ${PROJECT_SOURCE_DIR}/include)
26
+
27
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
28
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
29
+ set(XSPCOMM_HEADER_STAGE ${CMAKE_CURRENT_BINARY_DIR}/include)
30
+
31
+ add_subdirectory(src)
32
+ include(CTest)
33
+ if(BUILD_TESTING)
34
+ add_subdirectory(tests)
35
+ endif()
36
+ add_subdirectory(integrations/tlm)
37
+ add_subdirectory(swig)