• 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. Select cell view from lib manager

Stats

  • Locked Locked
  • Replies 19
  • Subscribers 143
  • Views 22121
  • 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

Select cell view from lib manager

netbug
netbug over 8 years ago

Dear all,

I have a script which allows the user to select a cell view from the library manager, without opening prompting the user. The user selects, in first place, the cell view from the library manager and only then the user should press the button for the script to run. As this is counter-intuitive for some, I would like to have the opposite. When user clicks the "select" button it will open the lib manager, so the user can choose the cell view.

This is described in Cadence documentation, and an example is given for the "ddsUpdateSyncWithForm" command. However this method uses three text boxes (string fields) which get the values for lib, cell and view. But in my case, I would like to use a single text box instead of three, and I can't do it. I've tried to pass the values (lib,cell,view) with variables but it didn't work.

Second question. In the code, you can see that I have to identical "procedures". The only difference is that one is executed when button 1 is pressed and the second when button 2 is pressed. How can I detect which button has been pressed, so I can do a generic function for both.

 

Thanks in advance.

Best regards,

José

 

My code


;==============================================================================
;============================== main function ================================
;==============================================================================

procedure(main()
let((retValue)

; Create the form
retValue=CreateMainForm()
putprop( 'settingsForm 'myHelpCB 'hiHelpAction) ; Customize the information displayed by the Help button

declare(selectedViewArray[2])
selectedViewArray[0]=""
selectedViewArray[1]=""
);end let
) ; end procedure

;==============================================================================
;=============== Display main Form - Create Main form" =======================
;==============================================================================

procedure(CreateMainForm()
let((label1 doneButton settingsForm cellView1 cellView2 selectButton1 selectButton2 selectButton3 sep1)
; template loading and saving

label1=hiCreateLabel(
?name 'label1
?labelText "SUMMARY FILE'S COMPARISON"
?justification 'center
)

sep1=hiCreateSeparatorField(?name 'sep1)

cellView1 = hiCreateStringField(
?name 'cellView1
?prompt "Summary file 1 :"
?value "Please select a summary file"
?editable nil

)

cellView2 = hiCreateStringField(
?name 'cellView2
?prompt "Summary file 2 :"
?value "Please select a summary file"
?editable nil
)

selectButton1=hiCreateButton(
?name 'selectButton1
?buttonText "Select"
?callback "cb_button1_pressed()"
)

selectButton2=hiCreateButton(
?name 'selectButton2
?buttonText "Select"
?callback "cb_button2_pressed()"
)

selectButton3=hiCreateButton(
?name 'selectButton3
?buttonText "Compare !"
?callback "cb_button3_pressed()"
)


hiCreateAppForm(
?name 'settingsForm
?formTitle "Compare summary files"
;?callback list("testOK()" "testCancel()")
?buttonLayout 'Close
?fields list(
list(label1 10:10 600:0 40)
list(sep1 0:35 600:0)
list(cellView1 15:50 500:30 100)
list(cellView2 15:85 500:30 100)
;list(cellView2 300:8 55:30)
;list(selectLabel 15:70 45:20 200)
list(selectButton1 520:50 50:30)
list(selectButton2 520:85 50:30)
list(selectButton3 120:120 90:30)
) ; end list
) ; create form

hiDisplayForm(settingsForm) ; Display form
); end let
); end procedure


;==============================================================================
;=============== Select button1 pressed "cb_button1_pressed" ====================
;==============================================================================
procedure(cb_button1_pressed()
let((selectedView libName cellName viewName pathToSelectedView)
;printf("Test!")
selectedView=ddsGetLibManLCV() ; list containing the the "lib", "cell" and "view", when clicked in lib manager

; separate the list into different variables
libName=nth(0 selectedView)
cellName=nth(1 selectedView)
viewName=nth(2 selectedView)

if(rexMatchp("small_sum" viewName)==t then ; checks if "small_sum" exist in the name of the cell view
; outputs the path to the cell view in the list
pathToSelectedView=ddGetObjReadPath(ddGetObj(libName cellName viewName "*"))

; creates a string in the format "cellname -> viewName" and copies it to the textbox
sprintf(cellViewStr "\n%s -> %s" cellName viewName)
get(settingsForm settingsForm->cellView1->value=cellViewStr)
;printf("Button 1 pressed\n")
;printf(pathToSelectedView)

selectedViewArray[0]=pathToSelectedView

else
dispMessage("Cellview must be text !")

) ;end if
) ;end let

) ;end procedure


;==============================================================================
;=============== Select button2 pressed "cb_button2_pressed" ====================
;==============================================================================
procedure(cb_button2_pressed()
let((selectedView libName cellName viewName pathToSelectedView)
;printf("Test!")
selectedView=ddsGetLibManLCV() ; list containing the the "lib", "cell" and "view", when clicked in lib manager

; separate the list into different variables
libName=nth(0 selectedView)
cellName=nth(1 selectedView)
viewName=nth(2 selectedView)

if(rexMatchp("small_sum" viewName)==t then

; outputs the path to the cell view in the list
pathToSelectedView=ddGetObjReadPath(ddGetObj(libName cellName viewName "*"))

; creates a string in the format "cellname -> viewName" and copies it to the textbox
sprintf(cellViewStr "\n%s -> %s" cellName viewName)
get(settingsForm settingsForm->cellView2->value=cellViewStr)

;printf("Button 2 pressed\n")
;printf(pathToSelectedView)
selectedViewArray[1]=pathToSelectedView

else
dispMessage("Cellview must be text !")
) ;end if


) ;end let
) ;end procedure

;==============================================================================
;=============== Compare Button "cb_button3_pressed" ====================
;==============================================================================
procedure(cb_button3_pressed()
let((str)

; checks if both textboxes aren't empty
if(cellView1->value!="Please select a summary file" && cellView2->value!="Please select a summary file" then
str=sprintf(test "tkdiff %s %s" selectedViewArray[0] selectedViewArray[1]) ; string having the full command to be executed in the shell

csh(str) ; executes the command on linux shell

; Re-initialise text boxes after closing tkdiff editor
get(settingsForm settingsForm->cellView1->value="Please select a summary file")
get(settingsForm settingsForm->cellView2->value="Please select a summary file")
else
dispMessage("Please select two views to be compared !!" )
) ;end if

) ;end let
) ;end procedure

;==============================================================================
;===================== Display Message "dispMessage" =========================
;==============================================================================
procedure(dispMessage( message )
hiDisplayAppDBox(
?name gensym('mybox)
?dboxBanner "Message"
?dboxText message
?dialogStyle 'modeless
?dialogType hicMessageDialog
?buttonLayout 'Close
) ; hiDisplayAppDBox
); End procedure


;==============================================================================
;===================== Building myHelpCB funtion =============================
;==============================================================================

procedure(myHelpCB(arg1 arg2 arg3 arg4)
let((helpStrMsg)

; Help Message
helpStrMsg="\n\
DESCRIPTION\n\
\tSummary file 1 - first summary view selected from the lib manager\n\
\tSummary file 2 - second summary view selected from the lib manager\n\
\t\"Select\" buttons- retrieve the name of the selected views from the lib manager\n\
\t\"Compare\" button - triggers \"tkdiff\" from linux in order to compare both views\n\n\
SUMMARY: \n\
\t1 - Click on the desired cell view from the \"Library manager\"\n\
\t2 - Click the correspondent \"Select\" button.\n\
\t3 - Hit the \"Compare\" button.\n"


hiDisplayAppDBox(
?name gensym("dbox")
?dboxBanner "compViews script HELP"
?dboxText helpStrMsg
?dialogType hicInformationDialog
?dialogStyle 'modeless
?buttonLayout 'Close
)
)
)



  • Cancel
Parents
  • netbug
    netbug over 8 years ago

    Dear Andrew,

    I would like to add a toggle field and String field. The string field will appear/disappear according to the value of the toggle field.

    I went through your oferExample code, but I am not really able to get the same result as you. I didn't understand how do the "extraFields" work. More over I can't understand how the form can be refreshed on-the-fly.

    Please find below an excerpt of my code. Please let me know if you need the full code.

    Thanks in advance.

    Best regards,

    José

    ;==============================================================================

    ;===============  Display main Form - Create Main form" =======================

    ;==============================================================================

    procedure(CreateMainForm()

       let((label1 doneButton settingsForm cellView1 cellView2 selectButton1 selectButton2 selectButton3 sep1 myToggle)

       myToggle = hiCreateToggleField(

     ?name 'myToggle

     ?choices list('(toggleLabel "Save summary file ?"))

     ?value '(nil)

     ?numSelect 1

     ?callback list("cb_checkbox()")

       )

       userPath = hiCreateStringField(

     ?name 'userPath

     ?prompt "Save the file to :"

     ?value "Please enter the path"

     ;?editable nil

     ?invisible '(t)

       )

       hiCreateAppForm(

    ?name 'settingsForm

    ?formTitle "Compare summary files"

    ?buttonLayout 'Close

    ?fields list(

       list(myToggle 250:155 -1:-1) ; -1 indicates fields that aren't used, so they can take any value

       list(userPath 15:120 500:30 100)

    ) ; end list

       ) ; create form

       ; store the extra fields on the form, ready for later

       ;settingsForm->extraFields=list(nil 'userPath userPath)

       hiDisplayForm(settingsForm) ; Display form

    ); end let

    ); end procedure

    ;==============================================================================

    ;=====================  Display Message "cb_checkbox" =========================

    ;==============================================================================

    procedure(cb_checkbox()

     let(( (oldOffset 0) (newOffset 0) (currentOffset 0) (fieldHeight 30))

       printf("\ncheckbox clicked")

       ; stores checkbox value into valueBox variable

       valueBox=car(myToggle->value)

       if(valueBox==t then

    printf("\nTrue\n")

    ;userPath->invisible='(nil)

    ;hiAddField(settingsForm

    ;let(settingsForm->extraFields->userPath 0:0 10:20 20))

       else

    printf("\nFalse\n")

       )

         ) ; end let

     ) ; end procedure

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • netbug
    netbug over 8 years ago

    Dear Andrew,

    I would like to add a toggle field and String field. The string field will appear/disappear according to the value of the toggle field.

    I went through your oferExample code, but I am not really able to get the same result as you. I didn't understand how do the "extraFields" work. More over I can't understand how the form can be refreshed on-the-fly.

    Please find below an excerpt of my code. Please let me know if you need the full code.

    Thanks in advance.

    Best regards,

    José

    ;==============================================================================

    ;===============  Display main Form - Create Main form" =======================

    ;==============================================================================

    procedure(CreateMainForm()

       let((label1 doneButton settingsForm cellView1 cellView2 selectButton1 selectButton2 selectButton3 sep1 myToggle)

       myToggle = hiCreateToggleField(

     ?name 'myToggle

     ?choices list('(toggleLabel "Save summary file ?"))

     ?value '(nil)

     ?numSelect 1

     ?callback list("cb_checkbox()")

       )

       userPath = hiCreateStringField(

     ?name 'userPath

     ?prompt "Save the file to :"

     ?value "Please enter the path"

     ;?editable nil

     ?invisible '(t)

       )

       hiCreateAppForm(

    ?name 'settingsForm

    ?formTitle "Compare summary files"

    ?buttonLayout 'Close

    ?fields list(

       list(myToggle 250:155 -1:-1) ; -1 indicates fields that aren't used, so they can take any value

       list(userPath 15:120 500:30 100)

    ) ; end list

       ) ; create form

       ; store the extra fields on the form, ready for later

       ;settingsForm->extraFields=list(nil 'userPath userPath)

       hiDisplayForm(settingsForm) ; Display form

    ); end let

    ); end procedure

    ;==============================================================================

    ;=====================  Display Message "cb_checkbox" =========================

    ;==============================================================================

    procedure(cb_checkbox()

     let(( (oldOffset 0) (newOffset 0) (currentOffset 0) (fieldHeight 30))

       printf("\ncheckbox clicked")

       ; stores checkbox value into valueBox variable

       valueBox=car(myToggle->value)

       if(valueBox==t then

    printf("\nTrue\n")

    ;userPath->invisible='(nil)

    ;hiAddField(settingsForm

    ;let(settingsForm->extraFields->userPath 0:0 10:20 20))

       else

    printf("\nFalse\n")

       )

         ) ; end let

     ) ; end procedure

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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