Hello all, I was following Professor Murmann's Boo...
# analog-design
k
Hello all, I was following Professor Murmann's Book to characterise a PDK using ngspice for which I have hspice models, specifically

this

schematic from his github page. I was able to characterise the nmos in my technology using his testbench for nfets, after making the necessary adjustments, but I am facing some trouble when using the testbench for pfets. Even though I am sweeping the transistor for same values of length and same voltages, the data generated doesn't match the expected size of
14x73x73x3
(
L x VGS x VDS x VBS
), instead the
.txt
file which ngspice outputs has
204344
entries i.e.
19474
entries less than expected. I wanted to convert the generated
.txt
table to a
.mat
file for use with the
lookup
function from the book but since the number of entries written by ngspice doesn't match the expected size, I am unable to reshape the array. Does anybody why ngspice might be writing fewer entries to the output .txt file? I have attached my xshcem schematic and the .txt file generated by the simulation
h
@Koustubh You can look here, there a plenty of notebooks and examples that use this methodology: https://github.com/iic-jku/analog-circuit-design/tree/main/sizing
k
@Harald Pretl I tried creating a fresh schematic (using one of the templates for pmos) and now for some reason when the sim is done running, despite having selected the
use simulation/schname
in xschem, it doesn't write a
.txt
file for me inside the directory, there is only the
.raw
file and the netlist there.
b
Look at the ngspice output log to see if the text file is written. The file must be somewhere...
I suspect there is an error message if the file wasn't generated.
k
It does say "Transient op failed, timestep too small" and other errors such as the
NOISE
analysis also failing. It would be greatly appreciated if anybody could help me understand why these errors are occuring and help me solve them. The models I am using are
BSIM3
models unlike SKY130's
BSIM4
models btw, so I am not saving some parameters such as
CSS
since my models don't seem to "report" those parameters to SPICE.
while at the end, it does give me values for operating point parameters like gm, cgg, gmbs etc. so the normal
op
sim seems to be working
b
A common issue is that you may be specifying W/L in meters instead of microns. Before running a long sweep, make sure that you can get a hello world sim to work, and that it produces physical results. You need to be very careful in setting things up for your specific model set. This also applies to the parameters. If css is not reported, you need to study the manual to find the proper parameters name.
k
After switching to linux, the simulation seems to be working fine i.e. it produces a .txt file in the appropriate directory but it doesn't seem to have as many entries as needed i.e. the reshape command in numpy expects a different size from that of the table it self. Could you please explain to me why that is? From what I understand, this would mean that the table in the .txt file is missing some simulation entries since the unique command, scans the table itself for unique values of Length and the various voltages. Is there anything I can do to fix this?
b
I don't know how to diagnose this based on the info you have provided. You should be able to look at the text file and see which rows are missing.