Home > Community > Forums > Custom IC SKILL > Changing instance properties though SKILL

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: *

 Changing instance properties though SKILL 

Last post Mon, Jun 30 2014 6:25 AM by Andrew Beckett. 6 replies.
Started by soathana 18 Jul 2012 06:50 AM. Topic has 6 replies and 7002 views
Page 1 of 1 (7 items)
Sort Posts:
  • Wed, Jul 18 2012 6:50 AM

    • soathana
    • Top 500 Contributor
    • Joined on Fri, Jan 13 2012
    • Posts 24
    • Points 375
    Changing instance properties though SKILL Reply

    Hi everyone I am using SKILL to generate a schematic.

    So I am using schReplaceProperty function, but i have some problems. How can I get the names used for the instance parameters? The way i do it is call:

    inst=dbCreateInst(...)

    inst=list(inst)

    schReplaceProperty(inst "name" "value") 

    So for  width appearing (in Property editor and edit object properties) "Total Width" this is not the case. Apparently When I insert for name  "Total Width" i get a user property named Total, apparently it does not like space :) 

    ideas? 

    thanks,

    Sotiris 

    Filed under: , ,
    • Post Points: 20
  • Wed, Jul 18 2012 11:27 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 395
    • Points 7,425
    Re: Changing instance properties though SKILL Reply

    The "Total Width" is the prompt defined in the CDF, so what you want to find are the names of the properties.

    In your CIW, you can type this to see the names and values:
    inst~>prop~>name
    inst~>prop~>value

    I have a little convenience command I have defined to a bindkey in the CIW (one of the function keys). First I select an instance in the schematic (or layout) and press this bindkey. It will store the car(selectedSet()) in a global variable 'X' and the cdf in a variable 'CDF' so I can easily reference them in the CIW while debugging. It also prints out all the properties, their prompts, their types and their values in an easy to read table:

    procedure(mysel()
      let((promptTable)
        X=car(geGetSelectedSet())
        promptTable = makeTable("cdfPrompts" nil)
        when(X~>objType=="inst"
            CDF = cdfGetInstCDF(X)
            foreach(p CDF~>parameters
                promptTable[p~>name] = p~>prompt
            )
        )
        printf("X  = %L   (%L)\n" X X~>objType)
        if(X~>prop then
            printf(" \nProperties on selected object:\n")
            printf("CDF Prompt                  Property Name (type)       Value\n")
            printf("============================================================\n")
            foreach(prop X~>prop
                printf("%-25s = %-25s: %L\n" promptTable[prop~>name]||"no cdf"  sprintf(nil "%s (%s)" prop~>name prop~>valueType) prop~>value)
            )
        else
            printf("No properties on selected object\n")
        )
        t
      )
    )

    Also, as a shortcut, you can set properties like this:

    inst~>name = "myname"

    You can define "name" during dbCreateInst as well.

    I hope this helps.

    Derek

     

    • Post Points: 20
  • Fri, Jul 20 2012 4:55 AM

    • soathana
    • Top 500 Contributor
    • Joined on Fri, Jan 13 2012
    • Posts 24
    • Points 375
    Re: Changing instance properties though SKILL Reply

    Hi Derek,

    Thanks for your reply.

    When you say inst~>prop~>name in ICW you mean for inst i choose the instance name in properties?

    for example I have generated the schematic through SKILL but when i type:

     "U78"~>"Total Width"~>name

     I get:

    *Error* get/getq: first arg must be either symbol, list, defstruct or user type - "U78"

    U78 is the instance name of a MOSFET, as defined through my SKILL code 

     Also when I try through my SKILL code to do:

    -------------------------------------------------------------------------------------------------------------------- 

         mstr = dbOpenCellViewByType("UMC_18_CMOS" "N_18_MM" "hspiceD")  

        inst = dbCreateInst(cvid mstr sprintf(nil "U%L" k) x:y "R0" 1)

        string=cdfGetInstCDF(inst)

        printf("%L",string~>"Total Width"~>value)  

    -------------------------------------------------------------------------------------------------------------------- 

    I get in CIW nil. 

    Any idea where the error could be?

    Thanks,

    Sotiris 

    • Post Points: 20
  • Fri, Jul 20 2012 7:49 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 395
    • Points 7,425
    Re: Changing instance properties though SKILL Reply

    Sotiris,
    The inst I was referring to is an object id like the one returned from dbCreateInst. There are several ways to get the object id:

    1. inst = dbCreateInst(cvid mstr nil x:y "R0" 1)
    2. inst = dbFindAnyInstByName(cvid "U78")
    3. Select the instance in the cellView and then do: inst = car(selectedSet())

    You need to understand the difference between the objects and their names and in the case of parameters, their prompts can be different from the names. Just as you can't do  "U78"~>, you also can't do "Total Width"~>. The reason I sent you the sample procedure called "mysel" was to show you how to identify the the parameter name so you can access the parameter object.

    cdfGetInstCDF is going to return an object id for the cdf, it is not going to return a string. Try loading and running the procedure I sent. Hopefully this will clarify some things for you. Load the code in the CIW, select the instance in your schematic and then run mysel() in your CIW.

    cdf = cdfGetInstCDF(inst)
    This will get the cdf for the instance object id stored in the variable called inst. From this cdf object id, you can then obtain other information from its attributes and properties. To see what is availble on that object id, do the following in your CIW:

    cdf~>?
    cdf~>??
    cdf~>parameters~>?
    cdf~>parameters~>??

    If the inst you are referring to is a pcell with a cdf, you should see a list of object ids when you do ~>? and a list of lists of each object's  attributes and values when you do ~>??.

    Let's say you have a cdf and one of the prompts is "Total Width". You can get this specific parameter from the cdf this way:
    tw = car(setof(x cdf~>parameters x~>prompt=="Total Width))

    The setof command looks at all the parameter ids and finds the one with a prompt attribute equal to "Total Width". It returns this parameter in a list, so we take the car of it and store it in a variable called tw. Now, you can get its name:
    tw~>name
    tw~>value

    Once you know that name, you can access it directly on the inst id. Lets say the name of the "Total Width" parameter is "totalWidth", then you can do this:
    inst~>totalWidth
    or
    inst~>master~>parameters~>totalWidth

    Do some playing around until you get comfortable with object ids.

    Derek

    • Post Points: 20
  • Mon, Jul 23 2012 8:54 AM

    • soathana
    • Top 500 Contributor
    • Joined on Fri, Jan 13 2012
    • Posts 24
    • Points 375
    Re: Changing instance properties though SKILL Reply
    Thanks Derek! This was very helpful! I was confused over whether to call something by its name /instance id etc. Now its solved and my SKILL script works just fine! Thanks again, Sotiris
    • Post Points: 20
  • Mon, Jun 30 2014 6:22 AM

    • BALBOA
    • Not Ranked
    • Joined on Mon, Jun 30 2014
    • Bangalore, Karnataka
    • Posts 3
    • Points 60
    Re: Changing instance properties though SKILL Reply

     Hi Derek,

    I accessed the number of fingers & width using cdf command.

     The code is

      x=car(geGetSelectedSet())
    x~>objType=="inst"
    cdf = cdfGetInstCDF(x)
    cdf~>parameters


    fingers = car(setof(x cdf~>parameters x~>name=="mi"))

    num_of_fingers=fingers~>value=1

     

    But when i force the value to change to some other value, its giving a warning saying,

                        *WARNING* Invalid CDF param value

    The MOS just disappears, & there will be a text layer in the laout window saying 

                        "pcell Eval Failed".

    Please help me out,

     

    Thanks & Regards,

    Girish B.S

    • Post Points: 20
  • Mon, Jun 30 2014 6:25 AM

    Re: Changing instance properties though SKILL Reply

    Maybe the parameter value is supposed to be a string? The fingers~>?? should show you the type. If it's a string, set the value to "1" (in quotes).

    Andrew.

    • Post Points: 5
Page 1 of 1 (7 items)
Sort Posts:
Started by soathana at 18 Jul 2012 06:50 AM. Topic has 6 replies.