EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

rodCreatePath pts conditional (if/then)

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Cadence - rodCreatePath pts conditional (if/then)

Rick Mattern
Guest

Wed Sep 15, 2010 5:55 pm   



is it possible to create a rodPath with conditional pts? If so, what
is the correct syntax?

for( i 0 pVdrainCnt
pOutRx = pOutRx + pOutRxstep
;; place a via at x,y
rodCreatePath( ?cvId cv
?layer list(metal1Layer "drawing")
?width outConnWidth

?pts list( if( f_n_a > 1 then
pOutRx:0.315 + w_p_b_int_Micro pOutRx:0

else

pOutRx:0.315 + w_p_b_int_Micro + 0.5 pOutRx:0)))
); for

Thanks

Rick

Marcel Preda
Guest

Thu Sep 16, 2010 1:19 pm   



On Sep 15, 5:55 pm, Rick Mattern <ejm2...@gmail.com> wrote:
Quote:
is it possible to create a rodPath with conditional pts?   If so, what
is the correct syntax?

for( i 0 pVdrainCnt
  pOutRx = pOutRx + pOutRxstep
  ;; place a via at x,y
       rodCreatePath( ?cvId cv
        ?layer  list(metal1Layer "drawing")
        ?width   outConnWidth

                 ?pts list( if( f_n_a > 1 then
                        pOutRx:0.315 + w_p_b_int_Micro  pOutRx:0

                        else

                        pOutRx:0.315 + w_p_b_int_Micro + 0.5  pOutRx:0)))
   ); for

Thanks

Rick

Hi,

Probable you want somethimg like
//~~~~~~~~~~~~~~~~~~~~~~~~
for( i 0 pVdrainCnt
pOutRx = pOutRx + pOutRxstep
;; place a via at x,y
rodCreatePath( ?cvId cv
?layer list(metal1Layer "drawing")
?width outConnWidth

?pts if( f_n_a > 1 then
list(pOutRx:0.315 + w_p_b_int_Micro
pOutRx:0)
else
list(pOutRx:0.315 + w_p_b_int_Micro + 0.5
pOutRx:0))
) ; if
); for
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But, I personnaly will put the if/else just before rodCreatePath()
call, into a local var.
The code is more readable.

BR,
Marcel

Rick Mattern
Guest

Thu Sep 16, 2010 7:53 pm   



On Sep 16, 3:19 am, Marcel Preda <marcel.pr...@gmail.com> wrote:
Quote:
On Sep 15, 5:55 pm, Rick Mattern <ejm2...@gmail.com> wrote:



is it possible to create a rodPath with conditional pts?   If so, what
is the correct syntax?

for( i 0 pVdrainCnt
  pOutRx = pOutRx + pOutRxstep
  ;; place a via at x,y
       rodCreatePath( ?cvId cv
        ?layer  list(metal1Layer "drawing")
        ?width   outConnWidth

                 ?pts list( if( f_n_a > 1 then
                        pOutRx:0.315 + w_p_b_int_Micro  pOutRx:0

                        else

                        pOutRx:0.315 + w_p_b_int_Micro + 0.5  pOutRx:0)))
   ); for

Thanks

Rick

Hi,

Probable you want somethimg like
//~~~~~~~~~~~~~~~~~~~~~~~~
for( i 0 pVdrainCnt
  pOutRx = pOutRx + pOutRxstep
  ;; place a via at x,y
       rodCreatePath( ?cvId cv
        ?layer  list(metal1Layer "drawing")
        ?width   outConnWidth

                 ?pts if( f_n_a > 1 then
                            list(pOutRx:0.315 + w_p_b_int_Micro
pOutRx:0)
                        else
                            list(pOutRx:0.315 + w_p_b_int_Micro + 0.5
pOutRx:0))
                        ) ; if
   ); for
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But, I personnaly will put the if/else just before rodCreatePath()
call, into a local var.
The code is more readable.

BR,
Marcel

Thanks for the reply. The reason to have it nested is to change the
pts at a certain trip point.
However, it seems to change the behavior of the for loop.

Rick

Andrew Beckett
Guest

Sun Sep 26, 2010 3:56 pm   



Rick Mattern wrote, on 09/16/10 17:53:
Quote:
Thanks for the reply. The reason to have it nested is to change the
pts at a certain trip point.
However, it seems to change the behavior of the for loop.

Rick

What do you mean by it changing the behaviour of the for loop? I can't see how
that would happen. If that's a problem for you still, you might want to elaborate.

The problem (that Marcel fixed) was that the if() was only returning the second
coordinate, and so the list passed to ?pts only had a single point in it. Since
you needed the if() to return a list of points, it was necessary to put the
list() inside the then/else parts of the if() call.

Regards,

Andrew.

elektroda.net NewsGroups Forum Index - Cadence - rodCreatePath pts conditional (if/then)

Ask a question - edaboard.com

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony