Skill Problem - Change properties of instances on schematic by Skill

Discussion in 'Cadence' started by nhalex, Sep 22, 2008.

  1. nhalex

    nhalex Guest

    I've got a task to put on all the instance and change the properties.
    Though I use the function schCreateInst() to place instance on
    schematic.


    Some part of the codes like this:

    myId = dbOpenCellViewByType(libId cellName "symbol" "" "a")
    instId = schCreateInst(schId myId cellNum 1:1 "R0")
    /** from the input string: spec1 = w spec2 = l **/
    instId ~>spec1 = 0u /**actually this line dosen' work**/
    instId ~>w = 0u /** but this line works! why????? **/

    anyone could tell me how to alter it ???
     
    nhalex, Sep 22, 2008
    #1
  2. I'm guessing that you have a variable called "spec1" which has the value "w"?

    If so, you can do:

    dbSet(instId 0u spec1)

    Effectively the ~> operator is equivalent to the dbSetq() function (when used as
    an assignment; note, this isn't strictly true, but it's close enough for the
    purposes of this explanation). This "q" function means that the argument is
    implicitly quoted. So:

    instId->w=0u

    is equivalent to:

    dbSetq(instId 0u w)

    which is in turn equivalent to

    dbSet(instId 0u 'w)

    Thus, if you want the property name to be a variable, you have to prevent it
    from being quoted - you have to allow it to be evaluated. So using dbSet() (and
    dbGet() if you want to read the value rather than set it) is the answer
    here. Assuming I've understood your question!

    Regards,

    Andrew.
     
    Andrew Beckett, Sep 22, 2008
    #2
  3. nhalex

    nhalex Guest

    Thanks anyway~
    I've got new knowledge of the functions :)
     
    nhalex, Sep 23, 2008
    #3
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.