• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Changing instance properties though SKILL

Stats

  • Locked Locked
  • Replies 13
  • Subscribers 145
  • Views 32038
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Changing instance properties though SKILL

soathana
soathana over 13 years ago

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 

  • Cancel
  • dmay
    dmay over 13 years ago

    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

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • soathana
    soathana over 13 years ago

    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 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 13 years ago

    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

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • soathana
    soathana over 13 years ago
    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
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • BALBOA
    BALBOA over 11 years ago

     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

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    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.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Jynee
    Jynee over 8 years ago

    Hi Derek, 

    When I try inst~>? , I won't see "totalWidth" in the output. But why when we type "inst~>totalWidth", there are output value? 

    Hope you may help. 

    Thanks

    ShyJiun

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    ShyJiun,

    There are two possibilities here. First of all, instance properties have objects of their own, and aren't directly visible on the inst object. There is a list of such property objects which you'd find as inst~>prop - so you could see the names with inst~>prop~>name and the values with inst~>prop~>value. Using inst~>totalWidth is a shortcut to avoid having to use dbFindProp to find the property, and then retrieve the value. However, if you have $CDS_Netlisting_Mode set to "Analog" then the inst~>totalWidth will first look for a user-defined property on the instance and retrieve that if it's there, and if not, it will look for a CDF property called the same thing and retrieve the default value.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Jynee
    Jynee over 8 years ago
    Hi Andrew,
    Thanks for your prompt response.
    totalWidth is not one of the item from "inst~>prop~>name".
    I tried to search online and the only possible reason I found is because totalWidth is default value. Therefore, it is not shown as one of the "inst~>prop~>name". But why it output a value when I input "inst~>totalWidth"?

    Thanks
    ~ShyJiun
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I explained that in my previous reply. It gets the default value from the CDF (typically the cell CDF, as you'd see in the CIW Tools-CDF-Edit form for whatever cell this is an instance of; I say "typically" because it could be the lib CDF, although that isn't usually used for parameters because you normally don't want to have parameters which exist for every cell in a library)

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
>

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information