• 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
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Pedro,

    If the form is not closing when you click the Close button, it's probably because you have declared the variable containing the form structure as a local variable; I mentioned this before - the point is that any interactions with the form have to be recorded in the CDS.log as a SKILL expression - so in essence when you interact with the form it generates a SKILL expression to complete the task. If the variable containing the form (as specified by the ?name argument to the hiCreateAppForm function) is not visible from the scope in which you are interacting the form (i.e. where you call hiDisplayForm from) then it will all go horribly wrong. So the best thing is to make the form variable global (i.e. don't put it in the let()). 

    I don't understand what you mean by "block the user to enter some characters in the text box". If you're saying that you want to disallow certain characters, then perhaps you want to specify a ?modifyCallback on the field which is a SKILL function that is called whenever there is a change in the field, but before it's displayed - so you can use this to modify what is actually entered.

    As for examples, there are lots on this form, and lots on support.cadence.com including the Resources->SKILL Information on the support site which has some code libraries to help you get started.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Pedro,

    If the form is not closing when you click the Close button, it's probably because you have declared the variable containing the form structure as a local variable; I mentioned this before - the point is that any interactions with the form have to be recorded in the CDS.log as a SKILL expression - so in essence when you interact with the form it generates a SKILL expression to complete the task. If the variable containing the form (as specified by the ?name argument to the hiCreateAppForm function) is not visible from the scope in which you are interacting the form (i.e. where you call hiDisplayForm from) then it will all go horribly wrong. So the best thing is to make the form variable global (i.e. don't put it in the let()). 

    I don't understand what you mean by "block the user to enter some characters in the text box". If you're saying that you want to disallow certain characters, then perhaps you want to specify a ?modifyCallback on the field which is a SKILL function that is called whenever there is a change in the field, but before it's displayed - so you can use this to modify what is actually entered.

    As for examples, there are lots on this form, and lots on support.cadence.com including the Resources->SKILL Information on the support site which has some code libraries to help you get started.

    Regards,

    Andrew.

    • 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