################################################################################ #!/usr/bin/perl -w # # cell_selector.pl - select the desired cells from foundry-provided library. # # By Chung-Ching Peng http://plaza.ufl.edu/peng6808/asic.html # # For usage help: Type cell_selector.pl with no parameters # ################################################################################ if(@ARGV[0] eq "") { print "ERROR: Insufficient input fields\n"; print "\n"; print "Usage:unix> ./cell_selector.pl <.lib file > \n"; print "\n"; exit; } ################################################################################ # Generate Buffer Statements ################################################################################ $i = 1; $j = 1; $cell_found=0; $start_print=0; open(out,">@ARGV[0].cell") || die "Couldn't open output file.\n "; print "-----------------\n"; print "output files are $ARGV[0].cell \n"; print "-----------------\n"; ################################################################################ # Main Codes ################################################################################ open(infile0,"<@ARGV[0]") || die "Couldn't open infile0. @ARGV[0]\n "; while ($line = ) { if($line =~ /HD/) { #try to find the keyword 'HD' $cell_found = 1; } if( $cell_found == 1) { chomp($line); @lines = split(/\/\//, $line); $lines[0] =~ s/^(\s+)//; #remove space $myline = $myline.$lines[0]; if($myline =~ /;/) { $compline = $myline; $myline = ""; print "compline = $compline\n"; } else { $compline = ""; } if($compline =~ /(^cell)\((\w+)\)(.*)/ ) { $cell_now = $2; if($cell_now =~ /L$/ ) { $start_print=1; print "$cell_now\n"; } else { $start_print=0; } } }#( $cell_found == 1) if( $start_print==1) { print out "$line"; $i=$i+1; } $cell_found=0; } #while ($compline1 = ) print $i; close(out); print "-----------------\n"; print "output files are $ARGV[0].cell \n"; print "-----------------\n";