📄 zrconnections.il
字号:
/*
################################################################################
# #
# Command: zrconnections #
# Skill File: zrconnections.il #
# How To Load: APD> (load("zrconnections.il")) #
# How To Execute: APD> zrconnections OR #
# zrconnections help OR #
# zrconnections h OR #
# zrconnections nomini #
# Author: Larry Bowman, Cadence Design Systems #
# Email: bowman@cadence.com #
# Telephone: 512-349-1109 #
# Creation Date: 10/31/2001 #
# #
################################################################################
################################################################################
# DISCLAIMER: #
# The user of this command assumes all responsibility and does not #
# hold Cadence Design Systems nor the author of this code for any #
# unwarranted results or problems due to the use of this code. #
# #
# This is non-supported code and the user may modify it as needed. #
# #
################################################################################
*/
;###########################################################
;# #
;# Main Program lcb_zrconnections #
;# #
;###########################################################
axlCmdRegister("zrconnections" 'lcb_zrconnections ?cmdType "interactive"
?doneCmd '_lcb_zrCancel ?cancelCmd '_lcb_zrCancel)
(defun lcb_zrconnections (@optional (args "") )
lnominargs = list("nomini" "-nomini" "no" "-no" "nomin" "-nomin")
lhelpargs = list("help" "h" "-h" "-help")
;; Check for command line arguments
if(args != "" then
case(lowerCase(args)
( ("help" "h" "-h" "-help")
axlUIWPrint(nil " - Displaying Info file. -")
;;; ### Insert function for Info file here.
zrconnections_info_createInfo()
goodarg = nil
); end help
( ("nomini" "-nomini" "no" "-no" "nomin" "-nomin")
nomini = t
goodarg = t
); end nomini
(t
axlUIWPrint(nil "*** Error, you entered ->%s<-" args)
;axlUIWPrint(nil "*** Only arguments accepted is \"help\" or \"h\" or \"nomini\".")
axlUIWPrint(nil " Only arguments accepted are:")
axlUIWPrint(nil " %L %L" lhelpargs lnominargs)
goodarg = nil
); incorrect argument
); end case
else
goodarg = t
nomini = nil
); endif
; Initialize Variables
_lcb_zrinit()
if(notdone && goodarg then
;; Set the Control Panel to the Options tab
axlControlRaise('options)
_createForm_zrconnections(lpopstack lpopcomp)
if(nomini then
zrconnections_Form=axlFormCreate( (gensym) zrconnections_form_file nil 'zrconnections_Form_Action t)
axlFormDisplay(zrconnections_Form)
else
zrconnections_Form=axlMiniStatusLoad( (gensym) zrconnections_form_file 'zrconnections_Form_Action t)
); endif
axlFormBuildPopup(zrconnections_Form "refdes" lcomponentpopup)
axlFormBuildPopup(zrconnections_Form "tolayer" lstackpopup)
if(isFile(zrconnections_form_file) then
deleteFile(zrconnections_form_file)
else
axlUIWPrint(nil "*** Warning, cannot find %s to delete\n" zrconnections_form_file)
axlUIWPrint(nil "*** Check SKILL path (getSkillPath()) and make sure . is first\n")
);endif
; Initialize the Form Entries
_lcb_setup_zrconnectionsForm()
; Now loop to allow user to select from layout or form.
; Will exit this loop when the user selects "Close" button
; on form, RMB-Done, or RMB-Cancel.
while(notdone
_lcb_zrgetpicks()
); end while
); endif for notdone AND goodarg
if(boundp('zroutport) then
close(zroutport)
); endif
); end defun
;###########################################################
;# #
;# End of Main lcb_zrconnections #
;# #
;###########################################################
;###########################################################
;# #
;# zrconnections_Form_Action #
;# #
;###########################################################
(defun zrconnections_Form_Action (zrconnections_Form)
(case zrconnections_Form->curField
("av_nets"
_lcb_zrSelectNetFromFormAndLayout(zrconnections_Form->curValue)
)
("allavnets"
axlUIWPrint(nil " - Selecting all remaining nets")
_lcb_zrSelectNetFromFormAndLayout("*")
)
("refdes"
prevlfnets = copy(final_lnetnames)
prevrefdes = defrefdes
lprevrefdes = list(list(prevrefdes prevlfnets))
defrefdes = zrconnections_Form->curValue
if(assoc(prevrefdes allrefdes) then
if(length(nthelem(2 assoc(prevrefdes allrefdes))) != length(prevlfnets) then
rplacd(assoc(prevrefdes allrefdes) list(prevlfnets))
); endif
else
allrefdes = append(allrefdes lprevrefdes)
); endif
if(assoc(defrefdes allrefdes) then
;axlUIWPrint(nil " - Found defrefdes, %s, in allrefdes" defrefdes)
final_lnetnames = nthelem(2 assoc(defrefdes allrefdes))
;; load the form with prior nets
axlFormListDeleteAll(zrconnections_Form "av_nets")
axlFormSetField(zrconnections_Form "av_nets" final_lnetnames)
axlFormSetField(zrconnections_Form "av_nets" nil)
else
;; Go get new list of nets
foreach(one lcomps
if(one->name == defrefdes then
axlFormListDeleteAll(zrconnections_Form "av_nets")
_lcb_zrFindNets(one)
) ;endif
); end foreach
); endif
)
("tolayer"
deftargetlayer = zrconnections_Form->curValue
)
("minvia"
defminvia = zrconnections_Form->curValue
)
("maxvia"
defmaxvia = zrconnections_Form->curValue
)
("xgrid"
defxgrid = zrconnections_Form->curValue
)
("ygrid"
defygrid = zrconnections_Form->curValue
)
("xoffset"
defxoffset = zrconnections_Form->curValue
)
("yoffset"
defyoffset = zrconnections_Form->curValue
)
("viatopadspace"
defvia2pad = zrconnections_Form->curValue
)
("zroutputfile"
prevzrconnfile = zrconnectionsfile
zrconnectionsfile = zrconnections_Form->curValue
axlUIWClose(zrviewfile)
_lcb_zrOpenFile(zrconnectionsfile)
)
("clearfile"
axlUIWPrint(nil " - Clearing Connections file, %s" zrconnectionsfile)
axlUIWClose(zrviewfile)
close(zroutport)
if(isFile(zrconnectionsfile) then
deleteFile(zrconnectionsfile)
_lcb_zrOpenFile(zrconnectionsfile)
); endif
;; Reload the form with all nets for the current refdes selected.
foreach(one lcomps
if(one->name == defrefdes then
axlFormListDeleteAll(zrconnections_Form "av_nets")
_lcb_zrFindNets(one)
) ;endif
); end foreach
;; Reset the Selected Net Name field
axlFormSetField(zrconnections_Form "selectednet" "")
)
("run"
drain(zroutport)
axlUIWClose(zrviewfile)
;axlUIWPrint(nil " - Run Button")
;; set up batch command
;; zrouter <connectionsfile> <via-pad> <xgrid> <ygrid> <xoffset> <yoffset>
sprintf(zrbatchcommand "%s %s %L %L %L %L %L %%s" "zrouter" zrconnectionsfile defvia2pad defxgrid defygrid defxoffset defyoffset)
if(fileLength(zrconnectionsfile) > 0 then
;; Now run the zrouter batch command
axlRunBatchDBProgram("zrouter" zrbatchcommand ?logfile "zrouter" ?reloadDB t)
axlSetFindFilter(?enabled list("noall" "pins") ?onButtons list("pins"))
else
axlUIWPrint(nil "*** Error, %s file is empty." zrconnectionsfile)
); endif
)
("info"
zrconnections_info_createInfo()
;axlUIWPrint(nil " - Info Button")
)
("lhelp" axlUIWPrint(nil " - Help Button")
axlShell("help zrouter")
)
("fbrowse"
zroutput = axlDMFileBrowse("ALLEGRO_TEXT", nil)
if(zroutput != nil then
axlUIWClose(zrviewfile)
prevzrconnfile = zrconnectionsfile
_lcb_zrOpenFile(zroutput)
); endif
)
("vzrlog"
if(isFile(zlog) then
axlUIEditFile(zlog "zrouter.log" nil)
else
axlUIWPrint(nil "*** Warning, No %s file to view." zlog)
); endif
)
("close"
_lcb_zrCancel()
); end cancel
); end case
);end defun
;###########################################################
;# #
;# End of zrconnections_Form_Action #
;# #
;###########################################################
;###########################################################
;# #
;# _lcb_zrSelectNetFromFormAndLayout #
;# #
;###########################################################
defun( _lcb_zrSelectNetFromFormAndLayout (netpick)
;; netpick is a single net name.
if(netpick != "*" then
if(member(netpick final_lnetnames) then
selnet = netpick
;; if selnet has a space in the name then the sprintf command will
;; have extra fields.
lselnet = parseString(selnet)
if(length(lselnet) > 1 then
axlUIWPrint(nil "*** Error, Illegal net name. Net %s" selnet)
axlUIWPrint(nil " has %n Space(s) in the name." length(lselnet) - 1)
axlUIWPrint(nil " Ignoring net name, %s ." selnet)
else
axlFormSetField(zrconnections_Form "selectednet" selnet)
;; ## Assume all fields will be set for:
;; Refdes ToLayer MinVia MaxVia
sprintf(zrconnline "%s %s %s %s %s" defrefdes selnet deftargetlayer defminvia defmaxvia)
;; Set info into Form for Connections File Name
axlFormSetField(zrconnections_Form "assigned_nets" zrconnline)
;; Write data to Connections File
_lcb_zrWriteToFile(zrconnline)
;; Remove selection from Nets in the Form.
axlFormListDeleteItem(zrconnections_Form "av_nets" zrconnections_Form->curValueInt)
;; Remove selection from original list of net names
final_lnetnames = remd(selnet final_lnetnames)
;; highlight all pins with the selected net name.
foreach(one lcomps
if(one->name == defrefdes then
lcompindbids = one->pins
); endif
); endforeach
foreach(cpin lcompindbids
if(cpin->net->name == selnet then
axlUIWPrint(nil " - Highlighting %s.%s with net %s." defrefdes cpin->number selnet)
axlHighlightObject(cpin)
lhighpinsdbids = cons(cpin lhighpinsdbids)
); endif
); endforeach
); endif for lselnet
else
if(netpick != "" then
axlUIWPrint(nil " - Net %s has already been selected. Only %n net name(s) left." netpick length(final_lnetnames))
else
axlUIWPrint(nil " - This is a DUMMY net. Ignoring Selection.")
); endif
); endif of member
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -