- 论坛徽章:
- 0
|
- #! /usr/bin/perl -w
- #use strict;
- #use warnings;
- my $curLine;
- my ($preEUItest,$EUItest,$EUIbinning);
- my (@preEUItests,@EUItests,@EUIbinnings,@preTemps);
- my ($testNumber,$EUIcounter,$EUInumber,$testResult);
- my @libEUI;
- my ($flagNewEUI,$tempEUI);
- my ($hardware,$LBid);
- my @hardwares;
- my @waferInfor;
- my ($waferID,$waferX,$waferY);
- print "The original file name is:",$ARGV[0],".bak and converted file name is:$ARGV[0]\n";
- print "------------------------------------------------------------------------------\n";
- ##-DeviceID- -Site- -TResult- -TNumber- -Used_EmberPD_EUI_ID- -EUI_Serio- -HBin- -SBin-
- ## 00001 0 PASS 2970 000d6f00012e95f9 000001 6 34
- my $allEUIdata=$ARGV[0]."_allEUIXYdata.log";
- my $passEUIdata=$ARGV[0]."_passEUIXYdata.log";
- my $databaseEmberEUI="databaseEmberEUI_dieID.log";
- my @databaseEUI;
- my ($databaseCounter,$curdatabaseCounter,$flagdatabase,$databaseStr);
- my $fileNameSTDF=$ARGV[0];
- $waferID="NA";
- $waferX="NA";
- $waferY="NA";
- open ALLEUIDATA,">$allEUIdata" or die "write file $allEUIdata failed $!";
- open PASSEUIDATA,">$passEUIdata" or die "write file $passEUIdata failed $!";
- open DATABASEEUI,"$databaseEmberEUI";
- @databaseEUI=<DATABASEEUI>;
- close DATABASEEUI;
- open DATABASEEUI,">>$databaseEmberEUI" or die "write file $databaseEmberEUI failed $!";
- printf PASSEUIDATA ("%10s %6s %9s %9s %21s %11s %6s %6s %10s %12s %9s %8s %8s %s\n","-DeviceID-","-Site-","-TResult-","-TNumber-","-Used_EmberPD_EUI_ID-","-EUI_Serio-","-HBin-","-SBin-","-LBoardID-","-FreshEUIID-","-WaferID-","-WaferX-","-WaferY-","-DataBaseStr-");
- while(<>){
- chomp;
- $curLine=$_;
- if(/^PIR:/){
- print ALLEUIDATA $curLine,"\n";
- }
- elsif(/^SDR:/){
- $hardware=$curLine;
- @hardwares=split(/\|/,$hardware);
- @hardwares[10]=~s/\W+//;
- @hardwares[10]=~s/\r//;
- $LBid=@hardwares[10];
- }
- elsif(/^PTR:(.*)wafer number/){
- @waferInfor=split(/\|/,$curLine);
- $waferID=@waferInfor[3];
- }
- elsif(/^PTR:(.*)wafer x/){
- @waferInfor=split(/\|/,$curLine);
- $waferX=@waferInfor[3];
- }
- elsif(/^PTR:(.*)wafer y/){
- @waferInfor=split(/\|/,$curLine);
- $waferY=@waferInfor[3];
- }
- elsif(/^PTR:(.*)company eui ok/){
- $preEUItest=$curLine;
- print ALLEUIDATA $curLine,"\n";
-
- # print ALLEUIDATA $curLine,"\n";
- }
- elsif(/^DTR:\<cmd\>/){
- if($preEUItest ne ""){
- $EUItest=$curLine;
- }
- else{
- $preEUItest="AbnormalData";
- $EUItest=$curLine;
- }
- print ALLEUIDATA $curLine,"\n";
- }
- elsif(/^PRR:/){
-
- ##Device: -DeviceID- -Site- -TResult- -TNumber- -Used_Ember_EUI_ID- -EUI_Serio- -HBin- -SBin-
- ##device# 00001 0 PASS 2970 000d6f00012e95f9 000001 6 34
-
- $EUIbinning=$curLine;
- if($EUItest ne "" && $preEUItest ne "AbnormalData"){
- @preEUItests=split(/\|/,$preEUItest);
- @EUItests=split(/=/,$EUItest);
- @EUIbinnings=split(/\|/,$EUIbinning);
- @preTemps=split(/:/,@preEUItests[0]);
- $testNumber=@preTemps[1];
- $flagNewEUI=1;
- @EUItests[1]=~s/\W+//;
- @EUItests[1]=~s/\r//;
- foreach $tempEUI(@libEUI){
- if(@EUItests[1] eq $tempEUI){
- $flagNewEUI=0;
- }
- }
- if($flagNewEUI eq 1 && @EUItests[1]=~/000d6f00/){
- $flagNewEUI=0;
- $EUIcounter++;
- $EUInumber=$EUIcounter;
- push(@libEUI,@EUItests[1]);
- }
- else{
- $EUInumber=0;
- }
- if(@EUIbinnings[4] eq "P"){
- $testResult="PASS";
- }
- elsif(@EUIbinnings[4] eq "F"){
- $testResult="FAIL";
- }
- else{
- $testResult="ERROR";
- }
-
- $curdatabaseCounter=0;
- $databaseCounter=0;
- $flagdatabase=1;
- $databaseStr="NEW_ID\n";
- foreach $tempEUI(@databaseEUI){
- if ($tempEUI=~/^@EUItests[1]/){
- $flagdatabase=0;
- $curdatabaseCounter=$databaseCounter+1;
- $databaseStr="RepeatID|---".$tempEUI;
- }
- else{
- $databaseCounter++;
- }
- }
- if($flagdatabase eq 1 && @EUItests[1]=~/000d6f00/){
- $curdatabaseCounter=scalar(@databaseEUI)+1;
- $databaseStr=@EUItests[1]."_HB".@EUIbinnings[5]"_DBid:".$curdatabaseCounter."_SB".@EUIbinnings[6]."_LB:".$LBid."_waferID:".$waferID."_waferX:".$waferX."_waferY:".$waferY."_".$fileNameSTDF."\n";
- push(@databaseEUI,$databaseStr);
- printf DATABASEEUI ("%s",$databaseStr);
- $databaseStr="NEW_ID\n";
- }
- if(!(@EUItests[1]=~/000d6f00/)){
- $databaseStr="INVALID_ID\n";
- }
- printf PASSEUIDATA ("%09s %5s %8s %8s %20s %010s %5s %5s %9s %11s %8s %7s %7s %s",@EUIbinnings[2],@EUIbinnings[1],$testResult,$testNumber,@EUItests[1],$EUInumber,@EUIbinnings[5],@EUIbinnings[6],$LBid,$curdatabaseCounter,$waferID,$waferX,$waferY,$databaseStr);
- $waferID="NA";
- $waferX="NA";
- $waferY="NA";
- $preEUItest="";
- $EUItest="";
- $EUIbinning="";
- }
-
- elsif($EUItest ne "" && $preEUItest ne "AbnormalData"){
- @EUItests=split(/=/,$EUItest);
- @EUIbinnings=split(/\|/,$EUIbinning);
- $flagNewEUI=0;
- @EUItests[1]=~s/\W+//;
- @EUItests[1]=~s/\r//;
- foreach $tempEUI(@libEUI){
- if(@EUIbinnings[4] eq "P" && @EUItests[1] eq $tempEUI){
- $flagNewEUI=1;
- }
- }
- if($flagNewEUI eq 1){
- $flagNewEUI=0;
- $EUIcounter++;
- $EUInumber=$EUIcounter;
- push(@libEUI,@EUItests[1]);
- }
- else{
- $EUInumber=0;
- }
- if(@EUIbinnings[4] eq "P"){
- $testResult="PASS";
- }
- elsif(@EUIbinnings[4] eq "F"){
- $testResult="FAIL";
- }
- else{
- $testResult="ERROR";
- }
- printf PASSEUIDATA ("%9s %5s %8s %8s %20s %10s %5s %5s\n",@EUIbinnings[2],@EUIbinnings[1],$testResult,"NON",@EUItests[1],$EUIcounter,@EUIbinnings[5],@EUIbinnings[6]);
- $preEUItest="";
- $EUItest="";
- $EUIbinning="";
- }
- else{
-
- }
-
-
-
-
-
- print ALLEUIDATA $curLine,"\n";
- }
- else{
- }
- }
- #print DATABASEEUI @databaseEUI;
- close ALLEUIDATA;
- close PASSEUIDATA;
- close DATABASEEUI;
复制代码 |
|