[AutoTool] infer port info automatically

This commit is contained in:
Jan Petykiewicz 2026-07-10 16:30:44 -07:00
commit fe4e2f760b
4 changed files with 434 additions and 43 deletions

View file

@ -158,7 +158,7 @@ from masque.builder import AutoTool
tool = (
AutoTool()
.add_straight('m1wire', make_straight, 'input')
.add_straight(make_straight, 'm1wire', 'input')
.add_bend(lib.abstract('bend'), 'input', 'output', clockwise=True)
.add_transition(lib.abstract('via'), 'top', 'bottom')
)
@ -167,7 +167,7 @@ tool = (
The key differences are:
- `BasicTool` -> `AutoTool`
- `straight=(fn, in_name, out_name)` -> `add_straight(ptype, fn, in_name)`
- `straight=(fn, in_name, out_name)` -> `add_straight(fn, ptype, in_name)`
- `bend=(abstract, in_name, out_name)` -> `add_bend(abstract, in_name, out_name)`
- transitions are registered with `add_transition(abstract, external_port, internal_port)`
- transitions are bidirectional by default; pass `one_way=True` to inhibit the reverse adapter