Home > Community > Forums > Custom IC SKILL > Code works a cds6 but not on cds5

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Code works a cds6 but not on cds5 

Last post Wed, Jan 30 2013 8:24 AM by Andrew Beckett. 3 replies.
Started by RVERP 28 Jan 2013 12:41 AM. Topic has 3 replies and 724 views
Page 1 of 1 (4 items)
Sort Posts:
  • Mon, Jan 28 2013 12:41 AM

    • RVERP
    • Top 500 Contributor
    • Joined on Mon, Oct 24 2011
    • Posts 27
    • Points 465
    Code works a cds6 but not on cds5 Reply

     Hi, I have a procedure witch creates a pcell.  This is working in cds 6, but when I try to use it in cds5 it goes wrong.

     First piece of code is :

    procedure( icsMatchedArrayUnit(libName cellName mosType l w pcDrainN)

     pcDefinePCell(

        ; Declare cell identifier
        list(ddGetObj(libName) cellName "layout")

        ; Set pcell parameters
        (
        (Unit int 1)
        (l float l)
        (w float w)
        (pcLibName string car(mosType))
        (pcViewName string cadr(mosType))
        (pcViewType string caddr(mosType))
        (pcDrainN int pcDrainN)
        )

     

    It goes wrong after the second line, error I get is *WARNING* Invalid cell name - nil

     

    Does somebody know what's wrong here?

    Thanks
    Rik

    • Post Points: 5
  • Mon, Jan 28 2013 3:08 AM

    • RVERP
    • Top 500 Contributor
    • Joined on Mon, Oct 24 2011
    • Posts 27
    • Points 465
    Re: Code works a cds6 but not on cds5 Reply

    Ok, I already found that if I change libName and cellName with another name they both pass.  Are these two restricted names?

    • Post Points: 5
  • Mon, Jan 28 2013 3:17 AM

    • RVERP
    • Top 500 Contributor
    • Joined on Mon, Oct 24 2011
    • Posts 27
    • Points 465
    Re: Code works a cds6 but not on cds5 Reply
    Everything seems to work now, the placement of vias caused the remaining errors
    • Post Points: 20
  • Wed, Jan 30 2013 8:24 AM

    Re: Code works a cds6 but not on cds5 Reply

    Effectively the problem is caused by the fact that you are relying on dynamic scoping when the pcell body is evaluated. The pcDefinePCell function is an "nlambda" function, and does not evaluate its arguments before it is called - because it contains code that you want to be evaluated later. As a result of this, certain variables may be being hidden by the code inside the implementation of pcDefinePCell.

    If instead you use the backquote function and then insert the values in the right place with the comma, and use eval() to evaluate the pcDefinePCell, it also works:

    procedure( icsMatchedArrayUnit(libName cellName mosType l w pcDrainN)

     eval(
      `pcDefinePCell(

        ; Declare cell identifier
        list(ddGetObj(,libName) ,cellName "layout")

        ; Set pcell parameters
        (
        (Unit int 1)
        (l float ,l)
        (w float ,w)
        (pcLibName string ,car(mosType))
        (pcViewName string ,cadr(mosType))
        (pcViewType string ,caddr(mosType))
        (pcDrainN int ,pcDrainN)
        )

        ; some dummy bit of code so that Andrew can test it
        let(()
        fprintf(stderr "Unit is %L\n" Unit)
        )
      )
     )
    )

    Andrew

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by RVERP at 28 Jan 2013 12:41 AM. Topic has 3 replies.