Skip to content

Sub-board infrastructure with export-tap#486

Merged
ducky64 merged 47 commits into
masterfrom
export-tap
May 17, 2026
Merged

Sub-board infrastructure with export-tap#486
ducky64 merged 47 commits into
masterfrom
export-tap

Conversation

@ducky64
Copy link
Copy Markdown
Collaborator

@ducky64 ducky64 commented May 17, 2026

Adds a SubblockBoard and WrapperSubblockBoard Block subclasses which have their internal implementation (links and blocks) in a separate board (or in the Wrapper case, discarded - the internal implementation is for electronics modeling only). Blocks marked as external can be used for, for example, connectors that sit on the carrier board.

Implementation-wise, this adds an export-tap construct, an export (or export-array) construct that does not propagate parameters but can be hooked onto exterior ports that have other exports (including export-taps). A compiler check pass checks that inner ports do not have defined parameters (are empty) and (in the array case) elements are equal.

Refactors A4988 and VL53L0x connectors to use this new infrastructure instead of the older WrapperFootprintBlock. which is removed.

Infrastructure towards #367, #389

Future PRs will:

  • Implement multi-netlist generation
  • Implement connector pairs with some examples
  • Refactor microcontrollers to use this infrastructure

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces SubboardBlock and WrapperSubboardBlock Block subclasses as infrastructure for sub-board partitioning. Adds an "export-tap" mechanism (a non-propagating Export variant compatible with existing connections on the exterior port) at the proto/compiler/HDL level, refactors Vl53l0xConnector and PololuA4988 from the old WrapperFootprintBlock (now removed) to the new infrastructure, and bumps the EDG proto version from 11 → 12.

Changes:

  • New ExportedExpr.tap proto field plus compiler support: non-propagating semantics, validity check pass (ExportTapCheck), and BoardScopedTransform base class to scope netlisting/refdes assignment per board.
  • New SubboardBlock/WrapperSubboardBlock Python classes with export_tap and Block(..., external=True) API; removed WrapperFootprintBlock.
  • Refactored PololuA4988 and Vl53l0xConnector consumers, plus updated reference netlists/svgpcb outputs; replaced Scala BlockConnectivityAnalysis and Python test_netlist_wrapper.py with new subboard tests.

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
proto/edgir/expr.proto Add tap bool to ExportedExpr.
edg/edgir/expr_pb2.py, .pyi Regenerated protobuf bindings for tap field.
edg/hdl_server/main.py Bump EDG_PROTO_VERSION to 12.
edg/electronics_model/SubboardBlock.py New SubboardBlock/WrapperSubboardBlock with export_tap.
edg/electronics_model/BoardScopedTransform.py New base transform tracking per-block board scope.
edg/electronics_model/NetlistGenerator.py Switch to BoardScopedTransform; assert single board.
edg/electronics_model/RefdesRefinementPass.py Switch to BoardScopedTransform.
edg/electronics_model/init.py Export new classes; remove WrapperFootprintBlock.
edg/electronics_model/test_netlist_wrapper.py Deleted; replaced by new tests.
edg/electronics_model/test_netlist_subboard.py New tests for WrapperSubboardBlock.
edg/electronics_model/test_netlist_subboard_array.py New array-port wrapper tests.
edg/parts/StepperDriver_A4988.py Refactor PololuA4988 to WrapperSubboardBlock.
edg/parts/Distance_Vl53l0x.py Refactor Vl53l0xConnector to WrapperSubboardBlock.
compiler/.../Compiler.scala Plumb tap through connect elaboration; bump expected proto version to 12.
compiler/.../ExportTapCheck.scala New design-map pass validating tap-export constraints.
compiler/.../ExprToString.scala Pretty-print tap exports.
compiler/.../ElemBuilder.scala Add tap arg to Exported/ExportedArray builders.
compiler/test/.../ExportTapTest.scala New tap-export tests.
compiler/test/.../ExportTunnelTest.scala Renamed TunnelExportTestExportTunnelTest.
compiler/test/.../CompilerTestUtil.scala Run ExportTapCheck in test harness.
compiler/.../BlockConnectivityAnalysis.scala, test Deleted (unused).
examples/RobotDriver, PcbBot (.net.ref, .svgpcb.js) Updated reference outputs reflecting new edg paths/values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread edg/electronics_model/SubboardBlock.py Outdated
Comment on lines +1 to +2
from typing import List, Tuple, override, Any
from typing_extensions import TypeVar
@@ -0,0 +1,66 @@
from typing import Optional, Dict, List, cast, override
self.export_tap(self.reset, self.wrapper.reset)
self.export_tap(self.sleep, self.wrapper.sleep)
self.export_tap(self.enable, self.wrapper.enable)
self.export_tap(self.reset, self.wrapper.reset)
Comment on lines +41 to +43
fp_external_blocks = self._design.get_value(context.path.to_tuple() + ("fp_external_blocks",))
assert isinstance(fp_external_blocks, list)
external_blocks: Optional[List[str]] = cast(List[str], fp_external_blocks)
@ducky64 ducky64 merged commit 3e87b41 into master May 17, 2026
12 checks passed
@ducky64 ducky64 deleted the export-tap branch May 17, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants