I am simulating a floating gate memory model custom made in verilog. I am running several simulations using an Ocean script with varying parameters to determine total charge, time to reach total charge, retention time, etc. All of these must be done with transient analysis.
My question is how do I abort a transient analysis once the maximum charge is reached (there is a node in the model that displays the charge that can be read as a voltage). The problem is when I run transient analysis, it takes an incredibly long time because the charge is constantly changing due to thermal effects and my time step is in the picosecond range. I have tried setting the step to a larger value using the ?step parameter for the analysis command, but that did not change anything.
Once the simulation is complete, I have the code to scan the waveform, find the maximum charge, how long it took to reach this value, print the information to a text file, change parameters and repeat. The only problem is the time to run the simulation. It takes up to 5 minutes and I have thousands of simulations to run for each data point. Also, the time it takes to reach the maximum charge varies with the parameters so I can not just set the transient analysis to a very small value. Right now it is at 1 microsecond.
So, I am looking for the analysis parameters that would allow me to stop after reaching the maximum charge. This could be found by a simple if statement that says if the same maximum is reached twice, stop the experiment. The charge on the floating gate changes by 1 due to thermal effects every few picoseconds and this is why the simulation takes so long.
For MDL-based autostop, there are examples in the installation. Look in <MMSIMinstDir>/tools/spectre/examples/MDL_workshop and you'll find a PDF and gzipped tar file showing you the data. Within the workshop, at least dflip/autostop.mdl is one (you may have others depending on the version you're using - do a grep for autostop). As with the VerilogA based solution, you need to have some criteria by which to decide to stop.
With VerilogA, there's no reason why you couldn't detect when (say) the derivative of the charge crosses 0 (i.e. the slope flattens and then goes negative). Or you could check it's been negative for a while. Really depends on how you want to decide whether to stop.
I don't know what you mean by "manually run a transient analysis". You can run spectre from the command line, if that's what you mean?