rodCreatePath pts conditional (if/then)

Discussion in 'Cadence' started by Rick Mattern, Sep 15, 2010.

  1. Rick Mattern

    Rick Mattern Guest

    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
     
    Rick Mattern, Sep 15, 2010
    #1
  2. Rick Mattern

    Marcel Preda Guest

    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
     
    Marcel Preda, Sep 16, 2010
    #2
  3. Rick Mattern

    Rick Mattern Guest

    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
     
    Rick Mattern, Sep 16, 2010
    #3
  4. Rick Mattern wrote, on 09/16/10 17:53:
    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.
     
    Andrew Beckett, Sep 26, 2010
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.