stuff before the T value => T value A: MTI Clock is being generated correctly ; => T=1102377 B: MTI Clock is being generated correctly ; => T=1092605 perhaps result: MTI Clock is being generated correctly ; T=1102377 T=1092605 #### #!/usr/bin/perl; use strict; use warnings; use Data::Dump qw(pp); # initialize @array and @array1 to what the OP describes as his current "output"..... my @array =<<'EOF' =~ m/(^.*\n)/mg; INFO @576892 mti_clk_chk: run_stimulus called; T=576892 INFO @1102266 PHResourceLayer_Z4: mti_clk_chk:################ start of test ################ ; T=1102266 INFO @1102334 PHResourceLayer_Z4: mti_clk_chk:Checking the period of MTI, MTI10 clk from SV; T=1102334 INFO @1102372 mti_clk_chk: Checking period of MTI CLk; T=1102372 INFO @1102377 mti_clk_chk: Period value of MTI Clock: 3.125000 ns; T=1102377 INFO @1102377 mti_clk_chk: MTI Clock is being generated correctly ; T=1102377 INFO @1102377 mti_clk_chk: Checking period of MTI10 CLk; T=1102377 INFO @1102418 mti_clk_chk: Period value of MTI10 Clock: 31.250000 ns; T=1102418 INFO @1102418 mti_clk_chk: MTI10 Clock is being generated correctly ; T=1102418 INFO @1102717 PHResourceLayer_Z4: mti_clk_chk: All clock period Checking done; T=1102717 INFO @1148661 mti_clk_chk: C-Code exit execution. code=; T=1148661 INFO @1148661 mti_clk_chk: ************************ SV END******************** ; T=1148661 EOF my @array1 =<<'EOF2' =~ m/(^.*\n)/mg; UVM_INFO @0 reporter testbench.top_level_module.\mti_clk_chk::main : MTI_CLK_CHK_STIM Started .....; T=0 UVM_INFO @0 reporter testbench.top_level_module.\mti_clk_chk::main : run_stimulus called; T=0 UVM_INFO @1092507 reporter Z4_COREA: mti_clk_chk: ################ start of test ################ ; T=1092507 UVM_INFO @1092563 reporter Z4_COREA: mti_clk_chk: Checking the period of MTI, MTI10 clk from SV; T=1092563 UVM_INFO @1092598 reporter testbench.top_level_module.\mti_clk_chk::main : Checking period of MTI CLk; T=1092598 UVM_INFO @1092605 /proj/rru2_verif/usr/Tilak/SV_UVM/testbench/data_ipdss/v_ms_mti_stim_vip/testbench/classes_v/mti_clk_chk.sv(147) uvm_test_top.default_env.default_sequencer100@@mti_clk_chk mti_clk_chk:INFO: Period value of MTI Clock: 3.125000 ns; T=1092605 UVM_INFO @1092605 reporter testbench.top_level_module.\mti_clk_chk::main : MTI Clock is being generated correctly ; T=1092605 UVM_INFO @1092605 reporter testbench.top_level_module.\mti_clk_chk::main : Checking period of MTI10 CLk; T=1092605 UVM_INFO @1092655 /proj/rru2_verif/usr/Tilak/SV_UVM/testbench/data_ipdss/v_ms_mti_stim_vip/testbench/classes_v/mti_clk_chk.sv(165) uvm_test_top.default_env.default_sequencer100@@mti_clk_chk mti_clk_chk:INFO: Period value of MTI10 Clock: 31.250000 ns; T=1092655 UVM_INFO @1092655 reporter testbench.top_level_module.\mti_clk_chk::main : MTI10 Clock is being generated correctly ; T=1092655 UVM_INFO @1092850 reporter Z4_COREA: mti_clk_chk: All clock period Checking done; T=1092850 UVM_INFO @1092886 /proj/rru2_verif/usr/Tilak/SV_UVM/testbench/data_ipdss/v_ms_mti_stim_vip/testbench/classes_v/mti_clk_chk.sv(186) uvm_test_top.default_env.default_sequencer100@@mti_clk_chk mti_clk_chk:INFO: ************************ SV END******************** ; T=1092886 EOF2 # evidently all that matters is stuff after the 'mti_clk_chk:' string # so remove all before that critical stuff @array = map{/^.*(mti_clk_chk:.*\n)/;$1;}@array; @array1 = map{/^.*(mti_clk_chk:.*\n)/;$1;}@array1; ## just print these arrays out so that we can see how to ## compare them? my $n=1; foreach (@array) {print "A$n) ",$_; $n++} print "===============================\n"; $n=1; foreach (@array1) {print "B$n) ",$_; $n++} ## Make hash tables of the 2 records ## regex could be better - not the point here.. just a quick demo of an approach.. my %A = map{/mti_clk_chk:(?::main :|INFO:)?\s*(.*).*\s*T=(\d+)$/;$1 => $2}@array; my %B = map{/mti_clk_chk:(?::main :|INFO:)?\s*(.*).*\s*T=(\d+)$/;$1 => $2}@array1; #print only common values in sequential order of file A print "\n********************************************\n"; print "Common Text descriptions with A and B T values:\n"; print "********************************************\n"; foreach my $mti (map{/mti_clk_chk:(?::main :|INFO:)?\s*(.*).*\s*T=(\d+)$/;$1}@array) { if (exists $B{$mti}) { print "$mti T(a)=$A{$mti} T(b)=$B{$mti}\n"; } } __END__ A1) mti_clk_chk: run_stimulus called; T=576892 A2) mti_clk_chk:################ start of test ################ ; T=1102266 A3) mti_clk_chk:Checking the period of MTI, MTI10 clk from SV; T=1102334 A4) mti_clk_chk: Checking period of MTI CLk; T=1102372 A5) mti_clk_chk: Period value of MTI Clock: 3.125000 ns; T=1102377 A6) mti_clk_chk: MTI Clock is being generated correctly ; T=1102377 A7) mti_clk_chk: Checking period of MTI10 CLk; T=1102377 A8) mti_clk_chk: Period value of MTI10 Clock: 31.250000 ns; T=1102418 A9) mti_clk_chk: MTI10 Clock is being generated correctly ; T=1102418 A10) mti_clk_chk: All clock period Checking done; T=1102717 A11) mti_clk_chk: C-Code exit execution. code=; T=1148661 A12) mti_clk_chk: ************************ SV END******************** ; T=1148661 =============================== B1) mti_clk_chk::main : MTI_CLK_CHK_STIM Started .....; T=0 B2) mti_clk_chk::main : run_stimulus called; T=0 B3) mti_clk_chk: ################ start of test ################ ; T=1092507 B4) mti_clk_chk: Checking the period of MTI, MTI10 clk from SV; T=1092563 B5) mti_clk_chk::main : Checking period of MTI CLk; T=1092598 B6) mti_clk_chk:INFO: Period value of MTI Clock: 3.125000 ns; T=1092605 B7) mti_clk_chk::main : MTI Clock is being generated correctly ; T=1092605 B8) mti_clk_chk::main : Checking period of MTI10 CLk; T=1092605 B9) mti_clk_chk:INFO: Period value of MTI10 Clock: 31.250000 ns; T=1092655 B10) mti_clk_chk::main : MTI10 Clock is being generated correctly ; T=1092655 B11) mti_clk_chk: All clock period Checking done; T=1092850 B12) mti_clk_chk:INFO: ************************ SV END******************** ; T=1092886 # Some of the issues involved in the comparison between sets: # Line B1 doesn't exist in set A # line A11 doesn't exist in set B # one plausible way to present the output? ******************************************** Common Text descriptions with A and B T values: ******************************************** run_stimulus called; T(a)=576892 T(b)=0 ################ start of test ################ ; T(a)=1102266 T(b)=1092507 Checking the period of MTI, MTI10 clk from SV; T(a)=1102334 T(b)=1092563 Checking period of MTI CLk; T(a)=1102372 T(b)=1092598 Period value of MTI Clock: 3.125000 ns; T(a)=1102377 T(b)=1092605 MTI Clock is being generated correctly ; T(a)=1102377 T(b)=1092605 Checking period of MTI10 CLk; T(a)=1102377 T(b)=1092605 Period value of MTI10 Clock: 31.250000 ns; T(a)=1102418 T(b)=1092655 MTI10 Clock is being generated correctly ; T(a)=1102418 T(b)=1092655 All clock period Checking done; T(a)=1102717 T(b)=1092850 ************************ SV END******************** ; T(a)=1148661 T(b)=1092886