Ahmed Reda
10/09/2022, 7:25 PMStefan Schippers
10/10/2022, 10:59 AMtype=subcircuit
spice_sym_def=".include /path/to/file.spice"
format="@name @pinlist @symname"
template="name=x1"
the spice_sym_def
attribute tells xschem to write the corresponding line into the netlist. This will include the specified .spice file.
This is a recend xschem addition, so use a recent xschem version.
the produced netlist of below example will be:
** sch_path: /home/schippes/.xschem/xschem_library/test_spice_include.sch
**.subckt test_spice_include
x2 AA BB ZZ spice_include
**.ends
* expanding symbol: spice_include.sym # of pins=3
** sym_path: /home/schippes/.xschem/xschem_library/spice_include.sym
.include /path/to/file.spice
.end
Stefan Schippers
10/10/2022, 11:00 AMStefan Schippers
10/10/2022, 11:08 AMStefan Schippers
10/10/2022, 11:09 AM** sch_path: /home/schippes/.xschem/xschem_library/test_spice_include.sch
**.subckt test_spice_include
x2 AA BB ZZ spice_include
**.ends
* expanding symbol: spice_include.sym # of pins=3
** sym_path: /home/schippes/.xschem/xschem_library/spice_include.sym
** sch_path: /home/schippes/.xschem/xschem_library/spice_include.sch
.subckt spice_include A B Z
*.ipin A
*.ipin B
*.opin Z
**** begin user architecture code
m2 Z A VCCPIN VCCPIN cmosp w=wpa l=lpa ad='wpa *4.6u' as='wpa *4.6u' pd='wpa *2+9.2u' ps='wpa *2+9.2u'
+ m=1
m1 Z B VCCPIN VCCPIN cmosp w=wpb l=lpb ad='wpb *4.6u' as='wpb *4.6u' pd='wpb *2+9.2u' ps='wpb *2+9.2u'
+ m=1
m3 Z A net1 VSSPIN cmosn w=wna l=lna ad='wna *4.3u' as='wna *4.3u' pd='wna *2+8.6u' ps='wna *2+8.6u'
+ m=1
m4 net1 B VSSPIN VSSPIN cmosn w=wnb l=lnb ad='wnb *4.3u' as='wnb *4.3u' pd='wnb *2+8.6u' ps='wnb *2+8.6u'
+ m=1
**** end user architecture code
.ends
.end
Ahmed Reda
10/10/2022, 12:43 PMtype=primitive
format="@name @pinlist @symname"
template="name=X1"
2-In the test bench, I add the following attribute
.include /path/to/path/sar.spice
Those steps make the testbench works fine. are they reasonable steps?
because when I used
type=subcircuit
spice_sym_def=".include sar.spice"
format="@name @pinlist @symname"
template="name=x1"
in the symbol window ,then use it in a testbench and press neltist in the testbench window, a samll window apprears that sar.sch is required.Stefan Schippers
10/10/2022, 1:24 PMAhmed Reda
10/10/2022, 1:27 PM