← Back to community index
# support·Active

Vivek Vijayan - Hi guys.. I've one observation...

Hi guys.. I've one observation. This is my high level code. code sample If the modules are defined inside <subcircuit , then the <trace will not connect. If modules are defined inside <group , <trace is connects the ports without any issues. Attached images show both conditions C

Started by Vivek VijayanJul 13, 20267 messages

Discussion

Last active 2 months ago · plain text
Vivek Vijayanoriginal post
Hi guys.. I've one observation. This is my high level code. ``` export const power_circuit = () => { return ( <board name="main-power-circuit" routingDisabled={true}> <BmsMonitorModule name="monitor_module" schX={0}/> <CurrentSensing name="current_sensing" schX={5}/> <HighVoltagePowerSupply name="hv_supply" schY={5}/> <CommunicationBridge name="com_bridge" schX={5} schY={5}/> <trace name="tr_cvdd" from="monitor_module.CVDD" to="hv_supply.LV_OUT"/> </board> ); }; ``` If the modules are defined inside <subcircuit>, then the <trace> will not connect. If modules are defined inside <group>, <trace> is connects the ports without any issues. Attached images show both conditions **Case 1: module as <group>** ``` export const BmsMonitorModule = ({ name, schX, schY }: BmsMonitorModuleProps) => { return ( <group name={name} schX={schX} schY={schY} showAsSchematicBox> ... </group> ) } ``` **Case 2: module as <subcircuit>** ``` export const BmsMonitorModule = ({ name, schX, schY }: BmsMonitorModuleProps) => { return ( <subcircuit name={name} schX={schX} schY={schY} showAsSchematicBox> ... </subcircuit> ) } ```
Seve
hey yes, use exposedNets
Seve
that will expose nets outside the subcircuit
Seve
subcircuits are isolated by default- this is actually useful in a lot of contexts but can be confusing
Vivek Vijayan
Is it possible to expose only selected nets? May be the nets from <port> component only?
Seve
can you should me an example of the behavior you're looking for w/ some tsx? Just want to make sure i understand
Vivek Vijayan
Hi <@757706909351411845> , Is this the right approach to use `exposedNets` ```low-voltage-power-supply.tsx export const LowVoltagePowerSupply = ({ name, schX, schY, showAsSchematicBox }:ModuleProps) => { return ( <subcircuit exposedNets={["VIN_P","PRI_GND", "VOUT_12V", "VOUT_3V3", "VOUT_1V2","SEC_GND"]} name={name} showAsSchematicBox={showAsSchematicBox} schX={schX} schY={schY}> <port name="VIN_P" direction="left" connectsTo={["C_in.pin1"]} /> <port name="PRI_GND" direction="left" connectsTo={["C_in.pin2"]} /> <port name="VOUT_12V" direction="right" connectsTo={["C13.pin1"]} /> <port name="VOUT_5V" direction="right" connectsTo={["C_5v_2.pin1"]} /> ... ``` ```microcontroller-module.tsx export const MicrocontrollerModule = ({ name, schX, schY, showAsSchematicBox }:ModuleProps) => { return ( <subcircuit name={name} exposedNets={["SWDIO","SWCLK", "NRST", "GND", "3V3","ADC_IN", "UART_TX", "UART_RX", "SPI_SCK","SPI_MISO","SYNC_GPIO", "CONTACTOR_GPIO"]} showAsSchematicBox={showAsSchematicBox} schX={schX} schY={schY}> {/* 1. Module Ports (Automatically route to target pins) */} <port name="SWDIO" direction="left" connectsTo={["U1.pin34"]} /> <port name="SWCLK" direction="left" connectsTo={["U1.pin37"]} /> ... ``` ```control-circuit.tsx import { MicrocontrollerModule } from "./microcontroller-module/Workspace/microcontroller-module" import { LowVoltagePowerSupply } from "./low-voltage-power-supply/Workspace/low-voltage-power-supply" export const ControlCircuit = () => { return ( <group name={name} showAsSchematicBox={showAsSchematicBox} schX={schX} schY={schY}> <LowVoltagePowerSupply name="lvps" schX={0} schY={0} showAsSchematicBox={true} /> <MicrocontrollerModule name="mcu" schX={10} schY={0} showAsSchematicBox={true} /> <trace name="t_v3v3_link" path={["lvps.VOUT_3V3", "mcu.3V3"]} /> <trace name="t_gnd_link" path={["lvps.SEC_GND", "mcu.GND"]} /> ... ```

Want to add to the conversation?

Reply in Discord so your notes stay connected to the source.
Continue in Discord ↗