Hello all I am facing a problem with spice (approa...
# chipalooza
i
Hello all I am facing a problem with spice (approaching max data size problem, (I am working with RDAC, facing this while simulating 10bit DAC output. If anyone knows a way around it, kindly let me know.
b
Do you have a
save
statement in your spice control block? Please try adding a line reading
save din0 din1 din2 ...
with the voltages and currents you wish to save, and which you need for analysis. Otherwise, ngspice will try saving everything, which occupies a lot of memory and slows down the sim.
i
like . save din0 din1 din2 or just save din0 din1 din2 ...
b
It should be a list of any variables you want to plot or measure. Ngspice will only save the variables you list. If you use a net name, it will save the voltage on that node.
i
Ok will try this
save statement should come before plot din0 din1 .... or after it ?
b
For mine, I've been putting the
save
statement before the
tran
statement, and all inside the
.control
block. I'll attach an example.
You could omit the
v( )
braces. I just use it to be explicit.
i
ok
Yes its working, i got the desired results, but still its taking 2 hours to simulate.
b
Speaking from recent personal experience, 1-2 hour sims aren't out of the question for even a modest analog design if the transient time is long enough. Some of this depends on the clock speed of the PC you're running it on. But your transient duration is less than 50 time steps, so that shouldn't be an issue. If you still have the Ngspice window open, try typing the command
display
. This will display a list of everything Ngspice saved during the sim. The longer this list is, the more work Ngspice is doing to log data during the transient sim. What happens if you change the second line in your spice code block from
save all
to
save out10bitdac
? If you run the
display
command after this sim, you should only see
time
and
out10bitdac
listed.
If you reduce the saved data and it's still slow, are you using a multi-core CPU for this work? A couple of forum threads have mentioned using the command
set num_threads=##
in the .spiceinit file, where you replace
##
with the number of threads you can give Ngspice. The location for this file is in the home directory where Xschem has created a
.xschem
folder. For me:
~/.xschem/simulations/.spiceinit
.
i
I will check this surely
Yes, its a multicore CPU running with Windows, i have running Ubuntu using Virtual Box, with these settings
so that means threads here are Virtual cores i,e 8
U are right, when save all is used, its a log list of vectors, Mine is Hierarchical design, so 3bit DAC is build using two 2 bit DAC and a switch, 4bit DAC is build using Two 3 bitDAC and a switch , and so on.
I have tried this way, still, spice is quite slow. also, made threads to 8
Now, for 12bits, spice is shutting, even before starting any simulation processing (bash kill)