#!/usr/bin/perl
#use strict;
use warnings;
use Cwd;
$dir= getcwd;
$Vstress='1.32';
@name=split(/\//,$dir);
@entrada=('1', '2');
@HOLD=('1','2','3','4','5');
@SETUP=('22','23','24','25');
##################
@lista=('zoneA','zoneB','SP0','SP50','SP100');
@age=('2','0.2','0.02');
@agingtype=('hci=0 nbti=1','hci=1 nbti=0','hci=1 nbti=1');
@agingtypex=('nbti','hci','NBTI+HCI');
@capacitance=('0.0008e-12','0.0141e-12','0.0495e-12');
$lsfout_high='extract.cvs';
$data3='87';
$data11='87';
$lista1='12';
############
#########
for ($n=0; $n<@entrada; $n++)
{
if ($entrada[$n]==1)
{$entrada=$dir."/charac_CSHT_Fresh_high.cir";
$entradaxx=charac_DATA_high;
for ($iii=0; $iii<@agingtype; $iii++ )
{
for ($ii=0; $ii<@age; $ii++ )
{
for ($jj=0; $jj<@capacitance; $jj++ )
{
#$hehe=<STDIN>;
$diry= $dir."/".$entradaxx."/".$agingtypex[$iii]."/".$age[$ii].'y'."/".$capacitance[$jj].'_nf/';
#print $diry.'soy jaja'."\n";
chdir($diry)|| die ('It couldnt be:'.$diry.$!."\n");
#print 'jeje'."\n";
for ($i=0; $i<@lista; $i++ )
{
$dirz= $lista[$i].'.aex';
#$dirz= 'prueba.aex';
open (PAGE ,"$dirz")|| die ('It couldnt be open:'.$dirz.$!."\n");
@arrayentrada=<PAGE>;
open (FILE_OUT ,">>".$lsfout_high)|| die ('It couldnt be open:'.$!."\n");
for ($j=0; $j<@arrayentrada; $j++ )
{
if($arrayentrada[$j]=~ m/EXTRACT SWEEP/)
{
$data0=$arrayentrada[$j];
}
if ($arrayentrada[$j]=~ m/"SETUPTIME_DATA_HIGH"/)
{
$data2=$arrayentrada[$j];
#print $data2;
}
if ($arrayentrada[$j]=~ m/SETUP_130PS/)
{
$data3=$arrayentrada[$j];
print FILE_OUT $data3."\n";
}
if ($arrayentrada[$j]=~ m/SETUP_120PS/)
{
$data4=$arrayentrada[$j];
# print $data4;
}
if ($arrayentrada[$j]=~ m/SETUP_110PS/)
{
$data5=$arrayentrada[$j];
#print $data5;
}
if ($arrayentrada[$j]=~ m/SETUP_100PS/)
{
$data6=$arrayentrada[$j];
#print $data6;
}
if ($arrayentrada[$j]=~ m/SETUP_90PS/)
{
$data7=$arrayentrada[$j];
#print $data7;
}
if ($arrayentrada[$j]=~ m/SETUP_80PS/)
{
$data8=$arrayentrada[$j];
#print $data8;
}
if ($arrayentrada[$j]=~ m/SETUP_70PS/)
{
$data9=$arrayentrada[$j];
#print $data9;
}
if ($arrayentrada[$j]=~ m/SETUP_60PS/)
{
$data10=$arrayentrada[$j];
# print $data10;
}
if ($arrayentrada[$j]=~ m/"CLKTOQ_SETUP_130ps"/)
{
$data11=$arrayentrada[$j];
# print $data11;
}
if ($arrayentrada[$j]=~ m/"CLKTOQ_SETUP_120ps"/)
{
$data12=$arrayentrada[$j];
# print $data12;
}
if ($arrayentrada[$j]=~ m/"CLKTOQ_SETUP_110ps"/)
{
$data13=$arrayentrada[$j];
#print $data13;
}
if ($arrayentrada[$j]=~ m/"CLKTOQ_SETUP_100ps"/)
{
$data14=$arrayentrada[$j];
#print $data14;
}
if ($arrayentrada[$j]=~ m/"CLKTOQ_SETUP_90ps"/)
{
$data15=$arrayentrada[$j];
#print $data15;
}
if ($arrayentrada[$j]=~ m/"CLKTOQ_SETUP_80ps"/)
{
$data16=$arrayentrada[$j];
#print $data16;
}
if ($arrayentrada[$j]=~ m/"CLKTOQ_SETUP_70ps"/)
{
$data17=$arrayentrada[$j];
# print $data17;
}
if ($arrayentrada[$j]=~ m/"CLKTOQ_SETUP_60ps"/)
{
$data18=$arrayentrada[$j];
#print $data18;
}
}#arrayentrada
format FILE_OUT =
name:@<<<<<<<<<<< @<<<<<<< @<<<<<<< @<<<<<<< @<<<<<<<< @<<<<<<<< @<<<<<<<< @<<<<<<< @<<<<< @<<<<<<<
$name[8], $Vstress, $age[$ii], $agingtypex[$iii], $capacitance[$jj], $lista1, $HOLD[0], $SETUP[2], $data3, $data11
$name[8], $Vstress, $age[$ii], $agingtypex[$iii], $capacitance[$jj], $lista[$i], $HOLD[1], $SETUP[3], $data4, $data12
.
#$hehe=<STDIN>;
#print FILE_OUT;
write FILE_OUT;
}#lista
}#for capacitance
#print 'jojo'."\n";
}
}
}#;first if
}#first for
close PAGE;
close FILE_OUT;