#include "tester.h"
#include "pattern1.h"
// ExamdiffPro compare 02/07/2006 (STANDARD)
// ******************************************************************
// *********************[ Func_VTP ]******************************
// ******************************************************************
//=========================[ vtp ]=====================================
//=========================[ vtp ]=====================================
//=========================[ vtp ]=====================================
//=========================[ vtp ]=====================================
//=========================[ vtp ]=====================================
int Func_Vtp(float vtvcc, float vtforce, float vtmin, float vtmax)
{
int vt_test_result;
//power_down();
//output( "Executing test block: %s", current_test_block() );
if (DEBUG) {output("=========================[ FUNC_VTP ]===========================");}
strcpy(Test_Name,"VTP");
edge_strobe(pl_all_output, TRUE); //edge
cycle(TSET1, 1 US); //
settime(TSET1, pl_all_input, NRZ , 100 NS); //
settime(TSET1, pl_all_output,STROBE , 850 NS); //
vih( vtvcc );
vil( 0.0 V );
voh( funcvoh );
vol( funcvol );
ioh( vtforce , pl_all_output);
iol( vtforce , pl_all_output);
vz( funcvth , pl_all_output);
dps( vtvcc , pl_all_vcc);
if(DEBUG)
{
output("vtvcc = %s",cnvt_result(vtvcc , LOG_V) );
output("funcvoh = %s",cnvt_result(funcvoh, LOG_V) );
output("funcvol = %s",cnvt_result(funcvol, LOG_V) );
output("funcvth = %s",cnvt_result(funcvth, LOG_V) );
output("vtforce = %s",cnvt_result(vtforce, LOG_V) );
}
//==========================================
bool SiteA = false;
bool SiteB = false;
bool SiteC = false;
bool SiteD = false;
bool DutSwitched[4];
bool vt_flag = false;
int cycles = 0; // reset
for (int z = 0; z < 4; ++z)
{
for( int y = 0; y < 16; ++y)
{
vtp_vtx[z][y] = 0 V; // reset
}
}
for (int k = 0; k < 4; ++k)
{
DutSwitched[k] = false; // default reset
}
//=========================================
float vihval = vtmin - (0.50 V);
if (VT_CALC_DISPLAY) { output("vtpstart vihval = %s",cnvt_result(vihval,LOG_V) ); }
//=========================================
// the following code will work for 4 sites and uses curr_dut_mask
BYTE this_dut = 0;
PinList* dutpinlist;
int active_dut;
while((!vt_flag) && (vihval <= (vtmax + (1.00 V))))
{
vih( 0.0 V );
setpin(pl_all_input, VIH); // bias inputs
vihval+=(10 MV);
vih( vihval );
vt_test_result = funtest(p_func_hi, finish);
if (VT_CALC_DISPLAY) { output("vtpstep = %s",cnvt_result(vihval,LOG_V) ); }
this_dut = 0;
for ( int dut_num = 0; dut_num<DutsPerSite( ); dut_num++ )
{
this_dut = ( 1 << dut_num );
if ( curr_dut_mask == 0 ) break; // all DUTs previously removed from curr_dut_mask
if ( ( curr_dut_mask & this_dut ) == 0x0 ) continue;// this DUT not in curr_dut_mask
active_dut = curr_dut_mask & this_dut;
// Select pinlist associated with "this_dut" so that
// test_pin() can be used to check for latched errors.
switch (this_dut)
{
case 1:
dutpinlist = pl_a_output;
SiteA = true;
break;
case 2:
dutpinlist = pl_b_output;
SiteB = true;
break;
case 4:
dutpinlist = pl_c_output;
SiteC = true;
break;
case 8:
dutpinlist = pl_d_output;
SiteD = true;
break;
default:
output("WARNING: invalid pinlist specified in func_vtp");
break;
} // end of switch(this_dut)
if ( test_pin(dutpinlist) == PASS ) // switched
{
if(!DutSwitched[dut_num])
{
vtp_vtx[dut_num][0] = vihval; // store and set flag
dc_data[dut_num][0] = vihval;
DutSwitched[dut_num] = true;
if ((DEBUG) || (VT_CALC_DISPLAY)) { output("cycles[ %d ] active_dut[%d] dut_num[%d] DutSwitched!",cycles,active_dut,dut_num); }
}
}
}// end for dun num
vt_flag = true;
if (SiteA) { if(!DutSwitched[0]) { vt_flag = false; } }
if (SiteB) { if(!DutSwitched[1]) { vt_flag = false; } }
if (SiteC) { if(!DutSwitched[2]) { vt_flag = false; } }
if (SiteD) { if(!DutSwitched[3]) { vt_flag = false; } }
++cycles;
} //end while
if ((DEBUG) || (VT_CALC_DISPLAY)) { output("total cycles[ %d ]",cycles); }
// this is for datalog to screen
int retval = dc_datalog (pl_all_input, LOG_V,vtmin,vtmax,vtvcc,vtforce, FORCE_I );
// the following required for production
if(!DEBUG)
{ // for use with dc-datalog only
if (retval == FAIL) { curr_dut_fail_mask |= dc_err_proc(); }
if (curr_dut_mask == 0) { return curr_dut_mask; }
}
return curr_dut_mask;
}
//=========================[ vtn ]=====================================
//=========================[ vtn ]=====================================
//=========================[ vtn ]=====================================
//=========================[ vtn ]=====================================
//=========================[ vtn ]=====================================
int Func_Vtn(float vtvcc, float vtforce, float vtmin, float vtmax)
{
int vt_test_result;
//power_down();
//output( "Executing test block: %s", current_test_block() );
if (DEBUG) {output("=========================[ FUNC_VTN ]===========================");}
strcpy(Test_Name,"VTN");
edge_strobe(pl_all_output, TRUE); //edge
cycle(TSET1, 1 US); //
settime(TSET1, pl_all_input, NRZ , 100 NS); //
settime(TSET1, pl_all_output,STROBE , 850 NS); //
vih( vtvcc );
vil( 0.0 V );
voh( funcvoh );
vol( funcvol );
ioh( vtforce , pl_all_output);
iol( vtforce , pl_all_output);
vz( funcvth , pl_all_output);
dps( vtvcc , pl_all_vcc);
setpin(pl_all_input, VIH); // bias inputs
if(DEBUG)
{
output("vtvcc = %s",cnvt_result(vtvcc , LOG_V) );
output("funcvoh = %s",cnvt_result(funcvoh, LOG_V) );
output("funcvol = %s",cnvt_result(funcvol, LOG_V) );
output("funcvth = %s",cnvt_result(funcvth, LOG_V) );
output("vtforce = %s",cnvt_result(vtforce, LOG_V) );
}
//==========================================
bool SiteA = false;
bool SiteB = false;
bool SiteC = false;
bool SiteD = false;
bool DutSwitched[4];
bool vt_flag = false;
int cycles = 0;
for (int z = 0; z < 4; ++z)
{
for( int y = 0; y < 16; ++y)
{
vtn_vtx[z][y] = 0 V; // reset
}
}
for (int k = 0; k < 4; ++k)
{
DutSwitched[k] = false; // default reset
}
//=========================================
float vilval = vtmax + (0.50 V);
if (VT_CALC_DISPLAY) { output("vtnstart vilval = %s",cnvt_result(vilval,LOG_V) ); }
//=========================================
// the following code will work for 4 sites and uses curr_dut_mask
BYTE this_dut = 0;
PinList* dutpinlist;
int active_dut = 0;
while((!vt_flag) && (vilval >= (vtmin - (1.00 V))))
{
vil( vtvcc );
setpin(pl_all_input, VIL); // bias inputs
vilval-=(10 MV);
vil( vilval );
vt_test_result = funtest(p_func_lo, finish);
if (VT_CALC_DISPLAY) { output("vtnstep = %s",cnvt_result(vilval,LOG_V) ); }
this_dut = 0;
for ( int dut_num = 0; dut_num<DutsPerSite( ); dut_num++ )
{
this_dut = ( 1 << dut_num );
if ( curr_dut_mask == 0 ) break; // all DUTs previously removed from curr_dut_mask
if ( ( curr_dut_mask & this_dut ) == 0x0 ) continue;// this DUT not in curr_dut_mask
active_dut = curr_dut_mask & this_dut;
// Select pinlist associated with "this_dut" so that
// test_pin() can be used to check for latched errors.
switch (this_dut)
{
case 1: