integrate and clean

This commit is contained in:
2026-03-09 16:43:04 +01:00
parent cde38d3f75
commit cc484d9458
10 changed files with 702 additions and 784 deletions

View File

@@ -48,7 +48,7 @@ FaultSource_getNbDeps( const def_sFaultSourceScoreRec* const pCtx,
const def_eFaultSource eFaultSource)
{
unsigned long res = 0;
for(unsigned long idx = 0; idx < NB_FAULT_SOURCE; idx++ )
for(unsigned long idx = 0; idx < NB_FAULT_SOURCE; ++idx )
if(pCtx[idx].eParrentFaultSource == eFaultSource)
res++;
return res;
@@ -80,7 +80,7 @@ void
FaultSource_divideAll( def_sFaultSourceScoreRec* const pCtx,
const double dDivider)
{
for(unsigned long idx = 0; idx < NB_FAULT_SOURCE; idx++ )
for(unsigned long idx = 0; idx < NB_FAULT_SOURCE; ++idx )
pCtx[idx].dScore /= dDivider;
}
@@ -88,7 +88,7 @@ static unsigned long
FaultSource_GetIdx( const def_sFaultSourceScoreRec* const pCtx,
const def_eFaultSource eFaultSource)
{
for(unsigned long idx = 0; idx < NB_FAULT_SOURCE; idx++ )
for(unsigned long idx = 0; idx < NB_FAULT_SOURCE; ++idx )
if(pCtx[idx].eThisFaultSource == eFaultSource)
return idx;
return _INVALID_FAULT_SOURCE_;
@@ -206,8 +206,8 @@ FaultSource_display(const def_sFaultSourceScoreRec* const pCtx)
dScoreSum += pCtx[idx].dScore;
printf("------------------------------------------------\n");
printf("\nDefects list:\n\n");
printf("Score\tElement [Loc]\n");
printf("\ndefects list:\n\n");
printf("score\telement [Loc]\n");
printf("------------------------------------------------\n");
for(unsigned long idx = 0;
@@ -233,61 +233,15 @@ WordBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
const def_eFaultSource eFaultSourceL,
const def_eFaultSource eFaultSourceH)
{
/*
for(unsigned char bitPos = 0; bitPos <= 31 ; bitPos++)
for(unsigned char bitPos = 0; bitPos <= 31 ; ++bitPos)
if(ErrorMark & (1u << bitPos))
{
if(bitPos < 16)
FaultSource_addScore(pCtx,eFaultSourceL + bitPos, dScore);
FaultSource_addScore(pCtx, eFaultSourceL + bitPos, dScore);
else
FaultSource_addScore(pCtx,eFaultSourceH + bitPos - 16, dScore);
FaultSource_addScore(pCtx, eFaultSourceH + bitPos - 16, dScore);
}
*/
if(ErrorMark & 0x000000FFu)
{
if(ErrorMark & 0x00000001u) FaultSource_addScore(pCtx,eFaultSourceL + 0, dScore);
if(ErrorMark & 0x00000002u) FaultSource_addScore(pCtx,eFaultSourceL + 1, dScore);
if(ErrorMark & 0x00000004u) FaultSource_addScore(pCtx,eFaultSourceL + 2, dScore);
if(ErrorMark & 0x00000008u) FaultSource_addScore(pCtx,eFaultSourceL + 3, dScore);
if(ErrorMark & 0x00000010u) FaultSource_addScore(pCtx,eFaultSourceL + 4, dScore);
if(ErrorMark & 0x00000020u) FaultSource_addScore(pCtx,eFaultSourceL + 5, dScore);
if(ErrorMark & 0x00000040u) FaultSource_addScore(pCtx,eFaultSourceL + 6, dScore);
if(ErrorMark & 0x00000080u) FaultSource_addScore(pCtx,eFaultSourceL + 7, dScore);
}
if(ErrorMark & 0x0000FF00u)
{
if(ErrorMark & 0x00000100u) FaultSource_addScore(pCtx,eFaultSourceL + 8, dScore);
if(ErrorMark & 0x00000200u) FaultSource_addScore(pCtx,eFaultSourceL + 9, dScore);
if(ErrorMark & 0x00000400u) FaultSource_addScore(pCtx,eFaultSourceL + 10, dScore);
if(ErrorMark & 0x00000800u) FaultSource_addScore(pCtx,eFaultSourceL + 11, dScore);
if(ErrorMark & 0x00001000u) FaultSource_addScore(pCtx,eFaultSourceL + 12, dScore);
if(ErrorMark & 0x00002000u) FaultSource_addScore(pCtx,eFaultSourceL + 13, dScore);
if(ErrorMark & 0x00004000u) FaultSource_addScore(pCtx,eFaultSourceL + 14, dScore);
if(ErrorMark & 0x00008000u) FaultSource_addScore(pCtx,eFaultSourceL + 15, dScore);
}
if(ErrorMark & 0x00FF0000u)
{
if(ErrorMark & 0x00010000u) FaultSource_addScore(pCtx,eFaultSourceH + 0, dScore);
if(ErrorMark & 0x00020000u) FaultSource_addScore(pCtx,eFaultSourceH + 1, dScore);
if(ErrorMark & 0x00040000u) FaultSource_addScore(pCtx,eFaultSourceH + 2, dScore);
if(ErrorMark & 0x00080000u) FaultSource_addScore(pCtx,eFaultSourceH + 3, dScore);
if(ErrorMark & 0x00100000u) FaultSource_addScore(pCtx,eFaultSourceH + 4, dScore);
if(ErrorMark & 0x00200000u) FaultSource_addScore(pCtx,eFaultSourceH + 5, dScore);
if(ErrorMark & 0x00400000u) FaultSource_addScore(pCtx,eFaultSourceH + 6, dScore);
if(ErrorMark & 0x00800000u) FaultSource_addScore(pCtx,eFaultSourceH + 7, dScore);
}
if(ErrorMark & 0xFF000000u)
{
if(ErrorMark & 0x01000000u) FaultSource_addScore(pCtx,eFaultSourceH + 8, dScore);
if(ErrorMark & 0x02000000u) FaultSource_addScore(pCtx,eFaultSourceH + 9, dScore);
if(ErrorMark & 0x04000000u) FaultSource_addScore(pCtx,eFaultSourceH + 10, dScore);
if(ErrorMark & 0x08000000u) FaultSource_addScore(pCtx,eFaultSourceH + 11, dScore);
if(ErrorMark & 0x10000000u) FaultSource_addScore(pCtx,eFaultSourceH + 12, dScore);
if(ErrorMark & 0x20000000u) FaultSource_addScore(pCtx,eFaultSourceH + 13, dScore);
if(ErrorMark & 0x40000000u) FaultSource_addScore(pCtx,eFaultSourceH + 14, dScore);
if(ErrorMark & 0x80000000u) FaultSource_addScore(pCtx,eFaultSourceH + 15, dScore);
}
}
void
@@ -296,13 +250,7 @@ QuartetBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
const double dScore,
const def_eFaultSource eFaultSource)
{
/*
for(uint8_t bitPos = 0; bitPos < 4 ; bitPos++)
for(uint8_t bitPos = 0; bitPos < 4 ; ++bitPos)
if(ErrorMark & (1u << bitPos))
FaultSource_addScore(pCtx,eFaultSource + bitPos, dScore);
*/
if(ErrorMark & 0x01u) FaultSource_addScore(pCtx,eFaultSource + 0, dScore);
if(ErrorMark & 0x02u) FaultSource_addScore(pCtx,eFaultSource + 1, dScore);
if(ErrorMark & 0x04u) FaultSource_addScore(pCtx,eFaultSource + 2, dScore);
if(ErrorMark & 0x08u) FaultSource_addScore(pCtx,eFaultSource + 3, dScore);
FaultSource_addScore(pCtx, eFaultSource + bitPos, dScore);
}

View File

@@ -5,13 +5,14 @@ CFLAGS= -Wall -std=gnu99 -O6 -m32 -march=pentium3 -fomit-frame-pointer \
-fexpensive-optimizations -ffast-math -fno-strict-aliasing \
-I. -I./glide/headers -I/usr/include/glide \
-DCVG
LFLAGS=-L./glide/lib -lglide
OBJ=OBJs/main.o \
OBJs/FaultSources.o \
OBJs/Utils.o \
OBJs/Draw.o \
OBJs/Test_Common.o \
OBJs/Test_Address.o \
OBJs/Test_Data.o \
OBJs/Test_Data_Huge.o

View File

@@ -290,9 +290,9 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
const def_eFaultSource _RES_RAS0 = (ucNumTMU == 0) ? R118 : R115;
const def_eFaultSource _RES_RAS1 = (ucNumTMU == 0) ? R149 : R150;
const def_eFaultSource RES_RAS = (add_list[idxdraw].nBank == 0) ? _RES_RAS0 : _RES_RAS1;
const def_eFaultSource RES_CAS = (ucNumTMU == 0) ? RA36 : RA32;
const def_eFaultSource RES_WE = (ucNumTMU == 0) ? R117 : R114;
const def_eFaultSource RES_RAS = (add_list[idxdraw].nBank == 0) ? _RES_RAS0 : _RES_RAS1;
const def_eFaultSource RES_CAS = (ucNumTMU == 0) ? RA36 : RA32;
const def_eFaultSource RES_WE = (ucNumTMU == 0) ? R117 : R114;
const def_eFaultSource RES_TEXADDR_0_L = (ucNumTMU == 0) ? RA35 : RA31;
const def_eFaultSource RES_TEXADDR_0_H = (ucNumTMU == 0) ? RA34 : RA30;
@@ -306,16 +306,11 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
const def_eFaultSource RES_TEXADDR_3_L = (ucNumTMU == 0) ? RA22 : RA20;
const def_eFaultSource RES_TEXADDR_3_H = (ucNumTMU == 0) ? RA21 : RA19;
const def_eFaultSource RES_TEXADDR_3_8 = (ucNumTMU == 0) ? R98 : R97;
if(count_bit32(ErrorMark_L1 & 0x0000FFFF) > 2)
{
NbErr++;
/*
printf("1: %08x %d\n",
ErrorMark_L1 & 0x0000FFFF,
count_bit32(ErrorMark_L1 & 0x0000FFFF));
*/
if((idxdraw == idx) && count_bit32(ErrorMark_L1 & 0x0000FFFF) > 6)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
@@ -368,7 +363,6 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_CASH, 1.0/8);
}
}
}
/* considering error only if more than 6 over 16 bits
@@ -377,11 +371,7 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
if(count_bit32(ErrorMark_L1 & 0xFFFF0000) > 2)
{
NbErr++;
/*
printf("2: %08x %d\n",
ErrorMark_L1 & 0xFFFF0000,
count_bit32(ErrorMark_L1 & 0xFFFF0000));
*/
if((idxdraw == idx) && count_bit32(ErrorMark_L1 & 0xFFFF0000) > 6)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
@@ -439,11 +429,7 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
if(count_bit32(ErrorMark_L2 & 0x0000FFFF) > 2)
{
NbErr++;
/*
printf("3: %08x %d\n",
ErrorMark_L2 & 0x0000FFFF,
count_bit32(ErrorMark_L2 & 0x0000FFFF));
*/
if((idxdraw == idx) && count_bit32(ErrorMark_L2 & 0x0000FFFF) > 6)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
@@ -502,11 +488,7 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
if(count_bit32(ErrorMark_L2 & 0xFFFF0000) > 2)
{
NbErr++;
/*
printf("4: %08x %d\n",
ErrorMark_L2 & 0xFFFF0000,
count_bit32(ErrorMark_L2 & 0xFFFF0000));
*/
if((idxdraw == idx) && count_bit32(ErrorMark_L2 & 0xFFFF0000) > 6)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
@@ -560,54 +542,8 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_CASH, 1.0/8);
}
}
}
/*
if(idxdraw == idx)
{
if(ErrorMark_L1)
{
printf("E (31..00): @%08x, read %08x, expected %08x !\n" ,
add_list[idxdraw].u32Addr,
L1 ,
TestVal1);
}
if(ErrorMark_L2)
{
printf("E (63..32): @%08x, read %08x, expected %08x !\n" ,
add_list[idxdraw].u32Addr,
L2 ,
TestVal2);
}
}
else
{
if(ErrorMark_L1)
{
printf("E (31..00)(trash) : @%08x, read %08x, expected %08x !\n" ,
add_list[idxdraw].u32Addr,
L1 ,
TestValBlank1);
}
if(ErrorMark_L2)
{
printf("E (63..32)(trash) : @%08x, read %08x, expected %08x !\n" ,
add_list[idxdraw].u32Addr,
L2 ,
TestValBlank2);
}
}
if(!ErrorMark_L1 && !ErrorMark_L2)
{
printf("OK !!\n");
}
*/
//printf("@ %08x done\n",add_list[idx]);
}
}
}

84
Test_Common.c Normal file
View File

@@ -0,0 +1,84 @@
/* V2MemTest - A CLI Tool to test & fix Voodoo² TMU System
* Copyright (C) 2026 ChaCha
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#define _BSD_SOURCE 1
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "cvg.h"
#include <glide.h>
#include "sst1init.h"
#include "fxpci.h"
#include "Draw.h"
#include "Test_Common.h"
#define _DEF_PREHEAT_TIME_S 5
#define _DEF_PREHEAT_NB_PIXEL_ROW 256
#define _DEF_PREHEAT_NB_PIXEL_COL 256
void
HeatMemAndTMU( sst1DeviceInfoStruct* devInfo,
FxU32* sst,
SstRegs *sstregs,
const char ucNumTMU,
const FxU32 mem)
{
/* set downstream TMUs to passthrough */
for (int i=0; i<ucNumTMU; i++)
ISET(SST_TREX(sstregs,i)->textureMode, SST_TC_PASS | SST_TCA_PASS);
/* Setting texture base address window for both CPU and TMU
*/
ISET(sstregs->texBaseAddr, (mem>>3));
/* Setting texture base address (to access it from CPU).
* We wont draw anything bigger than the texture so we can just use LOD0
* regardless of the actual size of the texture. And here its the maximum
* size (=LOD0) anyway.
*/
volatile FxU32 *texRowAddr
= (ucNumTMU<<(21-2))
+ (((FxU32)0)<<(17-2)) /*LOD0*/
+ (FxU32 *)SST_TEX_ADDRESS(sst);
for(unsigned short iter_row = 0; iter_row < _DEF_PREHEAT_NB_PIXEL_ROW; iter_row++)
{
for(unsigned short iter_col = 0; iter_col < _DEF_PREHEAT_NB_PIXEL_COL; iter_col+=2)
{
ISET(texRowAddr[iter_col/2], 0x55AA);
}
/* move to next line */
texRowAddr += (1<<(9-2));
}
clock_t begin = clock();
do
{
if(((sst1InitReturnStatus(sst) & SST_FIFOLEVEL)) >= 0x20)
{
/* draw a 256x256 square */
drawSquare(sstregs, 0, 0, 256);
}
}
while(((double)(clock() - begin)/CLOCKS_PER_SEC) < _DEF_PREHEAT_TIME_S );
sst1InitIdle(sst);
}

28
Test_Common.h Normal file
View File

@@ -0,0 +1,28 @@
/* V2MemTest - A CLI Tool to test & fix Voodoo² TMU System
* Copyright (C) 2026 ChaCha
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _DEF_TEST_COMMON_H_
#define _DEF_TEST_COMMON_H_
void
HeatMemAndTMU( sst1DeviceInfoStruct* devInfo,
FxU32* sst,
SstRegs *sstregs,
const char ucNumTMU,
const FxU32 mem);
#endif //_DEF_TEST_COMMON_H_

View File

@@ -14,8 +14,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#define _BSD_SOURCE 1
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include "cvg.h"
#include <glide.h>
@@ -26,6 +29,7 @@
#include "Utils.h"
#include "Draw.h"
#include "Test_Common.h"
#include "Test_Data.h"
static unsigned long long
@@ -39,6 +43,7 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
def_sFaultSourceScoreRec* const pFaultSrcCtx)
{
unsigned long long NbErr = 0;
static char szBuff[1024];
sst1InitIdle(sst);
unsigned long _trexInit0 = IGET(SST_TREX(sstregs,ucNumTMU)->trexInit0);
@@ -53,414 +58,164 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
= (ucNumTMU<<(21-2)) /* NUM_TMU */
+ (((FxU32)0)<<(17-2)) /* LOD_0 */
+ (FxU32 *)SST_TEX_ADDRESS(sst); /* tex base address */
ISET(texAddr[0], value1); ISET(texAddr[1], value1 + 1);
ISET(texAddr[2], value1 + 2); ISET(texAddr[3], value1 + 3);
ISET(texAddr[0], value1);
/* writing to second texture line, to use RAM bits 32..63 */
texAddr += (1<<(9-2));
ISET(texAddr[0], value2); ISET(texAddr[1], value2 + 1);
ISET(texAddr[2], value2 + 2); ISET(texAddr[3], value2 + 3);
ISET(texAddr[0], value2);
clearScreen(sstregs,0x00000000,8,2);
/* draw a 8x2 rectangle */
drawRect(sstregs,0,0,8,2);
drawRect(sstregs,0,0,2,2);
sst1InitIdle(sst);
/* reading back first line pixels addresses */
const uint32_t L1_1 = IGET(sst[(SST_LFB_ADDR >> 2) + 0]);
const uint32_t L1_2 = IGET(sst[(SST_LFB_ADDR >> 2) + 1]);
const uint32_t L1_3 = IGET(sst[(SST_LFB_ADDR >> 2) + 2]);
const uint32_t L1_4 = IGET(sst[(SST_LFB_ADDR >> 2) + 3]);
/* reading back second line pixels addresses */
const uint32_t L2_1 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 0]);
const uint32_t L2_2 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 1]);
const uint32_t L2_3 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 2]);
const uint32_t L2_4 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 3]);
const uint32_t ErrorMark_L1_1 = L1_1 ^ ( value1 + 0 );
const uint32_t ErrorMark_L1_2 = L1_2 ^ ( value1 + 1 );
const uint32_t ErrorMark_L1_3 = L1_3 ^ ( value1 + 2 );
const uint32_t ErrorMark_L1_4 = L1_4 ^ ( value1 + 3 );
const uint32_t ErrorMark_L2_1 = L2_1 ^ ( value2 + 0 );
const uint32_t ErrorMark_L2_2 = L2_2 ^ ( value2 + 1 );
const uint32_t ErrorMark_L2_3 = L2_3 ^ ( value2 + 2 );
const uint32_t ErrorMark_L2_4 = L2_4 ^ ( value2 + 3 );
if( ErrorMark_L1_1 || ErrorMark_L1_2 || ErrorMark_L1_3 || ErrorMark_L1_4
|| ErrorMark_L2_1 || ErrorMark_L2_2 || ErrorMark_L2_3 || ErrorMark_L2_4)
const uint32_t ErrorMark_L1 = L1_1 ^ ( value1 + 0 );
const uint32_t ErrorMark_L2 = L2_1 ^ ( value2 + 0 );
const double dScoreFront = (mem >= 0x200000) ? 1.0 / 8 : 1.0 / 4;
const double dScoreBack = (mem >= 0x200000) ? 1.0 / 4 : 1.0 / 8;
if(ErrorMark_L1)
{
NbErr++;
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1 >> 28, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2 >> 28, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3 >> 28, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4 >> 28, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1 >> 28, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2 >> 28, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3 >> 28, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4 >> 28, 1.0 / 16, RA13_1);
const double dScoreFront = (mem >= 0x200000) ? 1.0 / 8 : 1.0 / 4;
const double dScoreBack = (mem >= 0x200000) ? 1.0 / 4 : 1.0 / 8;
logD("===========================================================\n");
logD( "# fault on 1st line, value : 0x%04X [expected 0x%04X] !\n",
value1, L1_1);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 28, 1.0 / 16, RA13_1);
if(ucNumTMU == 0)
{
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreFront, U14, U12);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreBack, U23, U24);
WordBitFaultSet(pFaultSrcCtx,ErrorMark_L1, 1.0 / 4, U9_TMU0 + 1, U9_TMU0 + 16 + 1);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_1, dScoreFront, U14, U12);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_2, dScoreFront, U14, U12);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_3, dScoreFront, U14, U12);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_4, dScoreFront, U14, U12);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_1, dScoreFront, U18, U17);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_2, dScoreFront, U18, U17);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_3, dScoreFront, U18, U17);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_4, dScoreFront, U18, U17);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_1, dScoreBack, U23, U24);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_2, dScoreBack, U23, U24);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_3, dScoreBack, U23, U24);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_4, dScoreBack, U23, U24);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_1, dScoreBack, U25, U26);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_2, dScoreBack, U25, U26);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_3, dScoreBack, U25, U26);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_4, dScoreBack, U25, U26);
TMUTexDataFaultSet(pFaultSrcCtx, ErrorMark_L1_1, ErrorMark_L2_1, 1.0 / 4, U9_TMU0);
TMUTexDataFaultSet(pFaultSrcCtx, ErrorMark_L1_2, ErrorMark_L2_2, 1.0 / 4, U9_TMU0);
TMUTexDataFaultSet(pFaultSrcCtx, ErrorMark_L1_3, ErrorMark_L2_3, 1.0 / 4, U9_TMU0);
TMUTexDataFaultSet(pFaultSrcCtx, ErrorMark_L1_4, ErrorMark_L2_4, 1.0 / 4, U9_TMU0);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1_1,
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1,
1.0 / 8,
U9_TMU0_TEX_CAS0,
U9_TMU0_TEX_CAS1,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1_2,
1.0 / 8,
U9_TMU0_TEX_CAS0,
U9_TMU0_TEX_CAS1,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1_3,
1.0 / 8,
U9_TMU0_TEX_CAS0,
U9_TMU0_TEX_CAS1,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1_4,
1.0 / 8,
U9_TMU0_TEX_CAS0,
U9_TMU0_TEX_CAS1,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2_1,
1.0 / 8,
U9_TMU0_TEX_CAS2,
U9_TMU0_TEX_CAS3,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2_2,
1.0 / 8,
U9_TMU0_TEX_CAS2,
U9_TMU0_TEX_CAS3,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2_3,
1.0 / 8,
U9_TMU0_TEX_CAS2,
U9_TMU0_TEX_CAS3,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2_4,
1.0 / 8,
U9_TMU0_TEX_CAS2,
U9_TMU0_TEX_CAS3,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
mem < 0x200000 ?
U9_TMU0_TEX_RAS0
: U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
}
else if(ucNumTMU == 1)
else
{
/* during TMU1 test, TMU0 doesnt receive any textures => ignoring these
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
*/
/* U9_TMU0_TT_DATA_x is only tested when using TMU1 */
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreFront, U13, U11);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreBack, U27, U28);
WordBitFaultSet(pFaultSrcCtx,ErrorMark_L1, 1.0 / 4, U8_TMU1 + 1, U8_TMU1 + 16 + 1);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_1, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_2, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_3, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1_4, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_1, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_2, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_3, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2_4, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_1, dScoreFront, U13, U11);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_2, dScoreFront, U13, U11);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_3, dScoreFront, U13, U11);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_4, dScoreFront, U13, U11);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_1, dScoreFront, U16, U15);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_2, dScoreFront, U16, U15);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_3, dScoreFront, U16, U15);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_4, dScoreFront, U16, U15);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_1, dScoreBack, U27, U28);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_2, dScoreBack, U27, U28);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_3, dScoreBack, U27, U28);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1_4, dScoreBack, U27, U28);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_1, dScoreBack, U29, U30);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_2, dScoreBack, U29, U30);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_3, dScoreBack, U29, U30);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2_4, dScoreBack, U29, U30);
TMUTexDataFaultSet(pFaultSrcCtx, ErrorMark_L1_1, ErrorMark_L2_1, 1.0 / 4, U8_TMU1);
TMUTexDataFaultSet(pFaultSrcCtx, ErrorMark_L1_2, ErrorMark_L2_2, 1.0 / 4, U8_TMU1);
TMUTexDataFaultSet(pFaultSrcCtx, ErrorMark_L1_3, ErrorMark_L2_3, 1.0 / 4, U8_TMU1);
TMUTexDataFaultSet(pFaultSrcCtx, ErrorMark_L1_4, ErrorMark_L2_4, 1.0 / 4, U8_TMU1);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1_1,
1.0 / 8,
U8_TMU1_TEX_CAS0,
U8_TMU1_TEX_CAS1,
mem < 0x200000 ? U8_TMU1_TEX_RAS0 : U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1_2,
1.0 / 8,
U8_TMU1_TEX_CAS0,
U8_TMU1_TEX_CAS1,
mem < 0x200000 ? U8_TMU1_TEX_RAS0 : U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1_3,
1.0 / 8,
U8_TMU1_TEX_CAS0,
U8_TMU1_TEX_CAS1,
mem < 0x200000 ? U8_TMU1_TEX_RAS0 : U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1_4,
1.0 / 8,
U8_TMU1_TEX_CAS0,
U8_TMU1_TEX_CAS1,
mem < 0x200000 ? U8_TMU1_TEX_RAS0 : U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2_1,
1.0 / 8,
U8_TMU1_TEX_CAS2,
U8_TMU1_TEX_CAS3,
mem < 0x200000 ? U8_TMU1_TEX_RAS0 : U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2_2,
ErrorMark_L1,
1.0 / 8,
U8_TMU1_TEX_CAS2,
U8_TMU1_TEX_CAS3,
mem < 0x200000 ? U8_TMU1_TEX_RAS0 : U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_CAS0,
U8_TMU1_TEX_CAS1,
mem < 0x200000 ?
U8_TMU1_TEX_RAS0
: U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2_3,
1.0 / 8,
U8_TMU1_TEX_CAS2,
U8_TMU1_TEX_CAS3,
mem < 0x200000 ? U8_TMU1_TEX_RAS0 : U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2_4,
1.0 / 8,
U8_TMU1_TEX_CAS2,
U8_TMU1_TEX_CAS3,
mem < 0x200000 ? U8_TMU1_TEX_RAS0 : U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE );
}
logD("## overall fault LW bit-map : \n");
if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG)
{
if(ErrorMark_L1_1)
{
printf( "LFB[0][0] is 0x%08x [expected 0x%08x] !\n", L1_1, value1+0);
printf( "Faulty bits :\n");
printbin32Info(ErrorMark_L1_1, 31, 0);
printf( "\n");
}
if(ErrorMark_L1_2)
{
printf( "LFB[0][1] is 0x%08x [expected 0x%08x] !\n", L1_2, value1+1);
printf( "Faulty bits :\n");
printbin32Info(ErrorMark_L1_2, 31, 0);
printf( "\n");
}
if(ErrorMark_L1_3)
{
printf( "LFB[0][2] is 0x%08x [expected 0x%08x] !\n", L1_3, value1+2);
printf( "Faulty bits :\n");
printbin32Info(ErrorMark_L1_3, 31, 0);
printf( "\n");
}
if(ErrorMark_L1_4)
{
printf( "LFB[0][3] is 0x%08x [expected 0x%08x] !\n", L1_4, value1+3);
printf( "Faulty bits :\n");
printbin32Info(ErrorMark_L1_4, 31, 0);
printf( "\n");
}
if(ErrorMark_L2_1)
{
printf( "LFB[1][0] is 0x%08x [expected 0x%08x] !\n", L2_1, value2+0);
printf( "Faulty bits :\n");
printbin32Info(ErrorMark_L2_1, 63, 21);
printf( "\n");
}
if(ErrorMark_L2_2)
{
printf( "LFB[1][1] is 0x%08x [expected 0x%08x] !\n", L2_2, value2+1);
printf( "Faulty bits :\n");
printbin32Info(ErrorMark_L2_2, 63, 21);
printf( "\n");
}
if(ErrorMark_L2_3)
{
printf( "LFB[1][2] is 0x%08x [expected 0x%08x] !\n", L2_3, value2+2);
printf( "Faulty bits :\n");
printbin32Info(ErrorMark_L2_3, 63, 21);
printf( "\n");
}
if(ErrorMark_L2_4)
{
printf( "LFB[1][3] is 0x%08x [expected 0x%08x] !\n", L2_4, value2+3);
printf( "Faulty bits :\n");
printbin32Info(ErrorMark_L2_4, 63, 21);
printf( "\n");
}
sprintbin32Info(szBuff,ErrorMark_L1, 31, 0);
logD("%s\n",szBuff);
}
}
if(ErrorMark_L2)
{
NbErr++;
logD("===========================================================\n");
logD( "# fault on 2nd line, value : 0x%04X [expected 0x%04X] !\n",
value2, L2_1);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 0, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 4, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 8, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 12, 1.0 / 16, RA13_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 16, 1.0 / 16, RA10_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 20, 1.0 / 16, RA11_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 24, 1.0 / 16, RA12_1);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 28, 1.0 / 16, RA13_1);
if(ucNumTMU == 0)
{
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreFront, U18, U17);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreBack, U25, U26);
WordBitFaultSet(pFaultSrcCtx,ErrorMark_L1, 1.0 / 4, U9_TMU0 + 32 + 1, U9_TMU0 + 48 + 1);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2,
1.0 / 8,
U9_TMU0_TEX_CAS2,
U9_TMU0_TEX_CAS3,
mem < 0x200000 ? U9_TMU0_TEX_RAS0 : U9_TMU0_TEX_RAS1,
U9_TMU0_TEX_WE);
}
else
{
/* during TMU1 test, TMU0 doesnt receive any textures => ignoring these
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0);
*/
/* U9_TMU0_TT_DATA_x is only tested when using TMU1 */
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreFront, U16, U15);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreBack, U29, U30);
WordBitFaultSet(pFaultSrcCtx,ErrorMark_L2, 1.0 / 4, U8_TMU1 + 32 + 1, U8_TMU1 + 48 + 1);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L2,
1.0 / 8,
U8_TMU1_TEX_CAS2,
U8_TMU1_TEX_CAS3,
mem < 0x200000 ?
U8_TMU1_TEX_RAS0
: U8_TMU1_TEX_RAS1,
U8_TMU1_TEX_WE);
}
logD("## overall fault LW bit-map : \n");
if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG)
{
sprintbin32Info(szBuff,ErrorMark_L2, 31, 0);
logD("%s\n",szBuff);
}
}
@@ -510,23 +265,21 @@ test_TMU_datalines( sst1DeviceInfoStruct* devInfo,
/* set downstream TMUs to only passthrough */
for (int i=0; i<ucNumTMU; i++)
ISET(SST_TREX(sstregs,i)->textureMode, SST_TC_PASS | SST_TCA_PASS);
for( int iMemBlock = 0;
iMemBlock < sizeof(ar_memBlocks)/sizeof(def_sMemBlock);
iMemBlock++)
{
const def_sMemBlock* pMemBlk = &ar_memBlocks[iMemBlock];
if(RamSizeMB < 4 && pMemBlk->ulAddStart >= 0x300000) continue;
if(RamSizeMB < 3 && pMemBlk->ulAddStart >= 0x200000) continue;
if(RamSizeMB < 2 && pMemBlk->ulAddStart >= 0x100000) continue;
if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG)
{
printf("Testing @ 0x%08x to 0x%08x ...\n",
pMemBlk->ulAddStart,
pMemBlk->ulAddStart + pMemBlk->ulAddLength -4);
}
logD("Testing @ 0x%08x to 0x%08x ...\n",
pMemBlk->ulAddStart,
pMemBlk->ulAddStart + pMemBlk->ulAddLength -4);
unsigned char ucAddMovingBit = 0;
for( FxU32 addrTest = pMemBlk->ulAddStart ;
addrTest < (pMemBlk->ulAddStart + pMemBlk->ulAddLength);
@@ -534,6 +287,7 @@ test_TMU_datalines( sst1DeviceInfoStruct* devInfo,
{
FxU32 bitTest = 1u;
FxU32 bitTest2 = 1u << 31;
for(unsigned long nloop=0;; nloop++)
{
unsigned long ulNbError;
@@ -547,16 +301,18 @@ test_TMU_datalines( sst1DeviceInfoStruct* devInfo,
pFaultSrcCtx);
ullNbErrorAll += ulNbError;
if((bRandom && (nloop > 32)) || bitTest == 0)
{
if((bRandom && (nloop > 64)) || bitTest == 0)
break;
}
bitTest = bRandom ? get_notnull_random_balanced_mByte() : (bitTest << 1);
bitTest2 = bRandom ? get_notnull_random_balanced_mByte() : (bitTest2 >> 1);
bitTest = bRandom ?
get_notnull_random_balanced_mByte()
: (bitTest << 1);
bitTest2 = bRandom ?
get_notnull_random_balanced_mByte()
: (bitTest2 >> 1);
}
if(sOptions.eLogLevel >= E_LOGLEVEL__TRACE)
printf("Done @ 0x%08x\n",addrTest);
logT("Done @ 0x%08x\n",addrTest);
const FxU32 new_addrTest = pMemBlk->ulAddStart | (1u << ucAddMovingBit);
if(new_addrTest == pMemBlk->ulAddStart) break;

View File

@@ -31,6 +31,7 @@
#include "Utils.h"
#include "Draw.h"
#include "Test_Common.h"
#include "Test_Data_Huge.h"
#define _DEF_NB_PIXEL_ROW 256
@@ -39,49 +40,6 @@
//#define _PROFILING
#define _DEF_PREHEAT_TIME_S 5
static void
HeatMemAndTMU( sst1DeviceInfoStruct* devInfo,
FxU32* sst,
SstRegs *sstregs,
const char ucNumTMU,
const FxU32 mem)
{
/* set base mem @ */
ISET(sstregs->texBaseAddr, (mem>>3));
volatile FxU32 *texRowAddr
= (ucNumTMU<<(21-2))
+ (((FxU32)0)<<(17-2)) /*LOD0*/
+ (FxU32 *)SST_TEX_ADDRESS(sst);
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
{
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=2)
{
ISET(texRowAddr[iter_col/2], 0x55AA);
}
/* move to next line */
texRowAddr += (1<<(9-2));
}
clock_t begin = clock();
//printf("PREHEATING TMU/RAM\n");
do
{
if(((sst1InitReturnStatus(sst) & SST_FIFOLEVEL)) >= 0x20)
{
/* draw a 256x256 square */
drawSquare(sstregs, 0, 0, 256);
}
}
while(((double)(clock() - begin)/CLOCKS_PER_SEC) < _DEF_PREHEAT_TIME_S );
//printf("PREHEATING Done\n");
sst1InitIdle(sst);
}
typedef struct _def_sFaultSheet{
unsigned char ucNumTMU;
unsigned char bEvenRow;
@@ -89,12 +47,10 @@ typedef struct _def_sFaultSheet{
def_eFaultSource Ux_MEMChip_MainLSB;
def_eFaultSource Ux_MEMChip_AltMSB;
def_eFaultSource Ux_MEMChip_AltLSB;
def_eFaultSource Ux_MEMChip_CAS02;
def_eFaultSource Ux_MEMChip_CAS13;
def_eFaultSource Ux_MEMChip_RAS0;
def_eFaultSource Ux_MEMChip_RAS1;
def_eFaultSource Ux_MEMChip_WE;
def_eFaultSource Ux_TMUx_CAS02;
def_eFaultSource Ux_TMUx_CAS13;
def_eFaultSource Ux_TMU;
def_eFaultSource Ux_TMUx_TEXDATA_x_0;
}def_sFaultSheet;
static const def_sFaultSheet sFaultSheet[MAX_TMU][2] =
@@ -103,60 +59,52 @@ static const def_sFaultSheet sFaultSheet[MAX_TMU][2] =
{ /*ODD row*/
.ucNumTMU = 0,
.bEvenRow = 0,
.Ux_MEMChip_MainMSB = U14,
.Ux_MEMChip_MainLSB = U12,
.Ux_MEMChip_AltMSB = U23,
.Ux_MEMChip_AltLSB = U24,
.Ux_MEMChip_CAS02 = U9_TMU0_TEX_CAS0,
.Ux_MEMChip_CAS13 = U9_TMU0_TEX_CAS1,
.Ux_MEMChip_RAS0 = U9_TMU0_TEX_RAS0,
.Ux_MEMChip_RAS1 = U9_TMU0_TEX_RAS1,
.Ux_MEMChip_WE = U9_TMU0_TEX_WE,
.Ux_MEMChip_MainMSB = U12,
.Ux_MEMChip_MainLSB = U14,
.Ux_MEMChip_AltMSB = U24,
.Ux_MEMChip_AltLSB = U23,
.Ux_TMUx_CAS02 = U9_TMU0_TEX_CAS0,
.Ux_TMUx_CAS13 = U9_TMU0_TEX_CAS1,
.Ux_TMU = U9_TMU0,
.Ux_TMUx_TEXDATA_x_0 = U9_TMU0+1+0,
},
{ /*EVEN row*/
.ucNumTMU = 0,
.bEvenRow = 1,
.Ux_MEMChip_MainMSB = U18,
.Ux_MEMChip_MainLSB = U17,
.Ux_MEMChip_AltMSB = U25,
.Ux_MEMChip_AltLSB = U26,
.Ux_MEMChip_CAS02 = U9_TMU0_TEX_CAS2,
.Ux_MEMChip_CAS13 = U9_TMU0_TEX_CAS3,
.Ux_MEMChip_RAS0 = U9_TMU0_TEX_RAS0,
.Ux_MEMChip_RAS1 = U9_TMU0_TEX_RAS1,
.Ux_MEMChip_WE = U9_TMU0_TEX_WE,
.Ux_MEMChip_MainMSB = U17,
.Ux_MEMChip_MainLSB = U18,
.Ux_MEMChip_AltMSB = U26,
.Ux_MEMChip_AltLSB = U25,
.Ux_TMUx_CAS02 = U9_TMU0_TEX_CAS2,
.Ux_TMUx_CAS13 = U9_TMU0_TEX_CAS3,
.Ux_TMU = U9_TMU0,
.Ux_TMUx_TEXDATA_x_0 = U9_TMU0+1+32,
},
},
{ /*TMU1*/
{ /*ODD row*/
.ucNumTMU = 1,
.bEvenRow = 0,
.Ux_MEMChip_MainMSB = U13,
.Ux_MEMChip_MainLSB = U11,
.Ux_MEMChip_AltMSB = U27,
.Ux_MEMChip_AltLSB = U28,
.Ux_MEMChip_CAS02 = U8_TMU1_TEX_CAS0,
.Ux_MEMChip_CAS13 = U8_TMU1_TEX_CAS1,
.Ux_MEMChip_RAS0 = U8_TMU1_TEX_RAS0,
.Ux_MEMChip_RAS1 = U8_TMU1_TEX_RAS1,
.Ux_MEMChip_WE = U8_TMU1_TEX_WE,
.Ux_MEMChip_MainMSB = U11,
.Ux_MEMChip_MainLSB = U13,
.Ux_MEMChip_AltMSB = U28,
.Ux_MEMChip_AltLSB = U27,
.Ux_TMUx_CAS02 = U8_TMU1_TEX_CAS0,
.Ux_TMUx_CAS13 = U8_TMU1_TEX_CAS1,
.Ux_TMU = U8_TMU1,
.Ux_TMUx_TEXDATA_x_0 = U8_TMU1+1+0,
},
{ /*EVEN row*/
.ucNumTMU = 2,
.bEvenRow = 1,
.Ux_MEMChip_MainMSB = U16,
.Ux_MEMChip_MainLSB = U15,
.Ux_MEMChip_AltMSB = U29,
.Ux_MEMChip_AltLSB = U30,
.Ux_MEMChip_CAS02 = U8_TMU1_TEX_CAS2,
.Ux_MEMChip_CAS13 = U8_TMU1_TEX_CAS3,
.Ux_MEMChip_RAS0 = U8_TMU1_TEX_RAS0,
.Ux_MEMChip_RAS1 = U8_TMU1_TEX_RAS1,
.Ux_MEMChip_WE = U8_TMU1_TEX_WE,
.Ux_MEMChip_MainMSB = U15,
.Ux_MEMChip_MainLSB = U16,
.Ux_MEMChip_AltMSB = U30,
.Ux_MEMChip_AltLSB = U29,
.Ux_TMUx_CAS02 = U8_TMU1_TEX_CAS2,
.Ux_TMUx_CAS13 = U8_TMU1_TEX_CAS3,
.Ux_TMU = U8_TMU1,
.Ux_TMUx_TEXDATA_x_0 = U8_TMU1+1+32,
},
}
};
@@ -191,26 +139,62 @@ AssignFault(const def_sFaultSheet* psCurFaultSheet,
else
nbErrWord++;
logD("## fault on LW bit: %d\n",bitIdx);
logD("- TMU : %s\n",pFaultSrcCtx[psCurFaultSheet->Ux_TMU].szName);
/* Texture Source path, FBI to TMUx*/
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_TMU+81+relbitIdxWord, 1.0/4); //Ux_TMUx_FT_DATA_x
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_TMU
+ 81 //Ux_TMUx_FT_DATA_x
+ relbitIdxWord,
1.0/4);
/* Output path, TMU0 to FBI*/
FaultSource_addScore(pFaultSrcCtx, U9_TMU0+97+relbitIdxWord, 1.0/4); //U9_TMU0_TF_DATA_x
FaultSource_addScore( pFaultSrcCtx,
U9_TMU0
+ 97 //U9_TMU0_TF_DATA_x
+ relbitIdxWord,
1.0/4);
switch(WordIdx)
{
case 0:
case 2:
if(relbitIdx<=3)
FaultSource_addScore(pFaultSrcCtx, RA10_1+relbitIdxQuartet,1.0/8);
{
logD("- RA1x_x : %s\n",pFaultSrcCtx[RA10_1+relbitIdxQuartet].szName);
FaultSource_addScore( pFaultSrcCtx,
RA10_1
+ relbitIdxQuartet,
1.0/8);
}
else
FaultSource_addScore(pFaultSrcCtx, RA11_1+relbitIdxQuartet,1.0/8);
{
logD("- RA1x_x : %s\n",pFaultSrcCtx[RA11_1+relbitIdxQuartet].szName);
FaultSource_addScore( pFaultSrcCtx,
RA11_1
+ relbitIdxQuartet,
1.0/8);
}
break;
case 1:
case 3:
if(relbitIdx<=3)
FaultSource_addScore(pFaultSrcCtx, RA12_1+relbitIdxQuartet,1.0/8);
{
logD("- RA1x_x : %s\n",pFaultSrcCtx[RA12_1+relbitIdxQuartet].szName);
FaultSource_addScore( pFaultSrcCtx,
RA12_1
+ relbitIdxQuartet,
1.0/8);
}
else
FaultSource_addScore(pFaultSrcCtx, RA13_1+relbitIdxQuartet,1.0/8);
{
logD("- RA1x_x : %s\n",pFaultSrcCtx[RA13_1+relbitIdxQuartet].szName);
FaultSource_addScore( pFaultSrcCtx,
RA13_1
+ relbitIdxQuartet,
1.0/8);
}
break;
}
@@ -218,54 +202,107 @@ AssignFault(const def_sFaultSheet* psCurFaultSheet,
if(psCurFaultSheet->ucNumTMU == 1)
{
/* TMU1 output */
FaultSource_addScore(pFaultSrcCtx, U8_TMU1+97+relbitIdxWord, 1.0/4); //U8_TMU1_TF_DATA_x
FaultSource_addScore( pFaultSrcCtx,
U8_TMU1
+ 97 //U8_TMU1_TF_DATA_x
+ relbitIdxWord,
1.0/4);
/* line adaptation resistors */
FaultSource_addScore(pFaultSrcCtx, TT_TDATA_R131+relbitIdxWord, 1.0/4); //TT_TDATA_R131++
FaultSource_addScore( pFaultSrcCtx,
TT_TDATA_R131
+ 0
+ relbitIdxWord,
1.0/4);
/* TMU0 input */
/* Note: U9_TMU0_TT_DATA_x is only tested when using TMU1 */
FaultSource_addScore(pFaultSrcCtx, U9_TMU0+65+relbitIdxWord, 1.0/4); //U9_TMU0_TT_DATA_x
FaultSource_addScore( pFaultSrcCtx,
U9_TMU0
+ 65 //U9_TMU0_TT_DATA_x
+ relbitIdxWord,
1.0/4);
}
if(WordIdx>=2)
{
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_MEMChip_MainLSB+1+relbitIdxWord, 1.0/2); //ok
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_MEMChip_AltLSB+1+relbitIdxWord, 1.0/4);
logD( "- RAM chip/signal : %s\n",
pFaultSrcCtx[psCurFaultSheet->Ux_MEMChip_MainMSB
+ 1
+ relbitIdxWord].szName);
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_MEMChip_MainMSB
+ 1
+ relbitIdxWord,
1.0/2); //ok
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_MEMChip_AltMSB
+ 1
+ relbitIdxWord,
1.0/4);
}
else
{
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_MEMChip_MainMSB+1+relbitIdxWord, 1.0/2); //ok
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_MEMChip_AltMSB+1+relbitIdxWord, 1.0/4);
logD( "- RAM chip/signal : %s\n",
pFaultSrcCtx[psCurFaultSheet->Ux_MEMChip_MainLSB
+ 1
+ relbitIdxWord].szName);
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_MEMChip_MainLSB
+ 1
+ relbitIdxWord,
1.0/2);
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_MEMChip_AltLSB
+ 1
+ relbitIdxWord,
1.0/4);
}
if(!psCurFaultSheet->bEvenRow)
{
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_TMU+1+0+bitIdx, 1.0/2); //Ux_TMUx_TEXDATA_0_0
}
else
{
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_TMU+1+32+bitIdx, 1.0/2); //Ux_TMUx_TEXDATA_2_0
}
logD( "- TMUx_TEXDATA_x_x : %s\n",
pFaultSrcCtx[psCurFaultSheet->Ux_TMUx_TEXDATA_x_0+bitIdx].szName);
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_TMUx_TEXDATA_x_0
+ bitIdx,
1.0/2);
if((relbitIdxWord==15) && (nbErrWord>16))
{
logD("- too many errors on this Word, suspecting CAS/RAS/WE.\n");
switch(WordIdx)
{
case 0:
case 2:
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_MEMChip_CAS02, 1.0);
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_TMUx_CAS02,
1.0);
break;
case 1:
case 3:
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_MEMChip_CAS13, 1.0);
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_TMUx_CAS13,
1.0);
break;
}
FaultSource_addScore(pFaultSrcCtx,
mem < 0x200000 ?
psCurFaultSheet->Ux_MEMChip_RAS0
: psCurFaultSheet->Ux_MEMChip_RAS1,
1.0/2);
FaultSource_addScore(pFaultSrcCtx, psCurFaultSheet->Ux_MEMChip_WE, 1.0/2);
if(mem < 0x200000 )
{
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_TMU
+ 113, //Ux_TMUx_RAS0
1.0/2);
}
else
{
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_TMU
+ 114, //Ux_TMUx_RAS1
1.0/2);
}
FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_TMU
+ 119, //Ux_TMUx_WE
1.0/2);
}
logD("-----------------------------------------------------------\n");
}
static unsigned long long
@@ -277,18 +314,16 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
def_sFaultSourceScoreRec* const pFaultSrcCtx)
{
unsigned long long NbErr = 0;
static char szBuff[1024];
#ifdef _PROFILING
clock_t begin = clock();
#endif
/* set base mem @ */
ISET(sstregs->texBaseAddr, (mem>>3));
/* precomputing a pseudo-random texture data chunk.
*/
static uint16_t
ar_u16Pixels[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL];
static uint16_t
ar_u16PixelsReRead[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL];
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
{
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=2)
@@ -303,11 +338,24 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
clock_t after_create = clock();
#endif
/* Setting texture base address window for both CPU and TMU
*/
ISET(sstregs->texBaseAddr, (mem>>3));
/* Setting texture base address (to access it from CPU).
* We wont draw anything bigger than the texture so we can just use LOD0
* regardless of the actual size of the texture. And here its the maximum
* size (=LOD0) anyway.
*/
volatile FxU32 *texRowAddr
= (ucNumTMU<<(21-2))
+ (((FxU32)0)<<(17-2)) /*LOD0*/
+ (FxU32 *)SST_TEX_ADDRESS(sst);
/* Fast write of the texture memory, through PCI/FBI/TMU.
* we cannot use memcpy because it is not garented to do 32bit transfers.
* This code might not be portable on other architectures (=endianess)
*/
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
{
mmio_fastwrite32( texRowAddr,
@@ -326,7 +374,14 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
#endif
clearScreen(sstregs,0x00000000,256,256);
/* Note: The checking phase is done several time without generating new
* data to allow better trouble-shooting in the future (bad write to good
* read). This particular check is not implemented yet (everything checked
* regardeless of the iteration).
* Also, the screen is only cleared before, to "hide" FBI memory glitches.
* It might or might not be a good idea... :)
*/
for(unsigned int i = 0; i<_NB_CHECK_LOOP; i++)
{
#ifdef _PROFILING
@@ -342,13 +397,20 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
#endif
volatile FxU32* pLFB = sst + (SST_LFB_ADDR>>2);
/* Fast read of the frame buffer from FBI/PCI, toward CPU memory to
* allow faster processing later and to prevent working on FBI memory
* for too long. We walk line by line because screen is not continuous
* in FBI memory.
*/
static uint16_t
ar_u16PixelsReRead[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL];
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; ++iter_row)
{
//printf("reading row %d\n",iter_row);
logT("reading row %d\n",iter_row);
mmio_fastread32((uint32_t*)&ar_u16PixelsReRead[iter_row],
pLFB,
_DEF_NB_PIXEL_COL/2);
//printf("copy done\n");
logT("copy done\n");
pLFB += ((2048)>>2) ;
}
@@ -356,7 +418,12 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
after_read[i] = clock();
#endif
//logI("Pre-Analysing...\n");
logT("pre-analysing\n");
/* Computing ErrorMark for the whole array to improve cache usage and
* SuperScalar.
* Note: This could be merged with the previous read phase...
* But it seems fast enough ?
*/
static uint32_t
ar_u32ErrorMark_Lx[_DEF_NB_PIXEL_ROW*_DEF_NB_PIXEL_COL/2];
for(unsigned int iter = 0; iter < _DEF_NB_PIXEL_ROW*_DEF_NB_PIXEL_COL/2; iter+=2)
@@ -368,113 +435,131 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
= (*((uint32_t*)ar_u16PixelsReRead+iter+1))
^ (*((uint32_t*)ar_u16Pixels+iter+1));
}
//logI("Analysing...\n");
logT("analysing\n");
/* row index allows to know which memory chip we are reading
* this is why we cannot just walk the array as flat 32bit.
*/
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; ++iter_row)
{
//printf("checking row %d\n",iter_row);
logT("checking row %d\n",iter_row);
/* We will read 32bit words so we increase by 2 at every col loop.
* but as said, row/col index are used for Fault finding.
*/
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=2)
{
//printf("walk\n");
logT("checking col %d\n",iter_col);
const uint32_t ErrorMark_Lx = ar_u32ErrorMark_Lx[(iter_row*_DEF_NB_PIXEL_COL+iter_col)/2];
if(!ErrorMark_Lx) continue;
const uint16_t ErrorMark_Lx_n1 = ErrorMark_Lx & 0xFFFF;
const uint16_t ErrorMark_Lx_n2 = ErrorMark_Lx >> 16;
/* There are just too much data to do a naive bunch of check on
* every possible FaultSource. So we need to do an ErrorMark's
* bit driven check. So we will check every bit once and only
* once, then we will assign the fault's Score to every target.
* This reduces the test time by 4 and allow to run more passes.
*
* To speed up things, we are also using a LUT-like preset
* FaultSource array (psCurFaultSheet).
*/
const def_sFaultSheet* psCurFaultSheet = &sFaultSheet[(int)ucNumTMU][iter_row%2];
//unsigned char nbBitError = 0;
if(ErrorMark_Lx & 0x000000FFu)
if(ErrorMark_Lx)
{
if(ErrorMark_Lx & 0x00000001u) AssignFault(psCurFaultSheet,mem,0,0,0,0,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000002u) AssignFault(psCurFaultSheet,mem,1,1,1,1,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000004u) AssignFault(psCurFaultSheet,mem,2,2,2,2,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000008u) AssignFault(psCurFaultSheet,mem,3,3,3,3,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000010u) AssignFault(psCurFaultSheet,mem,4,4,4,0,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000020u) AssignFault(psCurFaultSheet,mem,5,5,5,1,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000040u) AssignFault(psCurFaultSheet,mem,6,6,6,2,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000080u) AssignFault(psCurFaultSheet,mem,7,7,7,3,0,pFaultSrcCtx);
}
if(ErrorMark_Lx & 0x0000FF00u)
{
if(ErrorMark_Lx & 0x00000100u) AssignFault(psCurFaultSheet,mem,8,0, 8, 0,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000200u) AssignFault(psCurFaultSheet,mem,9,1, 9, 1,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000400u) AssignFault(psCurFaultSheet,mem,10,2,10,2,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000800u) AssignFault(psCurFaultSheet,mem,11,3,11,3,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00001000u) AssignFault(psCurFaultSheet,mem,12,4,12,0,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00002000u) AssignFault(psCurFaultSheet,mem,13,5,13,1,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00004000u) AssignFault(psCurFaultSheet,mem,14,6,14,2,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00008000u) AssignFault(psCurFaultSheet,mem,15,7,15,3,1,pFaultSrcCtx);
}
if(ErrorMark_Lx & 0x00FF0000u)
{
if(ErrorMark_Lx & 0x00010000u) AssignFault(psCurFaultSheet,mem,16,0,0,0,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00020000u) AssignFault(psCurFaultSheet,mem,17,1,1,1,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00040000u) AssignFault(psCurFaultSheet,mem,18,2,2,2,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00080000u) AssignFault(psCurFaultSheet,mem,19,3,3,3,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00100000u) AssignFault(psCurFaultSheet,mem,20,4,4,0,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00200000u) AssignFault(psCurFaultSheet,mem,21,5,5,1,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00400000u) AssignFault(psCurFaultSheet,mem,22,6,6,2,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00800000u) AssignFault(psCurFaultSheet,mem,23,7,7,3,2,pFaultSrcCtx);
}
if(ErrorMark_Lx & 0xFF000000u)
{
if(ErrorMark_Lx & 0x01000000u) AssignFault(psCurFaultSheet,mem,24,0,8, 0,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x02000000u) AssignFault(psCurFaultSheet,mem,25,1,9, 1,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x04000000u) AssignFault(psCurFaultSheet,mem,26,2,10,2,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x08000000u) AssignFault(psCurFaultSheet,mem,27,3,11,3,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x10000000u) AssignFault(psCurFaultSheet,mem,28,4,12,0,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x20000000u) AssignFault(psCurFaultSheet,mem,29,5,13,1,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x40000000u) AssignFault(psCurFaultSheet,mem,30,6,14,2,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x80000000u) AssignFault(psCurFaultSheet,mem,31,7,15,3,3,pFaultSrcCtx);
}
if(ErrorMark_Lx_n1)
{
if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG)
{
printf("Error pix1 on row %d, col %d: expected %04x, got %04x\n",
iter_row, iter_col,
ar_u16Pixels[iter_row][iter_col],
ar_u16PixelsReRead[iter_row][iter_col]);
}
NbErr++;
}
else
{
if(sOptions.eLogLevel >= E_LOGLEVEL__TRACE)
logD("===========================================================\n");
/*This is another layer of optimization, we partition ErrorMark
* in binary-like tree.*/
if(ErrorMark_Lx & 0x0000FFFFu)
{
printf("Ok pix1 on row %d, col %d: value %04x\n",
logD("# fault detected, LFB[%d][%d] is 0x%04X [expected 0x%04X] !\n",
iter_row, iter_col,
ar_u16PixelsReRead[iter_row][iter_col],
ar_u16Pixels[iter_row][iter_col]);
if(ErrorMark_Lx & 0x000000FFu)
{
if(ErrorMark_Lx & 0x0000000Fu)
{
/*All calls have a lot of pre-computed const values to fast things up.*/
if(ErrorMark_Lx & 0x00000001u) AssignFault(psCurFaultSheet,mem,0,0,0,0,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000002u) AssignFault(psCurFaultSheet,mem,1,1,1,1,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000004u) AssignFault(psCurFaultSheet,mem,2,2,2,2,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000008u) AssignFault(psCurFaultSheet,mem,3,3,3,3,0,pFaultSrcCtx);
}
if(ErrorMark_Lx & 0x000000F0u)
{
if(ErrorMark_Lx & 0x00000010u) AssignFault(psCurFaultSheet,mem,4,4,4,0,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000020u) AssignFault(psCurFaultSheet,mem,5,5,5,1,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000040u) AssignFault(psCurFaultSheet,mem,6,6,6,2,0,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000080u) AssignFault(psCurFaultSheet,mem,7,7,7,3,0,pFaultSrcCtx);
}
}
if(ErrorMark_Lx & 0x0000FF00u)
{
if(ErrorMark_Lx & 0x00000F00u)
{
if(ErrorMark_Lx & 0x00000100u) AssignFault(psCurFaultSheet,mem,8,0, 8, 0,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000200u) AssignFault(psCurFaultSheet,mem,9,1, 9, 1,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000400u) AssignFault(psCurFaultSheet,mem,10,2,10,2,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000800u) AssignFault(psCurFaultSheet,mem,11,3,11,3,1,pFaultSrcCtx);
}
if(ErrorMark_Lx & 0x0000F000u)
{
if(ErrorMark_Lx & 0x00001000u) AssignFault(psCurFaultSheet,mem,12,4,12,0,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00002000u) AssignFault(psCurFaultSheet,mem,13,5,13,1,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00004000u) AssignFault(psCurFaultSheet,mem,14,6,14,2,1,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00008000u) AssignFault(psCurFaultSheet,mem,15,7,15,3,1,pFaultSrcCtx);
}
}
}
}
if(ErrorMark_Lx_n2)
{
if(ErrorMark_Lx & 0xFFFF0000u)
{
logD("# fault detected, LFB[%d][%d] is 0x%04X [expected 0x%04X] !\n",
iter_row, iter_col+1,
ar_u16PixelsReRead[iter_row][iter_col+1],
ar_u16Pixels[iter_row][iter_col+1]);
if(ErrorMark_Lx & 0x00FF0000u)
{
if(ErrorMark_Lx & 0x000F0000u)
{
if(ErrorMark_Lx & 0x00010000u) AssignFault(psCurFaultSheet,mem,16,0,0,0,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00020000u) AssignFault(psCurFaultSheet,mem,17,1,1,1,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00040000u) AssignFault(psCurFaultSheet,mem,18,2,2,2,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00080000u) AssignFault(psCurFaultSheet,mem,19,3,3,3,2,pFaultSrcCtx);
}
if(ErrorMark_Lx & 0x00F00000u)
{
if(ErrorMark_Lx & 0x00100000u) AssignFault(psCurFaultSheet,mem,20,4,4,0,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00200000u) AssignFault(psCurFaultSheet,mem,21,5,5,1,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00400000u) AssignFault(psCurFaultSheet,mem,22,6,6,2,2,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00800000u) AssignFault(psCurFaultSheet,mem,23,7,7,3,2,pFaultSrcCtx);
}
}
if(ErrorMark_Lx & 0xFF000000u)
{
if(ErrorMark_Lx & 0x0F000000u)
{
if(ErrorMark_Lx & 0x01000000u) AssignFault(psCurFaultSheet,mem,24,0,8, 0,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x02000000u) AssignFault(psCurFaultSheet,mem,25,1,9, 1,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x04000000u) AssignFault(psCurFaultSheet,mem,26,2,10,2,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x08000000u) AssignFault(psCurFaultSheet,mem,27,3,11,3,3,pFaultSrcCtx);
}
if(ErrorMark_Lx & 0xF0000000u)
{
if(ErrorMark_Lx & 0x10000000u) AssignFault(psCurFaultSheet,mem,28,4,12,0,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x20000000u) AssignFault(psCurFaultSheet,mem,29,5,13,1,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x40000000u) AssignFault(psCurFaultSheet,mem,30,6,14,2,3,pFaultSrcCtx);
if(ErrorMark_Lx & 0x80000000u) AssignFault(psCurFaultSheet,mem,31,7,15,3,3,pFaultSrcCtx);
}
}
}
logD("## overall fault LW bit-map : \n");
if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG)
{
printf("Error pix2 on row %d, col %d: expected %04x, got %04x\n",
iter_row, iter_col+1,
ar_u16Pixels[iter_row][iter_col+1],
ar_u16PixelsReRead[iter_row][iter_col+1]);
sprintbin32Info(szBuff,ErrorMark_Lx, 31, 0);
logD("%s\n",szBuff);
}
NbErr++;
}
else
{
if(sOptions.eLogLevel >= E_LOGLEVEL__TRACE)
{
printf("Ok pix2 on row %d, col %d: value %04x\n",
iter_row, iter_col+1,
ar_u16Pixels[iter_row][iter_col+1]);
}
}
}
}
//logI("Analysing Done\n");
@@ -484,15 +569,15 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
}
#ifdef _PROFILING
clock_t end = clock();
printf("time to create: %f\n",(double)(after_create-begin)/CLOCKS_PER_SEC);
printf("time to write: %f\n",(double)(after_write-after_create)/CLOCKS_PER_SEC);
logI("time to create: %f\n",(double)(after_create-begin)/CLOCKS_PER_SEC);
logI("time to write: %f\n",(double)(after_write-after_create)/CLOCKS_PER_SEC);
for(unsigned int i = 0; i<_NB_CHECK_LOOP; i++)
{
printf("time to draw [%d]: %f\n",i,(double)(after_draw[i]-before_draw[i])/CLOCKS_PER_SEC);
printf("time to read [%d]: %f\n",i,(double)(after_read[i]-after_draw[i])/CLOCKS_PER_SEC);
printf("time to check [%d]: %f\n",i,(double)(after_check[i]-after_read[i])/CLOCKS_PER_SEC);
logI("time to draw [%d]: %f\n",i,(double)(after_draw[i]-before_draw[i])/CLOCKS_PER_SEC);
logI("time to read [%d]: %f\n",i,(double)(after_read[i]-after_draw[i])/CLOCKS_PER_SEC);
logI("time to check [%d]: %f\n",i,(double)(after_check[i]-after_read[i])/CLOCKS_PER_SEC);
}
printf("overall: %f\n",(double)(end-begin)/CLOCKS_PER_SEC);
logI("overall: %f\n",(double)(end-begin)/CLOCKS_PER_SEC);
#endif
return NbErr;
@@ -547,21 +632,13 @@ test_TMU_datalines_Huge( sst1DeviceInfoStruct* devInfo,
if(RamSizeMB<4 && pMemBlk->ulAddStart >= 0x300000) continue;
if(RamSizeMB<3 && pMemBlk->ulAddStart >= 0x200000) continue;
if(RamSizeMB<2 && pMemBlk->ulAddStart >= 0x100000) continue;
//printf("RamSizeMB= %d, ulAddStart=%08x\n", RamSizeMB,pMemBlk->ulAddStart);
putchar('-');
fflush(stdout);
//HeatMemAndTMU(devInfo,sst,sstregs,ucNumTMU,pMemBlk->ulAddStart);
putchar('-');
fflush(stdout);
logT("RamSizeMB= %d, ulAddStart=%08x\n", RamSizeMB,pMemBlk->ulAddStart);
for( FxU32 addrTest = pMemBlk->ulAddStart ;
addrTest < (pMemBlk->ulAddStart + pMemBlk->ulAddLength);
addrTest += 131072) /* 256x256x2 (16bit pixels texture) */
{
//printf("Testing memory block 0x%08x ...\n", addrTest);
logD("Testing memory block 0x%08x ...\n", addrTest);
const unsigned long long
ullNbError = RenderTest( devInfo,
sst,
@@ -571,9 +648,9 @@ test_TMU_datalines_Huge( sst1DeviceInfoStruct* devInfo,
pFaultSrcCtx);
ullNbErrorAll += ullNbError;
if(ullNbError)
putchar('E');
logI("E");
else
putchar('-');
logI(".");
fflush(stdout);
}
}

54
Utils.c
View File

@@ -18,12 +18,14 @@
#define _BSD_SOURCE 1
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "Utils.h"
void
printbin32( const uint32_t ulVal,
const unsigned char bGroupByBytes)
sprintbin32( char* szBuff,
const uint32_t ulVal,
const unsigned char bGroupByBytes)
{
for(uint32_t idxBit = 1u<<31 ; idxBit > 0 ; idxBit >>= 1)
{
@@ -33,25 +35,53 @@ printbin32( const uint32_t ulVal,
case 1u << 23:
case 1u << 15:
case 1u << 7:
putchar(' ');
*(szBuff++) = ' ';
}
putchar(ulVal & idxBit ? '1' : '0');
*(szBuff++) = ulVal & idxBit ? '1' : '0';
}
*szBuff = '\0';
}
void
printbin32( const uint32_t ulVal,
const unsigned char bGroupByBytes)
{
char szBuff[32 + 3 + 1 + 1];
sprintbin32(szBuff,ulVal,bGroupByBytes);
strcat(szBuff,"\n");
puts(szBuff);
}
void
sprintbin32Info(char* szBuff,
const uint32_t ulVal,
const unsigned short uhb,
const unsigned short ulb)
{
sprintbin32(szBuff, ulVal, 1);
szBuff += 32 + 3;
*(szBuff++) = '\n';
*szBuff = '\0';
sprintf(szBuff,
"%02d....%02d %02d....%02d %02d....%02d %02d....%02d",
uhb,
3 * (uhb + ulb + 1) / 4, 3 * ( (uhb + ulb + 1) / 4) - 1,
(uhb + ulb + 1) / 2, ( (uhb + ulb + 1) / 2) - 1,
(uhb + ulb + 1) / 4, ( (uhb + ulb + 1) / 4) - 1,
ulb);
}
void
printbin32Info( const uint32_t ulVal,
const unsigned short uhb,
const unsigned short ulb)
{
printbin32(ulVal,1);
putchar('\n');
printf("%02d....%02d %02d....%02d %02d....%02d %02d....%02d\n",
uhb,
3 * (uhb+ulb+1) / 4, 3 * ( (uhb+ulb+1) / 4) - 1,
(uhb+ulb+1) / 2, ( (uhb+ulb+1) / 2) - 1,
(uhb+ulb+1) / 4, ( (uhb+ulb+1) / 4) - 1,
ulb);
char szBuff[2 * (32 + 3) + 2 + 1];
sprintbin32Info(szBuff, ulVal, uhb, ulb);
strcat(szBuff,"\n");
puts(szBuff);
}
uint32_t

11
Utils.h
View File

@@ -72,10 +72,21 @@ count_bit8(const uint8_t ulVal)
return cpt;
}
void
sprintbin32( char* szBuff,
const uint32_t ulVal,
const unsigned char bGroupByBytes);
void
printbin32( const uint32_t ulVal,
const unsigned char bGroupByBytes);
void
sprintbin32Info(char* szBuff,
const uint32_t ulVal,
const unsigned short uhb,
const unsigned short ulb);
void
printbin32Info( const uint32_t ulVal,
const unsigned short uhb,

89
main.c
View File

@@ -34,6 +34,7 @@
#include "Utils.h"
#include "Draw.h"
#include "Test_Common.h"
#include "Test_Address.h"
#include "Test_Data.h"
#include "Test_Data_Huge.h"
@@ -78,7 +79,7 @@ const char szHelp[] =
" -n, --num <N> Number of loops (default: 1).\n"
" -l, --log <file> Log file path.\n"
" --silent Silent mode (suppress normal output).\n"
" -t, --tsv <file> TSV output file path.\n"
/*" -t, --tsv <file> TSV output file path.\n"*/
"\n"
"Verbosity:\n"
" -v Increase log level by one step (repeatable).\n"
@@ -99,8 +100,10 @@ const char szHelp[] =
" --tmu1-ram <MB> Force TMU1 RAM size: -1=auto, 1..4=MB.\n"
"\n"
"Examples:\n"
" ./v2memtest --tmu0 --address -vv --tsv out.tsv\n"
" ./v2memtest --tmu0 --tmu1 --data --tmu0-ram 2 --tmu1-ram -1 -n 10\n";
/*" ./v2-tmu-memtester --tmu0 --address -v --tsv out.tsv\n"*/
" ./v2-tmu-memtester --tmu0 --address -v\n"
" ./v2-tmu-memtester --tmu0-ram 2 --tmu1-ram -1 -n 10\n"
" ./v2-tmu-memtester --tmu1 --data-huge\n";
def_sOptions sOptions = {
.eLogLevel = E_LOGLEVEL__INFO,
@@ -123,7 +126,7 @@ static struct option long_args[] = {
{"num", required_argument, NULL, 'n'},
{"log", required_argument, NULL, 'l'},
{"silent", no_argument, &sOptions.bSilent, true},
{"tsv", required_argument, NULL, 't'},
/*{"tsv", required_argument, NULL, 't'},*/
{"tmu0", no_argument, &sOptions.bTestTMU0, true},
{"tmu1", no_argument, &sOptions.bTestTMU1, true},
{"address", no_argument, &sOptions.bTestTMUAddress, true},
@@ -141,6 +144,8 @@ ar_dFaultScores[NB_FAULT_SOURCE];
def_sFaultSourceScoreRec
ar_dFaultScores_sorted[NB_FAULT_SOURCE];
#define _DEF_TEST_TIME_PER_MB_S 5
int main(int argc, char **argv)
{
int Status = 0;
@@ -153,7 +158,6 @@ int main(int argc, char **argv)
while((opt=getopt_long(argc,argv,"hvn:t:l:",long_args,&option_index)) != -1)
{
//printf("Parse Arg %d, %d\n",option_index,opt);
switch(opt)
{
/* other long options ? */
@@ -198,11 +202,11 @@ int main(int argc, char **argv)
case 'l':
strncpy(sOptions.szLogFileName, optarg, 2048);
break;
/*
case 't':
strncpy(sOptions.szTSVFile, optarg, 2048);
break;
*/
case 'h':
puts(szHelp);
bQuit = true;
@@ -338,7 +342,7 @@ int main(int argc, char **argv)
}
if(bTestTMU1 && !bTestTMU0)
{
logW("/!\\ testing TMU1 without TMU0 is not recommended !\n\n");
logW("/!\\ make sure you did test TMU0 BEFORE TMU1.\n\n");
}
ISET(sstregs->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER);
@@ -352,13 +356,20 @@ int main(int argc, char **argv)
if((tmu == 0) && !bTestTMU0) continue;
if((tmu == 1) && !bTestTMU1) continue;
logI("## Testing Board %d, TMU %d, %ldMB \n",boardNum,tmu,(unsigned long)devInfo.tmuMemSize[tmu]);
logI("## testing Board %d, TMU %d, %ldMB \n",boardNum,tmu,(unsigned long)devInfo.tmuMemSize[tmu]);
if(sOptions.bTestTMUAddress)
{
unsigned long long err=0;
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo,sst,sstregs,tmu,0x000000);
logI("### address & control lines test - cumulated\n");
for(int j=0;j<100;j++)
clearScreen(sstregs,0x00000000,256,256);
clock_t test_begin = clock();
do
{
err = RenderTestAddress(&devInfo,
sst,
@@ -367,9 +378,13 @@ int main(int argc, char **argv)
devInfo.tmuMemSize[tmu],
ar_dFaultScores);
ullNbErrorAll += err;
logI( err ? "E" : "-");
logI( err ? "E" : ".");
fflush(stdout);
}
while(!err
&& (((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S)));
logI("\n");
if(err)
{
@@ -382,8 +397,15 @@ int main(int argc, char **argv)
if(sOptions.bTestTMUData)
{
unsigned long long err=0;
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo,sst,sstregs,tmu,0x000000);
logI("### data test - single bit move\n");
for(int j=0;j<100;j++)
clearScreen(sstregs,0x00000000,256,256);
clock_t test_begin = clock();
do
{
err = test_TMU_datalines(&devInfo,
sst,
@@ -393,9 +415,13 @@ int main(int argc, char **argv)
devInfo.tmuMemSize[tmu],
ar_dFaultScores);
ullNbErrorAll += err;
logI( err ? "E" : "-");
logI( err ? "E" : ".");
fflush(stdout);
}
while(!err &&
(((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S)));
logI("\n");
if(err)
{
@@ -403,9 +429,15 @@ int main(int argc, char **argv)
logW("skiping next tests.\n\n");
continue;
}
err=0;
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo,sst,sstregs,tmu,0x000000);
logI("### data test - random patterns\n");
for(int j=0;j<100;j++)
clearScreen(sstregs,0x00000000,256,256);
test_begin = clock();
do
{
err = test_TMU_datalines(&devInfo,
sst,
@@ -415,9 +447,13 @@ int main(int argc, char **argv)
devInfo.tmuMemSize[tmu],
ar_dFaultScores);
ullNbErrorAll += err;
logI( err ? "E" : "-");
logI( err ? "E" : ".");
fflush(stdout);
}
while(!err &&
(((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S)));
logI("\n");
if(err)
{
@@ -430,8 +466,15 @@ int main(int argc, char **argv)
if(sOptions.bTestTMUDataHuge)
{
unsigned long long err=0;
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo,sst,sstregs,tmu,0x000000);
logI("### data test - huge data set\n");
for(int j=0;j<1;j++)
clearScreen(sstregs,0x00000000,256,256);
clock_t test_begin = clock();
do
{
err = test_TMU_datalines_Huge( &devInfo,
sst,
@@ -440,15 +483,19 @@ int main(int argc, char **argv)
devInfo.tmuMemSize[tmu],
ar_dFaultScores);
ullNbErrorAll += err;
logI( err ? "E" : "-");
logI( err ? "E" : ".");
fflush(stdout);
}
while(!err &&
(((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S)));
logI("\n");
if(err)
{
logW("error detected on data line (huge data set) !\n");
/*logW("skiping next tests.\n\n");
continue;*/
logW("skiping next tests.\n\n");
continue;
}
}
logI("\n");
@@ -458,7 +505,7 @@ int main(int argc, char **argv)
FaultSource_getSorted(ar_dFaultScores_sorted,ar_dFaultScores);
FaultSource_display(ar_dFaultScores_sorted);
logI("Test Complete, ullNbErrorAll = %lld\n",ullNbErrorAll);
logI("test completed, ullNbErrorAll = %lld\n",ullNbErrorAll);
logI("\n");
if(ullNbErrorAll)
logI(szKool);