Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:16:12

0001 #! /usr/bin/perl -w

0002 #

0003 #

0004 use strict;
0005 #use CGI qw(:standard);

0006 
0007 open (INPUT,  "<", "PanSam_REV_A.brd") or die "Can't open original file $!/n";
0008 open (OUTPUT, ">", "PanSamMap.txt") or die "Can't open original file $!/n";
0009 
0010 my %PadMap;
0011 my $CurrentSignal="GND";
0012 my @Connector = ();
0013 my @Pad = ();
0014 
0015 while (<INPUT>)
0016 {
0017     my $line = $_;
0018     
0019     if ($line =~ /<signal name/)
0020     {
0021     my @lineValues = split(/"/,$line);

0022     $CurrentSignal = $lineValues[1];

0023     @Connector = ();

0024     @Pad       = ();

0025     }

0026     

0027     if (!($CurrentSignal =~ /GND/) && $line =~ /<contactref/ )

0028     {

0029     print " push ";

0030     my @ContactRefValues = split(/"/,$line);
0031     push @Connector, $ContactRefValues[1];
0032     push @Pad, $ContactRefValues[3];
0033     }
0034 
0035     if (!($CurrentSignal =~ /GND/) && $line =~ /<\/signal/)
0036     {
0037     my $length = $#Connector + 1;
0038     print "$length\n";
0039     for (my $i=0; $i <= $#Connector; $i++)
0040     {
0041         print OUTPUT "$Connector[$i]$Pad[$i],";
0042     }
0043     print OUTPUT "\n";
0044     }
0045 
0046 
0047 }
0048 close (INPUT);
0049 close (OUTPUT);