Commit Graph

292 Commits

Author SHA1 Message Date
Akhil Velagapudi 222cced75e Simplify Component properties -> KiCad footprint properties pipeline (#256)
* Dedup PhysicalValue

We had 2 different PhysicalValue structs in pcb-sch and pcb-zen-core
just to avoid adding starlark deps to pcb-sch. I don't think its worth
it.

* Use rust_decimal_macros

Factor out some duplicate code

* Add proper enum -> String attr support

* Add config("mpn") to generated components for compat

* Format list component properties nicely when exporting to kicad

* Format physical value, enum, list kicad properties in compiler

* Don't rely on __attr__ values

Handle typed, stringified component properties directly.

* Title case kicad properties
2025-10-30 16:08:48 -04:00
Akhil Velagapudi 680373c88b Fix wasm build regression (#254)
My last PR added a transitive dependency on pcb-kicad to pcb-zen-wasm,
which caused the wasm build to fail.

Build wasm bundle in CI to prevent future regressions.
2025-10-30 00:27:39 -04:00
Akhil Velagapudi 30778a6561 Use kicad-cli for fallback bom instead of symbol parsing (#253)
* Use kicad-cli for fallback bom instead of symbol parsing

* Add snapshot test
2025-10-29 22:31:20 -04:00
Akhil Velagapudi de8f97ec39 Add component modifiers + interior mutability (#241)
* Add component modifiers

* Add component interior mutability

* Fix rebase issues, update snapshots

* Add support for bottom-up modifiers

* Update spec

* Fix refcell panic

* Add builtin.current_module_path()

* Don't return component on Component()

* Add manufacturer to alternatives

* Make modifiers order-independent

* Resolve mpn from properties during construction
2025-10-29 15:47:17 -04:00
Diode Robot e0d74088f7 Add warn() (#252)
Co-authored-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-28 11:24:41 -04:00
Diode Robot eeec06e65c Release v0.2.17 v0.2.17 2025-10-27 22:37:58 +00:00
Akhil Velagapudi 372fe59552 Store module tree in eval context instead of module starlark value (#251)
* Store module tree outside modules

* Raise diagnostics on Module()

* Fix lsp, wasm to use new API

* Fix formatting, simplify

* process_pending_child doesn't return frozen heap
2025-10-24 14:12:06 -04:00
Akhil Velagapudi 671d9e4f92 Skip update check on pcb update (#250)
* Skip update check on `pcb update`

* Fix layout tests

* Delete old snapshots
2025-10-23 11:17:02 -04:00
Diode Robot c00854e37f Release v0.2.16 v0.2.16 2025-10-23 03:44:12 +00:00
Akhil Velagapudi 95cfb6c774 Include content size in zstd frame header (#249)
* Include content size in zstd frame header

KiCad needs this ...

* Add pcb layout --temp

To preview layout without a layout block
2025-10-22 23:41:31 -04:00
Lenny Khazan 14ed225337 fix 3d model embedding (#247)
* fix 3d model embedding

* update order

* fix order
2025-10-22 21:52:59 -04:00
Diode Robot 08f391bf84 Release v0.2.15 v0.2.15 2025-10-22 17:08:09 +00:00
Akhil Velagapudi 01d6763c81 Add mfr, source to search (#246)
Also, write component zen file to components/<mfr name>/<mpn>/<mpn>.zen
2025-10-22 10:33:17 -04:00
Akhil Velagapudi d02f6e4b5c Add HTML fab drawing to release (#245)
* Add HTML fab drawing to release

Writing to manufacturing/fab_drawing.html.

* Only show inner copper weight if it makes sense
2025-10-21 19:36:32 -04:00
Akhil Velagapudi d9cdd3aa64 Improve pcb vendor perf (#244)
Reduced vendor time in test repo from 140s to 6s.

Classify remotes lazily instead of eagerly in fetch_remote.
2025-10-21 17:38:31 -04:00
Lenny Khazan 1709c3fa64 Parse description in pcb release (#243)
* Parse description in release

* update snap
2025-10-21 15:30:25 -04:00
Diode Robot 5340d35cd7 Release v0.2.14 v0.2.14 2025-10-21 18:58:55 +00:00
Akhil Velagapudi b51a972eb2 Include board config in release (#242)
JSON contents are written to <staging_dir>/layout/board_config.json.
2025-10-21 14:45:32 -04:00
Akhil Velagapudi ef4f3693c5 Add pcb mcp (#240)
* Add mcp support for search_component, add_component

* Add get_zener_docs, fix add_component

* Update help snapshot
2025-10-21 13:33:10 -04:00
Akhil Velagapudi 606fc140cb Add pcb auth, pcb scan, pcb search (#236)
* Add pcb auth, pcb scan

* Allow overriding APP, API urls

* Add pcb-scan crate

* Add pcb search

* Move all api stuff into separate crate

* Follow redirects, minor ux improvements

* Update snapshot

* Fix clippy lints

* Update lock file

* Download + extract images by default

* Use datasheel urls from download response

* Add pcb auth refresh

* Use use search API, do more work in parallel

* Dedup code

* Generate correct .zen file using template

* Remove unnecessary code

* Embed step file into kicad_mod

* Synchronize auth token refresh

* Switch to single datasheet url

Also normaize line endings.

* Fix step embedding

* Sanitize names, upgrade footprints
2025-10-20 23:24:45 -04:00
Akhil Velagapudi 9a8af05d2f Add "--exclude" to pcb tag as well (#238) 2025-10-18 10:49:56 -04:00
Akhil Velagapudi 516cb23028 Always eval io() defaults (#239) 2025-10-17 18:10:14 -04:00
Diode Robot 89f70b64e0 Release v0.2.13 v0.2.13 2025-10-17 19:06:44 +00:00
Akhil Velagapudi 930fa47937 Allow exclusion of certain artifacts during release (#237)
* Allow exclusion of certain artifacts during release

* Make enums the canonical identifier
2025-10-17 15:02:36 -04:00
Davide Asnaghi f1d40b0bb3 [FEATURE] sync track and vias (#110)
* sync vias and track

* cleanup tests

* add test

* simplify virtual classes

* sync vias and track

* cleanup tests

* add test

* simplify virtual classes

* sync vias and track

* cleanup tests

* add test

* simplify virtual classes

* cleaner stdio handling

* use list for kicad iters to avoid windows locks

* explicitly delete board

* cleanup resources

* update snap

* Add Windows warning and disable Windows layout tests

* update formatting

* update formatting

---------

Co-authored-by: AnandKapadia <anand.kapadia1@gmail.com>
Co-authored-by: Lenny Khazan <lenny.khazan@gmail.com>
2025-10-16 17:23:19 -04:00
Lenny Khazan fd81671a3b Multi-unit symbol position support (#235)
* Multi-unit symbol position support

* Add error on @

* update test
2025-10-16 11:59:27 -04:00
Diode Robot 14a74ddf91 Release v0.2.12 v0.2.12 2025-10-15 19:38:29 +00:00
Akhil Velagapudi 8cf661db95 Don't auto update pcb (#234)
Just print a message to stderr asking the user to run `pcb update`.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-15 15:22:03 -04:00
Akhil Velagapudi 3e0b15929e Update Net() spec to include impedance, voltage (#233)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-15 14:23:45 -04:00
Akhil Velagapudi 78b63cd9c1 [ENG-102] Auto assign netclasses by matching impedances (#232)
* Sync units, board_config

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Parse netclasses

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Auto assign netclasses by matching impedances

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Only match net -> SE, DiffPair -> diff

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-15 09:45:47 -04:00
Diode Robot 2ae2d9c084 Release v0.2.11 v0.2.11 2025-10-15 00:42:40 +00:00
Akhil Velagapudi d7bd751855 Set title, rev, date in drawing title block (#230)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-14 20:40:11 -04:00
Akhil Velagapudi eee722e306 Remove special handling of single-net interfaces (#229)
* Fix interface template cloning

Also, remove special-cased single net interface naming.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update snapshots

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Delete using(), interface promotion

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add back proper interface type checking

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update power check example

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Extract default value before type compilation

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-14 20:39:38 -04:00
Akhil Velagapudi 08460191ad Fix bug where hijacked interfaces didn't have default values (#231)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-14 18:39:01 -04:00
Diode Robot 23e08ef2ee Release v0.2.10 v0.2.10 2025-10-14 15:28:00 +00:00
Akhil Velagapudi 84ddcb835c Typed nets w/ metadata (#221)
* Add minimal repro

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Remove repro/ contents

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add new typed nets API

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Switch to new typed nets API

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update snapshots

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* cargo fmt

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add net metadata w/ type checking

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Document builtin.net()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix units in units.zen

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Treat symbol as standard net property

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix bug where casting between net types would alloc new id

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* fixup! Treat symbol as standard net property

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use net contructor to assign default values

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add net conversion (Power -> Net)

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Make regular release builds faster

We can just do all the optimizations on cargo dist.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add .NET deprecated field, static typing for fields

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Allow NET keyword arg

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Make print(net) less verbose

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Hijack stdlib single-net interfaces

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix net naming regressions

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Rename builtin.net() -> builtin.net_type()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-14 11:00:40 -04:00
Akhil Velagapudi fe7441b7f4 Deferred child module evaluation (#226)
* Deferred child module evaluation

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Require load_resolver

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Avoid unsafe {}

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Define imports at top of file

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add minimal repro

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add custom enum impl with structural type checking

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Bump starlark-rust to use stable record type ids

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Remove repro/ contents

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Delete copy_value, deep copy

Also, migrate testbench to use deferred eval.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix Symbol type ID stability for config defaults

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-13 11:59:14 -04:00
Akhil Velagapudi 198eb0414e Add back net/interface discriminant for signature json (#227)
Commit 2a8e1d3 swapped the module-signature serializer from our InputValue
wrapper to plain serde_json::Value. That dropped the legacy {"Net": {...}} /
{"Interface": {...}} tags inside __signature, so pcbviz’s hsheet code stopped
recognizing IOs (it only recurses when those tags are present). Normal
components were unaffected because they ignore __signature.

Reintroduce the legacy shape when exporting signatures—serialize
nets/interfaces explicitly so the JSON still carries the {"Net": …} and
{"Interface": …} wrappers expected by the viewer.

We could make a change in pcbviz to accept the new json, but seems like
it would be better to fix in pcb for now.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-11 11:07:48 -04:00
Akhil Velagapudi 22ea42fff5 Bump kicad to 9.0.5 (#225)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-10 14:35:02 -04:00
Akhil Velagapudi 2a8e1d30ca Replace InputValue with deep copy and native json ser/de (#223)
* Use deep_copy instead of input value conversion

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Delete InputValue

Use builtin starlarkvalue <> json serialization or deepcopy.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Dedup io() and config()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Impl DeepCopyToHeap for records, enums

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-10 12:14:29 -04:00
Diode Robot 992a3c6934 Release v0.2.9 v0.2.9 2025-10-09 17:18:58 +00:00
Akhil Velagapudi 1b6dad8243 Make PhysicalValue consistent with PhysicalRange (#222)
PhysicalRange has a better typing strategy.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-09 13:07:34 -04:00
Akhil Velagapudi 4634c160ab Fix an issue where the gltf optimizer would lose color data (#220)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-09 10:47:25 -04:00
Davide Asnaghi 25ef81ef01 feat: use symbol reference as fallback (#219)
* add reference parsing

* fall back on symbol reference when not provided

* fmt

* update snapshots

* update snapshots
2025-10-08 15:00:07 -04:00
Diode Robot 1b271a690c Release v0.2.8 v0.2.8 2025-10-08 03:09:27 +00:00
Akhil Velagapudi 0a77bbaa43 Add GLB export w/ gltfpacking (#218)
* Add GLB export w/ gltfpacking

Also separate 3d model exports into multiple tasks

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Switch to gltfpack-sys lib

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Bump gltfpack to drop cmake dependency

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-07 20:28:24 -04:00
Akhil Velagapudi 8170a10b1d Add "ground" copper role, don't use role in symmetric checks (#217)
* Don't use role in symmetric check

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add "ground" copper role

This is only for internal use as kicad only supports power.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Sync stdlib board_config.zen for documentation

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-07 18:32:34 -04:00
Diode Robot 0c7b1bf1ba Release v0.2.7 v0.2.7 2025-10-06 14:35:41 +00:00
Akhil Velagapudi 461d30b3f2 Add a workflow for bumping version (#216)
Use this instead of the "pcb-tag-release" script.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-06 10:28:40 -04:00
Akhil Velagapudi 602303f9a1 Add description as Component parameter (#215)
* Add description as Component param

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fall back to symbol datasheet, description if not set

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-05 20:48:59 -04:00