Hi,

I have two files and each consists of modules and in turn modules consists of some verilog

data and instances.i have to search for module name in the two files and comapare the

contents of the modules in the two files.

i have code it does module search,extract the contents of modules and compare

them and print the differnces.

BUT THE PROBLEM IS

I have same module 10 to 15 times in each file.

so what i have to do is take the the module name and for all occurrances

of module i have to take content in itand compare with other file

same module contents.but both the files have equal modules.

i was sending the files as attchements

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

$modul='X_RAMB18E1';
$string1 = readfile( $filename1); 
$string2 = readfile( $filename2); 


if($modul eq 'X_MMCM_ADV' or $modul eq 'X_RAMB18E1' or $modul eq 'X_RAMB36E1' or $modul eq 'X_FIFO36E1')
{
&mod1;
}
elsif($modul eq 'i_MMCM_ADV')
{
 &mod2;
}
else
{
print "module not found";
}

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

sub Help {
 $tmp = '\$';
print <<EOF
Usage\:perl pr2.pl -filename1 ise_routed.v -filename2 rodin_routed.v -modul X_MMCM_ADV
This script is used to generate a  report of differences between modules of 
file1 and file2taking module as another input parameter.
so according to the module name module based comparision will be done
EOF
    ;
exit 0;
}

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

$string2 =~ /$modul #\(([^;]*)\);/s;
$modcode_from_2 = $1;
open (MYFILE1, '>module2.txt');
print MYFILE1 "$modcode_from_2\n";
close (MYFILE1); 
undef $string2; 
$modcode_from_2 =~ s/[[:cntrl:]]//gm; 
@codes1 = split /\,/,  $modcode_from_1;
@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;
$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++;
}
}

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

$string2 =~ /$modul \(([^;]*)\);/s;
$modcode_from_2 = $1;
open (MYFILE1, '>module2.txt');
print MYFILE1 "$modcode_from_2\n";
close (MYFILE1); 
undef $string2; 
$modcode_from_2 =~ s/[[:cntrl:]]//gm; 
@codes1 = split /\,/,  $modcode_from_1;
@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;
$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++;
}

suppose if we take X_RAMB18E1 module it is present 15 times in each file.

but different is instances.so i have to take module in on file and compare it with other and print the diff.again upto the last occurance of module i have to do that.

so if select the X_RAMB18E1 comparision should be done in all 15 and print the differences


file1 file2 instance name


X_RAMB18E1 is occured 15 times each occurance has an instance different.

it below lock parameter in code.

i have uploaded the instances also.


'PLEASE TRY TO HELP ME"

YOU HELP ME FOR ONE ONE MODULE I WILL WORK FOR OTHER BY REFERENCE

Edited 6 Years Ago by koduruabhinav: n/a

Attachments
X_RAMB18E1 #(
    .DOA_REG ( 0 ),
    .DOB_REG ( 0 ),
    .READ_WIDTH_A ( 9 ),
    .READ_WIDTH_B ( 9 ),
    .WRITE_WIDTH_A ( 9 ),
    .WRITE_WIDTH_B ( 9 ),
    .RAM_MODE ( "TDP" ),
    .RDADDR_COLLISION_HWCONFIG ( "DELAYED_WRITE" ),
    .RSTREG_PRIORITY_A ( "REGCE" ),
    .RSTREG_PRIORITY_B ( "REGCE" ),
    .WRITE_MODE_A ( "READ_FIRST" ),
    .WRITE_MODE_B ( "READ_FIRST" ),
    .INITP_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_08 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_09 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_10 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_11 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_12 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_13 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_14 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_15 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_16 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_17 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_18 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_19 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_20 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_21 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_22 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_23 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_24 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_25 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_26 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_27 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_28 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_29 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_30 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_31 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_32 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_33 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_34 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_35 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_36 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_37 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_38 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_39 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_A ( 18'h00000 ),
    .INIT_B ( 18'h00000 ),
    .SRVAL_A ( 18'h00000 ),
    .SRVAL_B ( 18'h00000 ),
    .SIM_COLLISION_CHECK ( "ALL" ),
    .INIT_FILE ( "NONE" ),
    .LOC ( "RAMB18_X0Y31" ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l  (
    .CLKARDCLK(dut_clk),
    .CLKBWRCLK(dut_clk),
    .ENARDEN(1'b1),
    .ENBWREN(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_en_bram ),
    .REGCEAREGCE(1'b0),
    .REGCEB(1'b0),
    .RSTRAMARSTRAM(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTRAMB(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTREGARSTREG
(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l/INV_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_lRSTREGARSTREG )
,
    .RSTREGB
(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l/INV_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_lRSTREGB )
,
    .ADDRARDADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [0], 1'b1, 1'b1, 1'b1}),
    .ADDRBWRADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [0], 1'b1, 1'b1, 1'b1}),
    .DIADI({\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[15]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[14]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[13]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramge
X_RAMB18E1 #(
    .DOA_REG ( 0 ),
    .DOB_REG ( 0 ),
    .READ_WIDTH_A ( 9 ),
    .READ_WIDTH_B ( 9 ),
    .WRITE_WIDTH_A ( 9 ),
    .WRITE_WIDTH_B ( 9 ),
    .RAM_MODE ( "TDP" ),
    .RDADDR_COLLISION_HWCONFIG ( "DELAYED_WRITE" ),
    .RSTREG_PRIORITY_A ( "REGCE" ),
    .RSTREG_PRIORITY_B ( "REGCE" ),
    .WRITE_MODE_A ( "READ_FIRST" ),
    .WRITE_MODE_B ( "READ_FIRST" ),
    .INITP_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_08 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_09 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_10 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_11 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_12 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_13 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_14 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_15 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_16 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_17 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_18 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_19 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_20 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_21 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_22 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_23 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_24 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_25 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_26 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_27 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_28 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_29 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_30 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_31 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_32 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_33 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_34 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_35 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_36 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_37 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_38 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_39 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_A ( 18'h00000 ),
    .INIT_B ( 18'h00000 ),
    .SRVAL_A ( 18'h00000 ),
    .SRVAL_B ( 18'h00000 ),
    .SIM_COLLISION_CHECK ( "ALL" ),
    .INIT_FILE ( "NONE" ),
    .LOC ( "RAMB18_X1Y56" ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u  (
    .CLKARDCLK(dut_clk),
    .CLKBWRCLK(dut_clk),
    .ENARDEN(1'b1),
    .ENBWREN(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_en_bram ),
    .REGCEAREGCE(1'b0),
    .REGCEB(1'b0),
    .RSTRAMARSTRAM(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTRAMB(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTREGARSTREG(1'b0),
    .RSTREGB(1'b0),
    .ADDRARDADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/wr_addr [0], 1'b1, 1'b1, 1'b1}),
    .ADDRBWRADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr[7]_0 , 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr[5]_0 , 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/rd_addr [0], 1'b1, 1'b1, 1'b1}),
    .DIADI({\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u_DIADI[15]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u_DIADI[14]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u_DIADI[13]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u_DIADI[12]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u_DIADI[11]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u_DIADI[10]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u_DIADI[9]
Each  X_RAMB18E1 module consists of different instances like

\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/rx_fifo_i/ramgen_u
 \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_txmemory8  
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_l 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/rx_fifo_i/ramgen_l
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/rx_fifo_i/ramgen_u
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u
\U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_rxmemory8 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/rx_fifo_i/ramgen_l
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/rx_fifo_i/ramgen_u
\U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_txmemory8
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_l
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_u 
\U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_txmemory1
\U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_txmemory8 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/tx_fifo_i/ramgen_l


Each X_RAMB36E1 module consists of different instances like

  \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_rxmemory1  (

  \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_rxmemory2  (


  \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_rxmemory3  (


  \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_rxmemory4  (

  \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_rxmemory5  (

 \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_rxmemory6  (




Each X_FIFO36E1 module consists of different instances like

  \U_hwsim_engine/tx_fifo_i/BU2/U0/gbiv5.bi/v6_fifo.fblk/gextw[3].inst_extd/gonep.inst_prim/gf36e1_inst.sngfifo36e1  (

  \U_hwsim_engine/tx_fifo_i/BU2/U0/gbiv5.bi/v6_fifo.fblk/gextw[2].inst_extd/gonep.inst_prim/gf36e1_inst.sngfifo36e1  (

\U_hwsim_engine/tx_fifo_i/BU2/U0/gbiv5.bi/v6_fifo.fblk/gextw[1].inst_extd/gonep.inst_prim/gf36e1_inst.sngfifo36e1  (

\U_hwsim_engine/tx_fifo_i/BU2/U0/gbiv5.bi/v6_fifo.fblk/gextw[1].inst_extd/gonep.inst_prim/gf36e1_inst.sngfifo36e1  (

For the purpose of giving a simple example of extracting more than one instance from a string, I hard-coded a sample string instead of reading from your files. Notice that you can store the instances in an array instead of a single scalar variable.

#!/usr/bin/perl
use strict;
use warnings;

my $string_of_instances = <<END;
SIMPLE_MODULE #(
aa
bb
cc
dd
);

SIMPLE_MODULE #(
aa
bx
cx
dd
);

END

my @instances = $string_of_instances =~ /SIMPLE_MODULE #\(([^;]*)\);/gs;
my $count_of_instances = @instances;
print "Found $count_of_instances instances of SIMPLE_MODULE in the string.\n";

foreach (@instances){
    do_something($_);
}

sub do_something{
    #This subroutine is just a stub.
    #You can add logic to do what you want for each instance.
    my $mod_instance = shift(@_); #Assign passed parameter
    print "The following is one of the instances:\n$mod_instance\n";
    print '-' x 70, "\n";
}

Running the above prints the following output:

Found 2 instances of SIMPLE_MODULE in the string.
The following is one of the instances:

aa
bb
cc
dd

----------------------------------------------------------------------
The following is one of the instances:

aa
bx
cx
dd

----------------------------------------------------------------------

Hi,
the example was very useful for this basic programmer and working for 0ne instance.


in short my problem is

1. read the rwo files
2.take the contnt of files
3.find the module

3.compare the file1 X_RAMB18E1 and file 2 X_RAMB18E1

4.for each and every time and print the differences


so for example if X_RAMB18E1 occurs "n" times in file1

and X_RAMB18E1 occurs "n" time in file. n is not known

if n =15
i have to print differences for 15 times occuranceBut actually what i want is to print the differences
for first occurances print the differences
for second and so on

between number of same modules of same name in two files.
i was able toextract the instrance
in each module by RE

instance is some what like

1.) \U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/rx_fifo_i/ramgen_u

instance in X_RAMB18E1 for the first time

2.) \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_txmemory8

instance in X_RAMB18E1 for module occurance for the second time


like wise X_RAMB18E1 occurs 18 times each with different instance.

in the example file1 i have send only two modules of X_RAMB18E1


SO WHAT i want is if i give any module name the code should check occurance of module

if occurs then it should take the content of module from #( to semicolan

so upto now i can do this only for one module at a time.

i was trying to excute with while loop the code but i was unable....

#!/usr/bin/perl
use strict;
use warnings;

my $filename1='/home/david/Programming/Perl/data/filename1.txt';
my $filename2='/home/david/Programming/Perl/data/filename2.txt';

my $modul='X_RAMB18E1';
my $string1 = readfile( $filename1);
my $string2 = readfile( $filename2); 
$string1 =~ s/[[:cntrl:]]//gm; #Might as well get rid of newlines, etc. now
$string2 =~ s/[[:cntrl:]]//gm; #Might as well get rid of newlines, etc. now

#Extract instances of module from first file
$string1 =~ /($modul\s#\(.*\);)/gs;
my $string_of_instances_from_1 = $1;
undef $string1;
my @instances_1 = $string_of_instances_from_1 =~ /$modul #\(([^;]*)\);/g;
my $count_of_instances_1 = @instances_1;
print "Found $count_of_instances_1 instances of $modul in the string.\n";

#Extract instances of module from first file
$string2 =~ /($modul\s#\(.*\);)/gs;
my $string_of_instances_from_2 = $1;
undef $string2;
my @instances_2 = $string_of_instances_from_2 =~ /$modul #\(([^;]*)\);/g;
my $count_of_instances_2 = @instances_2;
print "Found $count_of_instances_2 instances of $modul in the string.\n";


die "$filename1 doesn't have same number of instances of $modul as $filename2!"
    unless $count_of_instances_1 == $count_of_instances_2;

my $i;
foreach(0..$#instances_1){
    $i = $_ + 1;
    print "Comparing Instance $i:-----------------------------------\n";
    compare_instances($_);
}

sub compare_instances{
    my $idx = shift @_; #Assign passed parameter to index variable
    my $modcode_from_1 = $instances_1[$idx];
    my $modcode_from_2 = $instances_2[$idx];
    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++;
    }
}

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

hi,
Thanks a lot for ur script it works with a bullet speed.

you are a great perl scripter.

Hi,

some simple code required.i was trying but i was unable.

i have turned the code u have devloped to work exactly with my requirement.

.But i want instances to get printed each time like we are printing comparing instance name.

suppose if we take

Each X_RAMB18E1 module consists of different instances like in file1
for the first time

\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/rx_fifo_i/ramgen_u   (
for the second time
 \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_txmemory8  (

Each X_RAMB18E1 module consists of different instances like in file2
for the first time

\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/rx_fifo_i/ramgen_u  (
for the second time
 \U_eth_aggregator_tb/eth_aggregator/core_0/central_memory/Mram_txmemory8  (

Now i want regular expression

to find the code starting with

\U_eth_aggregator_tb/eth_aggregator/core_0/ and ending with opening bracket.

and print the line.along with comparing instance1 (here i want the extaracted string) like

\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO1/rx_fifo_i/ramgen_u

for each every cccurance of module the instance is different

so i shouls use the same RE.but each insatance has same properties like starting with

\U_eth_aggregator_tb/eth_aggregator/core_0/ and ending with open bracket.

in short iwant RE starting with \U_eth_aggregator_tb/eth_aggregator/core_0/ and ending

with bracket.all the code is in @codes1 as u know. from codes1 i have to extract the instance with RE

I think that for this we don't need to extract the separate instances and split the codes. We can apply the regex to the string from the file instead. This time we don't remove the newlines.

#!/usr/bin/perl
use strict;
use warnings;

#Prepare regex pattern as follows (better to prepare complex rexex in advance)
my $pattern = '\\\U_eth_aggregator_tb/eth_aggregator/core_0/.+\(';
my $re = qr/$pattern/m;

my $filename1='/home/david/Programming/Perl/data/filename1.txt';

my $modul='X_RAMB18E1';
my $string1 = readfile( $filename1);

my $count = 0;
my @matches = $string1 =~ m/$re/g;
foreach (@matches){
        $count++;
        print "Occurence number $count of the pattern:\n$_\n\n";
}

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

Running the above on the filename1.txt that you attached gives the following output:

Occurence number 1 of the pattern:
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l  (

Occurence number 2 of the pattern:
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u  (

hi,
ya f9 its working good.actually i was fresher.i was not given any training in the company.i have to learn from net and should train myself.so i was asking u freqent.

thanq for ur timely help with good codes.

hi,
i have analysed the output of the code.but its not comparing correctly.
if X_RAMB18E1 module is taken in filename1 for the first occurances we have the instance like

\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u

if X_RAMB18E1 module is taken in filename2 for the first occurances we have the instance like

\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l

so arrangement of modules occurances is different from two files.
but comparision should not done like this.it should be done among the same instances only.
That isX_RAMB18E1 module is taken in filename1 has an instance

\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l

it should be compared with X_RAMB18E1 module is taken in filename2 has an instance only like

\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l

if ok means we can compare otherwise i have to search the file upto search criteria is find
But files have same no of modules and instances.but not comparing correctly.
we have to take one instance from file1 and find the occurance in another file and compare.
i was attaching all file1 file2 and code.pls run once and see.
in short problem.
Take one instance from X_RAMB18E1 from file1 and find its existence in second file2 if found compare that modules only.

that is X_RAMB18E1 module should be compared only if they have same instances .

my code also generate instances also.once you please run the code and give me solution.please help this was the final requirement.

my perl project will get completed.
upto now code is
1.read files
2.extracted the code
before comparison we have to do comparison of instances if ok means next comparison
(but every module instance in one file has compulsarily one instance in other file
3.comparision
instance means like this
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u
i was able to get them by inst_name1 inst_name2 .

Attachments
#!/usr/bin/perl
use strict;
use warnings; 
my $filename1='filename1.txt';
my $filename2='filename2.txt';
my $modul='X_RAMB18E1';
print " --------------------------------File1: $filename1\t\t File2:$filename2	-------------------------------------\n\n"; 
print "Module selected for comparision $modul\n\n";
my $string1 = readfile( $filename1);
my $string2 = readfile( $filename2); 
$string1 =~ s/[[:cntrl:]]//gm; 
$string2 =~ s/[[:cntrl:]]//gm; 

$string1 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom1 = $1;
undef $string1;
my @instances_1 = $instancesfrom1 =~ /$modul #\(([^;]*)\);/g;
my $instancescount1 = @instances_1;
print "Found $instancescount1 instances of $modul in the $filename1\n";

$string2 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom2 = $1;
undef $string2;
my @instances_2 = $instancesfrom2 =~ /$modul #\(([^;]*)\);/g;
my $instancescount2 = @instances_2;
print "Found $instancescount2 instances of $modul in the $filename2\n";

die "$filename1 doesn't have same number of instances of $modul as $filename2!"
    unless $instancescount1 == $instancescount2;
my $i;

foreach(0..$#instances_1){
    $i = $_ + 1; 
    print "Comparing Instance $i:-----------------------------------\n";
    compareinstances($_);
}
sub compareinstances
{
    my $x = shift @_; 
    my $modcodefrom1 = $instances_1[$x];
    my $modcodefrom2 = $instances_2[$x];
    my $inst_name1;
    if($modcodefrom1 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
        $inst_name1 = $1;
    }
    print "instance name from 1 is $inst_name1\n";
   
    my $inst_name2;
        if($modcodefrom2 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
            $inst_name2 = $1;
        }
    print "instance name from 2 is $inst_name2\n ";
   my @codes1 = split /\,/,  $modcodefrom1;
   my @codes2 = split /\,/,  $modcodefrom2;
   
    print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";
    printf "\t\t%-45s \t\t\t%s\n\n\n", $filename1, $filename2;
    my $i = 0;
    foreach ( @codes1) {
        unless ( $codes1[$i] eq $codes2[$i]) {
        printf "%-s IS NOT SAME AS %s\n\n", $codes1[$i], $codes2[$i];
        }
    $i++;
    }
}
sub readfile 
{
    my $file = shift;
    local $/;
    open my $fh,'<',"$file" or die "open of $file failed: $!\n";
    <$fh>;
};
X_RAMB18E1 #(
    .DOA_REG ( 0 ),
    .DOB_REG ( 0 ),
    .READ_WIDTH_A ( 9 ),
    .READ_WIDTH_B ( 9 ),
    .WRITE_WIDTH_A ( 9 ),
    .WRITE_WIDTH_B ( 9 ),
    .RAM_MODE ( "TDP" ),
    .RDADDR_COLLISION_HWCONFIG ( "DELAYED_WRITE" ),
    .RSTREG_PRIORITY_A ( "REGCE" ),
    .RSTREG_PRIORITY_B ( "REGCE" ),
    .WRITE_MODE_A ( "READ_FIRST" ),
    .WRITE_MODE_B ( "READ_FIRST" ),
    .INITP_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_08 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_09 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_10 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_11 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_12 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_13 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_14 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_15 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_16 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_17 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_18 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_19 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_20 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_21 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_22 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_23 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_24 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_25 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_26 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_27 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_28 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_29 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_30 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_31 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_32 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_33 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_34 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_35 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_36 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_37 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_38 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_39 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_A ( 18'h00000 ),
    .INIT_B ( 18'h00000 ),
    .SRVAL_A ( 18'h00000 ),
    .SRVAL_B ( 18'h00000 ),
    .SIM_COLLISION_CHECK ( "ALL" ),
    .INIT_FILE ( "NONE" ),
    .LOC ( "RAMB18_X0Y30" ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u  (
    .CLKARDCLK(dut_clk),
    .CLKBWRCLK(dut_clk),
    .ENARDEN(1'b1),
    .ENBWREN(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_en_bram ),
    .REGCEAREGCE(1'b0),
    .REGCEB(1'b0),
    .RSTRAMARSTRAM(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTRAMB(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTREGARSTREG
(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u/INV_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_uRSTREGARSTREG )
,
    .RSTREGB
(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u/INV_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_uRSTREGB )
,
    .ADDRARDADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [0], 1'b1, 1'b1, 1'b1}),
    .ADDRBWRADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [0], 1'b1, 1'b1, 1'b1}),
    .DIADI({\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u_DIADI[15]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u_DIADI[14]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u_DIADI[13]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/r
X_RAMB18E1 #(
    .DOA_REG ( 0 ),
    .DOB_REG ( 0 ),
    .READ_WIDTH_A ( 9 ),
    .READ_WIDTH_B ( 9 ),
    .WRITE_WIDTH_A ( 9 ),
    .WRITE_WIDTH_B ( 9 ),
    .RAM_MODE ( "TDP" ),
    .RDADDR_COLLISION_HWCONFIG ( "DELAYED_WRITE" ),
    .RSTREG_PRIORITY_A ( "REGCE" ),
    .RSTREG_PRIORITY_B ( "REGCE" ),
    .WRITE_MODE_A ( "READ_FIRST" ),
    .WRITE_MODE_B ( "READ_FIRST" ),
    .INITP_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_08 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_09 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_10 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_11 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_12 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_13 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_14 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_15 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_16 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_17 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_18 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_19 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_20 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_21 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_22 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_23 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_24 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_25 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_26 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_27 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_28 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_29 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_30 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_31 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_32 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_33 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_34 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_35 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_36 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_37 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_38 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_39 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_A ( 18'h00000 ),
    .INIT_B ( 18'h00000 ),
    .SRVAL_A ( 18'h00000 ),
    .SRVAL_B ( 18'h00000 ),
    .SIM_COLLISION_CHECK ( "ALL" ),
    .INIT_FILE ( "NONE" ),
    .LOC ( "RAMB18_X1Y59" ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l  (
    .CLKARDCLK(dut_clk),
    .CLKBWRCLK(dut_clk),
    .ENARDEN(1'b1),
    .ENBWREN(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_en_bram ),
    .REGCEAREGCE(1'b0),
    .REGCEB(1'b0),
    .RSTRAMARSTRAM(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTRAMB(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTREGARSTREG(1'b0),
    .RSTREGB(1'b0),
    .ADDRARDADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [0], 1'b1, 1'b1, 1'b1}),
    .ADDRBWRADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [0], 1'b1, 1'b1, 1'b1}),
    .DIADI({\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[15]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[14]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[13]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[12]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[11]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[10]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[9]_UN
#!/usr/bin/perl
use strict;
use warnings; 
my $filename1='/home/david/Programming/Perl/data/filename1.txt';
my $filename2='/home/david/Programming/Perl/data/filename2.txt';
my $modul='X_RAMB18E1';
print " --------------------------------File1: $filename1\t\t File2:$filename2    -------------------------------------\n\n"; 
print "Module selected for comparision $modul\n\n";
my $string1 = readfile( $filename1);
my $string2 = readfile( $filename2); 
$string1 =~ s/[[:cntrl:]]//gm; 
$string2 =~ s/[[:cntrl:]]//gm; 

$string1 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom1 = $1;
undef $string1;
my @instances_1 = $instancesfrom1 =~ /$modul #\(([^;]*)\);/g;
my $instancescount1 = @instances_1;
print "Found $instancescount1 instances of $modul in the $filename1\n";

$string2 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom2 = $1;
undef $string2;
my @instances_2 = $instancesfrom2 =~ /$modul #\(([^;]*)\);/g;
my $instancescount2 = @instances_2;
print "Found $instancescount2 instances of $modul in the $filename2\n";

die "$filename1 doesn't have same number of instances of $modul as $filename2!"
    unless $instancescount1 == $instancescount2;
my $i;

my %instance_index_1 = build_index_hash(\@instances_1);
my %instance_index_2 = build_index_hash(\@instances_2);

foreach(sort keys %instance_index_1){
    if (exists $instance_index_2{$_}){
        print "Comparing Instance $_------\n";
        compareinstances($instance_index_1{$_}, $instance_index_2{$_});
    }
    else{
        print "Instance $_ not found in second file.------\n"
    }
}

sub build_index_hash{
    my @arr = @{$_[0]}; #dereference passed parameter
    my %h;
    my $i;
    foreach (@arr){
        $_ =~ m/\)\s*\)\s*(.*)\s*\(\s*\./;
        $h{$1} = $i++;
    }
    return %h;
}

sub compareinstances
{
    my $x = shift @_;
    my $y = shift @_;
    my $modcodefrom1 = $instances_1[$x];
    my $modcodefrom2 = $instances_2[$y];
    my $inst_name1;
    if($modcodefrom1 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
        $inst_name1 = $1;
    }
    print "instance name from 1 is $inst_name1\n";
   
    my $inst_name2;
        if($modcodefrom2 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
            $inst_name2 = $1;
        }
    print "instance name from 2 is $inst_name2\n ";
   my @codes1 = split /\,/,  $modcodefrom1;
   my @codes2 = split /\,/,  $modcodefrom2;
   
    print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";
    printf "\t\t%-45s \t\t\t%s\n\n\n", $filename1, $filename2;
    my $i = 0;
    foreach ( @codes1) {
        unless ( $codes1[$i] eq $codes2[$i]) {
        printf "%-s IS NOT SAME AS %s\n\n", $codes1[$i], $codes2[$i];
        }
    $i++;
    }
}

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

Hi,
First of all i was thankful to u for your timely help by code.
The code work good.problem is it is working upto 68 modules and not working for 21 modules.
what i have observed in those 68 modules is lines arrangement in modules are same(position of lines).so codes eq codes[j] works.
for example first line in module of file1 has sham and first line in module of file2 has sham .then code works excellently.
otherwise problem.

so i think i have to do other than line wise comparision.
the common property of all the modules lines is
FOR EX .LOC ( "SLICE_X53Y152" )
STARTS WITH DOT AND ENDS WITH CLOSE BRACE.
THE COMPARISION I HAVE TO DO IS
1.)instances comparison if ok means comparision(already you done for me yesterday)

2.)now code comparison i have to add another level of comparision

for this the way i have to do is if we take above example

1.take content in between DOT and OPENING BRACE in file1, module(we get loc)

2.)take content form 1(loc) as search parameter and find the content present in file2 module

3.)if found take the content from dot to closing brace (.LOC ( "SLICE_X53Y152" )form two modules of two files and compare

like wise i have to do upto the end of module. upto number of occurances

i think my req was finished.but one more please give me solution.
i was learning a lot from u.

i was attaching files and the code is same as before but modul name is X_RAMD32

Attachments
#!/usr/bin/perl
use strict;
use warnings; 


my $filename1='filenam1.txt';
my $filename2='filename2.txt';
my $modul='X_RAMD32';
print " --------------------------------File1: $filename1\t\t File2:$filename2    -------------------------------------\n\n"; 
print "Module selected for comparision $modul\n\n";
my $string1 = readfile( $filename1);
my $string2 = readfile( $filename2); 
$string1 =~ s/[[:cntrl:]]//gm; 
$string2 =~ s/[[:cntrl:]]//gm; 

$string1 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom1 = $1;
undef $string1;
my @instances_1 = $instancesfrom1 =~ /$modul #\(([^;]*)\);/g;
my $instancescount1 = @instances_1;
print "Found $instancescount1 instances of $modul in the $filename1\n";

$string2 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom2 = $1;
undef $string2;
my @instances_2 = $instancesfrom2 =~ /$modul #\(([^;]*)\);/g;
my $instancescount2 = @instances_2;
print "Found $instancescount2 instances of $modul in the $filename2\n";

#die "$filename1 doesn't have same number of instances of $modul as $filename2!"
 #   unless $instancescount1 == $instancescount2;
my $i=1;
my %instance_index_1 = buildindexhash(\@instances_1);
my %instance_index_2 = buildindexhash(\@instances_2);

foreach(sort keys %instance_index_1){
    if (exists $instance_index_2{$_}){
        print "Comparing $i Instance $_------\n";
        compareinstances($instance_index_1{$_}, $instance_index_2{$_});
    }
    else{
        print "Instance $_ not found in second file.------\n";
    }
$i++;
	}

sub buildindexhash{
    my @arr = @{$_[0]}; 
    my %h;
    my $i;
    foreach (@arr){
        $_ =~ m/\)\s*\)\s*(.*)\s*\(\s*\./;
        $h{$1} = $i++;
    }
    return %h;
}

sub compareinstances
{
    my $x = shift @_;
    my $y = shift @_;
    my $modcodefrom1 = $instances_1[$x];
    my $modcodefrom2 = $instances_2[$y];
    my $inst_name1;
    if($modcodefrom1 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
        $inst_name1 = $1;
    }
    print "instance name of $modul from file1 $filename1 is $inst_name1\n";
   
    my $inst_name2;
        if($modcodefrom2 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
            $inst_name2 = $1;
        }
    print "instance name of $modul from file2 $filename2 is $inst_name1\n ";
   my @codes1 = split /\,/,  $modcodefrom1;
   my @codes2 = split /\,/,  $modcodefrom2;
   
    print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";
   
	printf "\t\t%-45s \t\t\t%s\n\n\n", $filename1, $filename2;
    my $i = 0;
    foreach ( @codes1) {
        unless ( $codes1[$i] eq $codes2[$i]) {
        printf "%-s IS NOT SAME AS %s\n\n", $codes1[$i], $codes2[$i];
        }
    $i++;
    }
}

sub readfile 
{
    my $file = shift;
    local $/;
    open my $fh,'<',"$file" or die "open of $file failed: $!\n";
    <$fh>;
};
X_RAMD32 #(
    .LOC ( "SLICE_X68Y145" ),
    .INIT ( 32'h55555555 ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/has_address_filter.has_host_if.has_mac_address_table.gen_ram_byte0[0].dist_ram/DP  (
    .RADR0(1'b0),
    .RADR1
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [0])
,
    .RADR2
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [1])
,
    .RADR3
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [2])
,
    .RADR4(1'b0),
    .CLK(dut_clk),
    .I
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_data [0])
,
    .O
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/mac_address_byte [0])
,
    .WADR0(1'b0),
    .WADR1
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [0])
,
    .WADR2
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [1])
,
    .WADR3
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [2])
,
    .WADR4
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [3])
,
    .WE
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/add_table_wr_142099 )

  );
X_RAMD32 #(
    .LOC ( "SLICE_X88Y155" ),
    .INIT ( 32'h55555555 ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/has_address_filter.has_host_if.has_mac_address_table.gen_ram_byte0[0].dist_ram/DP  (
    .O
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/mac_address_byte [0])
,
    .CLK(dut_clk),
    .I
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_data [0])
,
    .RADR0(1'b0),
    .RADR1
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [0])
,
    .RADR2
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [1])
,
    .RADR3
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [2])
,
    .RADR4(1'b0),
    .WADR0(1'b0),
    .WADR1
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [0])
,
    .WADR2
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [1])
,
    .WADR3
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [2])
,
    .WADR4
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [3])
,
    .WE
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/add_table_wr )

  );


X_RAMD32 #(
    .LOC ( "SLICE_X88Y155" ),
    .INIT ( 32'h00000000 ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/has_address_filter.has_host_if.has_mac_address_table.gen_ram_byte0[1].dist_ram/DP  (
    .RADR0(1'b0),
    .RADR1
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [0])
,
    .RADR2
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [1])
,
    .RADR3
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/counter [2])
,
    .RADR4(1'b0),
    .CLK(dut_clk),
    .I
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_data [1])
,
    .O
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/mac_address_byte [1])
,
    .WADR0(1'b0),
    .WADR1
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [0])
,
    .WADR2
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [1])
,
    .WADR3
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [2])
,
    .WADR4
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/ram_addr_wr [3])
,
    .WE
(\U_eth_aggregator_tb/eth_aggregator/core_0/trimac_core0/tri_mode_eth_mac_hdl/TRI_SPEED.TRIMAC_INST/addr_filter_top/dynamic_af_gen.dynamic_config/add_table_wr )

  );
#!/usr/bin/perl
use strict;
use warnings; 

my $filename1='/home/david/Programming/Perl/data/filename1.txt';
my $filename2='/home/david/Programming/Perl/data/filename2.txt';
my $modul='X_RAMD32';
print " --------------------------------File1: $filename1\t\t File2:$filename2    -------------------------------------\n\n"; 
print "Module selected for comparision $modul\n\n";
my $string1 = readfile( $filename1);
my $string2 = readfile( $filename2); 
$string1 =~ s/[[:cntrl:]]//gm; 
$string2 =~ s/[[:cntrl:]]//gm; 

$string1 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom1 = $1;
undef $string1;
my @instances_1 = $instancesfrom1 =~ /$modul #\(([^;]*)\);/g;
my $instancescount1 = @instances_1;
print "Found $instancescount1 instances of $modul in the $filename1\n";

$string2 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom2 = $1;
undef $string2;
my @instances_2 = $instancesfrom2 =~ /$modul #\(([^;]*)\);/g;
my $instancescount2 = @instances_2;
print "Found $instancescount2 instances of $modul in the $filename2\n";

#die "$filename1 doesn't have same number of instances of $modul as $filename2!"
 #   unless $instancescount1 == $instancescount2;
my $i=1;
my %instance_index_1 = buildindexhash(\@instances_1);
my %instance_index_2 = buildindexhash(\@instances_2);

foreach(sort keys %instance_index_1){
    if (exists $instance_index_2{$_}){
        print "Comparing $i Instance $_------\n";
        compareinstances($instance_index_1{$_}, $instance_index_2{$_});
    }
    else{
        print "Instance $_ not found in second file.------\n";
    }
$i++;
}

sub buildindexhash{
    my @arr = @{$_[0]}; 
    my %h;
    my $i;
    foreach (@arr){
        $_ =~ m/\)\s*\)\s*(.*)\s*\(\s*\./;
        $h{$1} = $i++;
    }
    return %h;
}

sub compareinstances
{
    my $x = shift @_;
    my $y = shift @_;
    my $modcodefrom1 = $instances_1[$x];
    my $modcodefrom2 = $instances_2[$y];
    my $inst_name1;
    if($modcodefrom1 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
        $inst_name1 = $1;
    }
    print "instance name of $modul from file1 $filename1 is $inst_name1\n";
   
    my $inst_name2;
        if($modcodefrom2 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
            $inst_name2 = $1;
        }
    print "instance name of $modul from file2 $filename2 is $inst_name1\n ";
   my @codes1 = split /\,/,  $modcodefrom1;
   my @codes2 = split /\,/,  $modcodefrom2;
   
    print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";
   
    printf "\t\t%-45s \t\t\t%s\n\n\n", $filename1, $filename2;

    foreach (@codes1){
    if ( m/
        (         #capture following to $1
         (        #capture following to $2
         \.       #dot
         [^(]+    #one or more characters excepting (
        )         #end of capture group $2
         \s*      #possibly some spaces or newlines
         \(       #followed by open (
           [^)]*? #possibly some characters excepting )
           \)     #followed by close )
         )        #end of capture group $1
          /x ){   #end of match condition. x means ignore spaces and allow comments
        my $all_code_1 = $1;
        my $lkup_cd1 = $2;
        my $code2compare = lookup_code2($lkup_cd1, \@codes2);
        unless ( $all_code_1 eq $code2compare) {
        printf "%-s IS NOT SAME AS %s\n\n", $all_code_1, $code2compare;
        }
    }
    }
}

sub lookup_code2{
    my $lkup = shift @_;
    #print "Attempting to match $lkup\n";
    my @cds2 = @{shift @_};
    foreach (@cds2){
    s/^\s+//; #remove leading spaces
    s/\s+$//; #remove trailing spaces
    if ( m/^(\Q$lkup(\E.+?\))/ ) { #\Q means escape non-word characters (such as dot) until \E
        #print "Returning $1\n";
        return $1;
    }
    }
    return "No match found in codes 2";
}

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

Hi,
Thank u for ur code.i was checking it for alla my 95 modules.it took some time for me to say about the working condition.anyway you are the great help for me.

what i have to do to learn perl.any tutorials there or any methods you suggest me to learn.if so pls send me the links of where i have to learn the perl

I'm glad it works. I bought Beginning Perl by Simon Cozens 5 years ago and have read it all through. I have referred to it often. Now it is available for free online. Learning Perl, by Randal Schwartz and others is good too, but not free.

A good source of documentation and tutorials would be perl.org. When I'm stuck I google perl plus a few key words. Often the answer turns up on stackoverflow.com, perl.org, perlmonks.org, about.perl.com and of course, daniweb.com.

Hi,
I have anotherr problem.Actually we are extracting the content of module between hash

paranthesis and ending with closing paranthesis and semicolan.but actually when i was

changing the RE to extact the code upto two closing paranthesis(two closing brackets)

getting error.i did it by simply removing semicolan in RE and replaced with slash bracket.
but error was coming

in short each module has the code
as follows

X_RAMB18E1 #(
                                    
---------------------
---------------------
))
-----------
);

now i want to extract code above double brackts in both files and compare them and print the diff.
remaining everything is same i think i have to change the RE.

remaing instance comp etc same but the thing is i have to extract the code upto first

occurance of double closing paranthesis

In the two files to identify i wrote END at the place of double paranthesi

But major twist is we are doing instance comparision know

but that line is below double paranthesis(or bracket)so i was getting error.

so i want instance based comparision but comparison of parameters should be abovr double

paranthesis only

plese try to help me

Attachments
X_RAMB18E1 #(
    .DOA_REG ( 0 ),
    .DOB_REG ( 0 ),
    .READ_WIDTH_A ( 9 ),
    .READ_WIDTH_B ( 9 ),
    .WRITE_WIDTH_A ( 9 ),
    .WRITE_WIDTH_B ( 9 ),
    .RAM_MODE ( "TDP" ),
    .RDADDR_COLLISION_HWCONFIG ( "DELAYED_WRITE" ),
    .RSTREG_PRIORITY_A ( "REGCE" ),
    .RSTREG_PRIORITY_B ( "REGCE" ),
    .WRITE_MODE_A ( "READ_FIRST" ),
    .WRITE_MODE_B ( "READ_FIRST" ),
    .INITP_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_08 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_09 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_10 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_11 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_12 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_13 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_14 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_15 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_16 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_17 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_18 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_19 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_20 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_21 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_22 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_23 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_24 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_25 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_26 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_27 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_28 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_29 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_30 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_31 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_32 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_33 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_34 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_35 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_36 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_37 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_38 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_39 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_A ( 18'h00000 ),
    .INIT_B ( 18'h00000 ),
    .SRVAL_A ( 18'h00000 ),
    .SRVAL_B ( 18'h00000 ),
    .SIM_COLLISION_CHECK ( "ALL" ),
    .INIT_FILE ( "NONE" ),
    .LOC ( "RAMB18_X0Y30" ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u  (
    .CLKARDCLK(dut_clk),
    .CLKBWRCLK(dut_clk),
    .ENARDEN(1'b1),
    .ENBWREN(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_en_bram ),
    .REGCEAREGCE(1'b0),
    .REGCEB(1'b0),
    .RSTRAMARSTRAM(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTRAMB(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTREGARSTREG
(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u/INV_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_uRSTREGARSTREG )
,
    .RSTREGB
(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u/INV_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_uRSTREGB )
,
    .ADDRARDADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [0], 1'b1, 1'b1, 1'b1}),
    .ADDRBWRADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [0], 1'b1, 1'b1, 1'b1}),
    .DIADI({\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u_DIADI[15]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u_DIADI[14]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_u_DIADI[13]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/r
X_RAMB18E1 #(
    .DOA_REG ( 0 ),
    .DOB_REG ( 0 ),
    .READ_WIDTH_A ( 9 ),
    .READ_WIDTH_B ( 9 ),
    .WRITE_WIDTH_A ( 9 ),
    .WRITE_WIDTH_B ( 9 ),
    .RAM_MODE ( "TDP" ),
    .RDADDR_COLLISION_HWCONFIG ( "DELAYED_WRITE" ),
    .RSTREG_PRIORITY_A ( "REGCE" ),
    .RSTREG_PRIORITY_B ( "REGCE" ),
    .WRITE_MODE_A ( "READ_FIRST" ),
    .WRITE_MODE_B ( "READ_FIRST" ),
    .INITP_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_08 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_09 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_10 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_11 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_12 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_13 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_14 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_15 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_16 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_17 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_18 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_19 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_20 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_21 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_22 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_23 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_24 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_25 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_26 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_27 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_28 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_29 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_30 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_31 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_32 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_33 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_34 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_35 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_36 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_37 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_38 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_39 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_A ( 18'h00000 ),
    .INIT_B ( 18'h00000 ),
    .SRVAL_A ( 18'h00000 ),
    .SRVAL_B ( 18'h00000 ),
    .SIM_COLLISION_CHECK ( "ALL" ),
    .INIT_FILE ( "NONE" ),
    .LOC ( "RAMB18_X1Y59" ))
  \U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l  (
    .CLKARDCLK(dut_clk),
    .CLKBWRCLK(dut_clk),
    .ENARDEN(1'b1),
    .ENBWREN(\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_en_bram ),
    .REGCEAREGCE(1'b0),
    .REGCEB(1'b0),
    .RSTRAMARSTRAM(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTRAMB(\U_eth_aggregator_tb/agg_tx_data_gen/reset_n_inv ),
    .RSTREGARSTREG(1'b0),
    .RSTREGB(1'b0),
    .ADDRARDADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/wr_addr [0], 1'b1, 1'b1, 1'b1}),
    .ADDRBWRADDR({\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [10], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [9], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [8], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [7], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [6], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [5], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [4], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [3], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [2], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [1], 
\U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/rd_addr [0], 1'b1, 1'b1, 1'b1}),
    .DIADI({\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[15]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[14]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[13]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[12]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[11]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[10]_UNCONNECTED , 
\NLW_U_eth_aggregator_tb/eth_aggregator/core_0/client_side_FIFO0/tx_fifo_i/ramgen_l_DIADI[9]_UN

hi,i have solved the problem.
i was able to write RE and made it to work
yesterday i read some of the articles you have said and solved this

Edited 6 Years Ago by koduruabhinav: n/a

Hi,
I have another problem.the code is working fine.
But in the differences i dont want differences of LOC parameters.
For example
.LOC ( "MMCM_ADV_X0Y0" ) IS NOT SAME AS .LOC ( "MMCM_ADV_X0Y5" )
should be eliminated.like wise each time module diff has parameters starting with .LOC("--------")
should not be eliminated
But i was trying with if loop at $lkup_cd1 notequal to .LOC entering into the loop otherwise doing
nothing in the loop.But i was unable to do it.

so when we are checking for the occurances (which u did for me two days before)

and comparing parameter wise we should eliminate parameters starting with .LOC

(thatis we are taking content between dot and first bracket we get LOC know
at that time we should not call function to show differences for remaining we shouls do
like that.)


so please try to help me

Attachments
#!/usr/bin/perl
use strict;
use warnings; 

my $filename1='filename1.txt';
my $filename2='filename2.txt';
my $modul='X_MMCM_ADV';
print " --------------------------------File1: $filename1\t\t File2:$filename2    -------------------------------------\n\n"; 
print "Module selected for comparision $modul\n\n";
my $string1 = readfile( $filename1);
my $string2 = readfile( $filename2); 
$string1 =~ s/[[:cntrl:]]//gm; 
$string2 =~ s/[[:cntrl:]]//gm; 

$string1 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom1 = $1;
undef $string1;
my @instances_1 = $instancesfrom1 =~ /$modul #\(([^;]*)\);/g;
my $instancescount1 = @instances_1;
print "Found $instancescount1 instances of $modul in the $filename1\n";

$string2 =~ /($modul\s#\(.*\);)/gs;
my $instancesfrom2 = $1;
undef $string2;
my @instances_2 = $instancesfrom2 =~ /$modul #\(([^;]*)\);/g;
my $instancescount2 = @instances_2;
print "Found $instancescount2 instances of $modul in the $filename2\n";

#die "$filename1 doesn't have same number of instances of $modul as $filename2!"
 #   unless $instancescount1 == $instancescount2;
my $i=1;
my %instance_index_1 = buildindexhash(\@instances_1);
my %instance_index_2 = buildindexhash(\@instances_2);

foreach(sort keys %instance_index_1){
    if (exists $instance_index_2{$_}){
        print "Comparing $i Instance $_------\n";
        compareinstances($instance_index_1{$_}, $instance_index_2{$_});
    }
    else{
        print "Instance $_ not found in second file.------\n";
    }
$i++;
}

sub buildindexhash{
    my @arr = @{$_[0]}; 
    my %h;
    my $i;
    foreach (@arr){
        $_ =~ m/\)\s*\)\s*(.*)\s*\(\s*\./;
        $h{$1} = $i++;
    }
    return %h;
}

sub compareinstances
{
    my $x = shift @_;
    my $y = shift @_;
    my $modcodefrom1 = $instances_1[$x];
    my $modcodefrom2 = $instances_2[$y];
    my $inst_name1;
    if($modcodefrom1 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
        $inst_name1 = $1;
    }
    print "instance name of $modul from file1 $filename1 is $inst_name1\n";
   
    my $inst_name2;
        if($modcodefrom2 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
            $inst_name2 = $1;
        }
    print "instance name of $modul from file2 $filename2 is $inst_name1\n ";
   my @codes1 = split /\,/,  $modcodefrom1;
   my @codes2 = split /\,/,  $modcodefrom2;
   
    print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";
   
    printf "\t\t%-45s \t\t\t%s\n\n\n", $filename1, $filename2;

    foreach (@codes1){
    if ( m/
        (         #capture following to $1
         (        #capture following to $2
         \.       #dot
         [^(]+    #one or more characters excepting (
        )         #end of capture group $2
         \s*      #possibly some spaces or newlines
         \(       #followed by open (
           [^)]*? #possibly some characters excepting )
           \)     #followed by close )
         )        #end of capture group $1
          /x ){   #end of match condition. x means ignore spaces and allow comments
        my $all_code_1 = $1;
        my $lkup_cd1 = $2;
        my $code2compare = lookup_code2($lkup_cd1, \@codes2);
        unless ( $all_code_1 eq $code2compare) {
        printf "%-s IS NOT SAME AS %s\n\n", $all_code_1, $code2compare;
        }
    }
    }
}

sub lookup_code2{
    my $lkup = shift @_;
    #print "Attempting to match $lkup\n";
    my @cds2 = @{shift @_};
    foreach (@cds2){
    s/^\s+//; #remove leading spaces
    s/\s+$//; #remove trailing spaces
    if ( m/^(\Q$lkup(\E.+?\))/ ) { #\Q means escape non-word characters (such as dot) until \E
        #print "Returning $1\n";
        return $1;
    }
    }
    return "No match found in codes 2";
}

sub readfile 
{
    my $file = shift;
    local $/;
    open my $fh,'<',"$file" or die "open of $file failed: $!\n";
    <$fh>;
};
X_MMCM_ADV #(
    .CLOCK_HOLD ( "FALSE" ),
    .CLKOUT4_CASCADE ( "FALSE" ),
    .BANDWIDTH ( "OPTIMIZED" ),
    .CLKFBOUT_USE_FINE_PS ( "FALSE" ),
    .CLKOUT0_USE_FINE_PS ( "FALSE" ),
    .CLKOUT1_USE_FINE_PS ( "FALSE" ),
    .CLKOUT2_USE_FINE_PS ( "FALSE" ),
    .CLKOUT3_USE_FINE_PS ( "FALSE" ),
    .CLKOUT4_USE_FINE_PS ( "FALSE" ),
    .CLKOUT5_USE_FINE_PS ( "FALSE" ),
    .CLKOUT6_USE_FINE_PS ( "FALSE" ),
    .COMPENSATION ( "ZHOLD" ),
    .STARTUP_WAIT ( "FALSE" ),
    .CLKFBOUT_MULT_F ( 6.000000 ),
    .CLKFBOUT_PHASE ( 0.000000 ),
    .CLKOUT0_DIVIDE_F ( 1.000000 ),
    .CLKOUT0_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT0_PHASE ( 0.000000 ),
    .CLKOUT1_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT1_PHASE ( 0.000000 ),
    .CLKOUT2_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT2_PHASE ( 0.000000 ),
    .CLKOUT3_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT3_PHASE ( 0.000000 ),
    .CLKOUT4_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT4_PHASE ( 0.000000 ),
    .CLKOUT5_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT5_PHASE ( 0.000000 ),
    .CLKOUT6_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT6_PHASE ( 0.000000 ),
    .REF_JITTER1 ( 0.010000 ),
    .REF_JITTER2 ( 0.010000 ),
    .CLKOUT1_DIVIDE ( 12 ),
    .CLKOUT2_DIVIDE ( 12 ),
    .CLKOUT3_DIVIDE ( 1 ),
    .CLKOUT4_DIVIDE ( 1 ),
    .CLKOUT5_DIVIDE ( 1 ),
    .CLKOUT6_DIVIDE ( 1 ),
    .DIVCLK_DIVIDE ( 1 ),
    .CLKIN1_PERIOD ( 5 ),
    .CLKIN2_PERIOD ( 0 ),
    .LOC ( "MMCM_ADV_X0Y0" ),
    .VCOCLK_FREQ_MAX ( 1200.000000 ),
    .VCOCLK_FREQ_MIN ( 600.000000 ),
    .CLKIN_FREQ_MAX ( 700.000000 ),
    .CLKIN_FREQ_MIN ( 10.000000 ),
    .CLKPFD_FREQ_MAX ( 450.000000 ),
    .CLKPFD_FREQ_MIN ( 10.000000 ))
  \U_hwsim_engine/mmcm_i  (
    .CLKFBIN(\U_hwsim_engine/clk_0_bufg ),
    .PSCLK(GND),
    .PWRDWN(\U_hwsim_engine/mmcm_i/PWRDWN_INT ),
    .DCLK(GND),
    .DEN(GND),
    .CLKINSEL(\U_hwsim_engine/mmcm_i/CLKINSEL_INT ),
    .CLKIN2(GND),
    .RST(\U_hwsim_engine/mmcm_i_ML_NEW_OUT ),
    .PSINCDEC(\U_hwsim_engine/mmcm_i/PSINCDEC_INT ),
    .DWE(GND),
    .PSEN(\U_hwsim_engine/mmcm_i/PSEN_INT ),
    .CLKIN1(sys_clk),
    .CLKOUT3(\U_hwsim_engine/mmcm_i/CLKOUT3 ),
    .CLKOUT3B(\U_hwsim_engine/mmcm_i/CLKOUT3B ),
    .CLKFBOUT(\U_hwsim_engine/clk_0 ),
    .CLKFBSTOPPED(\U_hwsim_engine/mmcm_i/CLKFBSTOPPED ),
    .CLKFBOUTB(\U_hwsim_engine/mmcm_i/CLKFBOUTB ),
    .CLKOUT1(\U_hwsim_engine/inclk_div2 ),
    .CLKOUT5(\U_hwsim_engine/mmcm_i/CLKOUT5 ),
    .DRDY(\U_hwsim_engine/mmcm_i/DRDY ),
    .CLKOUT0(\U_hwsim_engine/mmcm_i/CLKOUT0 ),
    .CLKOUT4(\U_hwsim_engine/mmcm_i/CLKOUT4 ),
    .CLKOUT1B(\U_hwsim_engine/mmcm_i/CLKOUT1B ),
    .CLKINSTOPPED(\U_hwsim_engine/mmcm_i/CLKINSTOPPED ),
    .CLKOUT0B(\U_hwsim_engine/mmcm_i/CLKOUT0B ),
    .CLKOUT2(\U_hwsim_engine/clk_fx_int ),
    .CLKOUT2B(\U_hwsim_engine/mmcm_i/CLKOUT2B ),
    .PSDONE(\U_hwsim_engine/mmcm_i/PSDONE ),
    .CLKOUT6(\U_hwsim_engine/mmcm_i/CLKOUT6 ),
    .LOCKED(\U_hwsim_engine/mmcm_i_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({\U_hwsim_engine/mmcm_i/DO15 , \U_hwsim_engine/mmcm_i/DO14 , \U_hwsim_engine/mmcm_i/DO13 , \U_hwsim_engine/mmcm_i/DO12 , 
\U_hwsim_engine/mmcm_i/DO11 , \U_hwsim_engine/mmcm_i/DO10 , \U_hwsim_engine/mmcm_i/DO9 , \U_hwsim_engine/mmcm_i/DO8 , \U_hwsim_engine/mmcm_i/DO7 , 
\U_hwsim_engine/mmcm_i/DO6 , \U_hwsim_engine/mmcm_i/DO5 , \U_hwsim_engine/mmcm_i/DO4 , \U_hwsim_engine/mmcm_i/DO3 , \U_hwsim_engine/mmcm_i/DO2 , 
\U_hwsim_engine/mmcm_i/DO1 , \U_hwsim_engine/mmcm_i/DO0 })
  );
  X_BSCAN_VIRTEX6 
  \U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/I_V6.ISYN.I_USE_SOFTBSCAN_EQ0.U_BS  (
    .CAPTURE
(\NLW_U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/I_V6.ISYN.I_USE_SOFTBSCAN_EQ0.U_BS_CAPTURE_UNCONNECTED )
,
    .DRCK
(\U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/iDRCK_LOCAL )
,
    .RESET
(\NLW_U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/I_V6.ISYN.I_USE_SOFTBSCAN_EQ0.U_BS_RESET_UNCONNECTED )
,
    .RUNTEST
(\NLW_U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/I_V6.ISYN.I_USE_SOFTBSCAN_EQ0.U_BS_RUNTEST_UNCONNECTED )
,
    .SEL(\U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/iSEL ),
    .SHIFT(\U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/iSHIFT_OUT ),
    .TCK
(\NLW_U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/I_V6.ISYN.I_USE_SOFTBSCAN_EQ0.U_BS_TCK_UNCONNECTED )
,
    .TDI(\U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/iTDI ),
    .TDO(\U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/iTDO ),
    .TMS
(\NLW_U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/I_V6.ISYN.I_USE_SOFTBSCAN_EQ0.U_BS_TMS_UNCONNECTED )
,
    .UPDATE(\U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/iUPDATE_OUT )
  );
  X_CKBUF #(
    .LOC ( "BUFGCTRL_X0Y31" ))
  \U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/I_USE_SOFTBSCAN_EQ0.I_USE_XST_TCK_WORKAROUND_EQ0.U_ICON_BSCAN_BUFG/I_BUFG.U_BUFG  (
    .I
(\U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/I_YES_BSCAN.U_BS/iDRCK_LOCAL )
,
    .O(\U_hwsim_engine/MASTER_SLAVE/U_XSDB_MSTR/U_VHD_CHIPSCOPE_ICON2XSDB_MSTRBR/U_ICON_INTERFACE/U_ICON_IFACE_ICON/U_ICON/U_ICON/iDRCK )
  );
  X_CKBUF #(
    .LOC ( "BUFGCTRL_X0Y1" ))
  \U_hwsim_engine/dcm_clk_div2_bufg  (
    .I(\U_hwsim_engine/inclk_div2 ),
    .O(\U_hwsim_engine/clk_div2_bufg )
  );
  X_CKBUF #(
    .LOC ( "BUFGCTRL_X0Y0" ))
  \U_hwsim_engine/dcm_bufg_0  (
    .I(\U_hwsim_engine/clk_0 ),
    .O(\U_hwsim_engine/clk_0_bufg )
  );
  X_CKBUF #(
    .LOC ( "BUFGCTRL_X0Y2" ))
  \U_hwsim_engine/dcm_bufg_fx  (
    .I(\U_hwsim_engine/clk_fx_int ),
    .O(\U_hwsim_engine/clk_fx_int_bufg )
  );
  X_BUF #(
    .LOC ( "BUFGCTRL_X0Y3" ))
  \U_hwsim_engine/bufgce_i/CE1INV  (
    .I(GND),
    .O(\U_hwsim_engine/bufgce_i/CE1_INT )
  );
  X_BUF #(
    .LOC ( "BUFGCTRL_X0Y3" ))
  \U_hwsim_engine/bufgce_i/IGNORE0INV  (
    .I(GND),
    .O(\U_hwsim_engine/bufgce_i/IGNORE0_INT )
  );
  X_BUF #(
    .LOC ( "BUFGCTRL_X0Y3" ))
  \U_hwsim_engine/bufgce_i/IGNORE1INV  (
    .I(VCC),
    .O(\U_hwsim_engine/bufgce_i/IGNORE1_INT )
  );
  X_BUF #(
    .LOC ( "BUFGCTRL_X0Y3" ))
  \U_hwsim_engine/bufgce_i/S0INV  (
    .I(VCC),
    .O(\U_hwsim_engine/bufgce_i/S0_INT )
  );
  X_BUF #(
    .LOC ( "BUFGCTRL_X0Y3" ))
  \U_hwsim_engine/bufgce_i/S1INV  (
    .I(GND),
    .O(\U_hwsim_engine/bufgce_i/S1_INT )
  );
  X_BUFGCTRL #(
    .INIT_OUT ( 0 ),
    .PRESELECT_I0 ( "TRUE" ),
    .PRESELECT_I1 ( "FALSE" ),
    .LOC ( "BUFGCTRL_X0Y3" ))
  \U_hwsim_engine/bufgce_i  (
    .S1(\U_hwsim_engine/bufgce_i/S1_INT ),
    .I0(\U_hwsim_engine/clk_fx_int ),
    .S0(\U_hwsim_engine/bufgce_i/S0_INT ),
    .IGNORE1(\U_hwsim_engine/bufgce_i/IGNORE1_INT ),
    .IGNORE0(\U_hwsim_engine/bufgce_i/IGNORE0_INT ),
    .CE1(\U_hwsim_engine/bufgce_i/CE1_INT ),
    .CE0(\U_hwsim_engine/tx_fifo_read_en ),
    .I1(\U_hwsim_engine/bufgce_i/I1 ),
    .O(dut_clk)
  );
X_MMCM_ADV #(
    .CLOCK_HOLD ( "FALSE" ),
    .CLKOUT4_CASCADE ( "FALSE" ),
    .BANDWIDTH ( "OPTIMIZED" ),
    .CLKFBOUT_USE_FINE_PS ( "FALSE" ),
    .CLKOUT0_USE_FINE_PS ( "FALSE" ),
    .CLKOUT1_USE_FINE_PS ( "FALSE" ),
    .CLKOUT2_USE_FINE_PS ( "FALSE" ),
    .CLKOUT3_USE_FINE_PS ( "FALSE" ),
    .CLKOUT4_USE_FINE_PS ( "FALSE" ),
    .CLKOUT5_USE_FINE_PS ( "FALSE" ),
    .CLKOUT6_USE_FINE_PS ( "FALSE" ),
    .COMPENSATION ( "EXTERNAL" ),
    .STARTUP_WAIT ( "FALSE" ),
    .CLKFBOUT_MULT_F ( 6.000000 ),
    .CLKFBOUT_PHASE ( 0.000000 ),
    .CLKOUT0_DIVIDE_F ( 1.000000 ),
    .CLKOUT0_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT0_PHASE ( 0.000000 ),
    .CLKOUT1_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT1_PHASE ( 0.000000 ),
    .CLKOUT2_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT2_PHASE ( 0.000000 ),
    .CLKOUT3_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT3_PHASE ( 0.000000 ),
    .CLKOUT4_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT4_PHASE ( 0.000000 ),
    .CLKOUT5_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT5_PHASE ( 0.000000 ),
    .CLKOUT6_DUTY_CYCLE ( 0.500000 ),
    .CLKOUT6_PHASE ( 0.000000 ),
    .REF_JITTER1 ( 0.010000 ),
    .REF_JITTER2 ( 0.010000 ),
    .CLKOUT1_DIVIDE ( 12 ),
    .CLKOUT2_DIVIDE ( 12 ),
    .CLKOUT3_DIVIDE ( 1 ),
    .CLKOUT4_DIVIDE ( 1 ),
    .CLKOUT5_DIVIDE ( 1 ),
    .CLKOUT6_DIVIDE ( 1 ),
    .DIVCLK_DIVIDE ( 1 ),
    .CLKIN1_PERIOD ( 5.000000 ),
    .CLKIN2_PERIOD ( 0.000000 ),
    .LOC ( "MMCM_ADV_X0Y5" ),
    .VCOCLK_FREQ_MAX ( 1200.000000 ),
    .VCOCLK_FREQ_MIN ( 600.000000 ),
    .CLKIN_FREQ_MAX ( 700.000000 ),
    .CLKIN_FREQ_MIN ( 10.000000 ),
    .CLKPFD_FREQ_MAX ( 450.000000 ),
    .CLKPFD_FREQ_MIN ( 10.000000 ))
  \U_hwsim_engine/mmcm_i  (
    .CLKFBIN(\U_hwsim_engine/clk_0_bufg ),
    .PSCLK(GND),
    .PWRDWN(\U_hwsim_engine/mmcm_i/PWRDWN_INT ),
    .DCLK(GND),
    .DEN(GND),
    .CLKINSEL(\U_hwsim_engine/mmcm_i/CLKINSEL_INT ),
    .CLKIN2(GND),
    .RST(\U_hwsim_engine/mmcm_i/RST_INT ),
    .PSINCDEC(\U_hwsim_engine/mmcm_i/PSINCDEC_INT ),
    .DWE(GND),
    .PSEN(\U_hwsim_engine/mmcm_i/PSEN_INT ),
    .CLKIN1(sys_clk),
    .CLKOUT3(\U_hwsim_engine/mmcm_i/CLKOUT3 ),
    .CLKOUT3B(\U_hwsim_engine/mmcm_i/CLKOUT3B ),
    .CLKFBOUT(\U_hwsim_engine/clk_0 ),
    .CLKFBSTOPPED(\U_hwsim_engine/mmcm_i/CLKFBSTOPPED ),
    .CLKFBOUTB(\U_hwsim_engine/mmcm_i/CLKFBOUTB ),
    .CLKOUT1(\U_hwsim_engine/inclk_div2 ),
    .CLKOUT5(\U_hwsim_engine/mmcm_i/CLKOUT5 ),
    .DRDY(\U_hwsim_engine/mmcm_i/DRDY ),
    .CLKOUT0(\U_hwsim_engine/mmcm_i/CLKOUT0 ),
    .CLKOUT4(\U_hwsim_engine/mmcm_i/CLKOUT4 ),
    .CLKOUT1B(\U_hwsim_engine/mmcm_i/CLKOUT1B ),
    .CLKINSTOPPED(\U_hwsim_engine/mmcm_i/CLKINSTOPPED ),
    .CLKOUT0B(\U_hwsim_engine/mmcm_i/CLKOUT0B ),
    .CLKOUT2(\U_hwsim_engine/clk_fx_int ),
    .CLKOUT2B(\U_hwsim_engine/mmcm_i/CLKOUT2B ),
    .PSDONE(\U_hwsim_engine/mmcm_i/PSDONE ),
    .CLKOUT6(\U_hwsim_engine/mmcm_i/CLKOUT6 ),
    .LOCKED(leds_2_OBUF_134690),
    .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({\U_hwsim_engine/mmcm_i/DO15 , \U_hwsim_engine/mmcm_i/DO14 , \U_hwsim_engine/mmcm_i/DO13 , \U_hwsim_engine/mmcm_i/DO12 , 
\U_hwsim_engine/mmcm_i/DO11 , \U_hwsim_engine/mmcm_i/DO10 , \U_hwsim_engine/mmcm_i/DO9 , \U_hwsim_engine/mmcm_i/DO8 , \U_hwsim_engine/mmcm_i/DO7 , 
\U_hwsim_engine/mmcm_i/DO6 , \U_hwsim_engine/mmcm_i/DO5 , \U_hwsim_engine/mmcm_i/DO4 , \U_hwsim_engine/mmcm_i/DO3 , \U_hwsim_engine/mmcm_i/DO2 , 
\U_hwsim_engine/mmcm_i/DO1 , \U_hwsim_engine/mmcm_i/DO0 })
  );
  X_RAMB18E1 #(
    .DOA_REG ( 0 ),
    .DOB_REG ( 0 ),
    .READ_WIDTH_A ( 9 ),
    .READ_WIDTH_B ( 9 ),
    .WRITE_WIDTH_A ( 9 ),
    .WRITE_WIDTH_B ( 9 ),
    .RAM_MODE ( "TDP" ),
    .RDADDR_COLLISION_HWCONFIG ( "DELAYED_WRITE" ),
    .RSTREG_PRIORITY_A ( "REGCE" ),
    .RSTREG_PRIORITY_B ( "REGCE" ),
    .WRITE_MODE_A ( "READ_FIRST" ),
    .WRITE_MODE_B ( "READ_FIRST" ),
    .INITP_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INITP_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_00 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_01 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_02 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_03 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_04 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_05 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_06 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_07 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_08 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_09 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_0F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_10 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_11 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_12 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_13 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_14 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_15 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_16 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_17 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_18 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_19 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_1F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_20 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_21 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_22 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_23 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_24 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_25 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_26 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_27 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_28 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_29 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2D ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2E ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_2F ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_30 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_31 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_32 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_33 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_34 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_35 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_36 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_37 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_38 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_39 ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3A ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3B ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3C ( 256'h0000000000000000000000000000000000000000000000000000000000000000 ),
    .INIT_3D ( 256'h0000000000000000000000000000000000000000000000000000000000

The trailing space in $lkup_cd1 spoils the test for '.LOC'. I changed only the following subroutine.

sub compareinstances
{
    my $x = shift @_;
    my $y = shift @_;
    my $modcodefrom1 = $instances_1[$x];
    my $modcodefrom2 = $instances_2[$y];
    my $inst_name1;
    if($modcodefrom1 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
        $inst_name1 = $1;
    }
    print "instance name of $modul from file1 $filename1 is $inst_name1\n";
   
    my $inst_name2;
        if($modcodefrom2 =~ m/\)\s*\)\s*(.*)\s*\(\s*\./) {
            $inst_name2 = $1;
        }
    print "instance name of $modul from file2 $filename2 is $inst_name1\n ";
   my @codes1 = split /\,/,  $modcodefrom1;
   my @codes2 = split /\,/,  $modcodefrom2;
   
    print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";
   
    printf "\t\t%-45s \t\t\t%s\n\n\n", $filename1, $filename2;

    foreach (@codes1){
    if ( m/
        (         #capture following to $1
         (        #capture following to $2
         \.       #dot
         [^(]+    #one or more characters excepting (
        )         #end of capture group $2
         \s*      #possibly some spaces or newlines
         \(       #followed by open (
           [^)]*? #possibly some characters excepting )
           \)     #followed by close )
         )        #end of capture group $1
          /x ){   #end of match condition. x means ignore spaces and allow comments
        my $all_code_1 = $1;
        my $lkup_cd1 = $2;
        
        #The problem was $lkup_cd1 often has a trailing space
        #So in the following condition we must test if equal to '.LOC ' with trailing space
        next if ( $lkup_cd1 eq '.LOC' or $lkup_cd1 eq '.LOC '); #Skip to next iteration of loop
        
        #print "Look up $lkup_cd1\n"; #I print here for testing. May want to comment it out.
        
        my $code2compare = lookup_code2($lkup_cd1, \@codes2);
        
        unless ( $all_code_1 eq $code2compare) {
            printf "%-s IS NOT SAME AS %s\n\n", $all_code_1, $code2compare;
        }
    }
    }
}

hi,thank u for ur great help for solving me with ur codes.the project is completed

Comments
Thanks for attaching sample files, explaining progress, and marking it solved.
This question has already been answered. Start a new discussion instead.