I'm running a transient sim for LSXO duty cycle th...
# chipalooza
b
I'm running a transient sim for LSXO duty cycle that takes quite a while. I think I could create spice .meas statements for duty cycle, Vol, Voh, and rise/fall time with a single simulation. Is there a way to capture data for multiple electrical parameters in a single testbench with CACE? Maybe I just haven't found this in the documentation.
t
The
instramp
example project has an example of this. The
gbw.sch
testbench produces three results: gain-bandwidth, gain margin, and phase margin. The
simulate { ... }
block has a
format
line that shows how many values are in the output line, and there's a
null
for each one that should be ignored, and
result
for the one that is important to that parameter. Unfortunately, CACE is not yet smart enough to keep track of which testbenches have been run under which conditions, so it will run ngspice multiple times to get each result instead of using the same resulting data file multiple times. That's on my to-do list for CACE.
So the only optimization you can do right now is to have one testbench instead of four, but you'll end up with ngspice running the lengthy simulation four separate times.
b
If I want to send an ideal sinusoid using a voltage source with a SINE() function, would CACE interrupt that? I have a testbench using these guys (image) that runs smoothly with xschem/ngspice, but is transformed into DC using CACE.
t
No, CACE shouldn't interrupt that. But it sounds like it is, anyway.
b
Well, I don't think it's realistic to find a bug fix in a few hours. I just pushed an update to https://github.com/b-etz/sky130_be_ip__lsxo if you're interested to see. The affected test is Vol and Voh.
I will sign up for a review slot, and hopefully I have some form of working verification beforehand. Otherwise, it might be a quick review. 😅
t
If I set "keep simulation files" in Settings, I can see the testbenches, and the
SIN()
is present on the voltage sources. If I add nodes
net4
and
net5
to the
save
line, they can be plotted. So, nothing wrong with the sinusoidal voltages.
✅ 1
b
If I bypass the parasitics symbol, CACE runs with a sensible result. Interesting.
I'm not sure why that would be, but I can work with that.
t
I think
lqfp_parasitics
is not being generated. I don't see it in the netlist. It appears to be an independent netlist you've defined in a schematic and are calling from the testbench. I think you probably will have to generate its netlist manually.
b
Does ".include {DUT_path}" include the whole directory? Or just the DUT and its dependencies?
Because I'll have to include that as well as the crystal symbols for the other tests. Thank you for the catch.
t
It includes only the schematic
sky130_be_ip__lsxo
. I think that the issue may be that the
lqfp_parasitics
is defined in the xschem directory, but it is being used directly in the testbench which is in the
cace
directory, and
cace
specifically does not add the
xschem
directory to the path because it needs to avoid putting the netlist of the DUT directly into the testbench. You may need to duplicate
lqfp_parasitics.sch
in the
cace
directory so that it can be found when generating the testbench netlists.
✅ 1
b
Easy enough. Thank you!
t
Well, I'm not all that sure of my answer. I get the general problem, but haven't stared at enough to have a high confidence about the solution. There are probably multiple ways to work around it.
Okay, I tried it and I'm confident now. I did have to delete the file
cace/tb_vol.spice
because moving around files did not trigger its "netlist out-of-date" check. Otherwise, all I did was to make a symbolic link to
xschem/lqfp_parasitics.sch
from
cace/
.
b
Can confirm that worked on my end, too. Glad you mentioned deleting the
.spice
generated files, because it would have taken me ages to try that.
t
Maybe I should give up checking for out-of-date files and just always regenerate netlists. There are just too many ways to subvert the out-of-date check.