uc-toffee 2.0.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 (287) hide show
  1. uc_toffee-2.0.0/.github/native-dependencies.json +9 -0
  2. uc_toffee-2.0.0/.github/workflows/ci.yml +175 -0
  3. uc_toffee-2.0.0/.github/workflows/release.yml +126 -0
  4. uc_toffee-2.0.0/.github/workflows/version.yml +103 -0
  5. uc_toffee-2.0.0/.gitignore +63 -0
  6. uc_toffee-2.0.0/CONTRIBUTING.md +86 -0
  7. uc_toffee-2.0.0/LICENSE +127 -0
  8. uc_toffee-2.0.0/MANIFEST.in +16 -0
  9. uc_toffee-2.0.0/PKG-INFO +117 -0
  10. uc_toffee-2.0.0/README.md +91 -0
  11. uc_toffee-2.0.0/benchmarks/README.md +40 -0
  12. uc_toffee-2.0.0/benchmarks/benchmark_asyncio_observer.py +80 -0
  13. uc_toffee-2.0.0/benchmarks/benchmark_coverage.py +239 -0
  14. uc_toffee-2.0.0/benchmarks/benchmark_driver_handoffs.py +70 -0
  15. uc_toffee-2.0.0/benchmarks/benchmark_runtime.py +168 -0
  16. uc_toffee-2.0.0/design/README.md +55 -0
  17. uc_toffee-2.0.0/design/architecture/asyncio-observer.md +232 -0
  18. uc_toffee-2.0.0/design/architecture/data-bundle-interface.md +662 -0
  19. uc_toffee-2.0.0/design/architecture/driver-resources.md +181 -0
  20. uc_toffee-2.0.0/design/architecture/overview.md +108 -0
  21. uc_toffee-2.0.0/design/architecture/scheduling-and-phase.md +125 -0
  22. uc_toffee-2.0.0/design/architecture/systemrdl-register-model.md +91 -0
  23. uc_toffee-2.0.0/design/backend/trigger-engine.md +152 -0
  24. uc_toffee-2.0.0/design/backend/xcomm-audit.md +70 -0
  25. uc_toffee-2.0.0/design/backend/xpin-xdata-boundary.md +116 -0
  26. uc_toffee-2.0.0/design/concepts/public-api.md +141 -0
  27. uc_toffee-2.0.0/design/concepts/trigger-event-reactor.md +95 -0
  28. uc_toffee-2.0.0/design/concepts/value-semantics.md +36 -0
  29. uc_toffee-2.0.0/design/current-implementation.md +689 -0
  30. uc_toffee-2.0.0/design/decisions.md +140 -0
  31. uc_toffee-2.0.0/design/delivery/baseline.md +48 -0
  32. uc_toffee-2.0.0/design/delivery/roadmap.md +208 -0
  33. uc_toffee-2.0.0/design/delivery/stateful-coverage-plan-2026-09.md +407 -0
  34. uc_toffee-2.0.0/design/delivery/systemrdl-support.md +55 -0
  35. uc_toffee-2.0.0/design/delivery/testing.md +118 -0
  36. uc_toffee-2.0.0/design/delivery/verification-flow-next.md +113 -0
  37. uc_toffee-2.0.0/design/features/compiled-triggers.md +86 -0
  38. uc_toffee-2.0.0/design/features/coverage-performance-and-reporting.md +152 -0
  39. uc_toffee-2.0.0/design/features/fsm-and-sequence.md +109 -0
  40. uc_toffee-2.0.0/design/features/functional-coverage.md +319 -0
  41. uc_toffee-2.0.0/design/features/ready-valid.md +118 -0
  42. uc_toffee-2.0.0/design/features/subscriptions.md +67 -0
  43. uc_toffee-2.0.0/design/history/asyncio-simulation-kernel.zh.md +1370 -0
  44. uc_toffee-2.0.0/design/integration/asyncio.md +119 -0
  45. uc_toffee-2.0.0/design/verification/README.md +37 -0
  46. uc_toffee-2.0.0/design/verification/agent-reference-model-2026-09.md +92 -0
  47. uc_toffee-2.0.0/design/verification/asyncio-observer-2026-09.md +77 -0
  48. uc_toffee-2.0.0/design/verification/beginner-quickstart-2026-09.md +74 -0
  49. uc_toffee-2.0.0/design/verification/cache-functional-points-2026-09.md +1281 -0
  50. uc_toffee-2.0.0/design/verification/cache-functional.md +295 -0
  51. uc_toffee-2.0.0/design/verification/continuous-randomization-research-2026-09.md +336 -0
  52. uc_toffee-2.0.0/design/verification/continuous_randomization_probe.py +175 -0
  53. uc_toffee-2.0.0/design/verification/coverage-standards-review-2026-09.md +265 -0
  54. uc_toffee-2.0.0/design/verification/coverage-without-test-tags-2026-09.md +55 -0
  55. uc_toffee-2.0.0/design/verification/coverage_standards_probe.py +214 -0
  56. uc_toffee-2.0.0/design/verification/driver-handoff-2026-09.md +76 -0
  57. uc_toffee-2.0.0/design/verification/driver-submission-2026-09.md +79 -0
  58. uc_toffee-2.0.0/design/verification/e203-functional-points-2026-09.md +988 -0
  59. uc_toffee-2.0.0/design/verification/e203-functional.md +167 -0
  60. uc_toffee-2.0.0/design/verification/feature-docs-regression-2026-09.md +87 -0
  61. uc_toffee-2.0.0/design/verification/framework-review-2026-09.md +370 -0
  62. uc_toffee-2.0.0/design/verification/hypothesis-stateful-randomization-research-2026-10.md +245 -0
  63. uc_toffee-2.0.0/design/verification/hypothesis_randomization_probe.py +318 -0
  64. uc_toffee-2.0.0/design/verification/native-coverage-2026-09.md +186 -0
  65. uc_toffee-2.0.0/design/verification/protocol-driver-scope-2026-09.md +40 -0
  66. uc_toffee-2.0.0/design/verification/rtl-feature-plan-2026-09.md +203 -0
  67. uc_toffee-2.0.0/design/verification/usability-review-2026-09.md +285 -0
  68. uc_toffee-2.0.0/design/verification/verification-flow-fixes-2026-09.md +111 -0
  69. uc_toffee-2.0.0/design/verification/verification-flow-progress-2026-09.md +281 -0
  70. uc_toffee-2.0.0/design/verification/verification_flow_probe.py +145 -0
  71. uc_toffee-2.0.0/docs/examples.md +113 -0
  72. uc_toffee-2.0.0/docs/explanation/coverage-results.md +50 -0
  73. uc_toffee-2.0.0/docs/explanation/execution-model.md +65 -0
  74. uc_toffee-2.0.0/docs/explanation/index.md +9 -0
  75. uc_toffee-2.0.0/docs/getting-started/agent-test.md +93 -0
  76. uc_toffee-2.0.0/docs/getting-started/clock-and-input.md +97 -0
  77. uc_toffee-2.0.0/docs/getting-started/coverage.md +104 -0
  78. uc_toffee-2.0.0/docs/getting-started/driver.md +88 -0
  79. uc_toffee-2.0.0/docs/getting-started/failures.md +108 -0
  80. uc_toffee-2.0.0/docs/getting-started/first-test.md +72 -0
  81. uc_toffee-2.0.0/docs/getting-started/index.md +61 -0
  82. uc_toffee-2.0.0/docs/getting-started/installation.md +56 -0
  83. uc_toffee-2.0.0/docs/getting-started/monitor.md +110 -0
  84. uc_toffee-2.0.0/docs/getting-started/more-cases.md +68 -0
  85. uc_toffee-2.0.0/docs/getting-started/native-and-next.md +123 -0
  86. uc_toffee-2.0.0/docs/getting-started/out-of-order.md +85 -0
  87. uc_toffee-2.0.0/docs/getting-started/pipeline.md +144 -0
  88. uc_toffee-2.0.0/docs/getting-started/reference-model.md +110 -0
  89. uc_toffee-2.0.0/docs/guides/agents-and-reference-models.md +186 -0
  90. uc_toffee-2.0.0/docs/guides/asyncio-and-pytest.md +140 -0
  91. uc_toffee-2.0.0/docs/guides/compiled-triggers.md +107 -0
  92. uc_toffee-2.0.0/docs/guides/coverage-classes.md +114 -0
  93. uc_toffee-2.0.0/docs/guides/coverage-patterns.md +103 -0
  94. uc_toffee-2.0.0/docs/guides/coverage-transactions.md +89 -0
  95. uc_toffee-2.0.0/docs/guides/coverage.md +450 -0
  96. uc_toffee-2.0.0/docs/guides/data.md +118 -0
  97. uc_toffee-2.0.0/docs/guides/drivers.md +141 -0
  98. uc_toffee-2.0.0/docs/guides/execution-and-backend.md +91 -0
  99. uc_toffee-2.0.0/docs/guides/expressions-and-resources.md +66 -0
  100. uc_toffee-2.0.0/docs/guides/functional-points.md +118 -0
  101. uc_toffee-2.0.0/docs/guides/index.md +45 -0
  102. uc_toffee-2.0.0/docs/guides/monitors.md +76 -0
  103. uc_toffee-2.0.0/docs/guides/pipeline-examples.md +291 -0
  104. uc_toffee-2.0.0/docs/guides/protocols.md +62 -0
  105. uc_toffee-2.0.0/docs/guides/runner.md +104 -0
  106. uc_toffee-2.0.0/docs/guides/scoreboard.md +181 -0
  107. uc_toffee-2.0.0/docs/guides/subscriptions.md +56 -0
  108. uc_toffee-2.0.0/docs/guides/toffee-v2-migration.md +452 -0
  109. uc_toffee-2.0.0/docs/guides/triggers.md +115 -0
  110. uc_toffee-2.0.0/docs/guides/verification-flow.md +88 -0
  111. uc_toffee-2.0.0/docs/guides/versioning-and-releases.md +128 -0
  112. uc_toffee-2.0.0/docs/index.md +31 -0
  113. uc_toffee-2.0.0/docs/reference/api.md +166 -0
  114. uc_toffee-2.0.0/docs/reference/execution.md +64 -0
  115. uc_toffee-2.0.0/docs/reference/feature-map.md +45 -0
  116. uc_toffee-2.0.0/docs/reference/index.md +16 -0
  117. uc_toffee-2.0.0/docs/reference/runner.md +74 -0
  118. uc_toffee-2.0.0/docs/reference/semantics-and-limitations.md +76 -0
  119. uc_toffee-2.0.0/examples/README.md +52 -0
  120. uc_toffee-2.0.0/examples/coverage/declarative_pipeline.py +118 -0
  121. uc_toffee-2.0.0/examples/coverage/declarative_protocol.py +397 -0
  122. uc_toffee-2.0.0/examples/coverage/functional_coverage.py +184 -0
  123. uc_toffee-2.0.0/examples/coverage/mixed_patterns.py +64 -0
  124. uc_toffee-2.0.0/examples/coverage/picker_adder.py +167 -0
  125. uc_toffee-2.0.0/examples/coverage/test_managed_run.py +13 -0
  126. uc_toffee-2.0.0/examples/coverage/trigger_bins.py +101 -0
  127. uc_toffee-2.0.0/examples/getting_started/README.md +71 -0
  128. uc_toffee-2.0.0/examples/getting_started/check_native.py +23 -0
  129. uc_toffee-2.0.0/examples/getting_started/failure_lab.py +24 -0
  130. uc_toffee-2.0.0/examples/getting_started/native_lab.py +23 -0
  131. uc_toffee-2.0.0/examples/getting_started/test_accumulator.py +310 -0
  132. uc_toffee-2.0.0/examples/getting_started/test_tutorial_out_of_order.py +26 -0
  133. uc_toffee-2.0.0/examples/getting_started/toy_dut.py +90 -0
  134. uc_toffee-2.0.0/examples/integration/cache/README.md +270 -0
  135. uc_toffee-2.0.0/examples/integration/cache/build_modules.sh +21 -0
  136. uc_toffee-2.0.0/examples/integration/cache/cache_assertion_env.py +96 -0
  137. uc_toffee-2.0.0/examples/integration/cache/cache_direct_protocol_probe.py +225 -0
  138. uc_toffee-2.0.0/examples/integration/cache/cache_functional_toffee.py +1219 -0
  139. uc_toffee-2.0.0/examples/integration/cache/cache_internal_coverage.py +1027 -0
  140. uc_toffee-2.0.0/examples/integration/cache/cache_module_env.py +64 -0
  141. uc_toffee-2.0.0/examples/integration/cache/conftest.py +9 -0
  142. uc_toffee-2.0.0/examples/integration/cache/example_toffee.py +83 -0
  143. uc_toffee-2.0.0/examples/integration/cache/test_cache_assertions.py +136 -0
  144. uc_toffee-2.0.0/examples/integration/cache/test_cache_coherence.py +155 -0
  145. uc_toffee-2.0.0/examples/integration/cache/test_cache_internal.py +591 -0
  146. uc_toffee-2.0.0/examples/integration/cache/test_cache_stage1.py +48 -0
  147. uc_toffee-2.0.0/examples/integration/cache/test_cache_stage2.py +164 -0
  148. uc_toffee-2.0.0/examples/integration/cache/test_cache_stage3.py +216 -0
  149. uc_toffee-2.0.0/examples/integration/cache/verification_plan.json +2286 -0
  150. uc_toffee-2.0.0/examples/integration/e203/README.md +166 -0
  151. uc_toffee-2.0.0/examples/integration/e203/benchmark_coverage.py +89 -0
  152. uc_toffee-2.0.0/examples/integration/e203/build_toffee.sh +39 -0
  153. uc_toffee-2.0.0/examples/integration/e203/e203_internal_coverage.py +390 -0
  154. uc_toffee-2.0.0/examples/integration/e203/e203_toffee_env.py +1181 -0
  155. uc_toffee-2.0.0/examples/integration/e203/run_pytest.sh +14 -0
  156. uc_toffee-2.0.0/examples/integration/e203/test_e203_toffee.py +560 -0
  157. uc_toffee-2.0.0/examples/integration/e203/verification_plan.json +1487 -0
  158. uc_toffee-2.0.0/examples/integration/rtl_checks.py +170 -0
  159. uc_toffee-2.0.0/examples/integration/rtl_line_coverage.py +164 -0
  160. uc_toffee-2.0.0/examples/integration/verilator_fatal_coverage.cpp +44 -0
  161. uc_toffee-2.0.0/examples/transactions/pipeline.py +270 -0
  162. uc_toffee-2.0.0/examples/transactions/reference_model.py +165 -0
  163. uc_toffee-2.0.0/examples/transactions/scoreboard.py +63 -0
  164. uc_toffee-2.0.0/examples/transactions/test_pipeline_coverage.py +38 -0
  165. uc_toffee-2.0.0/examples/transactions/verification_flow.py +142 -0
  166. uc_toffee-2.0.0/examples/triggers/basic_execution.py +45 -0
  167. uc_toffee-2.0.0/examples/triggers/subscription.py +36 -0
  168. uc_toffee-2.0.0/experiments/coverage_v2_engine_audit.py +186 -0
  169. uc_toffee-2.0.0/mkdocs.yml +68 -0
  170. uc_toffee-2.0.0/pyproject.toml +56 -0
  171. uc_toffee-2.0.0/scripts/check_coverage_v2_types.py +39 -0
  172. uc_toffee-2.0.0/scripts/release/verify_dist.py +125 -0
  173. uc_toffee-2.0.0/scripts/release/version_policy.py +106 -0
  174. uc_toffee-2.0.0/setup.cfg +4 -0
  175. uc_toffee-2.0.0/src/toffee/__init__.py +267 -0
  176. uc_toffee-2.0.0/src/toffee/__main__.py +3 -0
  177. uc_toffee-2.0.0/src/toffee/_artifacts.py +56 -0
  178. uc_toffee-2.0.0/src/toffee/_asyncio_observer.py +164 -0
  179. uc_toffee-2.0.0/src/toffee/_cleanup.py +27 -0
  180. uc_toffee-2.0.0/src/toffee/_context.py +26 -0
  181. uc_toffee-2.0.0/src/toffee/_coverage_capture.py +43 -0
  182. uc_toffee-2.0.0/src/toffee/_coverage_exclusions.py +119 -0
  183. uc_toffee-2.0.0/src/toffee/_coverage_runtime.py +623 -0
  184. uc_toffee-2.0.0/src/toffee/_driver_runtime.py +36 -0
  185. uc_toffee-2.0.0/src/toffee/_native_coverage.py +238 -0
  186. uc_toffee-2.0.0/src/toffee/_pytest.py +384 -0
  187. uc_toffee-2.0.0/src/toffee/_scoreboard_matching.py +41 -0
  188. uc_toffee-2.0.0/src/toffee/agent.py +298 -0
  189. uc_toffee-2.0.0/src/toffee/async_drivers.py +384 -0
  190. uc_toffee-2.0.0/src/toffee/backend.py +1552 -0
  191. uc_toffee-2.0.0/src/toffee/cli.py +58 -0
  192. uc_toffee-2.0.0/src/toffee/combinators.py +79 -0
  193. uc_toffee-2.0.0/src/toffee/components.py +97 -0
  194. uc_toffee-2.0.0/src/toffee/coverage.py +1850 -0
  195. uc_toffee-2.0.0/src/toffee/coverage_report.py +659 -0
  196. uc_toffee-2.0.0/src/toffee/data.py +844 -0
  197. uc_toffee-2.0.0/src/toffee/declarative/__init__.py +22 -0
  198. uc_toffee-2.0.0/src/toffee/declarative/_compiler.py +422 -0
  199. uc_toffee-2.0.0/src/toffee/declarative/_declarations.py +404 -0
  200. uc_toffee-2.0.0/src/toffee/declarative/_runtime.py +232 -0
  201. uc_toffee-2.0.0/src/toffee/decorators.py +181 -0
  202. uc_toffee-2.0.0/src/toffee/events.py +83 -0
  203. uc_toffee-2.0.0/src/toffee/execution.py +285 -0
  204. uc_toffee-2.0.0/src/toffee/external.py +79 -0
  205. uc_toffee-2.0.0/src/toffee/interfaces.py +166 -0
  206. uc_toffee-2.0.0/src/toffee/ir.py +682 -0
  207. uc_toffee-2.0.0/src/toffee/monitors.py +259 -0
  208. uc_toffee-2.0.0/src/toffee/protocols.py +106 -0
  209. uc_toffee-2.0.0/src/toffee/py.typed +0 -0
  210. uc_toffee-2.0.0/src/toffee/reactor.py +391 -0
  211. uc_toffee-2.0.0/src/toffee/scoreboard.py +963 -0
  212. uc_toffee-2.0.0/src/toffee/signals.py +131 -0
  213. uc_toffee-2.0.0/src/toffee/staged_drivers.py +174 -0
  214. uc_toffee-2.0.0/src/toffee/subscriptions.py +64 -0
  215. uc_toffee-2.0.0/src/toffee/sync_drivers.py +94 -0
  216. uc_toffee-2.0.0/src/toffee/templates/coverage_site.css +3 -0
  217. uc_toffee-2.0.0/src/toffee/templates/unified_coverage.html +108 -0
  218. uc_toffee-2.0.0/src/toffee/transfers.py +220 -0
  219. uc_toffee-2.0.0/src/toffee/triggers.py +129 -0
  220. uc_toffee-2.0.0/src/uc_toffee.egg-info/PKG-INFO +117 -0
  221. uc_toffee-2.0.0/src/uc_toffee.egg-info/SOURCES.txt +285 -0
  222. uc_toffee-2.0.0/src/uc_toffee.egg-info/dependency_links.txt +1 -0
  223. uc_toffee-2.0.0/src/uc_toffee.egg-info/entry_points.txt +3 -0
  224. uc_toffee-2.0.0/src/uc_toffee.egg-info/requires.txt +15 -0
  225. uc_toffee-2.0.0/src/uc_toffee.egg-info/top_level.txt +1 -0
  226. uc_toffee-2.0.0/tests/README.md +57 -0
  227. uc_toffee-2.0.0/tests/conftest.py +73 -0
  228. uc_toffee-2.0.0/tests/coverage/test_binding_boundaries.py +382 -0
  229. uc_toffee-2.0.0/tests/coverage/test_coverage.py +441 -0
  230. uc_toffee-2.0.0/tests/coverage/test_coverage_acceptance.py +357 -0
  231. uc_toffee-2.0.0/tests/coverage/test_coverage_report.py +325 -0
  232. uc_toffee-2.0.0/tests/coverage/test_coverage_schema.py +189 -0
  233. uc_toffee-2.0.0/tests/coverage/test_declarative.py +491 -0
  234. uc_toffee-2.0.0/tests/coverage/test_declarative_protocol.py +202 -0
  235. uc_toffee-2.0.0/tests/coverage/test_mixed_patterns.py +239 -0
  236. uc_toffee-2.0.0/tests/coverage/test_overlap_fastpath.py +43 -0
  237. uc_toffee-2.0.0/tests/coverage/test_trigger_bins.py +514 -0
  238. uc_toffee-2.0.0/tests/integration/conftest.py +26 -0
  239. uc_toffee-2.0.0/tests/integration/test_agent_native.py +346 -0
  240. uc_toffee-2.0.0/tests/integration/test_asyncio_adapters.py +80 -0
  241. uc_toffee-2.0.0/tests/integration/test_asyncio_observer.py +473 -0
  242. uc_toffee-2.0.0/tests/integration/test_backend_boundaries.py +447 -0
  243. uc_toffee-2.0.0/tests/integration/test_clock_ownership.py +133 -0
  244. uc_toffee-2.0.0/tests/integration/test_compiled_patterns.py +874 -0
  245. uc_toffee-2.0.0/tests/integration/test_documentation.py +56 -0
  246. uc_toffee-2.0.0/tests/integration/test_driver_handoffs.py +259 -0
  247. uc_toffee-2.0.0/tests/integration/test_http_integration.py +65 -0
  248. uc_toffee-2.0.0/tests/integration/test_pipeline_examples.py +355 -0
  249. uc_toffee-2.0.0/tests/integration/test_program_collection.py +174 -0
  250. uc_toffee-2.0.0/tests/integration/test_quickstart_tutorial.py +56 -0
  251. uc_toffee-2.0.0/tests/integration/test_reference_model_example.py +53 -0
  252. uc_toffee-2.0.0/tests/integration/test_transaction_lifecycle_native.py +105 -0
  253. uc_toffee-2.0.0/tests/integration/test_typed_expressions.py +163 -0
  254. uc_toffee-2.0.0/tests/integration/test_verification_flow.py +130 -0
  255. uc_toffee-2.0.0/tests/integration/test_xcomm_backend.py +747 -0
  256. uc_toffee-2.0.0/tests/interfaces/conftest.py +18 -0
  257. uc_toffee-2.0.0/tests/interfaces/test_agent.py +218 -0
  258. uc_toffee-2.0.0/tests/interfaces/test_async_driver.py +331 -0
  259. uc_toffee-2.0.0/tests/interfaces/test_compiled_sampler.py +101 -0
  260. uc_toffee-2.0.0/tests/interfaces/test_component_boundaries.py +372 -0
  261. uc_toffee-2.0.0/tests/interfaces/test_data_boundaries.py +162 -0
  262. uc_toffee-2.0.0/tests/interfaces/test_data_interfaces.py +417 -0
  263. uc_toffee-2.0.0/tests/interfaces/test_monitor_lifecycle.py +269 -0
  264. uc_toffee-2.0.0/tests/interfaces/test_protocols.py +275 -0
  265. uc_toffee-2.0.0/tests/interfaces/test_sampling_monitor.py +89 -0
  266. uc_toffee-2.0.0/tests/interfaces/test_signal_driver.py +64 -0
  267. uc_toffee-2.0.0/tests/interfaces/test_staged_driver.py +168 -0
  268. uc_toffee-2.0.0/tests/interfaces/test_sync_driver.py +111 -0
  269. uc_toffee-2.0.0/tests/release/test_distributions.py +96 -0
  270. uc_toffee-2.0.0/tests/release/test_version_policy.py +124 -0
  271. uc_toffee-2.0.0/tests/runner/__init__.py +0 -0
  272. uc_toffee-2.0.0/tests/runner/test_execution.py +302 -0
  273. uc_toffee-2.0.0/tests/runner/test_native.py +210 -0
  274. uc_toffee-2.0.0/tests/runner/test_project_policy.py +113 -0
  275. uc_toffee-2.0.0/tests/runtime/test_definition_boundaries.py +143 -0
  276. uc_toffee-2.0.0/tests/runtime/test_failure_boundaries.py +153 -0
  277. uc_toffee-2.0.0/tests/runtime/test_runtime.py +416 -0
  278. uc_toffee-2.0.0/tests/runtime/test_scoreboard.py +1094 -0
  279. uc_toffee-2.0.0/tests/runtime/test_scoreboard_fastpath.py +79 -0
  280. uc_toffee-2.0.0/tests/runtime/test_subscriptions.py +125 -0
  281. uc_toffee-2.0.0/tests/runtime/test_transaction_boundaries.py +130 -0
  282. uc_toffee-2.0.0/tests/runtime/test_transfers.py +90 -0
  283. uc_toffee-2.0.0/tests/typing/coverage_v2_negative.py +59 -0
  284. uc_toffee-2.0.0/tests/typing/coverage_v2_positive.py +47 -0
  285. uc_toffee-2.0.0/tests/typing/coverage_v2_protocol_positive.py +29 -0
  286. uc_toffee-2.0.0/tests/typing/coverage_v2_trigger_positive.py +49 -0
  287. uc_toffee-2.0.0/tests/typing/pyright-coverage-v2.json +6 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "xcomm": {
3
+ "repository": "XS-MLVP/xcomm",
4
+ "ref": "69e993d4fc0c8786819d2beae50a2197ea4ab124",
5
+ "package_version": "1.1.0",
6
+ "native_abi": 3,
7
+ "coverage_protocol": 5
8
+ }
9
+ }
@@ -0,0 +1,175 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["**"]
6
+ pull_request:
7
+ workflow_dispatch:
8
+ workflow_call:
9
+ inputs:
10
+ ref:
11
+ type: string
12
+ default: ""
13
+ expected-version:
14
+ type: string
15
+ default: ""
16
+ artifact-name:
17
+ type: string
18
+ default: toffee-dist
19
+
20
+ permissions:
21
+ contents: read
22
+
23
+ defaults:
24
+ run:
25
+ shell: bash
26
+
27
+ jobs:
28
+ test:
29
+ runs-on: ubuntu-24.04
30
+ strategy:
31
+ fail-fast: false
32
+ matrix:
33
+ python-version: ["3.11", "3.12"]
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ with:
37
+ fetch-depth: 0
38
+ ref: ${{ inputs.ref || github.sha }}
39
+ - name: Read native dependency pin
40
+ id: native
41
+ run: |
42
+ python - <<'PY'
43
+ import json, os, re
44
+ pin = json.load(open('.github/native-dependencies.json'))['xcomm']
45
+ assert re.fullmatch(r'[0-9a-f]{40}', pin['ref'])
46
+ with open(os.environ['GITHUB_OUTPUT'], 'a') as output:
47
+ for key in ('repository', 'ref', 'package_version', 'native_abi', 'coverage_protocol'):
48
+ print(f'{key}={pin[key]}', file=output)
49
+ PY
50
+ - uses: actions/checkout@v4
51
+ with:
52
+ repository: ${{ steps.native.outputs.repository }}
53
+ ref: ${{ steps.native.outputs.ref }}
54
+ fetch-depth: 0
55
+ path: _deps/xcomm
56
+ - uses: actions/setup-python@v5
57
+ with:
58
+ python-version: ${{ matrix.python-version }}
59
+ cache: pip
60
+ - name: Install build and report tools
61
+ run: |
62
+ sudo apt-get update
63
+ sudo apt-get install -y --no-install-recommends build-essential cmake ninja-build lcov verilator
64
+ python -m pip install 'build>=1,<2'
65
+ - name: Build pinned native backend
66
+ # This wheel is reused by another runner during isolated installation.
67
+ run: python -m build --wheel ./_deps/xcomm --outdir native-wheel -Ccmake.define.XSPCOMM_NATIVE=OFF
68
+ env:
69
+ BUILD_XSPCOMM_SWIG: python
70
+ XSPCOMM_BUILD_WHEEL: "1"
71
+ CMAKE_BUILD_PARALLEL_LEVEL: "2"
72
+ SETUPTOOLS_SCM_PRETEND_VERSION_FOR_UC_XCOMM: ${{ steps.native.outputs.package_version }}
73
+ - name: Install Toffee with the pinned dependency
74
+ run: |
75
+ python -m pip install native-wheel/*.whl '.[test]'
76
+ python -m pip check
77
+ - uses: actions/upload-artifact@v4
78
+ if: matrix.python-version == '3.12'
79
+ with:
80
+ name: ${{ inputs.artifact-name || 'toffee-dist' }}-native-cp312
81
+ path: native-wheel/*.whl
82
+ if-no-files-found: error
83
+ - name: Require the tested package, native ABI and coverage protocol
84
+ env:
85
+ EXPECTED_PACKAGE_VERSION: ${{ steps.native.outputs.package_version }}
86
+ EXPECTED_NATIVE_ABI: ${{ steps.native.outputs.native_abi }}
87
+ EXPECTED_COVERAGE_PROTOCOL: ${{ steps.native.outputs.coverage_protocol }}
88
+ run: |
89
+ python - <<'PY'
90
+ from importlib.metadata import version
91
+ import os, xspcomm
92
+ assert version('uc-xcomm') == os.environ['EXPECTED_PACKAGE_VERSION']
93
+ assert xspcomm.version() == os.environ['EXPECTED_PACKAGE_VERSION']
94
+ assert xspcomm.abi_version() == int(os.environ['EXPECTED_NATIVE_ABI'])
95
+ assert xspcomm.XTriggerEngine.CoverageVersion() == int(os.environ['EXPECTED_COVERAGE_PROTOCOL'])
96
+ for method in ('AcquireClock', 'ReleaseClock', 'CollectExpressions', 'ExprNewBits', 'ExprNewBool', 'ExprEvalBits'):
97
+ assert hasattr(xspcomm.XTriggerEngine, method), method
98
+ PY
99
+ - run: python -m pytest -q --require-xspcomm
100
+ - name: Run documented command-line examples
101
+ run: |
102
+ python examples/getting_started/check_native.py
103
+ python -m pytest -q examples/getting_started/native_lab.py
104
+ python examples/triggers/basic_execution.py
105
+ python examples/coverage/functional_coverage.py
106
+ python examples/triggers/subscription.py
107
+ python examples/transactions/scoreboard.py
108
+ python -m examples.transactions.reference_model
109
+ python -m examples.transactions.reference_model --backend native
110
+ python examples/transactions/pipeline.py
111
+ python examples/transactions/pipeline.py --backend native
112
+ python -m examples.coverage.trigger_bins --engine xcomm --strategy native
113
+
114
+ docs:
115
+ runs-on: ubuntu-24.04
116
+ steps:
117
+ - uses: actions/checkout@v4
118
+ with:
119
+ fetch-depth: 0
120
+ ref: ${{ inputs.ref || github.sha }}
121
+ - uses: actions/setup-python@v5
122
+ with:
123
+ python-version: "3.12"
124
+ cache: pip
125
+ - run: python -m pip install 'mkdocs>=1.6'
126
+ - run: mkdocs build --strict
127
+
128
+ package:
129
+ needs: [test, docs]
130
+ runs-on: ubuntu-24.04
131
+ steps:
132
+ - uses: actions/checkout@v4
133
+ with:
134
+ fetch-depth: 0
135
+ ref: ${{ inputs.ref || github.sha }}
136
+ - uses: actions/setup-python@v5
137
+ with:
138
+ python-version: "3.12"
139
+ cache: pip
140
+ - run: python -m pip install 'build>=1,<2' 'twine>=6,<7'
141
+ - name: Build and validate distributions
142
+ env:
143
+ EXPECTED_VERSION: ${{ inputs.expected-version }}
144
+ run: |
145
+ python -m build
146
+ python -m twine check --strict dist/*.whl dist/*.tar.gz
147
+ python scripts/release/verify_dist.py --expected-version "$EXPECTED_VERSION"
148
+ - name: Rebuild from the source distribution without Git metadata
149
+ run: |
150
+ mkdir -p "$RUNNER_TEMP/sdist-source" "$RUNNER_TEMP/sdist-wheel"
151
+ tar -xf dist/uc_toffee-*.tar.gz -C "$RUNNER_TEMP/sdist-source"
152
+ source_dir=("$RUNNER_TEMP"/sdist-source/uc_toffee-*)
153
+ python -m build --wheel "${source_dir[0]}" --outdir "$RUNNER_TEMP/sdist-wheel"
154
+ original=(dist/*.whl)
155
+ rebuilt=("$RUNNER_TEMP"/sdist-wheel/*.whl)
156
+ test "$(basename "${original[0]}")" = "$(basename "${rebuilt[0]}")"
157
+ - uses: actions/download-artifact@v4
158
+ with:
159
+ name: ${{ inputs.artifact-name || 'toffee-dist' }}-native-cp312
160
+ path: native-wheel
161
+ - name: Install the wheel in an isolated environment
162
+ run: |
163
+ python -m venv "$RUNNER_TEMP/wheel-test"
164
+ "$RUNNER_TEMP/wheel-test/bin/python" -m pip install --no-index --find-links=native-wheel dist/*.whl
165
+ "$RUNNER_TEMP/wheel-test/bin/python" -m pip check
166
+ "$RUNNER_TEMP/wheel-test/bin/python" -I -c 'from importlib.metadata import version; from importlib.resources import files; import toffee; assert files("toffee").joinpath("templates/unified_coverage.html").is_file(); print(version("uc-toffee"), toffee.__file__)'
167
+ - name: Record exact tested build provenance
168
+ env:
169
+ EXPECTED_VERSION: ${{ inputs.expected-version }}
170
+ run: python scripts/release/verify_dist.py --expected-version "$EXPECTED_VERSION" --manifest --verify-manifest
171
+ - uses: actions/upload-artifact@v4
172
+ with:
173
+ name: ${{ inputs.artifact-name || 'toffee-dist' }}
174
+ path: dist/*
175
+ if-no-files-found: error
@@ -0,0 +1,126 @@
1
+ name: Tagged release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*.*.*"]
6
+ repository_dispatch:
7
+ types: [version-tagged]
8
+ workflow_dispatch:
9
+ inputs:
10
+ tag:
11
+ description: "Existing merged-PR release tag (vX.Y.Z) to verify and publish"
12
+ required: true
13
+ type: string
14
+
15
+ permissions:
16
+ contents: read
17
+ pull-requests: read
18
+
19
+ defaults:
20
+ run:
21
+ shell: bash
22
+
23
+ concurrency:
24
+ group: toffee-release-${{ github.event.client_payload.tag || inputs.tag || github.ref_name }}
25
+ queue: max
26
+ cancel-in-progress: false
27
+
28
+ jobs:
29
+ resolve:
30
+ runs-on: ubuntu-24.04
31
+ outputs:
32
+ tag: ${{ steps.version.outputs.tag }}
33
+ version: ${{ steps.version.outputs.version }}
34
+ sha: ${{ steps.version.outputs.sha }}
35
+ env:
36
+ TAG: ${{ github.event.client_payload.tag || inputs.tag || github.ref_name }}
37
+ steps:
38
+ - name: Check tag syntax before checkout
39
+ run: '[[ "$TAG" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]'
40
+ - uses: actions/checkout@v4
41
+ with:
42
+ fetch-depth: 0
43
+ ref: ${{ env.TAG }}
44
+ - name: Verify tag and merge provenance
45
+ id: version
46
+ env:
47
+ GH_TOKEN: ${{ github.token }}
48
+ EXPECTED_SHA: ${{ github.event.client_payload.sha }}
49
+ run: |
50
+ git fetch origin main:refs/remotes/origin/main --tags
51
+ sha="$(git rev-parse HEAD)"
52
+ test "$sha" = "$(git rev-parse "refs/tags/${TAG}^{commit}")"
53
+ if [[ -n "$EXPECTED_SHA" ]]; then
54
+ test "$sha" = "$EXPECTED_SHA"
55
+ fi
56
+ python scripts/release/version_policy.py verify
57
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
58
+ echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
59
+ echo "sha=$sha" >> "$GITHUB_OUTPUT"
60
+
61
+ checks:
62
+ needs: resolve
63
+ uses: ./.github/workflows/ci.yml
64
+ with:
65
+ ref: ${{ needs.resolve.outputs.sha }}
66
+ expected-version: ${{ needs.resolve.outputs.version }}
67
+ artifact-name: release-dist-${{ needs.resolve.outputs.tag }}
68
+
69
+ publish:
70
+ needs: [resolve, checks]
71
+ runs-on: ubuntu-24.04
72
+ permissions:
73
+ contents: write
74
+ pull-requests: read
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+ with:
78
+ fetch-depth: 0
79
+ ref: ${{ needs.resolve.outputs.sha }}
80
+ - uses: actions/setup-python@v5
81
+ with:
82
+ python-version: "3.12"
83
+ - uses: actions/download-artifact@v4
84
+ with:
85
+ name: release-dist-${{ needs.resolve.outputs.tag }}
86
+ path: release-assets
87
+ - name: Recheck tag and exact tested distributions
88
+ env:
89
+ GH_TOKEN: ${{ github.token }}
90
+ TAG: ${{ needs.resolve.outputs.tag }}
91
+ VERSION: ${{ needs.resolve.outputs.version }}
92
+ run: |
93
+ git fetch origin main:refs/remotes/origin/main --tags
94
+ test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/${TAG}^{commit}")"
95
+ python scripts/release/version_policy.py verify
96
+ python scripts/release/verify_dist.py --dist release-assets --expected-version "$VERSION" --verify-manifest --existing-tag "$TAG"
97
+ - name: Publish the verified CI bundle
98
+ uses: softprops/action-gh-release@v2
99
+ with:
100
+ tag_name: ${{ needs.resolve.outputs.tag }}
101
+ generate_release_notes: true
102
+ files: release-assets/*
103
+ fail_on_unmatched_files: true
104
+ overwrite_files: false
105
+
106
+ pypi:
107
+ needs: [resolve, publish]
108
+ runs-on: ubuntu-24.04
109
+ environment:
110
+ name: pypi
111
+ url: https://pypi.org/p/uc-toffee
112
+ permissions:
113
+ id-token: write
114
+ steps:
115
+ - uses: actions/download-artifact@v4
116
+ with:
117
+ name: release-dist-${{ needs.resolve.outputs.tag }}
118
+ path: verified-assets
119
+ - name: Select the verified Python distributions
120
+ run: |
121
+ mkdir dist
122
+ cp verified-assets/*.whl verified-assets/*.tar.gz dist/
123
+ - name: Publish with Trusted Publishing
124
+ uses: pypa/gh-action-pypi-publish@release/v1
125
+ with:
126
+ skip-existing: true
@@ -0,0 +1,103 @@
1
+ name: Version policy
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ types: [opened, reopened, synchronize, ready_for_review, labeled, unlabeled]
7
+ push:
8
+ branches: [main]
9
+ workflow_dispatch:
10
+ inputs:
11
+ bump:
12
+ description: "Version bump for a merged main PR (including retry)"
13
+ required: true
14
+ type: choice
15
+ options: [patch, minor, major]
16
+ commit:
17
+ description: "Optional full merged commit SHA for recovery; empty uses the selected main commit"
18
+ required: false
19
+ type: string
20
+
21
+ permissions:
22
+ contents: read
23
+
24
+ defaults:
25
+ run:
26
+ shell: bash
27
+
28
+ jobs:
29
+ release-label:
30
+ if: github.event_name == 'pull_request'
31
+ runs-on: ubuntu-24.04
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - run: python scripts/release/version_policy.py label --json "$GITHUB_EVENT_PATH"
35
+
36
+ resolve:
37
+ if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
38
+ runs-on: ubuntu-24.04
39
+ permissions:
40
+ contents: read
41
+ pull-requests: read
42
+ outputs:
43
+ bump: ${{ steps.pr.outputs.bump }}
44
+ commit: ${{ steps.pr.outputs.commit }}
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - name: Resolve merged PR version bump
48
+ id: pr
49
+ env:
50
+ GH_TOKEN: ${{ github.token }}
51
+ MANUAL_BUMP: ${{ inputs.bump }}
52
+ TARGET_COMMIT: ${{ inputs.commit || github.sha }}
53
+ run: |
54
+ [[ "$TARGET_COMMIT" =~ ^[0-9a-f]{40}$ ]]
55
+ if [[ "$GITHUB_EVENT_NAME" == workflow_dispatch ]]; then
56
+ bump="$MANUAL_BUMP"
57
+ else
58
+ gh api "repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/pulls" > "$RUNNER_TEMP/associated-prs.json"
59
+ bump="$(python scripts/release/version_policy.py resolve --json "$RUNNER_TEMP/associated-prs.json" --commit "$GITHUB_SHA")"
60
+ fi
61
+ echo "bump=$bump" >> "$GITHUB_OUTPUT"
62
+ echo "commit=$TARGET_COMMIT" >> "$GITHUB_OUTPUT"
63
+
64
+ tag:
65
+ needs: resolve
66
+ if: needs.resolve.outputs.bump != ''
67
+ runs-on: ubuntu-24.04
68
+ concurrency:
69
+ group: toffee-version-tag
70
+ queue: max
71
+ cancel-in-progress: false
72
+ permissions:
73
+ contents: write
74
+ pull-requests: read
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+ with:
78
+ fetch-depth: 0
79
+ ref: ${{ needs.resolve.outputs.commit }}
80
+ - name: Verify merge result and create or reuse its tag
81
+ id: version
82
+ env:
83
+ GH_TOKEN: ${{ github.token }}
84
+ BUMP: ${{ needs.resolve.outputs.bump }}
85
+ run: |
86
+ git fetch origin main:refs/remotes/origin/main --tags
87
+ python scripts/release/version_policy.py verify
88
+ tag="$(python scripts/release/version_policy.py next --bump "$BUMP")"
89
+ if ! git rev-parse --verify "refs/tags/$tag" >/dev/null 2>&1; then
90
+ git config user.name 'github-actions[bot]'
91
+ git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
92
+ git tag -a "$tag" -m "Toffee ${tag#v}"
93
+ git push origin "refs/tags/$tag"
94
+ fi
95
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
96
+ - name: Dispatch tagged verification and release
97
+ env:
98
+ GH_TOKEN: ${{ github.token }}
99
+ TAG: ${{ steps.version.outputs.tag }}
100
+ TARGET_COMMIT: ${{ needs.resolve.outputs.commit }}
101
+ run: |
102
+ python -c 'import json, os; print(json.dumps({"event_type": "version-tagged", "client_payload": {"tag": os.environ["TAG"], "sha": os.environ["TARGET_COMMIT"]}}))' |
103
+ gh api -X POST "repos/${GITHUB_REPOSITORY}/dispatches" --input -
@@ -0,0 +1,63 @@
1
+ # Python bytecode, environments and tool caches.
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ .pytest_cache/
6
+ .hypothesis/
7
+ .mypy_cache/
8
+ .ruff_cache/
9
+ .tox/
10
+ .nox/
11
+
12
+ # Python packaging and documentation builds.
13
+ build/
14
+ dist/
15
+ site/
16
+ *.egg-info/
17
+ .eggs/
18
+ *.egg
19
+ *.whl
20
+
21
+ # Native simulator builds and waveforms.
22
+ obj_dir/
23
+ *.o
24
+ *.a
25
+ *.so
26
+ *.so.*
27
+ *.dylib
28
+ *.vcd
29
+ *.fst
30
+
31
+ # Python and native coverage data.
32
+ .coverage
33
+ .coverage.*
34
+ htmlcov/
35
+ /coverage.xml
36
+ /coverage.json
37
+ /coverage.dat
38
+ /*_coverage.dat
39
+ /*-coverage.dat
40
+ *.gcda
41
+ *.gcno
42
+
43
+ # Runtime artifacts and generated reports stay local.
44
+ /output/
45
+
46
+ # Local copies of dependencies and release artifacts used by CI.
47
+ /_deps/
48
+ /release-assets/
49
+
50
+ # Legacy generated evidence saved alongside authored verification records.
51
+ # Keep notes, probes, fixtures and formal verification plans visible to Git.
52
+ /design/verification/*-measurements-*.json
53
+ /design/verification/*-results-*.json
54
+ /design/verification/feature-docs-regression-*.json
55
+ /design/verification/rtl-internal-observation-inventory-*.json
56
+ /design/verification/rtl-property-evidence-*/
57
+
58
+ # Editor backups and operating-system metadata.
59
+ *.swp
60
+ *.swo
61
+ *~
62
+ .DS_Store
63
+ Thumbs.db
@@ -0,0 +1,86 @@
1
+ # 参与 Toffee 开发
2
+
3
+ Toffee 负责 Python API、仿真调度、验证组件和报告。
4
+ 原生时钟、信号和触发引擎由 xcomm 提供;真实 DUT 的环境代码放在
5
+ `examples/integration/<dut>/`,不要混进框架实现。
6
+
7
+ ## 一项改动应包含什么
8
+
9
+ 新增或修改功能时,一并更新:
10
+
11
+ 1. `src/toffee/` 中的实现。
12
+ 2. 相应的用户文档;按下文的读者目的选择页面。
13
+ 3. 对应 `tests/` 分类中的回归。
14
+ 4. 面向用户的功能示例;影响高频路径时,还应有可重复的性能测试。
15
+
16
+ 文档说明当前能做什么、怎样使用。不要把试验过程、机器专用路径、分轮测试数字
17
+ 或未实现的接口原型放进用户手册。生成的报告、日志和测量结果写入 `output/`,不要提交。
18
+
19
+ ## 文档按读者目的组织
20
+
21
+ 文档采用 [Diátaxis](https://diataxis.fr/) 的四类划分:
22
+
23
+ | 类型 | 位置 | 写作要求 |
24
+ | --- | --- | --- |
25
+ | 教程 | `docs/getting-started/` | 带读者完成可复现的练习,给出命令与预期结果;逐步引入概念,减少分支选择 |
26
+ | 操作指南 | `docs/guides/` | 开头说明目标和前提,围绕实际任务给步骤、验证方法和常见失败处理 |
27
+ | 参考 | `docs/reference/` | 准确列出签名、默认值、单位、返回值、异常与限制;与实现逐项核对 |
28
+ | 原理说明 | `docs/explanation/` | 解释原因、边界和取舍,通过具体场景建立概念之间的联系 |
29
+
30
+ 一页主要解决一种阅读需求;需要其他类型的内容时链接过去,避免在操作步骤中展开长篇
31
+ 原理,或在教程中罗列所有参数。已有页面混合多种内容时逐步拆分,并尽量保留旧地址。
32
+ 例如,配置步骤留在 Execution 指南,默认值放在 Execution 参考,调度原因放在原理说明。
33
+
34
+ 新增页面须接入 `mkdocs.yml` 和相应目录入口。检查相对链接与页内锚点,
35
+ 运行 `python3 -m pytest -q tests/integration/test_documentation.py` 和 `mkdocs build --strict`。
36
+ 新增可运行示例时还要实际执行;已有覆盖模型片段由文档测试校验。
37
+
38
+ ## 提交前检查
39
+
40
+ 先准备 `uc-xcomm>=1.1,<2`,再安装开发依赖。开发跨仓库未发布修改时,
41
+ 按 `.github/native-dependencies.json` 检出 xcomm 的固定提交,再运行:
42
+
43
+ ```bash
44
+ SETUPTOOLS_SCM_PRETEND_VERSION_FOR_UC_XCOMM=1.1.0 \
45
+ python3 -m pip install /path/to/xcomm
46
+ ```
47
+
48
+ 这里的版本覆盖仅用于本地和 CI 验证目标依赖范围,不发布该测试包。随后安装开发依赖:
49
+
50
+ ```bash
51
+ python3 -m pip install -e '.[test,docs]'
52
+ python3 -m pytest -q --require-xspcomm
53
+ mkdocs build --strict
54
+ ```
55
+
56
+ `--require-xspcomm` 会在原生依赖不满足时失败,避免把原生测试没运行当成通过。
57
+ 没有原生环境时,可先用 `python3 -m pytest -q` 检查纯 Python 部分,但这不代替完整回归。
58
+
59
+ 原生后端的提交、包版本、ABI 和协议版本以
60
+ [依赖清单](.github/native-dependencies.json)为准。
61
+ 只编译了本地绑定而未安装时,可设置 `XCOMM_PYTHON=/path/to/xcomm/build/python`。
62
+ 测试也会查找同级 Picker 的 `build/dependence/xcomm/python`。
63
+
64
+ 需要从 xcomm 源码安装时,SWIG 须为 4.2 或更新版本,并打开两个构建选项:
65
+
66
+ ```bash
67
+ BUILD_XSPCOMM_SWIG=python XSPCOMM_BUILD_WHEEL=1 \
68
+ python3 -m pip install /path/to/xcomm
69
+ ```
70
+
71
+ 不要只升级 Python 包而混用旧原生库。CI 会安装依赖清单固定的版本并运行原生测试。
72
+
73
+ ## 生命周期
74
+
75
+ `Execution` 只清理本次执行注册的等待、采样和组件,不拥有 backend。
76
+ 创建 backend 的代码负责调用 `close()`;创建 DUT 的 fixture 负责初始化和释放 DUT。
77
+ 修改这类行为时,要同时测试正常退出、取消和异常退出。
78
+
79
+ ## 版本和发布
80
+
81
+ 版本号由 Git tag 和 setuptools-scm 生成,不在源码中另写一份。
82
+ 针对 main 的 PR 需选择一个版本标签:`release:patch`、`release:minor` 或 `release:major`。
83
+ 具体选择和发布失败后的处理见[版本与发布](docs/guides/versioning-and-releases.md)。
84
+
85
+ 发布检查包括原生回归、严格文档构建、源码包重建和隔离安装。
86
+ 验证通过后发布的是同一组已检查产物,不另行构建一份替代。