⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clinecut.il

📁 Allegro常用skill
💻 IL
📖 第 1 页 / 共 5 页
字号:
/*
################################################################################
#                                                                              #
#                      Command: clinecut                                       #
#                   Skill File: clinecut.il                                    #
#                  How To Load: Command> (load("clinecut.il"))                 #
#               How To Execute: Command> clinecut          OR                  #
#                                        clinecut [-]help  OR                  #
#                                        clinecut [-]h     OR                  #
#                                                                              #
#                       Author: Larry Bowman, Cadence Design Systems           #
#                        Email: bowman@cadence.com                             #
#                    Telephone: 512-349-1109                                   #
#                Creation Date: 11/21/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.       #
#                                                                              #
################################################################################
################################################################################
#                                                                              #
#  8/3/2002:  Increased the Max Cut value to 99999 mils.                       #
#                                                                              #
################################################################################
*/

;###########################################################
;#                                                         #
;#                Main Program lcb_clinecut                #
;#                                                         #
;###########################################################
axlCmdRegister("clinecut" 'lcb_clinecut ?cmdType "interactive"
 ?doneCmd '_lcb_ccCancel ?cancelCmd '_lcb_ccCancel)


(defun lcb_clinecut (@optional (args ""))
 prog( ()


lhelpargs = list("help" "h" "-h" "-help" "debug" "d" "-debug" "-d")
debug = nil

;; 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.
    clinecut_info_createInfo()
    return()
   ); end help
   ( ("debug" "d" "-debug" "-d")
     ;; 
     debug = t
   ); end debug
   (t
    axlUIWPrint(nil "*** Error, you entered ->%s<-" args)
    axlUIWPrint(nil "     Only arguments accepted are:")
    axlUIWPrint(nil "     %L" lhelpargs)
    return()
   ); incorrect argument
  ); end case
); endif

;; find width of all clines and use smallest width * 2 for the minvalue
if( lallclinesegs = ashFindAllClinesegs() then
 defclinewidth = nthelem(1 lallclinesegs)->width
 foreach(one lallclinesegs
   if(one->width < defclinewidth then
     defclinewidth = one->width
  ); endif
 ); end foreach
else
 ;; no clinesegs in layout
 axlUIWPrint(nil " - Exiting, No Cline Segs in layout.")
 return()
);endif



;; initialize variables
 notdone = t
 dbaccuracy = nthelem(2 axlDBGetDesignUnits())
 dbunits = nthelem(1 axlDBGetDesignUnits())
 mincutvalue = defclinewidth * 2
 ;sprintf(mincutvalue "%L %s" mincutvalue dbunits)
 maxcutvalue = "99999 mils"
 minvalue = axlMKSConvert(mincutvalue dbunits) 
 maxvalue = axlMKSConvert(maxcutvalue dbunits)
 if(dbaccuracy == 0 then
  formatacc = 0
 else
  formatacc = dbaccuracy - 1
 ); endif

;; Set a user defined subclass to draw the user's window selection.
class_sub = "manufacturing/cutline"
axlLayerCreateNonConductor(class_sub)
axlVisibleLayer(class_sub t)
axlVisibleUpdate(t)

;; Set the Control Panel to the Options tab
axlControlRaise('options)

_createForm_clinecut()


clinecut_Form=axlMiniStatusLoad( (gensym) clinecut_form_file 'clinecut_Form_Action t)

;; Set form default values
axlFormSetFieldLimits(clinecut_Form "cutwidth" minvalue maxvalue + 2)
axlFormSetField(clinecut_Form "units" dbunits)
axlFormSetField(clinecut_Form "dbunits" dbunits)
sprintf(format "%%.%df" formatacc)
if(boundp('cutwidth) then
  if(cutwidth < minvalue  || cutwidth > maxvalue then
     cutwidth = axlMKSConvert(lastvalue dbunits)
     maxvalue = axlMKSConvert(maxcutvalue dbunits)
  ); endif
else
 cutwidth = evalstring(sprintf(cut_text format minvalue))
); endif
axlFormSetField(clinecut_Form "cutwidth" cutwidth)
axlFormColorize(clinecut_Form "tcut" 'text 'red)
axlFormColorize(clinecut_Form "tcut" 'background 'button)
axlFormSetField(clinecut_Form "minvalue" cut_text)
axlFormSetField(clinecut_Form "maxvalue" maxvalue)
axlFormColorize(clinecut_Form "minvalue" 'text 'yellow)
axlFormColorize(clinecut_Form "minvalue" 'background 'black)
axlFormColorize(clinecut_Form "maxvalue" 'text 'yellow)
axlFormColorize(clinecut_Form "maxvalue" 'background 'black)



;;; Create graphics in form.
ghandle = axlGRPDrwInit(clinecut_Form "drawarea" '_lcb_cutcline_graphic)
axlGRPDrwUpdate(ghandle)

if(isFile(clinecut_form_file)
 deleteFile(clinecut_form_file)
);endif

 while(notdone
   _lcb_ccgetpicks()
 ); end while

 ); end prog
); end defun
;###########################################################
;#                                                         #
;#      End of Main Program lcb_clinecut                   #
;#                                                         #
;###########################################################

;###########################################################
;#                                                         #
;#            _lcb_ccgetpicks                              #
;#                                                         #
;###########################################################
defun( _lcb_ccgetpicks ()
  
  axlClearSelSet()
  axlSetFindFilter(?enabled list("noall" "clinesegs") ?onButtons list("clinesegs"))
  _lcb_ccPopUp()

  cutbox = axlEnterBox(?prompts list(" - Enter First Window point -"
                                     " - Enter Second Window point -"))

 lcsegsignore = list()
 lhorcsegs = list()
 lvertcsegs = list()
 lslopecsegs = list()


  if(cutbox then

    ;; get clineseg dbids
    axlSingleSelectBox(cutbox)
    cc_lclinesegs = axlGetSelSet()

    ;; get boundary lines drawn by user
    _lcb_ccGetBoundaryLines()

    ;; Ignore clines within boundary and
    ;; sort clinesegs by horizontal, vertical, or sloped
    _lcb_ccSortclinesegs()

    ;; Highlight those clinesegs to be cut and give user
    ;; a final chance to abort.
    ;_lcb_ccHighlight()

    ;; Cut the clinesegs that cross the boundary
    ;; Input to function is a list of csegdbids.
    ;; Also already know type of line (H,V,S), so pass it on.
    if(lhorcsegs then
     _lcb_ccCutclinesegs(lhorcsegs "h")
    );endf
    if(lvertcsegs then
     _lcb_ccCutclinesegs(lvertcsegs "v")
    ); endif
    if(lslopecsegs then
     _lcb_ccCutclinesegs(lslopecsegs "s")
    ); endif
  /*
  else
    axlUIWPrint(nil " - Closed -")
  */
  );

); end defun
;###########################################################
;#                                                         #
;#            End of _lcb_ccgetpicks                       #
;#                                                         #
;###########################################################

;###########################################################
;#                                                         #
;#            _lcb_ccCutclinesegs                          #
;#                                                         #
;###########################################################
defun( _lcb_ccCutclinesegs (listcsegs mode)
  
  case(mode
   ("h"

      ;; create variables for cseg end points.
      ;; the cseg may start left to right, right to left,
      ;; top to bottom, or bottom to top.


     foreach(cseg listcsegs

      ;; create variables for cseg end points.
      ;; the cseg may start left to right, right to left,
      ;; top to bottom, or bottom to top.

      cXbeg = nthelem(1 nthelem(1 cseg->startEnd))
      cYbeg = nthelem(2 nthelem(1 cseg->startEnd))
      cXend = nthelem(1 nthelem(2 cseg->startEnd))
      cYend = nthelem(2 nthelem(2 cseg->startEnd))
      p1x = cXbeg
      p1y = cYbeg
      p4x = cXend
      p4y = cYend


      cond( ;; Crosses both Vertical lines
       ( (vlx > p1x && vlx < p4x || vlx > p4x && vlx < p1x) &&
         (vrx > p1x && vrx < p4x || vrx > p4x && vrx < p1x)
  
        if(debug then
         axlUIWPrint(nil " - Crosses Both V lines")
        ); endif
        if(nthelem(1 nthelem(1 cseg->startEnd)) < nthelem(1 nthelem(2 cseg->startEnd)) then
          cline1 = list(nthelem(1 cseg->startEnd) list(vlx nthelem(2 nthelem(1 cseg->startEnd))))
          cline2 = list(list(vlx + cutwidth nthelem(2 nthelem(1 cseg->startEnd))) list(vrx - cutwidth nthelem(2 nthelem(1 cseg->startEnd))))
          cline3 = list(list(vrx nthelem(2 nthelem(1 cseg->startEnd))) nthelem(2 cseg->startEnd))
        p3x = nthelem(1 nthelem(1 cline2))
        p5x = nthelem(1 nthelem(2 cline2))

        else
          cline1 = list(nthelem(1 cseg->startEnd) list(vrx nthelem(2 nthelem(1 cseg->startEnd))))
          cline2 = list(list(vrx - cutwidth nthelem(2 nthelem(1 cseg->startEnd))) list(vlx + cutwidth nthelem(2 nthelem(1 cseg->startEnd))))
          cline3 = list(list(vlx nthelem(2 nthelem(1 cseg->startEnd))) nthelem(2 cseg->startEnd))
        p3x = nthelem(1 nthelem(2 cline2))
        p5x = nthelem(1 nthelem(1 cline2))

        ); endif

        etchlayer = cseg->layer
        segnetname = cseg->net->name
        segwidth = cseg->width
        axlDeleteObject(cseg)


        axlDBCreateLine(cline1 segwidth etchlayer segnetname)
        if(p3x < p5x then
         axlDBCreateLine(cline2 segwidth etchlayer segnetname)
        ); endif
        axlDBCreateLine(cline3 segwidth etchlayer segnetname)
         
        ); cond 1 - end of one segment crossing both vertical boundary lines

       ( ;; Crosses just the left vertical line
         vlx > p1x && vlx < p4x || vlx > p4x && vlx < p1x
         
         if(debug then  
          axlUIWPrint(nil " - Crosses Left Vline")
         ); endif
         ;; segment ends do not always go from left-to-right but may go right-to-left.
         if(nthelem(1 nthelem(1 cseg->startEnd)) > nthelem(1 nthelem(2 cseg->startEnd)) then
          cline1 = list(nthelem(2 cseg->startEnd) list(vlx nthelem(2 nthelem(2 cseg->startEnd))))
          cline2 = list(list(vlx + cutwidth nthelem(2 nthelem(2 cseg->startEnd))) nthelem(1 cseg->startEnd))
         else
          cline1 = list(nthelem(1 cseg->startEnd) list(vlx nthelem(2 nthelem(1 cseg->startEnd))))
          cline2 = list(list(vlx + cutwidth nthelem(2 nthelem(1 cseg->startEnd))) nthelem(2 cseg->startEnd))
         ); endif
         etchlayer = cseg->layer
         segnetname = cseg->net->name
         segwidth = cseg->width
         axlDeleteObject(cseg)
         p3x = nthelem(1 nthelem(1 cline2))
         axlDBCreateLine(cline1 segwidth etchlayer segnetname)
         if(p3x < p4x then
          axlDBCreateLine(cline2 segwidth etchlayer segnetname)
         ); endif

       ); cond 2 - end of crossing left vertical  boundary line

       (;; Crosses Right Vertical line only

        vrx > p1x && vrx < p4x || vrx > p4x && vrx < p1x

         if(debug then
          axlUIWPrint(nil " - Crosses Right Vline")
         ); endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -