StefanSchippers / xschem

A schematic editor for VLSI/Asic/Analog custom designs, netlist backends for VHDL, Spice and Verilog. The tool is focused on hierarchy and parametric designs, to maximize circuit reuse.
Other
300 stars 22 forks source link

question about subcircuits #138

Closed olisnr closed 8 months ago

olisnr commented 8 months ago

if i draw a schematics "opamap1.sch" and generate ans symbol "opamp1.sym", then the spice-netlist findes the subcircuit from the @symname. so its working if i have for every .sch a .sym. i wanted to use the same opamp_p.sym for differnent *.sch. the way i was trying is to change the global parameters:

type=subcircuit
format="@name @pinlist @xschem"
template="name=x1" @xschhem="opamp" 

and then set the properties in the schematics where i use the opamp_p.sym to name=x2 xschem=opamap_p_130nm. but this doesent work. because there is always the symbolname used to produce the .subckt in the spice netlist...

is there an other way to do this?

StefanSchippers commented 8 months ago

Yes, there is an easy way to do that. You can do it even at instance level, so the same symbol placed multiple time can pick different schematics (schematics should have the same i/o interface of course, order of pins in schematic does not matter, the symbol ordering rules). See this manual page, just the initial part. https://xschem.sourceforge.io/stefan/xschem_man/tutorial_instance_based_implementation.html

olisnr commented 8 months ago

cool!