Hi, I believe, I am not understanding how symbols ...
# xschem
k
Hi, I believe, I am not understanding how symbols work in Xschem, properly. I am trying to simulate a 3-stage ring oscillator where each stage is a differential pair. So, I created a schematic for the differential pair, labelled the pins, and made a symbol out of it. Then I proceeded to use the symbol 3 times in another schematic to instantiate the differential pair device. But when I try to simulate it using ngspice, I get the time step too small error. I know that most of the time, it is because of some other problem, that ngspice throws up this error. I have checked all my schematics, all my symbols. But, I am unable to find, what am I doing wrong. because I have made the same design in [Insert Proprietary SPICE tool here] and it works. I even checked the netlist generated and it seems fine to me. Heck, I even made a separate schematic where I just copied my differential pair 3x times and connected the wires and it worked, but the schematic with my symbols doesn't work for some reason. hence, I believe that something is wrong with how I am either creating the symbol or mapping pins to it or something. Please somebody help.
Test.sch
is the schematic where it works without the symbols and
Razavi_Diff_Osc.sch
is the one with my symbol
Differential_Ring_Osc.sym
and it doesn't work.
Here is the exact SPICE log when I run
Razavi_Diff_Osc.sch
l
The problem must be the internal voltage source inside each instance.if you want to keep it, you must not use the hierarchical vdd symbol
k
I changed it and it works now. But I didn't get what's the problem with using the vdd symbol? could you please explain it in simpler terms?
s
@Koustubh You are using a
vsource.sym
symbol connected to a
vdd.sym
symbol with label
VDD
.
vdd.sym
symbols create global nodes, so you have 3 voltage sources each setting a value on global node
VDD
. This creates a voltage loop / singular circuit matrix. If you want to keep the
vsource.sym
inside the diffamp replace
vdd.sym
with a
lab_pin.sym
, so you will have a local vdd node inside each diffamp. Another suggestion: avoid using pin names Vout- and Vout+, replace these names with Voutm and Voutp. May be ngspice accepts this + and - characters, but stay on the safe side.
🫡 1
🧠 1