#! /bin/csh # Use your FILE->Save As... menu selection in your browser to download # this file. ################################################################################ # # Program: loadzukn # # By: Jim Porterfield # # Date: April 13, 1993 # # For: Router Solutions and Zuken Customers # # Purpose: Takes Zuken CR3000 PWS database and extracts all necessary # ASCII files for data conversion. # # Inputs: Required Binary Files: # layoutname.pcu # layoutname.pcm # # Optional Binary Files: # layoutname.pcg # layoutname.pcp # layoutname.pcw # # Zuken De-Compilers: # ubac # mlist # sbac # pmbac # gbac # wbac # # Creates: ASCII Files: # layoutname.bsf # layoutname.mdf # layoutname.udf # layoutname.wdf if .pcw exists # layoutname.pma if .pcp exists # layoutname.ccf if .pcg exists # layoutname.wsf if .pcw exists # ################################################################################ # Standard variables and header ################################################################################ onintr break unsetenv noclobber unalias rm set line = "----------------------------------------" set line = "$line$line" main: clear echo "" echo " ZUKEN DATA EXTRACTION PROCEDURE" echo "$line" echo "" ################################################################################ # Enter name of layout ################################################################################ if ( ! $?JOB && "$1" == "" ) then entnam: echo -n " Enter name of layout to extract: " set JOB = $< if ( "$JOB" == "" ) then echo "*** No Name Entered. Exiting\! ***" sleep 1 exit 0 endif else if ( "$1" != "" ) then set JOB = $1 endif if ( "$JOB" == "" ) then echo "*** Environment variable JOB is set to null (""). ***" unsetenv JOB unset JOB endif ################################################################################ # Check to see if layout exists ################################################################################ if (! -e $JOB.pcu ) then echo "" echo "*** ERROR *** Layout $JOB.pcu does not exist\!" echo " Check spelling and directory information and run" echo " this program again." echo "" exit 1 endif ################################################################################ # Set Log and Error filename variables ################################################################################ set logname = $JOB.clg set errname = $JOB.err if ( -e $logname ) then rm $logname endif set date = `date` echo "$line" > $logname echo "Data extraction from layout '$JOB' begun $date" >> $logname echo "$line" >> $logname ls -l $JOB.* >> $logname echo "$line" >> $logname echo " Data extraction from layout '$JOB'" echo " Begun $date" ################################################################################ # Create Layout from BSF file -- UBAC ################################################################################ if (( -e $JOB.pcu ) && (-e $JOB.pcm )) then if ( -e $JOB.bsf ) then rm $JOB.bsf endif echo -n " Extracting Technology (ubac) ... " echo "Extracting Technology (ubac) ... " >> $logname ( $CRHOME/pws/bin/ubac $JOB >> $logname ) >& $errname if ( $status != 0 || ! -e $JOB.bsf ) then echo "" >> $logname echo "*** ERROR *** occurred during Technology Extraction\!" >> $logname echo "$line" >> $logname cat $logname $errname > $JOB.ctmp mv $JOB.ctmp $logname if ( ! -e $JOB.pcu ) then echo "" echo "*** ERROR *** occurred during Technology Extraction\!" echo "" more $errname goto break endif else echo "Done." echo "Done." >> $logname echo "$line" >> $logname endif else echo "" echo "*** ERROR *** " echo "The required Zuken binary files ($JOB.pcu & $JOB.pcm) do not exist\!" echo "*** ERROR *** " >> $logname echo "The required Zuken binary files ($JOB.pcu & $JOB.pcm) do not exist\!" >> $logname echo "" goto break endif ################################################################################ # Extract footprint data from layout -- SBAC ################################################################################ if ( -e $JOB.mls ) then rm $JOB.mls endif echo -n " Getting a listing of Footprints in $JOB (mlist) ... " echo "Getting a listing of library components in $JOB (mlist)... " >> $logname ( $CRHOME/pws/bin/mlist -n 1-16128 -m $JOB > $JOB.mls ) >& $errname if ( $status != 0 ) then echo "" >> $logname echo "*** ERROR *** occurred during Footprint List\!" >> $logname echo "$line" >> $logname cat $logname $errname > $JOB.ctmp mv $JOB.ctmp $logname echo "" echo "*** ERROR *** occurred during Footprint List\!" echo "" more $errname goto break endif # Get all available footprint numbers if any footprints exist. set cline = `grep -n 'no.(c)' $JOB.mls | awk -F":" '{print $1}'` set sline = `grep -n 'no.(s)' $JOB.mls | awk -F":" '{print $1}'` if ( $cline == "" && $sline == "" ) then echo "" echo " *** Warning *** No footprint data exists\!" echo "*** Warning *** No footprint data exists\!" >> $logname else if ( $sline == "" ) then set sfeet = "" @ scnt = 0 else @ start = $sline + 1 sed -n -e "$start"',$p' $JOB.mls | awk ' \ BEGIN {cnt=0} \ { \ if (cnt == 0) {printf "%s",$1; cnt=cnt+1} \ else { \ if ($0 == "") {printf ""} \ else if (cnt >= 10) { \ printf ", %s\n ",$1 \ cnt=1} \ else { \ printf ", %s",$1 \ cnt=cnt+1 \ } \ } \ } ' > $JOB.sft #@ scnt = $#sfeet #set sfeet = `echo $sfeet | sed -e 's/ /,/g'` endif if ( $cline == "" ) then set cfeet = "" @ ccnt = 0 else @ start = $cline + 1 if ( $sline != "" ) then @ end = $sline - 1 else set end = '$' endif sed -n -e "$start,$end""p" $JOB.mls | awk ' \ BEGIN {cnt=0} \ { \ if (cnt == 0) {printf "%s",$1; cnt=cnt+1} \ else { \ if ($0 == "") {printf ""} \ else if (cnt >= 10) { \ printf ", %s\n ",$1 \ cnt=1} \ else { \ printf ", %s",$1 \ cnt=cnt+1 \ } \ } \ } ' > $JOB.cft endif echo "Done." echo "Done." >> $logname echo "$line" >> $logname echo -n " Extracting Footprint data (sbac) ... " #echo -n " There are $ccnt component side and $scnt solder side footprints ... " #echo "Extracting Footprint data = $ccnt c-side, $scnt s-side (sbac)..." >> $logname # Create extraction parameter file if ( -e $JOB.spf ) then rm $JOB.spf endif echo '$SPF {' > $JOB.spf echo ' PREC 5;' >> $JOB.spf echo ' OUT_LAYER ALL;' >> $JOB.spf if (! $?ccnt) then echo -n " OUT_C_CMP " >> $JOB.spf cat $JOB.cft >> $JOB.spf echo ";" >> $JOB.spf endif if (! $?scnt) then echo -n " OUT_S_CMP " >> $JOB.spf cat $JOB.sft >> $JOB.spf echo ";" >> $JOB.spf endif echo ' OUT_NOUN ALL;' >> $JOB.spf echo ' BREAK_NOUN CMP(PACK),RES(PACK),FIL; ' >> $JOB.spf echo ' }' >> $JOB.spf # Extract the data if ( -e $JOB.mdf ) then rm $JOB.mdf endif ( $CRHOME/pws/bin/sbac -vm $JOB >> $logname ) >& $errname if ( $status != 0 || ! -e $JOB.mdf ) then echo "" >> $logname echo "*** ERROR *** occurred during Footprint Extraction\!" >> $logname echo "$line" >> $logname cat $logname $errname > $JOB.ctmp mv $JOB.ctmp $logname echo "" echo "*** ERROR *** occurred during Footprint Extraction\!" echo "" more $errname goto break else echo "Done." echo "Done." >> $logname echo "$line" >> $logname endif endif ################################################################################ # Extract Placement and Artwork data from layout -- SBAC ################################################################################ #xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx echo -n " Extracting Placement and Artwork data (sbac) ... " echo "Extracting Placement and Artwork data (sbac)..." >> $logname # Create extraction parameter file if ( -e $JOB.spf ) then rm $JOB.spf endif echo '$SPF {' > $JOB.spf echo ' PREC 5;' >> $JOB.spf echo ' OUT_LAYER ALL;' >> $JOB.spf echo ' OUT_NOUN ALL;' >> $JOB.spf echo ' BREAK_NOUN RES(PACK),FIL; ' >> $JOB.spf echo ' }' >> $JOB.spf # Extract the data if ( -e $JOB.udf ) then rm $JOB.udf endif ( $CRHOME/pws/bin/sbac -vu $JOB >> $logname ) >& $errname if ( $status != 0 || ! -e $JOB.udf ) then echo "" >> $logname echo "*** ERROR *** occurred during Placement Data Extraction\!" >> $logname cat $logname $errname > $JOB.ctmp mv $JOB.ctmp $logname echo "$line" >> $logname echo "" echo "*** ERROR *** occurred during Placement Data Extraction\!" echo "" more $errname goto break else echo "Done." echo "Done." >> $logname echo "$line" >> $logname endif ################################################################################ # If device library exists, extract devices -- PMBAC ################################################################################ if ( -e $JOB.pcp ) then echo -n " Extracting device library information (pmbac) ... " echo "Extracting device library information (pmbac) ... " >> $logname ######################################################################## # Extract Library information. ######################################################################## if ( -e $JOB.pma ) then set files = `ls $JOB.pm*` mv $JOB.pma $JOB.pm$#files endif ($CRHOME/cr3000/bin/pmbac -m $JOB $JOB.pma >> $logname ) >& $errname if ( $status != 0 || ! -e $JOB.pma ) then echo "" echo "*** ERROR *** occurred during Library Extraction\!" echo "" echo "" >> $logname echo "*** ERROR *** occurred during Library Extraction\!" >> $logname cat $logname $errname > $JOB.ctmp mv $JOB.ctmp $logname echo "$line" >> $logname more $errname goto break else echo "Done." echo "Done." >> $logname echo "$line" >> $logname endif else echo " *** Warning *** The Device Library ($JOB.pcp) does not exist\!" echo "*** Warning *** The Device Library ($JOB.pcp) does not exist\!" >> $logname endif ################################################################################ # Extract Netlist -- GBAC ################################################################################ if ( -e $JOB.pcg ) then if ( -e $JOB.ccb ) then rm $JOB.ccb endif if ( -e $JOB.ccf ) then set files = `ls $JOB.cc*` mv $JOB.ccf $JOB.cc$#files endif echo -n " Extracting Netlist (gbac) ... " echo "Extracting Netlist (gbac) ... " >> $logname ( $CRHOME/pws/bin/gbac -u -c $JOB >> $logname ) >& $errname if ( $status != 0 || ! -e $JOB.ccb) then echo "" >> $logname echo "*** ERROR *** occurred during Netlist Extraction\!" >> $logname cat $logname $errname > $JOB.ctmp mv $JOB.ctmp $logname echo "$line" >> $logname else mv $JOB.ccb $JOB.ccf echo "Done." echo "Done." >> $logname echo "$line" >> $logname endif else echo " *** Warning *** Netlist data ($JOB.pcg) does not exist." echo "*** Warning *** Netlist data ($JOB.pcg) does not exist." >> $logname endif ################################################################################ # Extract Design Rules -- WBAC ################################################################################ if ( -e $JOB.pcw ) then echo -n " Extracting Design Rules (wbac) ... " echo "Extracting Design Rules (wbac) ... " >> $logname if ( -e $JOB.wsf ) then set files = `ls $JOB.ws*` mv $JOB.wsf $JOB.ws$#files endif ( $CRHOME/pws/bin/wbac $JOB >> $logname ) >& $errname if ( $status != 0 || ! -e $JOB.wsf ) then echo "" >> $logname echo "*** ERROR *** occurred during Design Rule Extraction\!" >> $logname cat $logname $errname > $JOB.ctmp mv $JOB.ctmp $logname echo "$line" >> $logname else echo "Done." echo "Done." >> $logname echo "$line" >> $logname endif else echo "*** Warning *** The Design Rule data ($JOB.pcw) does not exist. " >> $logname echo " *** Warning *** The Design Rule data ($JOB.pcw) does not exist. " endif ################################################################################ # Extract Wiring data from layout -- WIRBAC ################################################################################ if ( -e $JOB.pcw ) then echo -n " Extracting Wiring data (wirbac) ... " echo "Extracting Wiring data (wirbac)..." >> $logname # Create extraction parameter file if ( -e $JOB.wpf ) then rm $JOB.wpf endif echo '$WPF {' > $JOB.wpf echo ' PREC 5;' >> $JOB.wpf echo ' OUT_LAYER ALL;' >> $JOB.wpf echo ' OUT_NOUN ALL;' >> $JOB.wpf echo ' }' >> $JOB.wpf # Extract the data if ( -e $JOB.wdf ) then rm $JOB.wdf endif ( $CRHOME/pws/bin/wirbac -v -t $JOB >> $logname ) >& $errname if ( $status != 0 || ! -e $JOB.wdf ) then echo "" >> $logname echo "*** ERROR *** occurred during Wiring Data Extraction\!" >> $logname echo "$line" >> $logname cat $logname $errname > $JOB.ctmp mv $JOB.ctmp $logname echo "" echo "*** ERROR *** occurred during Wiring Data Extraction\!" echo "" more $errname goto break else echo "Done." echo "Done." >> $logname echo "$line" >> $logname endif else echo "*** Warning *** The Wiring data ($JOB.pcw) does not exist. " >> $logname echo " *** Warning *** The Wiring data ($JOB.pcw) does not exist. " endif ################################################################################ # Remove temporary files? ################################################################################ break: echo "" end: set date = `date` echo "Data extraction from layout '$JOB' finished $date" >> $logname echo "$line" >> $logname echo "$line" echo -n "Do you wish to remove temporary work files? (Y or n): " set ans = $< switch ($ans) case [Nn]*: breaksw case [Yy]: default: foreach file ( $JOB.spf $JOB.wpf $JOB.mls $JOB.sft $JOB.cft $errname $logname) if ( -e $file) then rm $file endif end breaksw endsw ################################################################################ # View Log file? ################################################################################ if ( -e $logname ) then echo -n "Would you like to see the log file ($logname)? (y or N): " set ans = $< if ( $ans =~ "Y"* || $ans =~ "y"* ) then clear more $logname echo "$line" echo -n " Press [Return] to continue: ";set ans = $< endif endif exit 0 ################################################################################ # End of File ################################################################################