perl

Uploaded from authorPOINT
Views:
 
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Slide1: 


Fun with PerlMike Haney m-haney@uiuc.edu: 

Fun with Perl Mike Haney m-haney@uiuc.edu

Why Perl?: 

Why Perl? We needed a scripting language to handle recurring tasks we had used csh with Unix Tried TCL/TK easy to make forms and buttons awkward to do real work Perl is the swiss-army-chainsaw of scripting languages Practical Extraction and Report Language

To be honest…: 

To be honest… most of the scripts started life as a Perl shell to call awk awk, cat, grep, sort, etc. essentially, ports of our csh scripts However, the Perl language contains all of the above, builtin! bom22.pl is pure Perl bill of materials the rest will be converted as needed...

Perl is free!: 

Perl is free! www.ActiveState.com our Perl5 source for NT www.jumbo.com Perl4, NT/95/DOS and countless others commercial shareware marketers university mirror sites everywhere...

Perl is reasonably well documented!: 

Perl is reasonably well documented! Programming Perl Wallandamp;Schwartz; O’Reilly/Nutshell the 'camel book' Programming Perl Wall, Christiansen,andamp;Schwartz; O’Reilly the other camel book www-cgi.cs.cmu/cgi-bin/perl-man html-based manual

Perl is fairly simple for scripts: 

Perl is fairly simple for scripts pdb_comp.pl: print 'PDB Compile \n'; $cat = 'I:\\tools\\bin\\cat'; $grep = 'I:\\tools\\bin\\grep'; $pdb_comp = 'I:\\veribest\\vbdc\\bin\\pdb_comp.exe'; system('$cat *_pdb.txt andgt; pdb_tmp.txt'); system('$pdb_comp pdb_tmp.txt cad.pdb 1 N Y'); system('$grep -i ERROR pdb_comp.txt');

Bill of Materials - bom22: 

Bill of Materials - bom22 find and read andlt;projectandgt;.prj in folder above convert CDB to ASCII convert localjob.pdb to ASCII produce tab-separated text file of RefDes Internal PartNumber PartName, PartNumber, Cell, Value comma-separated InstanceName list

bom22 - output: 

bom22 - output andlt;projectandgt;_bom.txt: .REF IPN PNAM PNUM CELL VAL INST U1 IDM7438 74F38 74F38 DIP143 ? U1b,U1d,U1c RP19 RNH___2 RES SIP8R4 SIP08 4.7K RP19d,RP19c,R19b,RP19a etc. rename to andlt;projectandgt;_bom.xls, poof! you have a spreadsheet

Parts List Generate -ipncount: 

Parts List Generate - ipncount read andlt;projectandgt;_bom.txt count like-IPNs look-up against in-house database MicroSoft ACCESS generate tab separated text IPN, description, MFG, MPN, Dist, cost (last time) number on board, project quantity

ipncount - example: 

ipncount - example andlt;projectandgt;_parts.txt: Project: axpr Board Count: 4 ITEM IPN DESC MPN MFG DIST QUANT NOB SPARES WAS IN QUOTED EACH ORDERED RCVD notes 1 AHH3105 1.0UF (1UF) 50V, DIPPED CER, .2 L.S. C330C105K5R5CA KEM BELL 52 13 0 $1.16 Dec-94 -/-/- $ -/-/- -/-/- 2 ANHC104K 0.1UF (100000PF), 50V, 10%, C1206 GRM42-6104K050B_ MU HAM 920 230 0 $0.06 Aug-94 -/-/- $ -/-/- -/-/- 2 ANHC104K 0.1UF (100000PF), 50V, 10%, C1206 VJ1206Y104KXAMT VITI BELL 920 230 0 $0.03 Apr-98 -/-/- $ -/-/- -/-/-

Fix Escaped Verilog Bundles - fixvsh: 

Fix Escaped Verilog Bundles - fixvsh INGR74ALS541 U8 (.A1(\~G~A~I~N[4] ), becomes INGR74ALS541 U8 (.A1(\~G~A~I~N [4] ), note space before '[4]'

Compile all PDB files: 

Compile all PDB files find all andlt;nameandgt;_pdb.txt files in this folder 'cat' into one file pdb_comp grep for warnings and errors text-based alternative to the PDB Editor

Pads Processing: 

Pads Processing We prefer to do extensive pads processing instead of planes processing to manipulate thermals and clearances as well as different top and bottom masks Rather than building pad-stacks per part we define a complete pin-based transformation as a spreadsheet (tab separated text)

Pads Processing - pads: 

Pads Processing - pads read pads_ctl.txt tab separated, column-pair text file contains pads_proc.caf data pull out a col-pair strip noise pads_proc

Pads Processing - pads_clt.txt: 

Pads Processing - pads_clt.txt # function # del - add - change - change - change - change - change - # all - all - planes - GND - VCC - VEE - masks - 7 - 1 - 14 - 14 - 14 - 14 - 14 - # layer spec (-1=all) -1 - -1 - 3 - 1 - 1 - 1 - 0 - - - - - 2 - 2 - 4 - 7 - - - - - - - 4 - - - - - - - - - - - - - 7 - - - - - - - - - # process mask layers 49 50 49 50 0 0 0 0 0 0 0 0 49 50 # process paste layers 51 52 51 52 0 0 0 0 0 0 0 0 0 0 # process unused pins 1 - 1 - 1 - 0 - 0 - 0 - 1 -

Pads Processing - pads_ctl.txt: 

Pads Processing - pads_ctl.txt It’s not pretty, but you can see where this is going… # process vias 1 - 1 - 1 - 1 - 1 - 1 - 1 - # pin spec 0 - 0 - 0 - 0 - 0 - 0 - 0 - # net spec 0 - 0 - 0 - 1 - 5 - 4 - 0 - - - - - - - GND %229 VCC %1142 VEE %1147 - - - - - - - - - - VCCA %1143 VEEA %1148 - - - - - - - - - - VCCB %1144 VEEA_IN %1149 - - - - - - - - - - VCC_ %1145 VEE2_IN %1150 - - - - - - - - - - VCC_I %1146 - - - - # comp spec 0 - 0 - 0 - 0 - 0 - 0 - 0 -

Pads Processing - pads_ctl.txt: 

Pads Processing - pads_ctl.txt # add/change flag 0 - 1 - 0 - 0 - 0 - 0 - 0 - # change list - - - - 38 - 40 - 40 - 40 - 50 - - - - - - - 10 510 10 510 10 510 8585 8787 - - - - 10 15 15 510 15 510 15 510 8787 1010 - - - - 15 20 20 515 20 515 20 515 1010 1212 # # # # # # # # # # # # # # - - - - - - - - - - - - 4035 4540 - - - - - - - - - - - - 5535 6040 - - - - - - - - - - - - - - - - - - - - - - - - - - 6535 7040 - - - - - - - - - - - - 7040 7545 - - - - - - - - - - - - 7545 8050 Sure, it is ugly. But these are rules, set up once!

Convert all Gerber files to Postscript - g2psnt: 

Convert all Gerber files to Postscript - g2psnt find all .gdo files in a folder extract apertures used look-up apertures from central list for each .gdo, call g2psnt g2psnt is a C program

Plot all Postscript - plot: 

Plot all Postscript - plot find all .ps files in a folder print to a networked printer if the maximum X coord is larger than page, translate and print again

Quickies and one-offs: 

Quickies and one-offs bamscan check bamwasis.bam for inconsistent flatnames part_bom compare bill-of-materials (cdb) to quote/order/rcvd list pinscan compare pin name and number in local2d.caf

Next?: 

Next? Perl/TK or Perl/CGI better solution than pads_ctl.txt eventual rewrites away from awk/cat/grep Try it; it’s fun! Scripts available on request