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

📄 drc_walk.il

📁 Allegro常用skill
💻 IL
📖 第 1 页 / 共 3 页
字号:
; drc_walk.il - Copyright 1994-96 Loral Federal Systems Owego
;
; drc walk - display DRCs in Allegro design
; layers   - show a group of class/subclass pairs for a given etch layer
;
;
; NO WARRANTY - This software is made available asis; and may not work
;  as advertised in all environment.
;
; This function works with Allegro 10+.
;
; This function will generate a list of DRCs in the current design, and
; allow the user to 'walk through' the list to inspect/verify/etc.
; User can filter the list of DRCs by layer and/or type. Select HELP
; from the drc walk menu for further details.
;
; This file also contains the layers function.
;
; Load the software (by including drc_walk.il in your allegro.ilinit file
;      or by explicity typing (load "drc_walk.il")  at your allegro command
;      line.
;
; This function builds its form & help screen in the /tmp directory
;
;  Created by:    Joe Morrison
;                 joe.morrison@lmco.com
;                 Loral Federal Systems-Owego
;
; This skill program demonstrates the following concepts:
;                 - File I/O
;                 - Asynchronous Forms & Callbacks
;                 - Manipulating design elements by database id
;                 - Create a sublist of items matching search criteria
;                 - viewfile creation
; Revision History
;    1.10    2001/05/13 Chris Walters
;                       corrected setting of _drcDir to work with any Unix or Windoze box
;    1.20    2002/07/18 Chris Walters
;                       changed the defaults for the Rollover List, Zoom To DRC and Zoom factor fields
;                       to enabled, enabled, and 2000, respectively
;                       added "NVIDIA Approved" to end of drcTypes list to be displayed - DONE
;                       added functionality such that choosing "NVIDIA Approved" brings up a list
;                           of all DRCs already marked as approved. DONE
;                       added Approve button. clicking Approve applies the approval symbol to the
;                           DRC, adds the DRC to "NVIDIA Approved" list and removes it from whichever
;                           nonapproved list it was selected from
;                       moved approve button to left edge
;                       made propagation-delay drcs visible when clicked
;                       removed drc_roll button from form
;                       enabled DRC Show Element button as default
;                       rewrote functions and list-handling such that approving a drc
;                           causes it to be immediately removed from the list and added to
;                           the approved list and decrement/increment the nonapproved/approved totals
;                           fixed glitch in removal-from-list function that didn't remove the FIRST
;                           DRC on the list
;                       updated visible layers dependant on DRC subclass and our own scripts
;                       slight correction to "ALL DRC subclass visible layer list
;                       add user-defined-property to approval symbol derived from DRC string
;                       to differentiate between DRCs at identical xy coordinates

(defun _drcZap ()
    line_list = nil
    axlClearSelSet()
    axlVisibleDesign(nil)
    axlVisibleLayer( lfsShowLayer t)
    axlSetFindFilter( ?enabled (list "noall" "lines" "clines" "invisible") ?onButtons (list "lines" "clines"))
    line_list = axlGetSelSet(axlAddSelectAll())
    foreach( line_db line_list
        axlDeleteObject( line_db)    ; delete every line off the subclass
    );end-foreach
    axlVisibleSet(vis_list)         ;restores color settings
    axlFlushDisplay()
);end-defun

(defun BuildApprovalList ()
; initialize tables and lists
approval_list = nil
all_drcs_key = nil
approval_table = makeTable("table0" nil)
all_drcs_list = nil
all_drcs_table = makeTable("table1" nil)
approved_drcs_list = nil
approved_drcs_table = makeTable("table2" nil)
nonapproved_drcs_list = nil
nonapproved_drcs_table = makeTable("table3" nil)
approval_tot = 0
all_drcs_tot = 0
approved_drcs_tot = 0
nonapproved_drcs_tot = 0

; build the list of pre-existing DRC-approval symbols
axlClearSelSet()
axlVisibleDesign(nil)
axlVisibleLayer("BOARD GEOMETRY/APPROVED_DRCS" t)
axlSetFindFilter( ?enabled (list "noall" "symbols") ?onButtons (list "symbols"))
approval_list = axlGetSelSet(axlAddSelectAll())
axlVisibleSet(vis_list)         ;restores color settings

; load approval table from list
foreach( approval_db approval_list
    app_key = cadr( car( axlDBGetProperties( approval_db)))
    approval_table[app_key] = approval_db
);end of foreach

; build unique keys for matching with property values on crosshairs later on 
foreach( drc_db drcs
    sprintf(drc_key, "%s%.2f%s%.2f%s%s%s%s%s%s%s%s%s%s",
                                             "x= " xCoord(drc_db->xy)
                                             " y= " yCoord(drc_db->xy)
                                             " name= " drc_db->name
                                             " type= " drc_db->type
                                             " layer= " drc_db->layer
                                             " expected= " drc_db->expected
                                             " actual= " drc_db->actual
    )
    all_drcs_table[drc_key] = drc_db
);end of foreach

; first weed out orphaned approvals
foreach( approval_key approval_table
    if( exists( all_drcs_key all_drcs_table ( all_drcs_key == approval_key )) then
        null( nil)                ; match
    else
        axlDeleteObject(approval_table[approval_key])
        remove( approval_key approval_table)    ; orphan approval
    );end-if
);end-foreach

; now start matching up approval symbols with DRCs
foreach( all_drcs_key all_drcs_table
    if( exists( approval_key approval_table ( all_drcs_key == approval_key )) then
         ; DRC has been approved
        approved_drcs_table[all_drcs_key] = all_drcs_table[all_drcs_key]
        approved_drcs_list  = cons( all_drcs_table[all_drcs_key] approved_drcs_list)
    else ; DRC has not been approved
        nonapproved_drcs_table[all_drcs_key] = all_drcs_table[all_drcs_key]
        nonapproved_drcs_list  = cons( all_drcs_table[all_drcs_key] nonapproved_drcs_list)
    );end-if
);end of foreach

; now gather totals
approval_tot = length( approval_list)
all_drcs_tot = length( all_drcs_table)
approved_drcs_tot = length( approved_drcs_table)
nonapproved_drcs_tot = length( nonapproved_drcs_table)
;rintf("%d%s\n", approval_tot "approval_tot")
;rintf("%d%s\n", all_drcs_tot "all_drcs_tot")
;rintf("%d%s\n", approved_drcs_tot "approved_drcs_tot")
;rintf("%d%s\n", nonapproved_drcs_tot "nonapproved_drcs_tot")

);end-defun

(defun _drcFormBuild ()
  (let (_drcPort)
    (setq _drcFormFile (strcat (makeTempFileName (strcat _drcDir "drc_walk")) ".form"))
    (setq _drcPort (outfile _drcFormFile))
   (fprintf _drcPort "FILE_TYPE=FORM_DEFN VERSION=2\n")
   (fprintf _drcPort "FORM\n")
   (fprintf _drcPort "FIXED\n")
   (fprintf _drcPort "PORT 70 16\n")
   (fprintf _drcPort "HEADER \"Allegro DRC Walker v1.20\"\n\n")
   (fprintf _drcPort "POPUP <drc_select_layer_p>\"a\"\"a\".\n")
   (fprintf _drcPort "POPUP <drc_select_type_p>\"a\"\"a\".\n\n\n")
   (fprintf _drcPort "TILE\n")
   (fprintf _drcPort "TEXT \"Layer:\"\n")
   (fprintf _drcPort "TLOC 2 2\n")
   (fprintf _drcPort "ENDTEXT\n\n")
   (fprintf _drcPort "TEXT \"Allegro DRC Walker v1.20\"\n")
   (fprintf _drcPort "TLOC 23 0\n")
   (fprintf _drcPort "ENDTEXT\n\n")
   (fprintf _drcPort "TEXT \"Matching DRCs\"\n")
   (fprintf _drcPort "TLOC 23 7\n")
   (fprintf _drcPort "ENDTEXT\n\n")
   (fprintf _drcPort "TEXT \"DRC Type:\"\n")
   (fprintf _drcPort "TLOC 2 4\n")
   (fprintf _drcPort "ENDTEXT\n\n")
   (fprintf _drcPort "TEXT \"DRC:\"\n")
   (fprintf _drcPort "TLOC 1 21\n")
   (fprintf _drcPort "ENDTEXT\n\n")
   (fprintf _drcPort "FIELD drc_select_layer\n")
   (fprintf _drcPort "FLOC 13 2\n")
   (fprintf _drcPort "ENUMSET 35\n")
   (fprintf _drcPort "POP \"drc_select_layer_p\"\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_select_type\n")
   (fprintf _drcPort "FLOC 13 4\n")
   (fprintf _drcPort "ENUMSET 35\n")
   (fprintf _drcPort "POP \"drc_select_type_p\"\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_list\n")
   (fprintf _drcPort "FLOC 5 9\n")
   (fprintf _drcPort "LIST \"Matching DRCs\" 50 5\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_this\n")
   (fprintf _drcPort "FLOC 6 21\n")
   (fprintf _drcPort "INFO_ONLY\n")
   (fprintf _drcPort "STRFILLIN 57 57\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_zoom\n")
   (fprintf _drcPort "FLOC 1 25\n")
   (fprintf _drcPort "CHECKLIST \"Zoom to DRC\"\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_zoomsize\n")
   (fprintf _drcPort "FLOC 20 25\n")
   (fprintf _drcPort "INTSLIDEBAR 5 25\n")
   (fprintf _drcPort "MIN 1\n")
   (fprintf _drcPort "MAX 20\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_showobj\n")
   (fprintf _drcPort "FLOC 32 25\n")
   (fprintf _drcPort "CHECKLIST \"DRC Show Element\"\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD lapprove\n")
   (fprintf _drcPort "FLOC  1 28\n")
   (fprintf _drcPort "MENUBUTTON \"Approve\" 8 3\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_next\n")
   (fprintf _drcPort "FLOC 10 28\n")
   (fprintf _drcPort "MENUBUTTON \"Next\" 8 3\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_prev\n")
   (fprintf _drcPort "FLOC 19 28\n")
   (fprintf _drcPort "MENUBUTTON \"Previous\" 12 3\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD drc_show\n")
   (fprintf _drcPort "FLOC 32 28\n")
   (fprintf _drcPort "MENUBUTTON \"Show\" 8 3\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD done\n")
   (fprintf _drcPort "FLOC 41 28\n")
   (fprintf _drcPort "MENUBUTTON \"Done\" 8 3\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "FIELD lhelp\n")
   (fprintf _drcPort "FLOC 50 28\n")
   (fprintf _drcPort "MENUBUTTON \"Help\" 8 3\n")
   (fprintf _drcPort "ENDFIELD\n\n")
   (fprintf _drcPort "ENDTILE\n\n")
   (fprintf _drcPort "ENDFORM\n")

     close(_drcPort)
     if(! isFile( _drcFormFile) then
        axlUIConfirm( (strcat "Unable to Open Form File, Check Permissions on " _drcDir))
        (_drcEnd)
     );if
  ) ; let
) ; defun - display form information

(defun _drcHelp ()
  (let (helpfile helpPort)
    (setq helpfile (strcat (makeTempFileName (strcat _drcDir "drcHelp")) ".txt"))
    (setq helpPort (outfile helpfile))
       (fprintf helpPort "     LAP Presents........\n\n")
       (fprintf helpPort "drc walk - A tool to inspect the Design Rule Check errors\n")
       (fprintf helpPort "in your Allegro design.\n\n")
       (fprintf helpPort "layers - A tool to turn on typical features for a given subclass of ETCH.\n")
       (fprintf helpPort "----------------------------------------------------------------------\n")
       (fprintf helpPort "The DRC Walker allows you to inspect DRC errors in your current\n")
       (fprintf helpPort "Allegro design, one at a time.  You can filter the DRC errors by\n")
       (fprintf helpPort "layer and/or DRC type.  The DRC to be inspected can either be\n")
       (fprintf helpPort "selected from the list by a mouse pick, or the user can 'walk'\n")
       (fprintf helpPort "through the list of errors using the 'next' and 'previous'\n")
       (fprintf helpPort "buttons.\n\n")
       (fprintf helpPort "Window title: the count of DRCs matching the currently selected\n")
       (fprintf helpPort "layer and type.\n\n")
       (fprintf helpPort "Layer: the list of all layers in the design containing DRC\n")
       (fprintf helpPort "errors.  You can select which layer to display using the middle\n")
       (fprintf helpPort "mouse button.\n\n")
       (fprintf helpPort "DRC Type: the list of all DRC errors currently flagged in this\n")
       (fprintf helpPort "design.  You can select which DRC to display by using the middle\n")
       (fprintf helpPort "mouse button.\n\n")
       (fprintf helpPort "Matching DRCs: the list of all DRCs that match the layer & type\n")
       (fprintf helpPort "selections.  Each line, which corresponds to one drc error, has a\n")
       (fprintf helpPort "sequence number, DRC error, the layer, and the x:y location.  You\n")
       (fprintf helpPort "can pick a particular DRC to examine with the left mouse button.\n")
       (fprintf helpPort "The currently displayed DRC is highlighted in the list.\n\n")
       (fprintf helpPort "DRC: an information only field that shows information about the\n")
       (fprintf helpPort "currently displayed DRC.\n\n")
       (fprintf helpPort "Rollover List: Normally, the 'next' button has no effect when you\n")
       (fprintf helpPort "select 'next' at the end of the list.  Similarly, 'previous' has\n")
       (fprintf helpPort "no effect when you select 'previous' at the top of the list.\n")
       (fprintf helpPort "Selecting the rollover checkbox causes 'next' at the last item to\n")
       (fprintf helpPort "show the first item in the list; and 'previous' at the first item\n")
       (fprintf helpPort "to show the last item.\n\n")
       (fprintf helpPort "DRC Show Element: If this box is selected, a 'show element'\n")
       (fprintf helpPort "window will appear to provide you with more information about the\n")
       (fprintf helpPort "current DRC.\n\n")
       (fprintf helpPort "Zoom to DRC: Normally, the full design is shown in the design\n")
       (fprintf helpPort "window. If 'Zoom to DRC' is selected, the design window will zoom\n")
       (fprintf helpPort "about the DRC. The size of the drc window is controlled by the\n")
       (fprintf helpPort "zoom factor field, which has a slider button to select the size.\n\n")
       (fprintf helpPort "Next: Pressing this button will cause the immediately following\n")
       (fprintf helpPort "DRC in the list to be displayed.\n\n")
       (fprintf helpPort "Previous: Pressing this button will cause the immediately prior\n")
       (fprintf helpPort "DRC in the list to be displayed.\n\n")
       (fprintf helpPort "Show: Redisplay the current DRC. This button is useful when you\n")
       (fprintf helpPort "change zooming or the show element controls.\n\n")
       (fprintf helpPort "Done: Exit from the DRC Walker\n\n")
       (fprintf helpPort "Help: Display this file.\n")
       (fprintf helpPort "---------------------------------------------------------------------\n\n")
       (fprintf helpPort "Layers:\n")
       (fprintf helpPort " invoke by typing:      layers [+,-] layername(s)\n")
       (fprintf helpPort " at the Allegro command line\n\n")
       (fprintf helpPort " Layername corresponds to one or more ETCH subclasses defined for\n")
       (fprintf helpPort "the current design.\n\n")
       (fprintf helpPort " A '+' causes the layer to be added to the current display\n")
       (fprintf helpPort "visibility, a '-' causes that layer to be removed. Normally, the\n")
       (fprintf helpPort "layers command causes all other currently displayed features to\n")
       (fprintf helpPort "be made invisible.\n\n")
       (fprintf helpPort " Classes involved:\n")
       (fprintf helpPort "        BOARD GEOMETRY/OUTLINE\n")
       (fprintf helpPort "        DRC ERROR CLASS/<layer>\n")
       (fprintf helpPort "        ETCH/<layer>\n")
       (fprintf helpPort "        PIN/<layer>\n")
       (fprintf helpPort "        VIA CLASS/<layer>\n")
       (fprintf helpPort "        VIA KEEPOUT/<layer>\n")
       (fprintf helpPort "        ROUTE KEEPOUT/<layer>\n")

⌨️ 快捷键说明

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