You seem to have removed the contents of your post. Was that intentional?
In reply to Andrew Beckett:
I dont know what happened then.
I want to ask about oceanscript to run corner.
Setup to run for -40, 27 150degC separately. There is no problem when I run 27deg and 150, however in -40deg, it is not able to run.
error mgs: is unbound variable - temp
error while loading file - "xxx.ocn"
problem resolve if i remove temp in ocnPrint and use temp instead of foreach loop?
How can I run -40degC and print the result?
Here is my part of my script;
for each(corner myCors
ocnPrint("corner" corner "temp" y1 "vgs" vgs)
In reply to yeong:
Have you tried defining y1 as a double prior to the foreach() statement? Specifically, prior to your foreach() statement, use a statement such as:
y1 = -40.0
foreach(y1 '(27.0 150.0 -40.0)
In this fashion, y1 is declared as a double. I have experienced similar errors if y1 is not defined prior to its use in temp().
In reply to smlogan:
I have used the same script for 27 and 150 deg. Both works fine.
I have define temp previous which is not included in the scipt in my first post.
this is my full script.
simulator( 'spectre )
resultsDir( "/xxx/spectre/schematic" )
analysis('ac ?start "1" ?stop
"1G" ?dec "50" )
analysis('dc ?saveOppoint t )
desVar( "cap_factor" 1 )
desVar( "iled" 16m )
desVar( "i" 848u )
option( 'temp "150.0"
saveOption( 'subcktprobelvl "5" )
temp( 150.0 )
myCors=list("ff_lib" "tt_lib" "ss_lib")
foreach(y2 '(1m 10m)
foreach(y3 '(1u 5u)
differnetial_psrr = dB20((VF("/psrr") - VF("/ref")))
plot( differnetial_psrr ?expr '( "differnetial psrr" ) )
differential_psrr_3dB_BW = cross(dB20(VF("/psrr")) (value(dB20(VF("/psrr"))
1) + 3) 1 "either" nil nil)
;plot( differential_psrr_3dB_BW ?expr '( "differential_psrr_3dB BW" )
differential_psrr_dB_DC = value(dB20((VF("/psrr") -
;plot( differential_psrr_dB_DC ?expr '( "differential_psrr_dB_DC" )
differential_psrr_dB_max = ymax(dB20((VF("/psrr") -
ctr = VAR("ctr")
iled = VAR("iled")
ocnPrint("corner" corner "temp" y1 "iled" iled
"ctr" ctr "differnetial_psrr_dc" differential_psrr_dB_DC
"differential_psrr_dB_MIN" differential_psrr_dB_max ?output
smlogany1 = -40.0foreach(y1 '(27.0 150.0 -40.0)
Shawn - this is absolutely unnecessary. SKILL doesn't require you to "declare" variables - and the type of a variable may change over time. In fact the foreach will cause a local variable y1 to be defined for the duration of the foreach - when the foreach completes, the previous value will become visible again (or if it was not defined, it will be unbound). That's fine...
I looked at the latest code posted by Yen, and it works OK (I had to adjust it to reflect signal names in my own testcase ,but apart from that it worked fine).
The most likely issue was that you may have accidentally had:
i.e. a space between the temp and the open parenthesis. This would have caused temp to be seen as a variable, followed by a function call to a function called y1. And that would result in:
*Error* eval: unbound variable - temp*Error* load: error while loading file - "forum.ocn" at line 43
There is no space btw temp and the open parenthesis.
Does it work for you if you set the temp to -40, ie
I see the following:
*Error* for each: second argument must be a list -40*Error* load: error while loading file - "ps.ocn"
No problem if i run the following:
.....foreach(y1 '(-40 150)temp(y1)....
I'm running each temp as it as because for each temp has different i variable.
Ah, I see. This seems to be an odd quirk of the parser. I don't really see a good reason for this - it seems peculiar to me.
Replace '(-40) with list(-40) and it will then work fine.
You can see this directly if you do:
'(-40) => -40'(40) => (40)
I'll have a chat with R&D about this. I think it's been this way forever though!
I checked, and it's to allow removal of (potential) ambiguity between a binary and unary minus. So you can then use 1+(-40). Not sure it's strictly essential, but that's the way it is. It will only affect a quoted list of a single negative number - and using list() is a reasonable workaround.
This is exactly the issue I have encountered numerous times. It was my motivation for suggesting declaring the variable. I fully realize that declaring a variable is not necssary - but this is how I workaround the issue you note.
But your workaround cannot possibly make a difference. Sorry!
I'm not sure which issue you're referring to - but it won't help...
Everything works fine. Thanks.Another question:
In ocean, how can i save the all corners simualtion results in a directory and retrieveit later? I tried to plot the from result brower, but it only save the last run.
Why not just use something like:
sprintf(myResultsDir "/xxx%s_%d%g" corner temp iled)
Andrew,This works, however the file name doesnt match the variables used.
sprintf(myResultsDir "/xxx%s_%d%g" corner temp iled)
I have to use sprintf(myResultsDir "/xxx%s_%d%g" corner y1 y2) instead. In this case the file name matches the variable.
Any reason why?
I want to print my output as follows:
corner temp iled i differential_psrr etc etctt_lib -40 1m 1u 60.34 xx xx
I tried to use fprintf instead of ocnPrint. Simulation completed without error, however there is no data in the output file. There is no problem using ocnPrint, just need to organise it a bit in excel.
This is what i use:
Also, I have quite a bit of expressions, how can i output the data in a more efficient manner?