I know it's not appealing to write one's first post in an RF focused group talking about DC but please bare with me :)
I am interested in plotting some MOS DC parameters like gm, gmoverid, Cgg, gds as they vary across VGS and VDS.
Keeping VDS fixed for the moment, I would expect to be able to DC sweep VGS and get a curve of - say - gm Vs. VGS. This is not the case. I actually get only one point, which is the point corresponding to the "static" value of VGS, in the design variables list.
Of course I could set up an equation in the Calculator for the derivative of Id but I think that "somewhere" the tool should calculate those parameters for me...And also because for some trickier parameters like Cgg the whole process would be more complicated.
The alternative to that is to run a parametric analysis, but this is way less effective timewise.
Does anybody know of a way of overcoming this?
Thank you in advance,
The way to do this is to create an ASCII file called "save.scs" and in that put:
save *:gm sigtype=dev
save *:oppoint sigtype=dev
(see "spectre -h save" for more details - particularly on wildcarding).
Then reference this file using Setup->Model Libraries in ADE. What this is doing is telling it to additionally save the operating point data (or specifically gm) for a single transistor or set of transistors. Normally this doesn't happen for DC sweeps, just DC operating points - in order to prevent a huge amount of data being produced that most of the time you don't need.
Having done this, you should be able to access the resulting operating point data from the DC sweep from the results browser, and then you'll get a plot of it versus your sweep. Similarly if you did a transient you could plot the gm versus time using this approach.
Hope that's clear,
thanks for your reply. I think you were pretty clear and I should have implemented everything, but it isn't working yet.
To recap, I have a very simple schematic with a transistor and two dc sources: I created an ASCII file named "save.scs" containing one single line of text:
save M1:oppoint [I tried save M1:gm and didn't work either]
In the libraries setup, I added a path to this file [this is different from where the other libraries reside]
ran the DC sweep
plotted OP("/M1", "gm") from the Calc
==> I get the buffer evaluated to a number
In order to select gm, I select the "op" choice in the Calc, then select an instance in the schematic view, and choose the parameter gm from the drop down list.
In the input.scs file, I do see the include directive for "save.scs" so I don't really know what could be wrong.
I would have added some screenshots inline in the post, but I couldn't find my way through. I have attached a zip with 3 screenshots showing the testbench, the simulation windows, and the (incredibly complex) save.scs file :)
Thanks for helping!
P.S. in te netlist the last line says:
saveOptions options save=al currents=all subcktprobelvl=2
is it conflicting with something?
The key is that you're using the OP() function, whereas I said to use the results browser. The OP function will retrieve the DC operating point data, not the results from the DC sweep.
If you do that, and send the signal from the results browser to the calculator, you'll get something like this:
getData("M1:gm" ?result 'dc)
And this should plot the gm versus the swept variable for the dc analysis. You could also just type the getData() expression into the calculator.
There is an enhancement request (for some time) requesting an easy way to set up these save statements and access the results from the UI, but it's not been implemented yet.
Thanks a lot Andrew!
It works just perfectly. I could swear I also looked in the results browser but of course if gm is here now, it must have been there last time as well :)
I have a second part for this question however :-D
Now, to retrieve the behavior Vs. two variables, I have to do a parametric sweep (I suppose): DC sweep VGS, par sweep VDS. This means that my gm will become a bidimensional function...A surface in a three dimensional space. I don't think that the Visualization Tool is equipped for plotting surfaces but actually what I need is plotting contours (slices of my surface).
If there is a way of doing it in Cadence, I would be glad to learn it. If not, I guess I could export the data in tabular form.
Can you point me to the place in the manuals where this topic is explained? I would also try to do it automatically, like more or less what you made me do for "save.scs"...Maybe include some "print.scs"?
Thank you very much for your help,
There's no contour capability, although you can take a slice across the data using the value() function - so maybe that is sufficient. For example, if the inner sweep is VGS and outer sweep VDS, a slice of the inner sweep would be:
value(getData("M1:gm" ?result 'dc) 0.5)
or if you want to do it for the outer sweep (the value function works by default on the inner sweep), you could do:
value(getData("M1:gm" ?result 'dc) 'VDS 0.6) ; where 'VGS is the name of the swept variable
Maybe that's what you want?
Otherwise you can save the data to a table - which version of Virtuoso are you using? (Help->About in the CIW)
Potentially there's a print statement in spectre, but I'm not sure that's really the right solution. You could add this in your save.scs :
print M1:gm, name=dc to="stuff%T.out"
I made the filename have %T so that it has a timestamp in there for each point in the parametric sweep - but this is a bit clunky. The print statement in spectre is primarily there for compatibility with other SPICE simulators, and is rarely used with spectre syntax (spectre -h print for more details; for example, it must have a comma at the end of all the outputs, which is a little strange).