Tether form to a specific window?

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

  1. All,

    The code below I am bringing up with the schematic and wish for it to
    always be "tethered", linked or whatever to that schematic. Meaning
    if I bring up another cell the code sometimes operates on the new
    window and I will have to click on the original(or do some operation).

    What is the code to capture the window or cell?

    Thank you in advance,
    Eric


    procedure(EFCreateNetForm()

    let((EFNetsBox EFTermsOrNet )

    cv=geGetEditCellView()
    EFNet_list=nil
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    EFCellname=inst~>master~>cellName
    foreach( instTerm inst~>instTerms
    Term=instTerm~>name
    Net=instTerm~>net~>name
    printf(EFInstance)
    printf(".")
    printf(EFCellname)
    printf(".")
    printf(Term)
    printf(" - ")
    printf(Net)
    printf("\n")

    EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))

    );foreach
    );foreach
    );when
    t
    );let

    ;sort the output
    EFNet_list=sort(EFNet_list nil)

    ;=============================================
    ;section below defines form
    ;=============================================

    EFDualMode = hiCreateRadioField(
    ?name 'EFDualMode
    ?prompt "Sort data by?"
    ?value "None"
    ?defValue "None"
    ?choices list("None" "Instance" "Cellname" "Pin" "Net")
    ?callback
    list("case(EFInstanceNetsForm->EFDualMode->value
    (\"None\"
    EFInstanceNetsForm->EFSortBy->editable = nil
    )
    (\"Instance\"
    EFInstanceNetsForm->EFSortBy->editable = t
    )
    (\"Cellname\"
    EFInstanceNetsForm->EFSortBy->editable = t
    )
    (\"Pin\"
    EFInstanceNetsForm->EFSortBy->editable = t
    )
    (\"Net\"
    EFInstanceNetsForm->EFSortBy->editable = t
    )
    )");end case
    )

    EFSortBy = hiCreateStringField(
    ?name 'EFSortBy
    ?prompt "Instance, Net, Cellname or Pin"
    ?editable nil
    ?value ""
    )

    EFNetsBox = hiCreateListBoxField(
    ?name 'EFListBoxField
    ?prompt " "
    ?choices EFNet_list
    ?value nil
    ?multipleSelect nil
    ?numRows length(EFNet_list)
    )

    ;;; defines the form

    hiCreateAppForm(
    ?name 'EFInstanceNetsForm
    ?formTitle "Instance Viewer. Data Format:Instance.Cellname.Term
    (Pin) - Net Name"
    ?callback "EFSortExecutionCB(hiGetCurrentForm())"
    ?fields
    list(
    EFDualMode
    EFSortBy
    EFNetsBox
    )
    ?help ""

    ) ; hiCreateAppForm

    hiDisplayForm(EFInstanceNetsForm)

    );procedure
    EFCreateNetForm()
    ;=================================================================
    ;After Form is up and All data is listed in list box, accept input
    ;for a sort. Create new forms for each. Use hiGetCurrentform on all.
    ;=================================================================

    procedure(EFSortExecutionCB(form)

    let((EFSortByans EFInstanceToSortBy EFCellnameToSortBy EFPinToSortBy
    EFNetToSortBy)

    EFSortByans=form->EFDualMode->value

    if(EFSortByans=="None"
    then EFSortByNoneForm()
    );if

    if(EFSortByans=="Instance"
    then EFInstanceToSortBy=form->EFSortBy->value
    EFSortByInstanceForm()
    );if

    if(EFSortByans=="Cellname"
    then EFCellnameToSortBy=form->EFSortBy->value
    EFSortByCellnameForm()
    );if

    if(EFSortByans=="Pin"
    then EFPinToSortBy=form->EFSortBy->value
    printf(EFPinToSortBy)
    EFSortByPinForm()
    );if

    if(EFSortByans=="Net"
    then EFNetToSortBy=form->EFSortBy->value
    EFSortByNetForm()
    );if


    );let
    );procedure EFSortExecution()

    procedure(EFSortByInstanceForm()

    let((EFNetsBox EFTermsOrNet EFInstanceVar)
    cv=geGetEditCellView()
    EFNet_list=nil
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    EFCellname=inst~>master~>cellName
    foreach( instTerm inst~>instTerms
    Term=instTerm~>name
    Net=instTerm~>net~>name
    if(EFInstanceToSortBy==nil
    then EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))

    );if

    if(EFInstanceToSortBy==EFInstance
    then EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))

    );if

    );foreach
    );foreach
    );when
    t
    );let

    ;sort the output
    EFNet_list=sort(EFNet_list nil)

    EFInstanceNetsForm->EFListBoxField->choices=EFNet_list

    )

    procedure(EFSortByCellnameForm()

    let((EFNetsBox EFTermsOrNet EFInstanceVar)
    cv=geGetEditCellView()
    EFNet_list=nil
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    EFCellname=inst~>master~>cellName
    foreach( instTerm inst~>instTerms
    Term=instTerm~>name
    Net=instTerm~>net~>name
    if(EFCellnameToSortBy==nil
    then EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))

    );if

    if(EFCellnameToSortBy==EFCellname
    then EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))

    );if

    );foreach
    );foreach
    );when
    t
    );let

    ;sort the output
    EFNet_list=sort(EFNet_list nil)

    EFInstanceNetsForm->EFListBoxField->choices=EFNet_list

    )

    procedure(EFSortByPinForm()

    let((EFNetsBox EFTermsOrNet EFInstanceVar)
    cv=geGetEditCellView()
    EFNet_list=nil
    printf(EFPinToSortBy)
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    EFCellname=inst~>master~>cellName
    foreach( instTerm inst~>instTerms
    Term=instTerm~>name
    Net=instTerm~>net~>name
    if(EFPinToSortBy==Term
    then EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))

    );if

    );foreach
    );foreach
    );when
    t
    );let

    ;sort the output
    EFNet_list=sort(EFNet_list nil)

    EFInstanceNetsForm->EFListBoxField->choices=EFNet_list

    )

    procedure(EFSortByNetForm()

    let((EFNetsBox EFTermsOrNet EFInstanceVar)
    cv=geGetEditCellView()
    EFNet_list=nil
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    EFCellname=inst~>master~>cellName
    foreach( instTerm inst~>instTerms
    Term=instTerm~>name
    Net=instTerm~>net~>name
    if(EFNetToSortBy==nil
    then EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))

    );if

    if(EFNetToSortBy==Net
    then EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))

    );if

    );foreach
    );foreach
    );when
    t
    );let

    ;sort the output
    EFNet_list=sort(EFNet_list nil)

    EFInstanceNetsForm->EFListBoxField->choices=EFNet_list

    )

    procedure(EFSortByNoneForm()

    let((EFNetsBox EFTermsOrNet EFInstanceVar)
    cv=geGetEditCellView()
    EFNet_list=nil
    when(cv
    foreach( inst cv~>instances
    EFInstance=inst~>name
    EFCellname=inst~>master~>cellName
    foreach( instTerm inst~>instTerms
    Term=instTerm~>name
    Net=instTerm~>net~>name
    EFNet_list=append(EFNet_list list(strcat( "|" EFInstance "."
    EFCellname "." Term " - " Net )))
    );foreach
    );foreach
    );when
    t
    );let

    ;sort the output
    EFNet_list=sort(EFNet_list nil)

    EFInstanceNetsForm->EFListBoxField->choices=EFNet_list

    )

    ;schSchFindForm->schFindPropValueString->value = "VREG1B"
    ;_hiFormApplyCB(schSchFindForm)
    ;schSchFindForm->schFindZoomButton->value = t
     
    eric.d.fitzsimmons, Apr 16, 2009
    #1
  2. eric.d.fitzsimmons

    Riad KACED Guest

    Hi Eric,

    The CV is kind of hard coded in the script. Why don't you make it as a
    user-parameter, specified either by a dbOpenCellViewByType(libName
    cellName viewName) or by geGetEditCellView(window(WINDOW_NUMBER)).
    This way the script would be tied to that cellView/window up until the
    end. Assuming I have understood your question ...

    Cheers,
    Riad.
     
    Riad KACED, Apr 16, 2009
    #2
  3. That will work!
    Thank you,
    Eric
     
    eric.d.fitzsimmons, Apr 16, 2009
    #3
  4. Eric,

    Often what I do is store the cellView or window Id as a property on the form:

    form~>currentCellView = cvId

    and then retrieve it in the callback.

    That way you can tie the form to the cellView which was current at the time the
    command was launched, rather than the cellView no longer being in the current
    window by the time the form was OK'd or Apply'd.

    Andrew.
     
    Andrew Beckett, Apr 17, 2009
    #4
  5. Thank you both for your help, I am actually starting to get some
    SKILLs :)
    Eric
     
    eric.d.fitzsimmons, Apr 17, 2009
    #5
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.