Code for selecting Cellnames and Instance Terms.

Discussion in 'Cadence' started by eric.d.fitzsimmons, Apr 27, 2009.

  1. All,

    I am trying to be able to select objects in schematic from SKILL. I
    want to be able to select Instances, Cellnames, Instance Terms, nets
    and pins. With the help of Riad and some work on my own I have the
    code I need for Instances, nets and pins. The code is below.

    I need code for Cellnames and Instance Terms.

    Thank you in advance for any help,
    Eric

    procedure(instSel()
    cv=geGetEditCellView()
    geSelectFig(dbFindAnyInstByName(cv "I23"))
    )
    instSel()

    ;======================procedure to select net "vbias"...replace
    "vbias" with variable....
    procedure(sigSel()
    cv=geGetEditCellView()
    vbiasNetId=dbFindNetByName(cv "vbias");gets dataid for Vbias as to get
    the and select figs attached.
    vbiasFigs=vbiasNetId~>figs
    foreach( fig vbiasFigs
    geSelectFig(fig)
    );foreach
    EFVbias="vbias";gets vias connected to vbias
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    foreach( instTerm inst~>instTerms
    Net=instTerm~>net~>name
    Term=instTerm~>name
    if(Term == "pdd" && Net == EFVbias
    then geSelectFig(dbFindAnyInstByName(cv EFInstance))
    );if
    );foreach
    );foreach
    );when
    );proc
    sigSel()

    ;======================gives top level pin for the schematic

    procedure( EFSelectPinFigs()
    let( (cv pinName matchPins term)
    cv = hiGetCurrentWindow()~>cellView
    pinName = "D";variable for pinname------------------<<<<<<<<<<<
    geDeselectAll()
    foreach( term cv~>terminals
    when( (term~>name == pinName)
    matchPins = append(matchPins term~>pins)
    ); when
    ); foreach
    foreach( pin matchPins
    when( pin && pin~>fig
    geSelectFig(pin~>fig)
    ); when
    ); foreach
    t
    ); let
    ); proc
    EFSelectPinFigs()
     
    eric.d.fitzsimmons, Apr 27, 2009
    #1
  2. eric.d.fitzsimmons

    I-F AB Guest

    Hi Eric,
    Your almost there, if I think I know what you want.
    Just a thought, when you create procedures, why not put parameters, so
    you won't have to change the code everytime (i.e. instead of a
    variable which needs to be called within the code, substitute with a
    variable/parameter which is called when running the function)?
    e.g. :
    ------------------------------------------------------------------------
    procedure( instSel(CELLNAME)
    cv=geGetEditCellView()
    geSelectFig(dbFindAnyInstByName(cv CELLNAME))
    ) ;proc
    ------------------------------------------------------------------------
    So when you want to run, you don't have to type the whole skill code
    again, just run by calling the procedure with the parameter.
    e.g. : instSel("I23")
    instSel("I122")
    instSel("MUX2_45") etc.

    So for the 2nd code:
    ------------------------------------------------------------------------
    procedure( sigSel(NETNAME)
    cv=geGetEditCellView()
    vbiasNetId=dbFindNetByName(cv NETNAME)
    ;gets dataid for Vbias as to get
    ;the and select figs attached.
    vbiasFigs=vbiasNetId~>figs
    foreach( fig vbiasFigs
    geSelectFig(fig)
    );foreach
    ;;;;;;FVbias=NETNAME ;;;;line for variable not needed now
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    foreach( instTerm inst~>instTerms
    Net=instTerm~>net~>name
    Term=instTerm~>name
    if(Term == "pdd" && Net == NETNAME
    then geSelectFig(dbFindAnyInstByName(cv EFInstance))
    );if
    );foreach
    );foreach
    );when
    );proc
    ------------------------------------------------------------------------

    Now the sigSel() function created will give a list of instances, so to
    get the cell names, do:

    MatchedInsts = sigSel("net1192") ; or "EFVbias" in your case
    MatchedInsts~>name ;gives all cellnames

    If you want to select instances by cellname, simply do:
    ------------------------------------------------------------------------
    procedure( SelInst(NAME)
    cv = geGetEditCellView()
    geSelectFig(dbFindAnyInstByName(cv NAME))
    ) ;proc
    ------------------------------------------------------------------------
    Or if you want to get the terminal names of the cellname just from
    giving the cellname: TermNameSel("NAND2_2")
    will give something like:
    ("B" "Y" "A") (or whatever corresponding terminal name)
    ------------------------------------------------------------------------
    procedure( TermNameSel(NAME)
    cv = geGetEditCellView()
    dbFindAnyInstByName(cv NAME)~>instTerms~>name
    ) ;proc
    ------------------------------------------------------------------------
    I'm not sure about selecting terminals themselves since when I use
    geGetSelSet(), the terminals can't be selected (although I can do a
    query on them, which I think is strange)

    So, for selecting terminals in schematic, I'm not sure how it can be
    done.
    Perhaps Riad or Andrew can help when the sun comes up on their side of
    the planet?

    Best Regards,
    I-FAB
     
    I-F AB, Apr 28, 2009
    #2
  3. eric.d.fitzsimmons

    Riad KACED Guest

    Hi Guys,

    Sun is shining high over the country down here in Swindon (UK). Yeah,
    Britain is not all clouds and fog :)
    A quick lines as example for the instTerm joby. I'll be back later on
    (after work hours) for more details if needed:
    ;
    procedure( EFSelectInstTerms()
    let( (cv instTermFig)
    cv = hiGetCurrentWindow()~>cellView
    geDeselectAll()
    foreach( inst cv~>instances
    foreach(instTerm inst~>instTerms
    instTermFig=car(instTerm~>term~>pins~>fig)
    when(instTermFig
    geSelectObject(instTermFig list(list(inst 0 0 0)))
    )
    )
    ); foreach
    t
    ); let
    ); proc
    ;

    Cheers,
    Riad.
     
    Riad KACED, Apr 28, 2009
    #3
  4. I-F AB wrote, on 04/28/09 04:30:
    I'm not sure what selecting "Cellnames" means, but as for instTerms, I think you
    mean selection of the pins on a specific instance (instTerms are logical
    objects, and as such can't be selected). To select these you need to use
    functions such as geSelectObject() and geGetObjectSelectedSet() which allow you
    to select/list the selected figures from down the hierarchy - for example, the
    pin figure on a specific instance.

    procedure(ABselectInstancePins(instName @optional termName
    (cv geGetEditCellView()))
    let((inst pinFigs)
    inst=dbFindAnyInstByName(cv instName)
    when(inst
    ; Find the list of pin figures which either match the specified
    ; terminal name, or give all terminals if termName not specified
    pinFigs=foreach(mapcan term
    setof(term inst~>master~>terminals !termName || term~>name==termName)
    term~>pins)~>fig
    ; note I didn't do anything for iterated instances - it just selects
    ; the pin for the first iterated instance.
    foreach(pinFig pinFigs
    geSelectObject(pinFig list(list(inst 0 0 0)))
    ) ; foreach
    ) ; when
    ) ; let
    ) ; procedure

    So for example:

    ABselectInstancePins("I1")

    will select all pins on instance I1. Or:

    ABselectInstancePins("I1" "B")

    will select all pins B on instance I1.

    Regards,

    Andrew.
     
    Andrew Beckett, Apr 28, 2009
    #4
  5. All,

    I appreciate all the examples and feedback to improve. The posts
    here gives me what I needed for selecting instTerms.

    By cellnames I mean, for example
    ("I12.bcp35_delay20.I - p2")
    This string is instance I12, Cellname bcp35_delay20, the instTerm is
    connected to net p2. For each part of the string I want to be able
    to select any part of the string from user input from a form.

    I now have everything, but cellname. Perhaps a better way of
    thinking of cellname is the cell that the instance is calling.

    Learning SKILL still has me a bit Gobsmacked!

    Thank you all for your input so far!
    Eric
     
    eric.d.fitzsimmons, Apr 28, 2009
    #5
  6. All,

    I appreciate all the feedback and code efforts. I know have all the
    code I need to select by Instances, Cellnames, instTerms, net and
    pins.

    I was able to get Cellnames on my own. I find all the instances that
    use a given cell and select the Instances.

    procedure(EFCellNameSelect(EFCellVar)
    let((EFInstance EFCellname Term Net)
    cv=geGetEditCellView()
    EFNet_list=nil
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    EFCellname=inst~>master~>cellName
    if(EFCellVar==EFCellname
    then geSelectFig(dbFindAnyInstByName(cv EFInstance))
    );if
    );foreach
    );when
    t
    );let
    );procedure

    I appreciate all your help!!
    Eric
     
    eric.d.fitzsimmons, Apr 28, 2009
    #6
  7. eric.d.fitzsimmons

    lokeshraje Guest

    Hey Just wanted to add the following peice of code:

    ;If you want to select instances by cellname
    procedure(instSel(instname);please do note that instname should be in
    double quotes
    cv=geGetEditCellView()
    geDeselectAll()
    geSelectFig(dbFindAnyInstByName(cv instname))
    );proc

    One comment is that you have to use "geDeselectAll() " to deselect all
    the figures else I was surprised to see that multiple instances are
    highlighted even though you tried to select only one instance....
    Regards,
    Lokesh rajendran.
     
    lokeshraje, May 26, 2009
    #7
  8. geSelectFig adds one figure to the selected set. It does not replace the select set.

    Regards,

    Andrew.
     
    Andrew Beckett, May 27, 2009
    #8
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.