Quantcast
Channel: Cadence Custom IC Design Forum
Viewing all articles
Browse latest Browse all 4897

Use if statement to define parameters in Monte Carlo simulation

$
0
0

Hi everyone,

in adexl I have a global variable "IFL", is has only four values 1,2,3,4. In Monte Carlo simulation, I would like to randomly select value of "IFL" from them, so in scs file I write:

parameters
     IFL_value=0 \
     ifl=0
if (IFL_value < 1/4) {
   ifl=1
} else if (IFL_value< 2/4) {
   ifl=2
} else if (IFL_value < 3/4) {
   ifl=3
} else { ifl=4 }

statistics {

 process{   vary IFL_value dist=unif N=1

 }

}

And in global variable, "IFL" is "ifl". And I get following error, it looks like I did something wrong in if statement.

Cannot run the simulation because syntax error `Unexpected equals "="' was encountered at line 21, column 6. Correct the syntax error and rerun the simulation.

So should I change the code to something like:

ifl = {

if (IFL_value < 1/4) : 1

else if (IFL_value < 2/4)  :2

............

}

Or is there any other solution? Any feedback would be appreciated


Viewing all articles
Browse latest Browse all 4897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>