GtDio6xMultiSiteGetRealTimeCompareFailures

Applies To

GX5296

Purpose

Returns in the specified range of steps all the sites and channels failures.

Syntax

GtDio6xMultiSiteGetRealTimeCompareFailures (nHandle, nFindFailuresMode, lStartStep, lStepCount, lRerunStartStep, plSitesStatus, plChStatus, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Session identifier:
Board handle is used when communicating with the hardware. The Board handle session identifier is returned by calling GtDio6xInitialize or GtDio6xSetupInitialization.
nFindFailuresMode
SHORT
Used to specify the method of finding all the sites and channels failures:

0.    GTDIO6X_MULTI_SITE_GET_FAILURES_MODE_DEFAULT: Returns all sites and channels status.

lStartStep  
LONG
Start step to look for Real Time Compare errors.
lStepCount
LONG
Number of steps to search.
plSitesStatus
PLONG
Returned all the 32 sites (max sites number) status. Each bit represents a site stating form bit 0=site 0, bit 31=site 31. Bit levels are :
0.      Bit low means passed (GTDIO6X_MULTI_SITE_STATUS_PASS)
1.    Bit high means failed  (GTDIO6X_MULTI_SITE_STATUS_FAIL)
plChStatus
PLONG
Returned all the 32 boards channels status. Each bit represents a channel starting from bit 0=channel 0, bit 31= channel 31. Bit levels are :
0.      Bit low means passed (GTDIO6X_MULTI_SITE_STATUS_PASS)
1.    Bit high means failed  (GTDIO6X_MULTI_SITE_STATUS_FAIL)
pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

The function returns in the specified range of steps all the sites and channels failures.

When nFindFailuresMode=GTDIO6X_MULTI_SITE_GET_FAILURES_MODE_DEFAULT: The function will first read the Real Time Compare 1K error memory, if no errors found returns with plSitesStatus=0 and plChStatus=0. If all sites also failed than it will update plSitesStatus=0 and plChStatus=0 accordingly and returns. If there were Real Time Compare errors but not for all sites, there is a possibility that there the 1K error memory was filled before all the errors could be recorded, in that case we will have to read the GtDio6xRealTimeCompareGetFailedChannels() API, update plSitesStatus=0 and plChStatus=0 accordingly and returns.

Note: The GtDio6xMultiSiteXXX() APIs provides the functionality required for efficient multi-site testing. By enabling parallel testing of multiple Devices Under Test (DUTs) simultaneously.

Example

The following multisite example does the following:

 

SHORT   nStatus;

LONG    lStep, alChannels[32];

LONG    alSiteChannels[32];

LONG    alSiteList[32];

LONG    lSiteCount;

LONG    lCh, l, lVectorLength, lVectorOffset;

LONG    lFailedSites, lFailedCh, alSiteArray[3];

BOOL    bIsRunning;

PCHAR   paucChVectorsArray; // Channels Vectors Array

 

//**** Setup ****//

GtDio6xReset(nHandle, &nStatus);

CheckStatus(nStatus);

//DIO Global settings

// Use Timing Set 0

GtDio6xTimingSetMemoryWriteData(nHandle, 0, GTDIO6X_TIMING_SET_PHASE_WINDOW_0, 0.0, 400.0, 200.0, 600.0, &nStatus);

CheckStatus(nStatus);

GtDio6xChannelSetMode(nHandle, GTDIO6X_ALL_BOARD, NULL, GTDIO6X_CHANNEL_MODE_DYNAMIC_IO, &nStatus);

CheckStatus(nStatus);

GtDio6xChannelSetSourceLevels(nHandle, GTDIO6X_ALL_BOARD, NULL, 3.0, 0.0, &nStatus);

CheckStatus(nStatus);

GtDio6xChannelSetSenseLevels(nHandle, GTDIO6X_ALL_BOARD, NULL, 2.5, 0.75, &nStatus);

CheckStatus(nStatus);

GtDio6xRealTimeCompareSetErrorCountSource(nHandle, GTDIO6X_RTC_ERROR_COUNTER_SOURCE_BOARD, &nStatus);

CheckStatus(nStatus);

 

// steps setup

for (lStep = 0; lStep < 2; lStep++)

{   // Set clock period to 1MHz

    GtDio6xStepSetClock(nHandle, lStep, 1000, 1, &nStatus);

    CheckStatus(nStatus);

    // Set Step Timing Index to index 0

    GtDio6xStepSetTimingSetIndex(nHandle, lStep, 0, &nStatus);

    CheckStatus(nStatus);

    // Set Step to record Errors

    GtDio6xStepSetRecordMode(nHandle, lStep, GTDIO6X_STEP_RECORD_MODE_RTC, &nStatus);

    CheckStatus(nStatus);

}

 

for (l = 0; l < 32; l++)

    alChannels[l] = l;

// Init the DIO memory with Tristate OpCode

GtDio6xFillVectors(nHandle, 32, alChannels, 0, 20000, GTDIO6X_FILL_VECTORS_OP, GTDIO6X_OPCODE_DISABLE_CHANNEL, GTDIO6X_OPCODE_DISABLE_CHANNEL, &nStatus);

CheckStatus(nStatus);

 

//**** Set 3 sites channels ****//

// Clear any previous site lists

GtDio6xMultiSiteDeleteAllSites(nHandle, &nStatus);

CheckStatus(nStatus);

 

// Fill Site #0 Channels Array: CH0-CH3

for (l = 0; l < 4; l++)

    alSiteChannels[l] = l;

// Set Site0 Channels list

GtDio6xMultiSiteSetChannelList(nHandle, 0, 4, alSiteChannels, &nStatus);

CheckStatus(nStatus);

 

// Fill Site #1 Channels Array: CH5-CH8

for (l = 0; l < 4; l++)

    alSiteChannels[l] = l + 5;

// Set Site #1 Channels list

GtDio6xMultiSiteSetChannelList(nHandle, 1, 4, alSiteChannels, &nStatus);

CheckStatus(nStatus);

 

// Fill Site #2 Channels Array: CH10-CH12

for (l = 0; l < 3; l++)

    alSiteChannels[l] = l + 10;

// Set Site #2 Channels list

GtDio6xMultiSiteSetChannelList(nHandle, 2, 3, alSiteChannels, &nStatus);

CheckStatus(nStatus);

 

// Print sites numbers

GtDio6xMultiSiteGetSiteCount(nHandle, &lSiteCount, &nStatus);

CheckStatus(nStatus);

GtDio6xMultiSiteGetSiteList(nHandle, lSiteCount, alSiteList, &nStatus);

CheckStatus(nStatus);

for (l = 0; l < lSiteCount; l++)

    printf("Added Site # %i\n", alSiteList[l]);

 

// Optional step: Disable the outputs of all the channels that are not

// in any site

GtDio6xMultiSiteSetSiteOutputMode(nHandle, -1, alSiteList, GTDIO6X_MULTI_SITE_OUTPUT_DISABLED, &nStatus);

CheckStatus(nStatus);

 

//*************************************************************

// Step 0: assign 4096 Vectors to Step 0, start from offset 0

lVectorLength = 4096;

lVectorOffset = 0;

GtDio6xStepSetVectorCount(nHandle, 0, lVectorOffset, lVectorLength, &nStatus);

CheckStatus(nStatus);

GtDio6xStepSetLast(nHandle, 0, TRUE, &nStatus);

CheckStatus(nStatus);

//  Initialize System Memory with GTDIO6X_OPCODE_DISABLE_CHANNEL and 4096 vectors length

GtDio6xMultiSiteSetSiteArray(nHandle, GTDIO6X_MULTI_SITE_MEMORY_FILL_USER_OPCODE, lVectorLength, 0, GTDIO6X_OPCODE_DISABLE_CHANNEL, &nStatus);

CheckStatus(nStatus);

 

// fill channels in site #0 and #1:

// Define channels vectors array of 4096 vectors and 4 channels to match #0 and #1

paucChVectorsArray = malloc(lVectorLength * 4);

for (l = 0; l < lVectorLength; l++)

{

    paucChVectorsArray[l * 4 + 0] = GTDIO6X_OPCODE_DRIVE_LOW_EXPECT_LOW;

    paucChVectorsArray[l * 4 + 1] = GTDIO6X_OPCODE_DRIVE_HIGH_EXPECT_HIGH;

    paucChVectorsArray[l * 4 + 2] = GTDIO6X_OPCODE_DRIVE_LOW_EXPECT_LOW;

    paucChVectorsArray[l * 4 + 3] = GTDIO6X_OPCODE_DRIVE_HIGH_EXPECT_HIGH;

}

 

// Fill List of Site Array with site #0 and site #1

alSiteArray[0] = 0; // Site #0

alSiteArray[1] = 1; // Site #1

// Write channels' vectors array to System Memory, the same 4 channels

// vector data will be written to site 0 and 1

GtDio6xMultiSiteWriteVectorMemoryToSystemMemory(nHandle, 2, alSiteArray, 0, lVectorLength, paucChVectorsArray, -1, -1, GTDIO6X_OPCODE_DISABLE_CHANNEL, &nStatus);

CheckStatus(nStatus);

 

// fill channels in site #2:

// Define channels vectors array for site #2 - 4096 vectors and 3 channels

paucChVectorsArray = malloc(lVectorLength * 3);

for (l = 0; l < lVectorLength; l++)

    for (lCh = 0; lCh < 3; lCh++)

        paucChVectorsArray[l * 3 + lCh] = GTDIO6X_OPCODE_DRIVE_HIGH;

 

alSiteArray[0] = 2; // Site #2

// Write channels vectors array to System Memory, the  3 channels vector

// data will be written to site 2

GtDio6xMultiSiteWriteVectorMemoryToSystemMemory(nHandle, 1, alSiteArray, 0, lVectorLength, paucChVectorsArray, -1, -1, GTDIO6X_OPCODE_DISABLE_CHANNEL, &nStatus);

CheckStatus(nStatus);

 

// Write the System Memory to the DIO board

GtDio6xMultiSiteWriteSystemMemoryToBoard(nHandle, 0, 0, lVectorLength, &nStatus);

CheckStatus(nStatus);

 

//*************************************************************

// Step 1: assign 2048 Vectors to Step 1, start from offset 4096

lVectorLength = 3072;

lVectorOffset = 4096;

 

GtDio6xStepSetVectorCount(nHandle, 1, lVectorOffset, lVectorLength, &nStatus);

CheckStatus(nStatus);

GtDio6xStepSetLast(nHandle, 1, TRUE, &nStatus);

CheckStatus(nStatus);

 

// Initialize System Memory with adio6xMulitSiteMemoryModeReadFromDio,

// The function will initialize the system memory to 2048 vectors and

// fill it with vectors read from

// the board starting from offset 4096.

// Since we fill the system memory with actual vector data from the

// DIO board, the fill opcode value has no affect

GtDio6xMultiSiteSetSiteArray(nHandle, GTDIO6X_MULTI_SITE_MEMORY_FILL_FROM_DIO, lVectorLength, lVectorOffset, GTDIO6X_OPCODE_DISABLE_CHANNEL, &nStatus);

CheckStatus(nStatus);

 

// fill channels in site #0 and #1:

// Define channels vectors array of 4096 vectors and 4 channels to match #0 and #1

paucChVectorsArray = malloc(lVectorLength * 4);

for (l = 0; l < lVectorLength; l++)

    for (lCh = 0; lCh < 4; lCh++)

        paucChVectorsArray[l * 4 + lCh] = GTDIO6X_OPCODE_DRIVE_HIGH;

 

// Fill List of Site Array with site #0 and site #1

alSiteArray[0] = 0; // Site #0

alSiteArray[1] = 1;    // Site #1

// Write channels' vectors array to System Memory, the same 4 channels

// vector data will be written to site 0 and 1

GtDio6xMultiSiteWriteVectorMemoryToSystemMemory(nHandle, 2, alSiteArray, 0, lVectorLength, aucChVectorsArray, -1, -1,        GTDIO6X_OPCODE_DISABLE_CHANNEL, &nStatus);

CheckStatus(nStatus);

 

// fill channels in site #2:

// Define channels vectors array for site #2 - 4096 vectors and 3 channels

paucChVectorsArray = malloc(lVectorLength * 3);

for (l = 0; l < lVectorLength; l++)

    for (lCh = 0; lCh < 3; lCh++)

        paucChVectorsArray[l * 3 + lCh] = GTDIO6X_OPCODE_DRIVE_HIGH_EXPECT_HIGH;

 

for (l = 0; l < 2048; l++)

    paucChVectorsArray[l * 3 + 0] = GTDIO6X_OPCODE_DRIVE_HIGH_EXPECT_LOW;

for (l = 2048; l < lVectorLength; l++)

    paucChVectorsArray[l * 3 + 1] = GTDIO6X_OPCODE_DRIVE_LOW_EXPECT_HIGH;

 

// List of Site Array

alSiteArray[0] = 2; // Site #2

// Write channels vectors array to System Memory, the 3 channels vector data

// will be written to site 2

GtDio6xMultiSiteWriteVectorMemoryToSystemMemory(nHandle, 1, alSiteArray, 0, lVectorLength, paucChVectorsArray, -1, -1, GTDIO6X_OPCODE_DISABLE_CHANNEL, &nStatus);

CheckStatus(nStatus);

 

// Write the System Memory to the DIO board, starting at offset 4096,

// which is the end of step 0

GtDio6xMultiSiteWriteSystemMemoryToBoard(nHandle, 0, 4096, lVectorLength, &nStatus);

CheckStatus(nStatus);

 

free(paucChVectorsArray);

// Run the 2 steps, one at a time

for (lStep = 0; lStep < 2; lStep++)

{

    GtDio6xSequencerReset(nHandle, &nStatus);

    CheckStatus(nStatus);

    // Run Step

    GtDio6xSequencerArm(nHandle, lStep, &nStatus);

    CheckStatus(nStatus);

    GtDio6xSequencerRun(nHandle, lStep, &nStatus);

    CheckStatus(nStatus);

    bIsRunning = TRUE;

    while (bIsRunning)

    {   GtDio6xSequencerIsRunning(nHandle, &bIsRunning, &nStatus);

        CheckStatus(nStatus);

        if (bIsRunning == FALSE)

               break;

    }

    GtDio6xMultiSiteGetRealTimeCompareFailures(nHandle,     GTDIO6X_MULTI_SITE_GET_FAILURES_MODE_DEFAULT, lStep, 1, &lFailedSites, &lFailedCh, &nStatus);

    CheckStatus(nStatus);

    // Print failed sites

    if (lFailedSites == GTDIO6X_MULTI_SITE_STATUS_PASS)

        printf("All 3 sites passed running step# = %d\n", lStep);

    else

    {   for (l = 0; l < 3; l++)

        {       if (((lFailedCh >> l) & 0x1) == GTDIO6X_MULTI_SITE_STATUS_FAIL)

                       printf("Site %i failed running step# = %d\n", l, lStep);

        }

    }

    // Print failed channels

    if (lFailedCh == GTDIO6X_MULTI_SITE_STATUS_PASS)

        printf("All sites' channels passed running step# = %d\n", lStep);

    else

    {   for (l = 0; l < 32; l++)

        {       if (((lFailedCh >> l) & 0x1) == GTDIO6X_MULTI_SITE_STATUS_FAIL)

                       printf("Channel %i failed running step# = %d\n", l, lStep);

        }

    }

 

See Also

GtDio6xMultiSiteDeleteAllSites, GtDio6xMultiSiteGetChannelList, GtDio6xMultiSiteGetSiteChannelCount, GtDio6xMultiSiteGetSiteList, GtDio6xMultiSiteGetSiteCount, GtDio6xMultiSiteSetChannelList, GtDio6xMultiSiteSetSiteArray, GtDio6xMultiSiteWriteSystemMemoryToBoard, GtDio6xMultiSiteWriteVectorMemoryToSystemMemory, GtDio6xGetErrorString