Stefan Schippers
02/06/2022, 2:21 AMdevice_model=""
attribute, then in the listbox at the right-top of the dialog box select the device_model
you just created, you can use the 'Load' button in the dialog box to load a file (model or .subckt definition) for the symbol. When creating the netlist the device_model is dumped into the netlist only once, even if you have multiple instances, like this:
** sch_path: /home/schippes/.xschem/xschem_library/test_sym_with_netlist.sch
**.subckt test_sym_with_netlist PLUS OUT MINUS
*.ipin PLUS
*.opin OUT
*.ipin MINUS
X1 PLUS MINUS VCC VSS OUT AMPLIFIER
X2 PLUS MINUS VCC VSS OUT AMPLIFIER
**.ends
**** begin user architecture code
.subckt AMPLIFIER PLUS MINUS VCC VSS OUT
* something here....
.ends
**** end user architecture code
.end
The section between the ** begin .. ** end sections is the device_model attribute.
There are other ways, for example you might want t create an empty schematic with just the I/O pins, and insert a 'code.sym' symbol with the definition of the schematic expressed as netlist code instead of drawing the actual circuit.
The advantage of this first approach is that you don't even need to have a schematic view, you only need a .sym view.