Commit Graph

52 Commits

Author SHA1 Message Date
Lenny Khazan 6a3d88fde1 Upgrade shipped symbols to KiCad 10 and enforce their format (#1198)
Amp-Thread-ID: https://ampcode.com/threads/T-01a07398-1a5e-751d-9d9c-c9e05b3d1313

Co-authored-by: Amp <amp@ampcode.com>
2026-09-05 22:19:00 +00:00
Akhil Velagapudi a31b48b499 Use API-only generic BOM matching (#1100)
* Preserve BOM match provenance in output

* Remove local generic BOM matching

* Fix grouped BOM status rendering

* Cache BOM sourcing groups atomically

* Shorten BOM changelog entry
2026-08-27 14:42:06 -04:00
Akhil Velagapudi caf7d63a8f Update pcb-version examples to 0.4 (#897) 2026-06-22 18:24:09 -04:00
Akhil Velagapudi 4e01cb2635 Bundle kicad lib assets into lib/std (#886)
* docs: simplify README

* Add third-party notices

* Bundle stdlib KiCad assets

* Remove implicit KiCad library resolution

* Remove stale KiCad alias fixtures

* Remove layout-time model embedding

* Remove global KiCad footprint lookup

* Add KiCad stdlib path aliases

* Clean up KiCad stdlib aliases

* Derive WorkspaceConfig default

* Clean up KiCad STEP generator typing

* Use bundled KiCad footprints in tests

* Simplify interface template tests

* Ignore bundled KiCad library dependencies

* Bundle KiCad connector compatibility assets

* Resolve KiCad FPIDs to bundled stdlib footprints

* Normalize legacy KiCad library dependencies

* Bundle Governor KiCad compatibility assets

* Restore changelog entries
2026-06-17 11:56:42 -04:00
Akhil Velagapudi f0464212e0 Bump version to 0.4, add pcb migrate version bump (#873)
* chore: bump version to 0.4.0

* Add latest-toolchain workspace migration flow

* Handle global flags before migrate dispatch

* Address migrate review feedback

* Delete pcb.sum

* Bump workspace fixtures to pcb 0.4
2026-06-10 10:21:13 -04:00
Akhil Velagapudi adfdc228d8 pcb 0.4 breaking changes (#870)
* Migrate stdlib to KiCad 10 symbols + footprints (#701)

* Bump stdlib KiCad asset pin to 10.0.0

* Update crystal generic for KiCad 10 pin names

* Update snapshots

* Delete deprecated stdlib (#703)

* Delete deprecated stdlib files

* Fix tests

* Remove deprecated generic stdlib modules

* Remove deprecated standoff and terminal block generics

* Remove deprecated stdlib helpers and API shims

* Remove physical value range deprecation hook

* Drop legacy stdlib load path

* Remove V1 manifest migration support

* Remove legacy net moved directives

* Remove legacy manifest assets support

* Bump KiCad 10 assets to 10.0.3

* Error on legacy Component properties

* Remove legacy module property API

* Drop old toolchain compatibility shims

* Strict 0.4 net naming (#849)

* Enforce strict regular net naming

* Treat NotConnected nets as source-unnamed

* Update unreleased changelog for 0.4 changes

* Clean up 0.4 docs

* fix: pcb fmt

* Fix CI for KiCad 10 symbols and examples

* Fix symbol library fallback and NetTie defaults

* Use versioned KiCad parts index URL

* Include stdlib assets in frozen dependency materialization

* fix: bump W25Q128JVE dep

* Bundle KiCad split symbols granularly

* Remove flash module from workspace test board

* Update publish snapshots

* chore: bump @stdlib dependencies

* Fix Crystal compatibility for KiCad 9 symbols
2026-06-09 17:22:27 -04:00
Akhil Velagapudi b2e725caf2 Update docs for hydrated dependency manifests (#862) 2026-06-02 10:07:38 -04:00
Akhil Velagapudi 4413c9d4d9 Deprecate [workspace.members] (#852)
* Hydrate V2 deps during migrate

* Fix mixed hydrated package resolution

* Simplify workspace discovery

* Clean up workspace package discovery naming

* Update stdlib formatting paths
2026-05-27 16:23:57 -04:00
Akhil Velagapudi af496032d0 Lower silkscreen text default, add 48V SMBJ TVS house part (#848)
* Lower default silkscreen text height

* Add 48V SMBJ TVS house part
2026-05-26 13:40:33 -04:00
Akhil Velagapudi 6247ee421d Warn on legacy Component() inputs (#820)
* Warn on legacy Component() inputs

Emit a deprecated.component_property warning whenever Component() is
called with a legacy properties[...] key that has a typed kwarg
replacement (do_not_populate, Exclude_from_bom, type, mpn, manufacturer,
datasheet, description, and casing variants), or when mpn=/manufacturer=
are used instead of part=Part(...). Legacy values continue to be
honored; the warning just nudges users toward the endorsed forms.

Migrate examples, stdlib, and test fixtures off these legacy inputs
where the surrounding code is not specifically exercising the legacy
fallback path.

* Expose add_property as builtin.add_property and deprecate the global

Adds builtin.add_property as the endorsed entry point. The bare global
add_property still works for backwards compatibility but now emits a
deprecated.add_property warning. Stdlib callers are migrated to
builtin.add_property.

* Cleanup: warn on Description key, simpler add_property message, drop a stray mpn

* Warn on legacy module DNP property keys

Module(..., properties={...}) and add_property(...) / builtin.add_property(...)
now emit deprecated.module_property warnings when they use the legacy DNP key
spellings (do_not_populate, Do_not_populate, DNP, dnp). Pass dnp=True to
Module(...) instead. Legacy values still flow through to conversion.

* Consolidate module DNP deprecation helpers

Extract a shared warn_deprecated_module_property() to remove duplicated
diagnostic-emission boilerplate between the add_property and
properties-dict warning helpers.

* Address PR review: route sourcing keys to part=Part(...), trim changelog

- Remove mpn/Mpn/manufacturer/Manufacturer from LEGACY_COMPONENT_PROPERTY_KEYS
  so they share the same part=Part(...) suggestion as the kwarg path instead
  of producing a misleading two-hop deprecation (legacy -> deprecated kwarg).
- Collapse three verbose changelog entries into two short ones.

* Tighten changelog entries for legacy-properties deprecations
2026-05-18 18:14:26 -04:00
Akhil Velagapudi b3d193e07d Fix stdlib style warnings (#738)
* Fix stdlib style warnings

* Fix formatting, lints

* Update snapshot
2026-04-17 15:20:01 -04:00
Akhil Velagapudi 34f51cb157 ENG-249: io() template as first arg support (#726)
* Add template-first io() support

* Clean up io template enforcement

* Add io template follow-up coverage

* Clean up AD7171 io declarations

* Fix lints in blinky

* Preserve io declaration spans on generated nets

* Update changelog for io templates

* Delete design.md file

* Limit io implicit checks to template syntax

* Keep io implicit-check failures non-fatal

* Demote io implicit-check failures to warnings

* Preserve net identity for io alias defaults

* Preserve shared net clones in interface templates

* Skip io implicit checks for reused net templates

* Simplify io template handling

* Avoid wasted interface net clones
2026-04-16 18:03:10 -04:00
Akhil Velagapudi 813bae2377 Add redundant explicit-name style lint (#722)
* Add redundant explicit-name style lint

* Clean up redundant-name style lint follow-ups

* Format stdlib/

* Fixup PR comment

* Simplify style lint and restore net naming semantics

* Deduplicate repeated style advice
2026-04-14 19:04:36 -04:00
Akhil Velagapudi 56e759e669 Add direction to io(), add input(), output() (#716)
* Add io() direction metadata

* Add input() and output() io sugar

* Move io helpers into stdlib prelude
2026-04-13 10:58:31 -04:00
Akhil Velagapudi efe63682ff Implement ENG-248 net name inference (#704)
* Implement ENG-248 net name inference

* Clean up inferred net names in docs and examples
2026-04-11 18:09:32 -04:00
Akhil Velagapudi 01b59039ea Coerce physical values in net fields (#698)
* Coerce physical values in net fields

* Simplify Power voltage examples
2026-04-10 18:05:19 -04:00
Akhil Velagapudi e843773185 Clean up noisy .zen comment banners
Remove decorative section banners and other low-value headers.
They added noise without adding meaning and were a waste of tokens.
2026-03-17 10:36:19 -04:00
Akhil Velagapudi cc167be4cb Add Part to stdlib prelude and update all usage (#613) 2026-03-08 11:12:26 -04:00
Akhil Velagapudi 0a000c548e Add stdlib prelude (Power, Ground, NotConnected, Layout, Board) (#606)
Make Power, Ground, NotConnected, Layout, and Board implicitly available
in user .zen files without explicit load() statements. Remove
now-redundant imports across all .zen files, tests, examples, and docs.
2026-03-06 18:45:47 -05:00
Akhil Velagapudi 020ec1dbea Embed stdlib in pcb (#604)
* Embed stdlib in toolchain and materialize via canonical hash

* Manage stdlib in toolchain

* Filter stdlib, update manifests

* Ignore layout log, snapshot files

* Fix wasm stdlib root directory listing

* Simplify stdlib ignore in resolver

* Align stdlib layout-json exclude glob

* simplify wasm stdlib path handling and filtering

* Fix typo: manufactuers -> manufacturers

* Bump stdlib in bench test workspace

* Simplify stdlib fork flow and remove semantics
2026-03-06 17:24:39 -05:00
Akhil Velagapudi 42f83f25f1 Add typed part metadata to Component (#600)
* feat(core): add typed Part and mutable alternatives

* test: cover Part netlist behavior in pcb-zen and pcb

* docs: fold Part spec into docs and update examples

* fix(core): preserve typed part over legacy part property

* feat(core): make part canonical over scalar sourcing fields

* refactor(core): simplify canonical part resolution

* refactor(core): simplify component sourcing flow and add unit tests

* builtin.part -> builtin.Part

* Use netlist snapshot tests for part api
2026-03-03 16:39:25 -05:00
Akhil Velagapudi 8e5b1d962d Deprecate [assets] and add built-in resolution of KiCad-style asset repositories (#573)
* Decouple KiCad libraries with [[workspace.kicad_library]] config

Replace hardcoded KiCad repo coupling with a generic
`[[workspace.kicad_library]]` config model. Each entry declares
symbol/footprint/model repo relationships and an optional http_mirror
template for archive-based fetching.

- Add `[[workspace.kicad_library]]` schema with version, symbols,
  footprints, models, and http_mirror fields
- Extract `kicad_library.rs` module with version selection, repo
  matching, and config validation helpers
- Default to KiCad 9.0.3 libraries when no explicit config is provided
- Route symbol->footprint linkage through matched config entries
  instead of hardcoded alias paths
- Make archive fetching config-driven via http_mirror template
- Remove hardcoded KICAD_ALIASES, kicad9-libraries-version, and
  special-case kicad auto-deps mutation
- Exclude non-manifest KiCad repos from pcb.sum lockfile
- Update docs/spec to reflect new config model

* Embed 3D models into KiCad layout files

Add model_embed_discovery module that embeds referenced 3D model files
directly into .kicad_pcb output. Discovers model references in
footprints, fetches and compresses model data with zstd, and rewrites
model paths to use embedded references. This eliminates the need for
external 3D model files at layout time.

* Simplify KiCad resolution and materialization flow

Consolidate resolution maps, remove implicit KiCad dependency injection,
and simplify the materialization pipeline. Config-driven version
selection replaces scattered version parsing. Assets backcompat hook
provides fallback version hints from legacy [assets] declarations.

* Stage KiCad library files from eval for offline release validation

Move KiCad file staging into copy_sources using eval1's schematic so
validate_build needs no network access. Place files in .pcb/cache with
.pcb-cached markers. Deduplicate sexpr node builders, kicad repo
matchers, and release staging helpers. Flatten nested code in model
embed discovery.

* Simplify KiCad library types and clean up dead code

- Parse KicadLibraryConfig.version as semver::Version at deserialize
  time, eliminating fallible kicad_entry_version and making match/version
  functions infallible
- Move kicad_model_dirs and asset_dep_versions to methods on
  WorkspaceInfo, computed on demand from config
- Remove kicad_model_dirs field from Schematic
- Simplify materialize_asset_deps to derive targets internally
- Format PCB output unconditionally at end of patch_pcb_file
- Remove dead code: package_roots dedup guard, redundant post-fetch
  assertion, trivial vendor config tests, duplicate tests
- Delete superseded kicad-libraries-proposal-v3 spec

* Remove the offline field from NativePathResolver

* Update changelog

* Remove unnecessary result wrapping

* Dedup resolution logic for assets

* Encode schema version in filename

* Search all package_resolutions for kicad asset deps

* Address bot review comments, dedup

* Fix confusing arg name
2026-03-02 01:48:03 +00:00
Akhil Velagapudi 9d1976f918 Add symbol-driven default footprint inference in Component() (#559)
* Add strict Component footprint inference from symbol Footprint

* Add KiCad symbol footprint fallback inference

* Add snapshot test for inferred KiCad footprint fallback

* test: add CLI netlist snapshot for inferred symbol footprint

* docs: summarize symbol-driven footprint inference in changelog

* docs: tighten changelog wording for footprint inference

* Use more symbol-derived footprints

* test: use snapshot_eval for footprint inference errors

* test: remove duplicate footprint inference happy-path test
2026-02-19 19:08:19 -05:00
Akhil Velagapudi 870a87541f Remove unused spec field in BoardConfig (#549)
The intent was to maybe have some other file format to store this stuff,
but we never implemented that and it's just confusing to keep this
around.
2026-02-17 17:30:40 -05:00
Akhil Velagapudi 69a865d452 Set required config values in tests (#538)
Also, support int/float -> physical value promotion in config().
2026-02-12 17:58:19 -05:00
Akhil Velagapudi 10da5b302e Use package:// URIs for stable, machine-independent file references (#529)
* Use package:// URIs for stable, machine-independent file references

* Fix pytest failures

* Replace package uris with relative paths in footprint properties

* Tolerate relative path in `footprint=` (instead of package uri)

* Tolerate relative path as "layout_path"

* Address PR comments
2026-02-11 22:25:08 -05:00
Akhil Velagapudi 48b3b49a49 Drop support for v1 workspaces (#508)
* Drop v1 dependency resolution support

* Fix tests

* More cleanup

* Address PR comments
2026-02-06 03:44:58 +00:00
Akhil Velagapudi b49839a6d3 Nuke physical ranges (#498) 2026-02-04 21:31:46 +00:00
Akhil Velagapudi 6cc1890f0d Pin stdlib version to toolchain (#353)
* Pin stdlib version to toolchain

* Update docs

* Fix pcb.sum tidying to remove unused entries on build

* Inject stdlib into every package's resolution map

* Skip stdlib in pcb update

* Remove redundant stdlib dependencies from pcb.toml in auto-dep

* Fix auto dep snapshot
2025-12-15 19:29:37 -05:00
Akhil Velagapudi eb9ffd684a Update README.md, fix inline manifest alias resolution (#351)
* Fix embed-readme

* Delete last-run file

* Fix inline manifest handling

* Update README.md

* Document some more crates

* Fix pcb.toml path
2025-12-12 16:44:08 -05:00
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 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
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 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 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
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 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
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
Akhil Velagapudi 6b65301cce Add spec to BoardConfg() and datasheet to Component() (#214)
* Add spec to BoardConfig

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

* Add datasheet as Component param

Also, sets the built-in "Datasheet" field instead of adding a custom
"datasheet" field.

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-05 18:07:38 -04:00
Akhil Velagapudi 304551b1db Add better error messages, update blinky.zen (and add it to CI) (#212)
* Improve pcb layout error messages

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

* Update blinky code to use versioned stdlib, board config

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

* Keep examples/blinky.zen in sync with README.md blinky

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

* Build all examples in CI

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

* Build all examples

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-05 00:27:42 -04:00
Akhil Velagapudi 67b164f34b Add builtin.add_electrical_check (#199)
* Add builtin.add_electrical_check

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

* Add snapshot tests

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

* Add checks arg to io()

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

* le final api

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

* Allow constructing PhysicalRange with PhysicalRange value

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

* Reduce API surface, only expose check_voltage_within

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-02 17:57:46 -04:00
Akhil Velagapudi 1680e12d65 Add physical value ranges (#195)
* Dedup quantity str

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

* Switch to get_methods for builtin

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

* Add PhysicalRange

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

* Remove unused ComponentFactoryValue

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

* Document the physical range feature

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

* Add ser/de and InputValue support for ranges

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

* Ensure min <= nominal <= max

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

* Add min, nominal, max, unit attrs to physical range

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-01 16:57:01 -04:00
Akhil Velagapudi 5e669e6fcb Bunch of minor fixes from testing against read boards (#193)
- Make # of user layers configurable (defaults to 4)
- Preserve all kicad standard technical layers
- Add 0 value placeholder entries for predefined sizes
- Fix layers sexpr formatting
- Make netclass diff_pair_via_gap and priority configureable
- For "Default" netclass, modify the default
- Add better type hints

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-10-01 14:50:56 -04:00
Akhil Velagapudi ac8434ff42 Board-level configuration (#188)
* Add `builtin.add_board_config`

Sets constraints

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

* Enable json extension

Useful for debugging

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

* More compact config mapping

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

* Add predefined sizes support to board config

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

* Make all board config fields optional, add merging

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

* Add netclass support to board config

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

* Add stackup support, sexpr library

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

* Patch stackup on `pcb layout`

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

* Sync board config by default

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

* Fix deep_merge

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

* Document board config feature

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

* Flatten netclasses

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

* Add base configurations

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

* Remove unused _is_new_board

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

* Move board_config.zen to examples/

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

* Use pcb-sexpr

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

* Replace --dont-sync with --sync (default true)

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-29 15:57:15 -04:00
Akhil Velagapudi 8e9c355a3f Disallow dots in names (#150)
* Disallow dots in names

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

* Bump stdlib

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

* Simplify is_instance_position

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

* Update snapshot

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-15 18:06:28 -04:00
Akhil Velagapudi ae7766a8a6 Add warnings for unstable refs in load(), Module() (#105)
* Refactor diagnostics for warnings support

- Add render trait
- Render warnings after errors
- Reuse build code across build, layout

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

* Delete bundle

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

* Fix clippy lints

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

* Add git ref metadata

3 stages to fetch_remote:
- Ensure remote is in cache
- Add appropriate symlinks
- Classify + store ref metadata

Some code cleanup:
- Factored out some git clone dupe code
- Centralized git operations in git.rs

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

* Warn on unstable refs

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

* Add "-Dwarnings" flag to error on warnings

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

* Warn on unstable refs in Module()

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

* Add snapshot tests for warnings

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

* Fix span detection for chained Module()

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

* Add ResolveContext, dedup resolve code

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

* Use spec history for better alias warnings

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

* Add pcb.toml spans

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

* Add type-erased error storage to Diagnostic

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

* Fix bug with load() span detection

The previous logic would just attempt to match by path, but if there are
multiple load() statements in a single file with the same path, then
find_load_span_for_path with always return the first.

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

* Added diagnostics passes

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

* Add LSP-specific pass to filter out some warnings

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

* Fix rebase conflicts

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

* Fix unstable ref detection logic

If we clone by tag and the tag exists in the git repo, it's a stable
ref. Same with commit.

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-25 15:45:51 -07:00
Akhil Velagapudi 1ee83c6e7e Initial implementation of interface subclasses + auto-promotion (#89)
* Add serialize(), deserialize() builtins for debugging

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

* Add field(), __post_init__ to interface()

Also, add better print() behavior.

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

* Add interface/net promotion

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

* Remove Cargo.toml patch

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

* Fix example

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

* Fix test workspace

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

* Add interface arg type checking

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

* Update spec.mdx

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

* Allow `using(Net)`

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-20 09:27:39 -07:00
Akhil Velagapudi f20ac95f64 [DIO-298] [DIO-299] Add pcb bom command to generate unmatched bom (#66)
* Add structured, unmatched BOM export command

Run using `pcb bom <path/to/zen> -o json`

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

* Test bom command in CI

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

* Bump stdlib in examples from v0.2.0 to v0.2.2

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

* Remove default_multiplier, use struct for group key

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

* Use PhysicalValue to do less string parsing

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

* Add alternatives to group key

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

* Use DynamicFullWidth for the comfy table

Attempts to fit the table within terminal width.

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

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-14 12:13:20 -07:00
Davide Asnaghi dbb13bd4aa pin stdlib (#63) 2025-08-08 16:23:01 -04:00
Lenny Khazan 0682b72e08 Fix schematics when symbol= and pin_defs= are provided (#37) 2025-07-20 16:57:04 -04:00