The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 6th, 2024, 11:14pm
Pages: 1
Send Topic Print
Conditional AEL in CDF (Cadence/icfb)? (Read 1079 times)
Haydar
New Member
*
Offline



Posts: 8
Portland, OR
Conditional AEL in CDF (Cadence/icfb)?
Jan 22nd, 2009, 12:07pm
 
Can I have a conditional expression in the CDF to determine a device value? The AEL document lists "?:" as a valid operator but it didn't work for me.

For example, assuming p1 is already defined and I try to make the value of the resistor r dependent on the value of parameter p1.

(iPar("p1")==1) ? 10 : 20

Thanks,

-Haydar
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Conditional AEL in CDF (Cadence/icfb)?
Reply #1 - Jan 22nd, 2009, 4:24pm
 
The ternary operator is supported in AEL, as the code below shows:

Code:
> e=aelEnvCreate("f")
aelEnv:0x08e38018
> aelEnvInterpret(e "1==1?10:20")
"10.0"
> aelEnvInterpret(e "1==2?10:20")
"20.0"
> 



How did you test it? Was it for a particular netlister? For example, the spectre netlister wouldn't fully evaluate the expression (I think) - it would end up in the netlist (the iPar would get replaced), but spectre can also handle this expression.

Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
Haydar
New Member
*
Offline



Posts: 8
Portland, OR
Re: Conditional AEL in CDF (Cadence/icfb)?
Reply #2 - Jan 23rd, 2009, 1:41pm
 
I test this under the Tools->CDF->Edit tab, not through skill code.

I tried some more and have somewhat puzzling results:
For a resistor which has parameters p1, p2, p3 added,
I make the resistor value r dependent on parameter values via a conditional and observe these:

(iPar("p1")==1)?10:20                        -> Works
(iPar("p1")==1)?iPar("p2"):20             -> Works
(iPar("p1")==1)?iPar("p2"):iPar("p3")   -> Doesn't work

When it doesn't work, Virtuoso schematic shows "*Error*" on the schematic, otherwise it shows the actual evaluated value.

Thanks,

-Haydar
Back to top
 
« Last Edit: Jan 23rd, 2009, 4:00pm by Haydar »  
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Conditional AEL in CDF (Cadence/icfb)?
Reply #3 - Jan 27th, 2009, 1:20pm
 
I did some tests, and put together a component with CDF as you describe. I got an error on the label when it tried to evaluate it, so I called

Code:
artSetDetailedLabelErrorFlag(t) 



as suggested in the CIW. When I do this I get an error in the attached picture. I tried adding some extra parentheses, but it didn't help...

You should contact Cadence customer support and report this.

Regards,

Andrew.
Back to top
 

AELerr.png
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.