Select schematic instance from instance iterations

Discussion in 'Cadence' started by Robin, Mar 1, 2011.

  1. Robin

    Robin Guest

    Hello,

    I have a question, how do i select in SKILL a single instance from a
    instance?

    This is my situation:
    I have a schematic with a instance I5<153:0> and this instance has 7
    pins.
    Connected to these pins are nets with "complex" net names.
    Like
    this :"<*4>(<*16>coladdr<4>,<*16>coladdr_<4>),<*16>coladdr<4>,<*10>coladdr_<4>".

    I wanted to make a generic skill script that selects each iteration
    (e.g. I5<15>) and generate a via matrix to forsee the correct connects
    at his pins in layout.

    However I have difficulties finding the right attribute to get the
    list of the iterations.

    This is how far i got:
    libName = "my_lib"
    cellName = "my_cell"

    targetInstanceName= "my_instname<153:0>"

    cvId=dbOpenCellViewByType(libName cellName "schematic" "schematic"
    "r");

    instList=cvId~>instances;

    n=length(instList);
    targetPosition=0;
    for( index 0 n
    if(nth(index instList)~>name == targetInstanceName
    then
    targetPosition=index;
    )
    )

    targetInstance=nth(targetPosition instList);

    From here i wanted to make an array from the iterations as objects and
    then see what the connections should be for each pin.

    Thanks for your help,

    Robin
     
    Robin, Mar 1, 2011
    #1
  2. Robin

    Marcel Preda Guest

    Hi Robin,

    Could you explain what data structure do you want to have at the end ?
    And I think that the code that you wrote above can be replaced with
    targetInstance = dbGetInstByName(cvId targetInstanceName)

    At least it is (much) faster.

    BR,
    Marcel
     
    Marcel Preda, Mar 2, 2011
    #2
  3. Marcel Preda wrote, on 03/02/11 10:42:
    I agree with Marcel - the way you're doing it is terribly inefficient. First of
    all you're treating the list you have as an array - it is NOT random access, and
    so you are having to do a sequential search from the beginning of the list each
    time you call nth(), and so that loop will be doing (roughly) N^2/2 (where N is
    the number of instances). A foreach loop would be better, but best is the
    dbGetInstByName() function.

    Then you probably want:

    dbGetMemName(targetInstanceName 23) => "my_instname<130>"

    or

    dbProduceMemName(targetInstanceName)
    ("my_instname<153>" "my_instname<152>" "my_instname<151>" "my_instname<150>"
    "my_instname<149>"
    "my_instname<148>" "my_instname<147>" "my_instname<146>" "my_instname<145>"
    "my_instname<144>"
    "my_instname<143>" "my_instname<142>" "my_instname<141>" "my_instname<140>"
    "my_instname<139>" ... )

    dbGetNameNumBit(targetInstanceName) => 154

    could be useful too.

    You can use these same functions on the expression
    "<*4>(<*16>coladdr<4>,<*16>coladdr_<4>),<*16>coladdr<4>,<*10>coladdr_<4>" too.
    For example:

    dbGetMemName("<*4>(<*16>coladdr<4>,<*16>coladdr_<4>),<*16>coladdr<4>,<*10>coladdr_<4>"
    23) => "coladdr_<4>"

    Regards,

    Andrew.
     
    Andrew Beckett, Mar 7, 2011
    #3
  4. Robin

    Robin Guest

    Hi andrew,



    Thanks for your reply. I'm just a beginner so don't know these
    functions yet. It's like my 3th SKILL script ever :)

    Thats why i taken the most elementary approach. I do realize its not
    so magnificient efficient but i thoughed it was the only way. Thanks
    for that tip. Will be very handy later :)

    Back to the actual problem, I solved it by making a spectre netlist
    and then parsing it. Also not efficient but at that time i saw it as
    the only solution :)

    Thanks for the tips,

    Robin
     
    Robin, Mar 9, 2011
    #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.