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

📄 hl_ntp.il

📁 Allegro常用skill
💻 IL
📖 第 1 页 / 共 2 页
字号:
;
;DESCRIPTION:
;       This function is used by the _HNTP_Init_Form_Display for the call
;       back required from the axlFormCreate command.
;       This function requires form dbid parameters This function returns no
;       paramteres. This funtion does pass a value to the global dbid
;       defined as HNTP_Form_Data and gets the form dbid number from global
;       variable HNTP_Form_Ptr.
;
;       For further information See:
;       axlFormCreate, axlFormSetField, axlFormDisplay, and
;       Form Interface Functions in the Allegro SKILL Functions Reference
;       Manual.
;-
;==========================================================================
defun( _HNTP_Form_CallBack (form)
case( get( HNTP_Form_Ptr 'curField)
        ("inpin" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'inpin))
        ("outpin" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'outpin))
        ("anypin" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'anypin))
        ("via" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'via))
        ("anypnt" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'anypnt))
        ("single" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'single))
        ("node" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'node))
        ("flood" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'flood))
        ("unused" putprop( HNTP_Form_Data get(HNTP_Form_Ptr 'curValue) 'unused))
        ( "execute" _HNTP_Execute() )
        ( "cancel"  _HNTP_Cancel() )
);end-case
);end-defunction _HNTP_Form_CallBack
 
;==========================================================================
;+
;NAME:
;       _HNTP_Cancel
;
;SYNOPSIS:
;       _HNTP_Cancel()
;
;DESCRIPTION:
;       This function called by the _HNTP_Form_CallBack().This funtion closes
;       the open form, deletes the hl_ntp.form file and exits the SKILL
;       process. This function requires the HNTP_Form_Ptr global variable.
;
;       For further information see:
;       axlFormClose, axlClearSelSet,axlCancelEnterFun()
;-
;==========================================================================
defun( _HNTP_Cancel ()
        when( isFile( "hl_ntp.form" )  deleteFile("hl_ntp.form"))
        when( HNTP_Form_Ptr axlFormClose( HNTP_Form_Ptr ))
        axlClearSelSet()
        axlCancelEnterFun()
);end-defun _HNTP_Cancel
 
 
;==========================================================================
;+
;NAME:
;       _HNTP_Flood_No_TP
;
;SYNOPSIS:
;       _HNTP_Flood_No_TP(list)
;
;DESCRIPTION:
;       This function returns a list of pin or via dbids() which have a
;       testPoint value of nil. This function takes in one parameter. The
;       input parameter (list) is a list of pin or via dbids.
;-
;==========================================================================
defun( _HNTP_Flood_No_TP (dbid_list )
prog( ()
let( ( return_list )
        foreach( item dbid_list
            when( item->testPoint == nil
                return_list = cons( item return_list)
            );end-when
        ); end-foreach
        return(return_list)
);end-let
);end-prog
);end-defun _HNTP_Flood_No_TP
 
 
;==========================================================================
;+
;NAME:
;       _HNTP_Single_No_TP
;
;SYNOPSIS:
;       _HNTP_Single_No_TP(pvlist nlist)
;
;DESCRIPTION:
;       This function takes in two parameters. The firat paramter is a
;       list of pin or via dbids (pvlist). The second parameter takes in a list
;       of net dbids (nlist). The function checks the pvlist dbids to determine
;       if the dbid has a  testPoint value of t. If the value t exists, the net
;       dbid number is removed from the nlist. This function returns a list of
;       net dbids which do not have a test point assigned.
;-
;==========================================================================
defun( _HNTP_Single_No_TP (pvlist nlist )
prog( ()
        foreach( item pvlist
            when( item->testPoint != nil
                nlist = remd( item->net nlist)
            );end-when
        ); end-foreach
        return(nlist)
);end-prog
);end-defun _HNTP_Single_No_TP
 
 
;==========================================================================
;+
;NAME:
;       _HNTP_Check_Unused
;
;SYNOPSIS:
;       _HNTP_Check_Unused(list)
;
;DESCRIPTION:
;       This function returns a list of pin dbids which have a valid net name
;       This function takes in one parameter. The input parameter
;       (list) is a list of pin dbids.
;-
;==========================================================================
defun( _HNTP_Check_Unused (dbid_list)
prog( ()
let( (return_list)
        foreach( item dbid_list
            when( item->net->name != ""
                return_list = cons( item return_list)
            );end-when
        ); end-foreach
        return(return_list)
);end-let
);end-prog
);end-defun _HNTP_Check_Unused
 
 
;==========================================================================
;+
;NAME:
;       _HNTP_Check_Unnamed
;
;SYNOPSIS:
;       _HNTP_Check_Unnamed(list)
;
;DESCRIPTION:
;       This function returns a list of net dbids which have a valid net name
;       This function takes in one parameter. The input parameter
;       (list) is a list of net dbids.
;-
;==========================================================================
defun( _HNTP_Check_Unnamed (dbid_list)
prog( ()
let( (return_list)
        foreach( item dbid_list
            when( item->name != ""
                return_list = cons( item return_list)
            );end-when
        ); end-foreach
        return(return_list)
);end-let
);end-prog
);end-defun _HNTP_Check_Unnamed
 
 
;==========================================================================
;+
;NAME:
;       _HNTP_Execute
;
;SYNOPSIS:
;       _HNTP_Execute()
;
;DESCRIPTION:
;       This function is called by the _HNTP_Form_CallBack(). This function
;       begins the execution of the SKILL commands to sort the choices made
;       from the form parameters and execute the functions required to hilight
;       the necessary elements.
;       This function requires no parameters.
;
;       for further information see:
;
;-
;==========================================================================
defun( _HNTP_Execute ()
let( (pin_list via_list net_list hilite_list)
  axlFormClose( HNTP_Form_Ptr )
        ;
        ;identify which list of dbids to obtain
        ;
   pin_list = nil
   via_list = nil
   net_list = nil
 
   if( HNTP_Form_Data->inpin == t  then
        pin_list = _HNTP_Bld_Inpin_lst()
   );end-if
 
   if(  HNTP_Form_Data->outpin == t then
        pin_list = _HNTP_Bld_Outpin_lst()
   );endif
 
   if( HNTP_Form_Data->anypin then
        pin_list = _HNTP_Bld_Pin_lst()
   ); endif
 
   when( HNTP_Form_Data->via == t via_list = _HNTP_Bld_Via_lst())
 
   when( HNTP_Form_Data->anypnt == t
        pin_list = _HNTP_Bld_Pin_lst()
        via_list = _HNTP_Bld_Via_lst()
   );end-when
 
   if( HNTP_Form_Data->flood == nil then
       net_list = _HNTP_Bld_Net_lst()
   );end-if
 
        ;
        ; if test unused pins is not selected, then remove the unused pin
        ; ids from the list
        ;
 
   if(  HNTP_Form_Data->unused == nil then
     when( pin_list != nil pin_list = _HNTP_Check_Unused( pin_list ))
     when( net_list != nil net_list = _HNTP_Check_Unnamed( net_list ))
   );end-if
        
 
        ;
        ; identify Methodology and identify missing test points and then
        ; highlight the proper items.
        ;
 
   when( HNTP_Form_Data->flood == t
        when( via_list != nil  hilite_list= _HNTP_Flood_No_TP(via_list) )
        if( hilite_list == nil then
                axlMsgPut( "No Vias to Highlight")
        else
                axlHighlightObject( hilite_list )
        );end-if
        hilite_list = nil
        when( pin_list != nil  hilite_list= _HNTP_Flood_No_TP(pin_list) )
        if( hilite_list == nil then
                axlMsgPut( "No Pins to Highlight")
        else
                axlHighlightObject( hilite_list t )
        );end-if
   );end-when
 
   when( HNTP_Form_Data->single == t
     if( net_list == nil  then
        axlMsgPut("ERROR 02: No Net dbids found")
     else
        when( via_list != nil net_list = _HNTP_Single_No_TP(via_list net_list))
        when( pin_list != nil net_list = _HNTP_Single_No_TP(pin_list net_list))
        if( net_list == nil then
                axlMsgPut( "No Nets to Highlight")
        else
                axlHighlightObject( net_list t )
        );end-if
     );end-if
   );end-when
 
  when( HNTP_Form_Data->node == t
  let( (used_netid)
     when(pin_list != nil
        foreach( pinid pin_list
        if( pinid->testPoint != nil then
                if( member(pinid->net net_list) then
                    used_netid= cons(pinid->net used_netid)
                    net_list = remd( pinid->net net_list)
                else
                    if( member(pinid->net used_netid) remd( pinid->net used_netid))
                );endif
        );end-if
        );end-foreach
    );end-when
 
     when(via_list != nil
        foreach( via_id via_list
        if( via_id->testPoint != nil then
                if( member(via_id->net net_list) then
                    used_netid= cons(via_id->net used_netid)
                    net_list = remd( via_id->net net_list)
                else
                    if( member(via_id->net used_netid) remd( via_id->net used_netid))
                );endif
        );end-if
        );end-foreach
    );end-when
        
    when( used_netid != nil
        foreach( netid used_netid hilite_list = cons( netid hilite_list))
        )
    when( net_list != nil
        foreach( netid net_list hilite_list = cons( netid hilite_list))
        )
 
    if(hilite_list == nil then
        axlMsgPut( "No Nets to Highlight")
    else
        axlHighlightObject( hilite_list t )
    );end-if
  )
  );end-when
 
   axlMsgPut(" Operation Completed!")
   _HNTP_Cancel()
);end-let
); end-defun _HNTP_Execute
 
;==========================================================================
;+
;NAME:
;       _HNTP_Run
;
;SYNOPSIS:
;       _HNTP_Run()
;
;DESCRIPTION:
;       This function is called at the startup of the SKILL hl_ntp.il program.
;       This function set the global variables HNTP_Form_Ptr and HNTP_Form_Data
;       which are required for Form display and call backs.
;       This function also verifies that all other function are halted before
;       begining this process.
;
;       This function requires no parameters.
;
;       for further information see:
;
;-
;==========================================================================
defun( _HNTP_Run ()
         HNTP_Form_Ptr = nil
         HNTP_Form_Data = nil
         when(axlOKToProceed()
           when(  _HNTP_Create_Form_File()
              _HNTP_Init_Form_Display()
           );end-when
         );end-when
);end-defun _HNTP_Run

; register command with Allegro
axlCmdRegister( "hl_ntp" `_HNTP_Run ?cmdType "general")

⌨️ 快捷键说明

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