-1

we get module1 and module 2 from the two files

which i have uploaded.

But actually the problem is i was not listing differences correctly

i have uploade the output image also

but actually that number of differences are not there.

only 6 to 8 diifferences are there so how to handle this problem.

we are using dort as the split parameter so 5.0000 is taken as 5

and 00000 and comparing as two paramters.

so i tried using other but output is disturbed.

so please try to solve.

use strict;
use warnings;
#use Getopt::Long;  
  #my $filename1;
  #my $filename2;
  #my $modul;
   #my @args    = @ARGV;
  #print "Getting the options";
 # my $ok = &GetOptions("args"     => sub { &PrintArgs(\@args) },
#		       "h|help|?" => sub { &Help },
#		       "filename1=s"      => \$filename1,
#		       "filename2=s"      => \$filename2,
#		       "modul=s" => \$modul);
#		  print "\n\n";
#		   print " --------------------------------File1: $filename1 #File2:$filename2	-------------------------------------\n\n\n\n";


my $modul='X_MMCM_ADV';
my $filename1 = 'ise_routed.v';
my $filename2 = 'rodin_routed.v';



my $string1 = readfile( $filename1); 

my $string2 = readfile( $filename2); 


sub readfile {
  
    my ($file) = @_;
    local $/;
    open my $fh,'<',"$file" or die "open of $file failed: $!\n";
    <$fh>;
    };




 
$string1 =~ /$modul #\(([^;]*)\);/s;
my $modcode_from_1 = $1;
#print "$modcode_from_1";
open (MYFILE, '>module1.txt');
print MYFILE "$modcode_from_1\n";
close (MYFILE); 
undef $string1; 
$modcode_from_1 =~ s/[[:cntrl:]]//gm; 


$string2 =~ /$modul #\(([^;]*)\);/s;
my $modcode_from_2 = $1;
#print "$modcode_from_2";
open (MYFILE1, '>module2.txt');
print MYFILE1 "$modcode_from_2\n";
close (MYFILE1); 
undef $string2; 
$modcode_from_2 =~ s/[[:cntrl:]]//gm; 



my @codes1 = split /\./, $modcode_from_1;

my @codes2 = split /\./, $modcode_from_2;


print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";

printf "\t\t\t%-45s %s\n\n\n", $filename1, $filename2;

my $i = 0;
foreach (@codes1) {
    unless ($codes1[$i] eq $codes2[$i]) {
        
        printf "\t%-45s is not the same as %s\n\n", $codes1[$i], $codes2[$i];


    
    }
    
    
    
    $i++;
}
Attachments
.CLKFBIN(CLKFBIN),
    .PSCLK(GND),
    .PWRDWN(\i_MMCM_ADV/PWRDWN_INT ),
    .DCLK(GND),
    .DEN(GND),
    .CLKINSEL(\i_MMCM_ADV/CLKINSEL_INT ),
    .CLKIN2(GND),
    .RST(\i_MMCM_ADV/RST_INT ),
    .PSINCDEC(\i_MMCM_ADV/PSINCDEC_INT ),
    .DWE(GND),
    .PSEN(\i_MMCM_ADV/PSEN_INT ),
    .CLKIN1(clk_IBUF_7819),
    .CLKOUT3(CLKOUT3),
    .CLKOUT3B(\i_MMCM_ADV/CLKOUT3B ),
    .CLKFBOUT(CLKFBOUT),
    .CLKFBSTOPPED(\i_MMCM_ADV/CLKFBSTOPPED ),
    .CLKFBOUTB(\i_MMCM_ADV/CLKFBOUTB ),
    .CLKOUT1(CLKOUT1),
    .CLKOUT5(CLKOUT5),
    .DRDY(\i_MMCM_ADV/DRDY ),
    .CLKOUT0(clk_out0_OBUF_7848),
    .CLKOUT4(CLKOUT4),
    .CLKOUT1B(\i_MMCM_ADV/CLKOUT1B ),
    .CLKINSTOPPED(\i_MMCM_ADV/CLKINSTOPPED ),
    .CLKOUT0B(\i_MMCM_ADV/CLKOUT0B ),
    .CLKOUT2(CLKOUT2),
    .CLKOUT2B(\i_MMCM_ADV/CLKOUT2B ),
    .PSDONE(\i_MMCM_ADV/PSDONE ),
    .CLKOUT6(CLKOUT6),
    .LOCKED(i_MMCM_ADV_ML_NEW_I1),
    .DI({GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND}),
    .DADDR({GND, GND, GND, GND, GND, GND, GND}),
    .DO({\i_MMCM_ADV/DO15 , \i_MMCM_ADV/DO14 , \i_MMCM_ADV/DO13 , \i_MMCM_ADV/DO12 , \i_MMCM_ADV/DO11 , \i_MMCM_ADV/DO10 , \i_MMCM_ADV/DO9 , 
\i_MMCM_ADV/DO8 , \i_MMCM_ADV/DO7 , \i_MMCM_ADV/DO6 , \i_MMCM_ADV/DO5 , \i_MMCM_ADV/DO4 , \i_MMCM_ADV/DO3 , \i_MMCM_ADV/DO2 , \i_MMCM_ADV/DO1 , 
\i_MMCM_ADV/DO0 })
.CLKFBIN(CLKFBIN),
    .PSCLK(GND),
    .PWRDWN(\i_MMCM_ADV/PWRDWN_INT ),
    .DCLK(GND),
    .DEN(GND),
    .CLKINSEL(\i_MMCM_ADV/CLKINSEL_INT ),
    .CLKIN2(GND),
    .RST(\i_MMCM_ADV/RST_INT ),
    .PSINCDEC(\i_MMCM_ADV/PSINCDEC_INT ),
    .DWE(GND),
    .PSEN(\i_MMCM_ADV/PSEN_INT ),
    .CLKIN1(clk_IBUF_2571),
    .CLKOUT3(CLKOUT3),
    .CLKOUT3B(\i_MMCM_ADV/CLKOUT3B ),
    .CLKFBOUT(CLKFBOUT),
    .CLKFBSTOPPED(\i_MMCM_ADV/CLKFBSTOPPED ),
    .CLKFBOUTB(\i_MMCM_ADV/CLKFBOUTB ),
    .CLKOUT1(CLKOUT1),
    .CLKOUT5(CLKOUT5),
    .DRDY(\i_MMCM_ADV/DRDY ),
    .CLKOUT0(clk_out0_OBUF_2333),
    .CLKOUT4(CLKOUT4),
    .CLKOUT1B(\i_MMCM_ADV/CLKOUT1B ),
    .CLKINSTOPPED(\i_MMCM_ADV/CLKINSTOPPED ),
    .CLKOUT0B(\i_MMCM_ADV/CLKOUT0B ),
    .CLKOUT2(CLKOUT2),
    .CLKOUT2B(\i_MMCM_ADV/CLKOUT2B ),
    .PSDONE(\i_MMCM_ADV/PSDONE ),
    .CLKOUT6(CLKOUT6),
    .LOCKED(LOCKED_OBUF_2386),
    .DI({GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND}),
    .DADDR({GND, GND, GND, GND, GND, GND, GND}),
    .DO({\i_MMCM_ADV/DO15 , \i_MMCM_ADV/DO14 , \i_MMCM_ADV/DO13 , \i_MMCM_ADV/DO12 , \i_MMCM_ADV/DO11 , \i_MMCM_ADV/DO10 , \i_MMCM_ADV/DO9 , 
\i_MMCM_ADV/DO8 , \i_MMCM_ADV/DO7 , \i_MMCM_ADV/DO6 , \i_MMCM_ADV/DO5 , \i_MMCM_ADV/DO4 , \i_MMCM_ADV/DO3 , \i_MMCM_ADV/DO2 , \i_MMCM_ADV/DO1 , 
\i_MMCM_ADV/DO0 })
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by sandy40
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.