Hello,
I was wondering, is it possible to write a script that interactively changes a design variable in a while loop? My idea is to measure a voltage at a node of a transistor and if it is less than a given value, change the size of the transistor. I have experience in C/C++ programming so the algorithm there would be something like
while(voltage < VALUE){
change transistor size
calculate voltage
}
I tried to implement something like that in OCEAN, but got an error:
*Error* eval: not a function - set_W_tail(W_tail_temp)
this function is my own and is given below...
the code is given below:
; initial setup stuff
ocnWaveformTool( 'wavescan )
simulator( 'spectre )
design( "/home/Cadence/cadence/simulation/Ocean_test/spectre/schematic/netlist/netlist")
resultsDir( "/home/Cadence/cadence/simulation/Ocean_test/spectre/schematic" )
modelFile(
'("/opt/ncsu-cdk/models/spectre/standalone/tsmc25N.m" "")
'("/opt/ncsu-cdk/models/spectre/standalone/tsmc25P.m" "")
)
desVar( "ibias" 10u )
desVar( "in_n" 1.25 )
desVar( "in_p" 1.25 )
desVar( "vdd" 2.5 )
desVar( "W_tail" 1u )
temp( 27 )
; function that gets the new transistor Width value. It should alter the W_tail design variable and run the calculations again
procedure( set_W_tail(W)
desVar( "W_tail" W )
run()
selectResult( 'tran )
ICMmax = evalstring(desVar("vdd")) - value(v("/net21") 1e-6) ;calculate the voltage at a transistor node when X=1us
;printf("width = %f \n" ICMmax)
ICMmax ; the value that is returned by the function
)
specICMmax = 0.1
W_tail_temp = evalstring(desVar("W_tail"))
analysis('tran ?stop "50u" )
run()
selectResult( 'tran )
measuredICMmax = evalstring(desVar("vdd")) - value(v("/net21") 1e-6)
;here I should theoretically change the width until the condition is met
while( (measuredICMmax > specICMmax) (measuredICMmax=set_W_tail(W_tail_temp) W_tail_temp=W_tail_temp+1e-6)))
So the main question would be - is it possible to change a design parameter and run a simulation (evaluate the altered parameter) in a WHILE loop? (maybe it is done using something else). All examples just use printf or something like that with while loops...