Rename cleanups, make some budle ports Passive#527
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the EDG electrical modeling APIs to (1) make certain USB/CAN bundle ports Passive to reflect special signaling requirements, and (2) rename several port/link parameters (voltage_out→voltage, signal_out→signal, current_drawn→current_draw) with a deprecation pathway, including fixes to ensure passive ports are not ignored in pin assignment / netlisting.
Changes:
- Convert USB, CAN differential, and USB CC bundle ports/bridges to
Passive(and update affected circuits and netlisting tests). - Rename core electrical parameters (
voltage_out,signal_out,reverse_voltage_out,current_drawn, etc.) to new names, updating implementations across parts/circuits/examples. - Add a
deprecated_param_remapdecorator and broaden IoController footprint pinning to includePassiveleaf ports.
Reviewed changes
Copilot reviewed 203 out of 206 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/UsbUart/UsbUart.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/UsbUart/UsbUart.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/UsbFpgaProgrammer/UsbFpgaProgrammer.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/UsbFpgaProgrammer/UsbFpgaProgrammer.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TofArray/TofArray.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TofArray/TofArray.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyWithSchematicImport/TestBlinkyWithSchematicImport.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyWithSchematicImport/TestBlinkyWithSchematicImport.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyWithModeledSchematicImport/TestBlinkyWithModeledSchematicImport.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyWithModeledSchematicImport/TestBlinkyWithModeledSchematicImport.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyWithLibraryExport/TestBlinkyWithLibraryExport.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyWithLibraryExport/TestBlinkyWithLibraryExport.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyWithLibrary/TestBlinkyWithLibrary.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyWithLibrary/TestBlinkyWithLibrary.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyPacked/TestBlinkyPacked.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyPacked/TestBlinkyPacked.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyMicro/TestBlinkyMicro.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyMicro/TestBlinkyMicro.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyImplicit/TestBlinkyImplicit.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyImplicit/TestBlinkyImplicit.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyExpanded/TestBlinkyExpanded.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyExpanded/TestBlinkyExpanded.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyComplete/TestBlinkyComplete.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyComplete/TestBlinkyComplete.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyChain/TestBlinkyChain.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyChain/TestBlinkyChain.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/TestBlinkyArray/TestBlinkyArray.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/TestBlinkyArray/TestBlinkyArray.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/test_usb_source_measure.py | Updates renamed voltage/signal/current parameter usage in example design. |
| examples/test_tofarray.py | Updates VoltageSource(voltage_out=…) to voltage=… in example. |
| examples/test_robotdriver.py | Updates refinement paths from signal_out to signal. |
| examples/test_robotcrawler.py | Updates AnalogSource args to voltage/signal. |
| examples/test_multimeter.py | Updates AnalogSource args to voltage/signal. |
| examples/test_lora.py | Updates refinement paths from current_drawn to current_draw. |
| examples/test_iot_thermal_camera.py | Updates VoltageSource args to voltage. |
| examples/test_iot_led_driver.py | Updates VoltageSource args to voltage. |
| examples/test_iot_iron.py | Updates AnalogSource + UsbCReceptacle args to renamed params. |
| examples/test_iot_fan.py | Updates PowerBarrelJack/UsbCReceptacle args to renamed params. |
| examples/test_iot_display.py | Updates VoltageSource args and current_drawn usages. |
| examples/test_iot_blinds.py | Updates VoltageSource args to renamed params. |
| examples/test_high_switch.py | Updates VoltageSource args to renamed params. |
| examples/test_deskcontroller.py | Updates VoltageSource args to renamed params. |
| examples/test_datalogger.py | Updates current_drawn→current_draw and related VoltageSource arg renames. |
| examples/test_can_adapter.py | Updates VoltageSource(voltage_out=…) to voltage=…. |
| examples/SwdDebugger/SwdDebugger.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/SwdDebugger/SwdDebugger.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/ProtectedCharger/ProtectedCharger.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/ProtectedCharger/ProtectedCharger.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/PicoProbe/PicoProbe.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/PicoProbe/PicoProbe.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/PcbBot/PcbBot.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/PcbBot/PcbBot.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/Multimeter/Multimeter.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/Multimeter/Multimeter.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/LedMatrix/LedMatrix.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/LedMatrix/LedMatrix.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/Keyboard/Keyboard.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/Keyboard/Keyboard.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/Fcml/Fcml.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/EspProgrammer/EspProgrammer.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/EspProgrammer/EspProgrammer.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/EspLora/EspLora.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/EspLora/EspLora.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/Datalogger/Datalogger.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/Datalogger/Datalogger.net.ref | Updates edg_path strings to match renamed port/block paths. |
| examples/BleJoystick/BleJoystick.svgpcb.js | Updates EDG path comments to match renamed schematic/net path nodes. |
| examples/BleJoystick/BleJoystick.net.ref | Updates edg_path strings to match renamed port/block paths. |
| edg/util/init.py | Adds deprecated_param_remap decorator for kwarg deprecation/remapping. |
| edg/tools/jlc_pcba/init.py | Establishes edg.tools.jlc_pcba as a package (script relocation support). |
| edg/tools/init.py | Establishes edg.tools as a package (script relocation support). |
| edg/parts/sensor/Rtc_Pcf2129.py | Updates DigitalBidir/VoltageSource args to renamed params. |
| edg/parts/sensor/Mag_Qmc5883.py | Updates VoltageSource args to renamed params. |
| edg/parts/sensor/Mag_A1304.py | Updates AnalogSource.from_supply arg rename (signal_out_abs→signal_abs). |
| edg/parts/power/Ref30xx.py | Updates VoltageSource voltage assignment field name. |
| edg/parts/power/motor/StepperDriver_A4988.py | Updates voltage/current naming throughout driver model. |
| edg/parts/power/motor/MotorDriver_L293dd.py | Updates current draw naming for output ports. |
| edg/parts/power/motor/MotorDriver_Drv8870.py | Updates current draw naming for output ports. |
| edg/parts/power/motor/MotorDriver_Drv8833.py | Updates voltage/current naming throughout driver model. |
| edg/parts/power/motor/Bldc_Drv8313.py | Updates voltage/current naming + current-sense wiring modeling. |
| edg/parts/power/LedDriver_Tps92200.py | Updates voltage naming and reverse_voltage_out→reverse_voltage. |
| edg/parts/power/gate_driver/Ucc27282.py | Updates voltage/current naming for driver rails and outputs. |
| edg/parts/power/gate_driver/Ncp3420.py | Updates voltage/current naming for driver supplies and bootstrap. |
| edg/parts/power/gate_driver/Ir2301.py | Updates current draw naming for supply currents. |
| edg/parts/power/converter/Torex_Boost.py | Updates voltage/current naming and vout initialization field names. |
| edg/parts/power/converter/TexasInstruments_SwitchedCap.py | Updates voltage/current naming and ripple calculations. |
| edg/parts/power/converter/TexasInstruments_Boost.py | Updates voltage/current naming and rectifier constraints. |
| edg/parts/power/converter/Mp2722.py | Updates voltage/current naming + reverse voltage field name. |
| edg/parts/power/converter/DiodesInc_Boost.py | Updates voltage/current naming and rectifier constraints. |
| edg/parts/power/converter/CustomBuckBoost.py | Adds deprecated param remap + updates voltage/current naming. |
| edg/parts/power/converter/CustomBuck.py | Updates current draw naming in forced draw modeling. |
| edg/parts/power/converter/Ap3418.py | Updates current draw naming in sink model and power path. |
| edg/parts/power/converter/AnalogDevices_Boost.py | Updates voltage/current naming and output constraints. |
| edg/parts/power/BatteryProtector_S8261A.py | Updates current draw naming for NFET sizing. |
| edg/parts/power/BatteryCharger_Mcp73831.py | Updates reverse_voltage_out→reverse_voltage. |
| edg/parts/power/Batteries.py | Updates voltage/current naming and series-cell ground modeling current draw name. |
| edg/parts/microcontroller/test_mcu_wrapper.py | Updates dummy voltage source ctor arg name. |
| edg/parts/microcontroller/Stm32l432.py | Updates analog model naming and adds passive USB pin resources. |
| edg/parts/microcontroller/Stm32g431.py | Updates DAC model naming, adds passive USB/CC pin resources, updates USB/CC port models. |
| edg/parts/microcontroller/Stm32f303.py | Updates regulator voltage naming + DAC model naming. |
| edg/parts/microcontroller/Stm32f103.py | Updates crystal driver voltage arg name, adds passive USB pin resources, updates USB port model usage. |
| edg/parts/microcontroller/Rp2040.py | Updates regulator voltage naming, current draw naming, and USB fixed-pin resource model. |
| edg/parts/microcontroller/nRF52840.py | Updates power-node generation helper arg name + VUSB output voltage arg name. |
| edg/parts/microcontroller/Lpc1549.py | Updates crystal driver voltage arg name + DAC model naming. |
| edg/parts/microcontroller/EspCommon.py | Updates digital source voltage arg name. |
| edg/parts/microcontroller/Esp32s3.py | Adds passive USB pin resources, updates USB port model + power-node voltage arg name. |
| edg/parts/microcontroller/Esp32c3.py | Updates crystal driver voltage arg name + power-node voltage arg name. |
| edg/parts/microcontroller/Esp32.py | Updates VUSB output voltage arg name + power-node voltage arg name. |
| edg/parts/microcontroller/Ch32v203.py | Updates crystal driver voltage arg name, adds passive USB pin resources, updates USB port model. |
| edg/parts/microcontroller/Ch32v003.py | Updates crystal driver voltage arg name. |
| edg/parts/Jacdac.py | Updates voltage naming for power and data port model. |
| edg/parts/interface/UsbUart_Cp2102.py | Updates VoltageSource voltage arg name. |
| edg/parts/interface/UsbPd_Fusb302b.py | Updates CC port model (passive) and i2c voltage arg name. |
| edg/parts/interface/UsbInterface_Ft232h.py | Updates multiple internal supply voltage arg names + crystal driver voltage arg name. |
| edg/parts/interface/Rf_Sx1262.py | Updates voltage arg naming for regulator-related ports. |
| edg/parts/interface/Rf_Pn7160.py | Updates internal supply voltage arg names. |
| edg/parts/interface/CanTransceiver_Sn65hvd230.py | Switches CAN diff side to passive CAN bundle + voltage arg rename. |
| edg/parts/interface/CanTransceiver_Iso1050.py | Switches CAN diff side to passive CAN bundle + voltage arg rename. |
| edg/parts/human_interface/SpeakerDriver_Analog.py | Updates AnalogSource voltage/signal arg names. |
| edg/parts/display/Waveshare_Epd.py | Updates internal supply voltage arg names. |
| edg/parts/display/oled/test_oled_i2c_spi.py | Updates dummy voltage source ctor arg name. |
| edg/parts/display/oled/Er_Oled_096_1c.py | Updates internal supply voltage arg names. |
| edg/parts/display/oled/Er_Oled_096_1_1.py | Updates internal supply voltage arg names and property usage. |
| edg/parts/display/oled/Er_Oled_091_3.py | Updates internal supply voltage arg names and property usage. |
| edg/parts/display/oled/Er_Oled_028.py | Updates internal supply voltage arg names. |
| edg/parts/display/oled/Er_Oled_022.py | Updates internal supply voltage arg names. |
| edg/parts/display/EInkBoostPowerPath.py | Adds deprecated param remap + renames internal voltage parameter + conversions. |
| edg/parts/display/EInk_Er_Epd027_2.py | Updates internal supply voltage arg names. |
| edg/parts/connector/FanConnector.py | Updates digital bidir voltage arg naming. |
| edg/parts/connector/Connectors.py | Adds deprecated param remap for barrel jack voltage + modernizes deprecations. |
| edg/parts/analog/opamp/Tlv915x.py | Updates analog output swing arg name. |
| edg/parts/analog/opamp/Tlv9061.py | Updates analog output swing arg name. |
| edg/parts/analog/opamp/Opax333.py | Updates analog output swing arg name. |
| edg/parts/analog/opamp/Opax197.py | Updates analog output swing arg name. |
| edg/parts/analog/opamp/Opax189.py | Updates analog output swing arg name. |
| edg/parts/analog/opamp/Opax171.py | Updates analog output swing arg name. |
| edg/parts/analog/opamp/Mcp6001.py | Updates analog output swing arg name. |
| edg/parts/analog/opamp/Lmv321.py | Updates analog output swing arg name. |
| edg/parts/analog/opamp/Ina826.py | Updates analog output swing arg name + forced signal field name. |
| edg/parts/analog/opamp/Ina219.py | Converts __getattr__ deprecations to @property deprecations. |
| edg/parts/analog/dac/Mcp4901.py | Updates analog output swing arg name. |
| edg/parts/analog/dac/Mcp47f.py | Updates analog output swing arg name. |
| edg/parts/analog/CurrentSense_Ad8418.py | Updates AnalogSource voltage/signal arg names. |
| edg/parts/analog/adc/Mcp3561.py | Updates dummy voltage source ctor arg name. |
| edg/electronics_model/PassivePort.py | Renames adapter ctor args (voltage_out→voltage, signal_out→signal, etc.). |
| edg/electronics_interfaces/VoltageDummy.py | Renames dummy voltage ctor args and adds deprecated alias properties. |
| edg/electronics_interfaces/UsbPort.py | Makes USB D+/D- and CC pins passive and swaps bridges to passive bridging. |
| edg/electronics_interfaces/test_bundle_netlist.py | Updates expected netlist paths for new port/net semantics. |
| edg/electronics_interfaces/MergedBlocks.py | Renames merged block voltage/current fields to new names. |
| edg/electronics_interfaces/GroundPort.py | Renames voltage_out→voltage for ground reference and adds deprecation alias. |
| edg/electronics_interfaces/GroundDummy.py | Converts __getattr__ deprecations to @property deprecations. |
| edg/electronics_interfaces/CrystalPort.py | Renames crystal driver voltage field and adds deprecated alias. |
| edg/electronics_interfaces/CircuitPackingBlock.py | Renames packed block voltage/current fields to new names. |
| edg/electronics_interfaces/CanPort.py | Makes CANH/CANL passive and swaps bridges to passive bridging. |
| edg/circuits/VoltageClamping.py | Renames analog/digital clamp outputs and current propagation field names. |
| edg/circuits/UsbSeriesResistor.py | Switches USB series elements to physical Resistor blocks and uses passive USB pins. |
| edg/circuits/UsbBitBang.py | Updates USB bitbang resistor wiring and renamed voltage/current fields. |
| edg/circuits/test_power_circuits.py | Updates dummy voltage/digital source ctor arg names. |
| edg/circuits/test_diodemerge.py | Updates dummy voltage ctor arg names + asserts new compiled value key. |
| edg/circuits/SwitchMatrix.py | Renames voltage/current link fields used for switch/diode sizing. |
| edg/circuits/ResistiveSensor.py | Renames analog source fields + current propagation field name. |
| edg/circuits/ResistiveDivider.py | Renames analog source fields + current propagation field name. |
| edg/circuits/PowerCircuits.py | Renames voltage/current link fields used for FET sizing and KiCad conversions. |
| edg/circuits/PassiveFilters.py | Renames analog/digital source fields + current propagation field name. |
| edg/circuits/OpampCurrentSensor.py | Renames current draw field used in output swing calculation. |
| edg/circuits/OpampCircuits.py | Renames forced-signal fields and analog source conversion fields. |
| edg/circuits/LevelShifter.py | Renames voltage/current link fields for FET sizing and I/O models. |
| edg/circuits/DigitalAmplifiers.py | Renames voltage/current link fields for PFET sizing and conversions. |
| edg/circuits/ControlCircuits.py | Renames KiCad conversion voltage field name. |
| edg/circuits/BuckConverterPowerPath.py | Renames output VoltageSource field name. |
| edg/circuits/BuckBoostConverterPowerPath.py | Renames output VoltageSource field name. |
| edg/circuits/BootstrapVoltageAdder.py | Renames current draw field used for diode sizing. |
| edg/circuits/BootstrapCapacitor.py | Renames voltage field and assigns new output voltage field name. |
| edg/circuits/BoostConverterPowerPath.py | Renames output VoltageSource field name. |
| edg/abstract_parts/ZenerDiode.py | Renames analog source fields + current propagation field name. |
| edg/abstract_parts/VoltageRegulator.py | Renames voltage/current link fields used in constraints and ideal models. |
| edg/abstract_parts/TestPoint.py | Updates CAN diff test point to use passive CAN port and generic test points. |
| edg/abstract_parts/test_pinmappable.py | Updates test expectations for renamed voltage field initializers. |
| edg/abstract_parts/test_ideal_circuit.py | Updates to current_draw naming. |
| edg/abstract_parts/SwitchingVoltageRegulator.py | Renames voltage/current fields in constraints and ideal models. |
| edg/abstract_parts/Switch.py | Renames current draw field used for switch sizing. |
| edg/abstract_parts/SolidStateRelay.py | Renames voltage/current fields in relay modeling. |
| edg/abstract_parts/Resistor.py | Renames voltage/current fields and digital/analog passthrough fields. |
| edg/abstract_parts/LinearRegulator.py | Renames voltage/current fields in ideal and abstract models. |
| edg/abstract_parts/Jumper.py | Renames reverse voltage/current fields and current propagation fields. |
| edg/abstract_parts/IoControllerWrapper.py | Fixes footprint pinning generation to include Passive ports. |
| edg/abstract_parts/IoControllerInterfaceMixins.py | Adds deprecated param remap to power-node helper and renames arg. |
| edg/abstract_parts/IoController.py | Adds deprecation warning for legacy .can access and renames current draw link usage. |
| edg/abstract_parts/Inductor.py | Renames voltage/current link fields in inductor model. |
| edg/abstract_parts/IdealIoController.py | Renames current draw link fields in IO aggregation. |
| edg/abstract_parts/Fuse.py | Renames voltage/current link fields for fuse sizing. |
| edg/abstract_parts/FerriteBead.py | Renames voltage/current link fields for bead sizing. |
| edg/abstract_parts/Capacitor.py | Renames analog source fields for coupling-cap model. |
| edg/abstract_parts/Battery.py | Renames voltage field used in battery constraint. |
| edg/abstract_parts/AnalogSwitch.py | Renames analog source fields and current propagation fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+15
to
+29
| def decorator(func: CallableType) -> CallableType: | ||
| @wraps(func) | ||
| def wrapper(self: Any, *args: Any, **kwargs: Any) -> Any: | ||
| for old_param, new_param in params: | ||
| if old_param in kwargs: | ||
| warnings.warn( | ||
| f"{old_param} is deprecated and replaced with {new_param}", | ||
| DeprecationWarning, | ||
| stacklevel=2, | ||
| ) | ||
| assert new_param not in kwargs, f"both old {old_param} and new {new_param} parameters specified" | ||
| kwargs[new_param] = kwargs.pop(old_param) | ||
| return func(self, *args, **kwargs) | ||
|
|
||
| return wrapper # type: ignore |
Comment on lines
29
to
30
| self.require(self.pwr.voltage.within((0, 24) * Volt)) # datasheet ratings for connector | ||
| self.require(self.pwr.current_limits.within((0, 2.5) * Volt)) |
Comment on lines
51
to
52
| self.require(self.pwr.voltage.within((0, 24) * Volt)) # datasheet ratings for connector | ||
| self.require(self.pwr.current_limits.within((0, 5) * Volt)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #525
Resolves #524