#!/usr/local/bin/perl # Run this script on the def file exported from Virtuoso before # importing the file into silicon ensemble for place & route # to run, type "def_correction old_file.def > new_file.def" at the prompt while (<>) { #this section decrements the number of pins by two if ($_ =~ /^PINS ([^ ]*) ;/) { $pin_count = $1 - 2; $pin = 1; print "PINS ".$pin_count." ;\n"; } # this section removes first line of power/ground pin declarations elsif (($_ =~ /USE GROUND/ || $_ =~ /USE POWER/) && $pin) { $flag = 1; } # this section removes second line of power/ground pin declarations elsif ($flag && $pin) { $flag = 0; } # denotes end of midifications to pins section elsif ($_ =~ /^END PINS/) { $pin = 0; print $_; } # denoted end of modification to nets section elsif ($_ =~ /^END NETS/) { $net = 0; print $_; } # this section decrements number of nets by 2 elsif ($_ =~ /^NETS ([^ ]*) ;/) { $net_count = $1 - 2; $net = 1; print "NETS ".$net_count." ;\n"; } # begin skipping power and ground net declarations elsif ($_ =~ / - [^ ]*! / && $net) { $skip = 1; } # end skipping power and ground net declarations elsif (($_ =~ /USE GROUND/ || $_ =~ /USE POWER/) && $net) { $skip = 0; } # middle of skipping power and ground net declarations elsif ($skip && $net) { } else { print $_; } }