7 Commits

Author SHA1 Message Date
a58e0241b4 Update Readme.md 2026-05-14 15:03:48 +02:00
712e9cfcab improved overall diagnostics, and specifically TMU-FBI BUS. 2026-03-16 18:12:11 +01:00
c363aa6284 implement no-mem test and start validating / tuning with real hardware 2026-03-15 22:18:42 +01:00
3ba8a3a985 bump version 2026-03-09 17:54:53 +01:00
7cc2e47d07 fix tmu1 on data-huge test
fix CAS/RAS/WE fault detect on data-huge test
fix data test Fault assignment
fix comment
fix shutdown
2026-03-09 17:53:35 +01:00
c4a91ad3ac bump version 2026-03-09 17:36:29 +01:00
6863990336 fix bit count ! 2026-03-09 17:35:41 +01:00
23 changed files with 3195 additions and 730 deletions

169
Draw.c
View File

@@ -28,64 +28,157 @@ static inline uint32_t f32u(const float f)
} }
void void
drawRect( const SstRegs * const sst, drawRect( const SstRegs * const sstregs,
const unsigned char ucNumTMU,
const int16_t x, const int16_t x,
const int16_t y, const int16_t y,
const int16_t tSizeX, const int16_t tSizeX,
const int16_t tSizeY) const int16_t tSizeY)
{ {
ISET(sst->sARGB,0xFFFFFFFF); ISET(sstregs->sSetupMode, 0x0020);
ISET(sst->sOowfbi,f32u(1.0f)); ISET(SST_TREX(sstregs,ucNumTMU)->sARGB,0xFFFFFFFF);
ISET(sst->sVx, f32u((float)x)); ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)x));
ISET(sst->sVy, f32u((float)y)); ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y));
ISET(sst->sSow0,f32u(0.0f)); ISET(SST_TREX(sstregs,ucNumTMU)->sOowfbi,f32u(1.0f));
ISET(sst->sTow0,f32u(0.0f)); ISET(SST_TREX(sstregs,ucNumTMU)->sSow0,f32u(0.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sTow0,f32u(0.0f));
/* 0b10 0000 (Update only S0/T0), doc page 76 */ /* 0b10 0000 (Update only S0/T0), doc page 76 */
ISET(sst->sSetupMode, 0x0020); ISET(sstregs->sBeginTriCMD, 1);
ISET(sst->sBeginTriCMD, 1);
ISET(sst->sVx, f32u((float)(x+tSizeX))); ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)(x+tSizeX)));
ISET(sst->sVy, f32u((float)y)); ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y));
ISET(sst->sSow0,f32u((float)tSizeX)); ISET(SST_TREX(sstregs,ucNumTMU)->sSow0,f32u((float)tSizeX));
ISET(sst->sTow0,f32u(0.0f)); ISET(SST_TREX(sstregs,ucNumTMU)->sTow0,f32u(0.0f));
ISET(sst->sDrawTriCMD, 1); ISET(SST_TREX(sstregs,ucNumTMU)->sDrawTriCMD, 1);
ISET(sst->sVx, f32u((float)x)); ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)x));
ISET(sst->sVy, f32u((float)y+tSizeY)); ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y+tSizeY));
ISET(sst->sSow0,f32u(0.0f)); ISET(SST_TREX(sstregs,ucNumTMU)->sSow0,f32u(0.0f));
ISET(sst->sTow0,f32u((float)tSizeY)); ISET(SST_TREX(sstregs,ucNumTMU)->sTow0,f32u((float)tSizeY));
ISET(sst->sDrawTriCMD, 1); ISET(SST_TREX(sstregs,ucNumTMU)->sDrawTriCMD, 1);
ISET(sst->sVx, f32u((float)x+tSizeX)); ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)x+tSizeX));
ISET(sst->sVy, f32u((float)y+tSizeY)); ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y+tSizeY));
ISET(sst->sSow0,f32u((float)tSizeX)); ISET(SST_TREX(sstregs,ucNumTMU)->sSow0,f32u((float)tSizeX));
ISET(sst->sTow0,f32u((float)tSizeY)); ISET(SST_TREX(sstregs,ucNumTMU)->sTow0,f32u((float)tSizeY));
ISET(sst->sDrawTriCMD, 1); ISET(SST_TREX(sstregs,ucNumTMU)->sDrawTriCMD, 1);
ISET(sst->nopCMD, 0x1); ISET(sstregs->nopCMD, 0x1);
}
void
drawRect2( const SstRegs * const sstregs,
const unsigned char ucNumTMU,
const int16_t x,
const int16_t y,
const int16_t tSizeX,
const int16_t tSizeY)
{
ISET(sstregs->sSetupMode, 0x0020);
//ISET(SST_TREX(sstregs,ucNumTMU)->sARGB,0xFF55AA55);
ISET(SST_TREX(sstregs,ucNumTMU)->sOowfbi, f32u(1.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)x));
ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y));
ISET(SST_TREX(sstregs,ucNumTMU)->sSow0, f32u(0.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sTow0, f32u(0.0f));
/* 0b10 0000 (Update only S0/T0), doc page 76 */
ISET(sstregs->sBeginTriCMD, 1);
ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)(x+tSizeX)));
ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y));
ISET(SST_TREX(sstregs,ucNumTMU)->sSow0, f32u((float)tSizeX));
ISET(SST_TREX(sstregs,ucNumTMU)->sTow0, f32u(0.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sDrawTriCMD, 1);
ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)x));
ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y+tSizeY));
ISET(SST_TREX(sstregs,ucNumTMU)->sSow0, f32u(0.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sTow0, f32u((float)tSizeY));
ISET(SST_TREX(sstregs,ucNumTMU)->sDrawTriCMD, 1);
ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)x+tSizeX));
ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y+tSizeY));
ISET(SST_TREX(sstregs,ucNumTMU)->sSow0, f32u((float)tSizeX));
ISET(SST_TREX(sstregs,ucNumTMU)->sTow0, f32u((float)tSizeY));
ISET(SST_TREX(sstregs,ucNumTMU)->sDrawTriCMD, 1);
ISET(sstregs->nopCMD, 0x1);
} }
void void
clearScreen( const SstRegs * const sst, clearScreen( const SstRegs * const sstregs,
const uint32_t u32Color, const uint32_t u32Color,
const int16_t u16SizeX, const int16_t u16SizeX,
const int16_t u16SizeY) const int16_t u16SizeY)
{ {
ISET(sst->clipLeftRight, u16SizeX); ISET(sstregs->clipLeftRight, u16SizeX);
ISET(sst->clipBottomTop, u16SizeY); ISET(sstregs->clipBottomTop, u16SizeY);
ISET(sst->zaColor, u32Color); ISET(sstregs->zaColor, u32Color);
//ISET(sst->zaColor, 0x0000); //ISET(sstregs->zaColor, 0x0000);
const uint32_t fbz_saved = IGET(sst->fbzMode); const uint32_t fbz_saved = IGET(sstregs->fbzMode);
ISET(sst->c1,u32Color); ISET(sstregs->c1,u32Color);
ISET(sst->c0,0x0); ISET(sstregs->c0,0x0);
ISET(sst->zaColor,0x0); ISET(sstregs->zaColor,0x0F);
ISET(sst->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK); ISET(sstregs->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK);
ISET(sst->fastfillCMD, 0); ISET(sstregs->fastfillCMD, 0);
ISET(sst->nopCMD, 0x1); ISET(sstregs->nopCMD, 0x1);
ISET(sst->fbzMode, fbz_saved); ISET(sstregs->fbzMode, fbz_saved);
}
#define XY_ONE (1<<SST_XY_FRACBITS)
void
drawPixel( const SstRegs *sstregs,
const unsigned char ucNumTMU,
const int x,
const int y)
{
ISET( SST_TREX(sstregs,ucNumTMU)->vA.x,x*XY_ONE);
ISET(SST_TREX(sstregs,ucNumTMU)->vA.y,y*XY_ONE);
ISET(SST_TREX(sstregs,ucNumTMU)->vB.x,(x+2)*XY_ONE);
ISET(SST_TREX(sstregs,ucNumTMU)->vB.y,y*XY_ONE);
ISET(SST_TREX(sstregs,ucNumTMU)->vC.x,x*XY_ONE);
ISET(SST_TREX(sstregs,ucNumTMU)->vC.y,(y+1)*XY_ONE);
ISET(SST_TREX(sstregs,ucNumTMU)->triangleCMD,0);
}
void
drawTriangle( const SstRegs * const sstregs,
const unsigned char ucNumTMU,
const int16_t x,
const int16_t y,
const int16_t tSizeX,
const int16_t tSizeY)
{
ISET(sstregs->sSetupMode, 0x0020);
//ISET(SST_TREX(sstregs,ucNumTMU)->sARGB,0xFF55AA55);
ISET(SST_TREX(sstregs,ucNumTMU)->sOowfbi, f32u(1.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)x));
ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y));
ISET(SST_TREX(sstregs,ucNumTMU)->sSow0, f32u(0.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sTow0, f32u(0.0f));
/* 0b10 0000 (Update only S0/T0), doc page 76 */
ISET(sstregs->sBeginTriCMD, 1);
ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)(x+tSizeX)));
ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y));
ISET(SST_TREX(sstregs,ucNumTMU)->sSow0, f32u((float)tSizeX));
ISET(SST_TREX(sstregs,ucNumTMU)->sTow0, f32u(0.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sDrawTriCMD, 1);
ISET(SST_TREX(sstregs,ucNumTMU)->sVx, f32u((float)x));
ISET(SST_TREX(sstregs,ucNumTMU)->sVy, f32u((float)y+tSizeY));
ISET(SST_TREX(sstregs,ucNumTMU)->sSow0, f32u(0.0f));
ISET(SST_TREX(sstregs,ucNumTMU)->sTow0, f32u((float)tSizeY));
ISET(SST_TREX(sstregs,ucNumTMU)->sDrawTriCMD, 1);
ISET(sstregs->nopCMD, 0x1);
} }

32
Draw.h
View File

@@ -21,23 +21,47 @@
#include <stdint.h> #include <stdint.h>
void void
drawRect( const SstRegs * const sst, drawRect( const SstRegs * const sstregs,
const unsigned char ucNumTMU,
const int16_t x, const int16_t x,
const int16_t y, const int16_t y,
const int16_t tSizeX, const int16_t tSizeX,
const int16_t tSizeY); const int16_t tSizeY);
void
drawRect2( const SstRegs * const sstregs,
const unsigned char ucNumTMU,
const int16_t x,
const int16_t y,
const int16_t tSizeX,
const int16_t tSizeY);
void
drawTriangle( const SstRegs * const sstregs,
const unsigned char ucNumTMU,
const int16_t x,
const int16_t y,
const int16_t tSizeX,
const int16_t tSizeY);
void
drawPixel( const SstRegs *sstregs,
const unsigned char ucNumTMU,
const int x,
const int y);
static inline void static inline void
drawSquare( const SstRegs * const sst, drawSquare( const SstRegs * const sstregs,
const unsigned char ucNumTMU,
const int16_t x, const int16_t x,
const int16_t y, const int16_t y,
const int16_t tSize) const int16_t tSize)
{ {
drawRect(sst, x, y, tSize, tSize); drawRect(sstregs,ucNumTMU, x, y, tSize, tSize);
} }
void void
clearScreen( const SstRegs * const sst, clearScreen( const SstRegs * const sstregs,
const uint32_t u32Color, const uint32_t u32Color,
const int16_t u16SizeX, const int16_t u16SizeX,
const int16_t u16SizeY); const int16_t u16SizeY);

View File

@@ -62,20 +62,41 @@ FaultSource_addScore( def_sFaultSourceScoreRec* const pCtx,
double dDivider = 1.0; double dDivider = 1.0;
do do
{ {
//if(dDivider==1.0)
// printf("set Score %f to %s\n",dScore,pCtx[eFaultSource].szName);
dScore /= dDivider; dScore /= dDivider;
pCtx[eFaultSource].dScore += dScore; pCtx[eFaultSource].dScore += dScore;
/*
if(dDivider==1.0)
printf("Add score to %s : %02.3f\n",
pCtx[eFaultSource].szName,
dScore);
*/
eFaultSource = pCtx[eFaultSource].eParrentFaultSource; eFaultSource = pCtx[eFaultSource].eParrentFaultSource;
dDivider *= 5; dDivider *= 5;
}while(eFaultSource != _INVALID_FAULT_SOURCE_); }while(eFaultSource != _INVALID_FAULT_SOURCE_);
} }
void
FaultSource_nomalize( def_sFaultSourceScoreRec* const pCtx)
{
double dSum = 0.0;
for(unsigned long idx = 0; idx < NB_FAULT_SOURCE; ++idx )
dSum+= pCtx[idx].dScore;
if(dSum != 0)
FaultSource_divideAll(pCtx,dSum);
}
// This function can only be used on non-sorted Rec (is relies on indexes)!
void
FaultSource_sum( def_sFaultSourceScoreRec** const pCtxRef,
const unsigned int uNbRef,
def_sFaultSourceScoreRec* const pCtx)
{
for(unsigned long idx = 0; idx < NB_FAULT_SOURCE; ++idx )
{
for(unsigned long idxRef = 0; idxRef < uNbRef; ++idxRef )
{
pCtx[idx].dScore += pCtxRef[idxRef][idx].dScore;
}
}
FaultSource_divideAll(pCtx,uNbRef);
}
void void
FaultSource_divideAll( def_sFaultSourceScoreRec* const pCtx, FaultSource_divideAll( def_sFaultSourceScoreRec* const pCtx,
const double dDivider) const double dDivider)
@@ -122,11 +143,11 @@ FaultSource_getSorted( def_sFaultSourceScoreRec* const pDst,
sizeof(_ar_dFaultScores)); sizeof(_ar_dFaultScores));
for(unsigned long idx = 0; for(unsigned long idx = 0;
idx < (NB_FAULT_SOURCE - 1); idx < NB_FAULT_SOURCE;
++idx ) ++idx )
pDst[idx].dScore *= pDst[idx].dWeight; pDst[idx].dScore *= pDst[idx].dWeight;
// shaker sort // shaker sort FixMe: use qsort()
while(bSwapped) while(bSwapped)
{ {
bSwapped = 0; bSwapped = 0;
@@ -197,14 +218,6 @@ FaultSource_getLoc( const def_sFaultSourceScoreRec* const pCtx,
void void
FaultSource_display(const def_sFaultSourceScoreRec* const pCtx) FaultSource_display(const def_sFaultSourceScoreRec* const pCtx)
{ {
double dScoreSum = 1;
for(unsigned long idx = 0;
idx < NB_FAULT_SOURCE
&& pCtx[idx].dScore > 0;
++idx )
dScoreSum += pCtx[idx].dScore;
printf("------------------------------------------------\n"); printf("------------------------------------------------\n");
printf("\ndefects list:\n\n"); printf("\ndefects list:\n\n");
printf("score\telement [Loc]\n"); printf("score\telement [Loc]\n");
@@ -218,16 +231,43 @@ FaultSource_display(const def_sFaultSourceScoreRec* const pCtx)
static char buff[1024] = {0}; static char buff[1024] = {0};
buff[0]='\0'; buff[0]='\0';
FaultSource_getLoc(pCtx,idx, buff); FaultSource_getLoc(pCtx,idx, buff);
printf("%02.5f\t%s [%s]\n", printf("%02.3f\t%s [%s]\n",
100 * pCtx[idx].dScore / dScoreSum, pCtx[idx].dScore,
pCtx[idx].szName, pCtx[idx].szName,
buff ); buff );
} }
} }
void
ByteBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
const uint8_t ErrorMark,
const double dScore,
const def_eFaultSource eFaultSource)
{
for(unsigned char bitPos = 0; bitPos <= 7 ; ++bitPos)
if(ErrorMark & (1u << bitPos))
{
FaultSource_addScore(pCtx, eFaultSource + bitPos, dScore);
}
}
void void
WordBitFaultSet( def_sFaultSourceScoreRec* const pCtx, WordBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
const uint16_t ErrorMark,
const double dScore,
const def_eFaultSource eFaultSource)
{
for(unsigned char bitPos = 0; bitPos <= 15 ; ++bitPos)
if(ErrorMark & (1u << bitPos))
{
FaultSource_addScore(pCtx, eFaultSource + bitPos, dScore);
}
}
void
LWordBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
const uint32_t ErrorMark, const uint32_t ErrorMark,
const double dScore, const double dScore,
const def_eFaultSource eFaultSourceL, const def_eFaultSource eFaultSourceL,
@@ -254,3 +294,98 @@ QuartetBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
if(ErrorMark & (1u << bitPos)) if(ErrorMark & (1u << bitPos))
FaultSource_addScore(pCtx, eFaultSource + bitPos, dScore); FaultSource_addScore(pCtx, eFaultSource + bitPos, dScore);
} }
void
RGBToBus_Fault( def_sFaultSourceScoreRec* const pCtx,
const uint32_t ErrorMark,
const double dScore,
const def_eFaultSource eFaultSource)
{
const uint16_t u16pix1 = ErrorMark & 0xFFFF;
const uint16_t u16pix2 = (ErrorMark>>16) & 0xFFFF;
uint16_t u16Bus_r8 = ((u16pix1>>11) & 0x1F) << 3;
uint16_t u16Bus_g8 = ((u16pix1>>5) & 0x3F) << 2;
uint16_t u16Bus_b8 = ((u16pix1>>0) & 0x1F) << 3;
uint16_t u16Bus_a8 = 0;
/*
uint16_t u16Fault_W1 = (u16Bus_g8<<8) + u16Bus_b8;
uint16_t u16Fault_W2 = (u16Bus_a8<<8) + u16Bus_r8;
*/
/* Incoming data wont have Alpha channel, so we must normalize
* Fault weight */
ByteBitFaultSet(pCtx, u16Bus_b8, dScore/2, eFaultSource);
ByteBitFaultSet(pCtx, u16Bus_g8, dScore, eFaultSource + 8);
ByteBitFaultSet(pCtx, u16Bus_r8, dScore/2, eFaultSource);
//ByteBitFaultSet(pCtx, u16Bus_a8, dScore, eFaultSource + 8);
u16Bus_r8 = ((u16pix2>>11) & 0x1F) << 3;
u16Bus_g8 = ((u16pix2>>5) & 0x3F) << 2;
u16Bus_b8 = ((u16pix2>>0) & 0x1F) << 3;
u16Bus_a8 = 0;
/*
uint16_t u16Fault_W3 = (u16Bus_g8<<8) + u16Bus_b8;
uint16_t u16Fault_W4 = (u16Bus_a8<<8) + u16Bus_r8;
*/
/* Incoming data wont have Alpha channel, so we must normalize
* Fault weight */
ByteBitFaultSet(pCtx, u16Bus_b8, dScore/2, eFaultSource);
ByteBitFaultSet(pCtx, u16Bus_g8, dScore, eFaultSource + 8);
ByteBitFaultSet(pCtx, u16Bus_r8, dScore/2, eFaultSource);
//ByteBitFaultSet(pCtx, u16Bus_a8, dScore, eFaultSource + 8);
}
void
RGBToBus_Fault_Quartets( def_sFaultSourceScoreRec* const pCtx,
const uint32_t ErrorMark,
const double dScore,
const def_eFaultSource eFaultSource1,
const def_eFaultSource eFaultSource2,
const def_eFaultSource eFaultSource3,
const def_eFaultSource eFaultSource4)
{
const uint16_t u16pix1 = ErrorMark & 0xFFFF;
const uint16_t u16pix2 = (ErrorMark>>16) & 0xFFFF;
uint16_t u16Bus_r8 = ((u16pix1>>11) & 0x1F) << 3;
uint16_t u16Bus_g8 = ((u16pix1>>5) & 0x3F) << 2;
uint16_t u16Bus_b8 = ((u16pix1>>0) & 0x1F) << 3;
uint16_t u16Bus_a8 = 0;
/*
uint16_t u16Fault_W1 = (u16Bus_g8<<8) + u16Bus_b8;
uint16_t u16Fault_W2 = (u16Bus_a8<<8) + u16Bus_r8;
*/
/* Incoming data wont have Alpha channel, so we must normalize
* Fault weight */
QuartetBitFaultSet(pCtx, u16Bus_b8 & 0xF, dScore/2, eFaultSource1);
QuartetBitFaultSet(pCtx, (u16Bus_b8<<4) & 0xF, dScore/2, eFaultSource2);
QuartetBitFaultSet(pCtx, u16Bus_g8 & 0xF, dScore, eFaultSource3);
QuartetBitFaultSet(pCtx, (u16Bus_g8<<4) & 0xF, dScore, eFaultSource4);
QuartetBitFaultSet(pCtx, u16Bus_r8 & 0xF, dScore/2, eFaultSource1);
QuartetBitFaultSet(pCtx, (u16Bus_r8<<4) & 0xF, dScore/2, eFaultSource2);
//QuartetBitFaultSet(pCtx, u16Bus_a8 & 0xF, dScore, eFaultSource3);
//QuartetBitFaultSet(pCtx, (u16Bus_a8<<4) & 0xF, dScore, eFaultSource4);
u16Bus_r8 = ((u16pix2>>11) & 0x1F) << 3;
u16Bus_g8 = ((u16pix2>>5) & 0x3F) << 2;
u16Bus_b8 = ((u16pix2>>0) & 0x1F) << 3;
u16Bus_a8 = 0;
/*
uint16_t u16Fault_W3 = (u16Bus_g8<<8) + u16Bus_b8;
uint16_t u16Fault_W4 = (u16Bus_a8<<8) + u16Bus_r8;
*/
/* Incoming data wont have Alpha channel, so we must normalize
* Fault weight */
QuartetBitFaultSet(pCtx, u16Bus_b8 & 0xF, dScore/2, eFaultSource1);
QuartetBitFaultSet(pCtx, (u16Bus_b8<<4) & 0xF, dScore/2, eFaultSource2);
QuartetBitFaultSet(pCtx, u16Bus_g8 & 0xF, dScore, eFaultSource3);
QuartetBitFaultSet(pCtx, (u16Bus_g8<<4) & 0xF, dScore, eFaultSource4);
QuartetBitFaultSet(pCtx, u16Bus_r8 & 0xF, dScore/2, eFaultSource1);
QuartetBitFaultSet(pCtx, (u16Bus_r8<<4) & 0xF, dScore/2, eFaultSource2);
//QuartetBitFaultSet(pCtx, u16Bus_a8 & 0xF, dScore, eFaultSource3);
//QuartetBitFaultSet(pCtx, (u16Bus_a8<<4) & 0xF, dScore, eFaultSource4);
}

View File

@@ -23,6 +23,38 @@
#define FAULT_SOURCES(ACTION) \ #define FAULT_SOURCES(ACTION) \
ACTION(U3_FBI, "U3/FBI (front middle big Chip)" ,VOODOO_BOARD, 1.0)\ ACTION(U3_FBI, "U3/FBI (front middle big Chip)" ,VOODOO_BOARD, 1.0)\
ACTION(U3_FBI_FT_DATA_0, "pin 179" ,U3_FBI, 1.0)/*Offset: 1*/\
ACTION(U3_FBI_FT_DATA_1, "pin 178" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_2, "pin 176" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_3, "pin 174" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_4, "pin 173" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_5, "pin 172" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_6, "pin 171" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_7, "pin 168" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_8, "pin 167" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_9, "pin 166" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_10, "pin 165" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_11, "pin 164" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_12, "pin 162" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_13, "pin 161" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_14, "pin 160" ,U3_FBI, 1.0)\
ACTION(U3_FBI_FT_DATA_15, "pin 159" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_0, "pin 155" ,U3_FBI, 1.0)/*Offset: 17*/\
ACTION(U3_FBI_TF_DATA_1, "pin 153" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_2, "pin 152" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_3, "pin 151" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_4, "pin 150" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_5, "pin 148" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_6, "pin 147" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_7, "pin 146" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_8, "pin 142" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_9, "pin 141" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_10, "pin 140" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_11, "pin 139" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_12, "pin 138" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_13, "pin 137" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_14, "pin 136" ,U3_FBI, 1.0)\
ACTION(U3_FBI_TF_DATA_15, "pin 135" ,U3_FBI, 1.0)\
ACTION(U9_TMU0, "U9/TMU0 (front right big Chip)" ,VOODOO_BOARD, 1.0)\ ACTION(U9_TMU0, "U9/TMU0 (front right big Chip)" ,VOODOO_BOARD, 1.0)\
/* /!\ Keep in-order, only appEND new fields */ \ /* /!\ Keep in-order, only appEND new fields */ \
ACTION(U9_TMU0_TEXDATA_0_0, "pin 52" ,U9_TMU0, 1.0)/*Offset: 1*/\ ACTION(U9_TMU0_TEXDATA_0_0, "pin 52" ,U9_TMU0, 1.0)/*Offset: 1*/\
@@ -182,7 +214,7 @@
ACTION(U9_TMU0_TEX_ADDR_3_8, "pin 182" ,U9_TMU0, 1.0)\ ACTION(U9_TMU0_TEX_ADDR_3_8, "pin 182" ,U9_TMU0, 1.0)\
ACTION(U8_TMU1, "U8/TMU1 (front left big Chip)" ,VOODOO_BOARD, 1.0)\ ACTION(U8_TMU1, "U8/TMU1 (front left big Chip)" ,VOODOO_BOARD, 1.0)\
/* /!\ Keep in-order, only appEND new fields */ \ /* /!\ Keep in-order, only appEND new fields */ \
ACTION(U8_TMU1_TEXDATA_0_0, "pin 52" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_0_0, "pin 52" ,U8_TMU1, 1.0)/*Offset: 1*/\
ACTION(U8_TMU1_TEXDATA_0_1, "pin 53" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_0_1, "pin 53" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_0_2, "pin 54" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_0_2, "pin 54" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_0_3, "pin 55" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_0_3, "pin 55" ,U8_TMU1, 1.0)\
@@ -198,7 +230,7 @@
ACTION(U8_TMU1_TEXDATA_0_13, "pin 67" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_0_13, "pin 67" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_0_14, "pin 69" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_0_14, "pin 69" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_0_15, "pin 70" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_0_15, "pin 70" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_1_0, "pin 90" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_1_0, "pin 90" ,U8_TMU1, 1.0)/*Offset: 17*/\
ACTION(U8_TMU1_TEXDATA_1_1, "pin 91" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_1_1, "pin 91" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_1_2, "pin 92" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_1_2, "pin 92" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_1_3, "pin 93" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_1_3, "pin 93" ,U8_TMU1, 1.0)\
@@ -214,7 +246,7 @@
ACTION(U8_TMU1_TEXDATA_1_13, "pin 106" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_1_13, "pin 106" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_1_14, "pin 107" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_1_14, "pin 107" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_1_15, "pin 108" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_1_15, "pin 108" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_2_0, "pin 71" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_2_0, "pin 71" ,U8_TMU1, 1.0)/*Offset: 33*/\
ACTION(U8_TMU1_TEXDATA_2_1, "pin 72" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_2_1, "pin 72" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_2_2, "pin 74" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_2_2, "pin 74" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_2_3, "pin 75" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_2_3, "pin 75" ,U8_TMU1, 1.0)\
@@ -230,7 +262,7 @@
ACTION(U8_TMU1_TEXDATA_2_13, "pin 87" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_2_13, "pin 87" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_2_14, "pin 88" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_2_14, "pin 88" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_2_15, "pin 89" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_2_15, "pin 89" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_3_0, "pin 110" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_3_0, "pin 110" ,U8_TMU1, 1.0)/*Offset: 49*/\
ACTION(U8_TMU1_TEXDATA_3_1, "pin 111" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_3_1, "pin 111" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_3_2, "pin 112" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_3_2, "pin 112" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_3_3, "pin 113" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_3_3, "pin 113" ,U8_TMU1, 1.0)\
@@ -246,23 +278,23 @@
ACTION(U8_TMU1_TEXDATA_3_13, "pin 125" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_3_13, "pin 125" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_3_14, "pin 126" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_3_14, "pin 126" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEXDATA_3_15, "pin 127" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEXDATA_3_15, "pin 127" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_0, "pin 30" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_0, "pin 188" ,U8_TMU1, 1.0)/*Offset: 65*/\
ACTION(U8_TMU1_TF_DATA_1, "pin 32" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_1, "pin 189" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_2, "pin 33" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_2, "pin 190" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_3, "pin 34" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_3, "pin 191" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_4, "pin 35" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_4, "pin 192" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_5, "pin 36" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_5, "pin 193" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_6, "pin 37" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_6, "pin 194" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_7, "pin 38" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_7, "pin 195" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_8, "pin 42" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_8, "pin 199" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_9, "pin 44" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_9, "pin 200" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_10, "pin 45" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_10, "pin 201" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_11, "pin 46" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_11, "pin 202" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_12, "pin 47" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_12, "pin 204" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_13, "pin 48" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_13, "pin 205" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_14, "pin 49" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_14, "pin 206" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_15, "pin 80" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TT_DATA_15, "pin 207" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_FT_DATA_0, "pin 6" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_FT_DATA_0, "pin 6" ,U8_TMU1, 1.0)/*Offset: 81*/\
ACTION(U8_TMU1_FT_DATA_1, "pin 7" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_FT_DATA_1, "pin 7" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_FT_DATA_2, "pin 8" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_FT_DATA_2, "pin 8" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_FT_DATA_3, "pin 9" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_FT_DATA_3, "pin 9" ,U8_TMU1, 1.0)\
@@ -278,14 +310,30 @@
ACTION(U8_TMU1_FT_DATA_13, "pin 23" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_FT_DATA_13, "pin 23" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_FT_DATA_14, "pin 24" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_FT_DATA_14, "pin 24" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_FT_DATA_15, "pin 25" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_FT_DATA_15, "pin 25" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_RAS0, "pin 129" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TF_DATA_0, "pin 30" ,U8_TMU1, 1.0)/*Offset: 97*/\
ACTION(U8_TMU1_TF_DATA_1, "pin 32" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_2, "pin 33" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_3, "pin 34" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_4, "pin 35" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_5, "pin 36" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_6, "pin 37" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_7, "pin 38" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_8, "pin 42" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_9, "pin 44" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_10, "pin 45" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_11, "pin 46" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_12, "pin 47" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_13, "pin 48" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_14, "pin 49" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TF_DATA_15, "pin 80" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_RAS0, "pin 129" ,U8_TMU1, 1.0)/*Offset: 113*/\
ACTION(U8_TMU1_TEX_RAS1, "pin 130" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_RAS1, "pin 130" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_CAS0, "pin 131" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_CAS0, "pin 131" ,U8_TMU1, 1.0)/*Offset: 115*/\
ACTION(U8_TMU1_TEX_CAS1, "pin 132" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_CAS1, "pin 132" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_CAS2, "pin 134" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_CAS2, "pin 134" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_CAS3, "pin 135" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_CAS3, "pin 135" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_WE, "pin 136" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_WE, "pin 136" ,U8_TMU1, 1.0)/*Offset: 119*/\
ACTION(U8_TMU1_TEX_ADDR_0_0, "pin 138" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_0_0, "pin 138" ,U8_TMU1, 1.0)/*Offset: 120*/\
ACTION(U8_TMU1_TEX_ADDR_0_1, "pin 139" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_0_1, "pin 139" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_0_2, "pin 141" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_0_2, "pin 141" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_0_3, "pin 142" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_0_3, "pin 142" ,U8_TMU1, 1.0)\
@@ -294,7 +342,7 @@
ACTION(U8_TMU1_TEX_ADDR_0_6, "pin 146" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_0_6, "pin 146" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_0_7, "pin 147" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_0_7, "pin 147" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_0_8, "pin 149" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_0_8, "pin 149" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_1_0, "pin 161" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_1_0, "pin 161" ,U8_TMU1, 1.0)/*Offset: 129*/\
ACTION(U8_TMU1_TEX_ADDR_1_1, "pin 162" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_1_1, "pin 162" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_1_2, "pin 164" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_1_2, "pin 164" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_1_3, "pin 165" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_1_3, "pin 165" ,U8_TMU1, 1.0)\
@@ -303,7 +351,7 @@
ACTION(U8_TMU1_TEX_ADDR_1_6, "pin 168" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_1_6, "pin 168" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_1_7, "pin 169" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_1_7, "pin 169" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_1_8, "pin 171" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_1_8, "pin 171" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_2_0, "pin 150" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_2_0, "pin 150" ,U8_TMU1, 1.0)/*Offset: 138*/\
ACTION(U8_TMU1_TEX_ADDR_2_1, "pin 151" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_2_1, "pin 151" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_2_2, "pin 152" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_2_2, "pin 152" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_2_3, "pin 154" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_2_3, "pin 154" ,U8_TMU1, 1.0)\
@@ -312,7 +360,7 @@
ACTION(U8_TMU1_TEX_ADDR_2_6, "pin 157" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_2_6, "pin 157" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_2_7, "pin 158" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_2_7, "pin 158" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_2_8, "pin 160" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_2_8, "pin 160" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_3_0, "pin 172" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_3_0, "pin 172" ,U8_TMU1, 1.0)/*Offset: 147*/\
ACTION(U8_TMU1_TEX_ADDR_3_1, "pin 174" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_3_1, "pin 174" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_3_2, "pin 175" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_3_2, "pin 175" ,U8_TMU1, 1.0)\
ACTION(U8_TMU1_TEX_ADDR_3_3, "pin 176" ,U8_TMU1, 1.0)\ ACTION(U8_TMU1_TEX_ADDR_3_3, "pin 176" ,U8_TMU1, 1.0)\
@@ -1028,13 +1076,30 @@ FaultSource_getLoc( const def_sFaultSourceScoreRec* const pCtx,
void void
FaultSource_display(const def_sFaultSourceScoreRec* const pCtx); FaultSource_display(const def_sFaultSourceScoreRec* const pCtx);
void void
FaultSource_divideAll( def_sFaultSourceScoreRec* const pCtx, FaultSource_divideAll( def_sFaultSourceScoreRec* const pCtx,
const double dDivider); const double dDivider);
void
FaultSource_nomalize( def_sFaultSourceScoreRec* const pCtx);
void
FaultSource_sum( def_sFaultSourceScoreRec** const pCtxRef,
const unsigned int uNbRef,
def_sFaultSourceScoreRec* const pCtx);
void
ByteBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
const uint8_t ErrorMark,
const double dScore,
const def_eFaultSource eFaultSource);
void void
WordBitFaultSet( def_sFaultSourceScoreRec* const pCtx, WordBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
const uint16_t ErrorMark,
const double dScore,
const def_eFaultSource eFaultSource);
void
LWordBitFaultSet( def_sFaultSourceScoreRec* const pCtx,
const uint32_t ErrorMark, const uint32_t ErrorMark,
const double dScore, const double dScore,
const def_eFaultSource eFaultSourceL, const def_eFaultSource eFaultSourceL,
@@ -1055,7 +1120,7 @@ MemChipDQFaultSet( def_sFaultSourceScoreRec* const pCtx,
const def_eFaultSource eFaultSourceH) const def_eFaultSource eFaultSourceH)
{ {
WordBitFaultSet(pCtx,ErrorMark, dScore, eFaultSourceL + 1, eFaultSourceH + 1); LWordBitFaultSet(pCtx,ErrorMark, dScore, eFaultSourceL + 1, eFaultSourceH + 1);
} }
static inline void static inline void
@@ -1065,11 +1130,10 @@ TMUTexDataFaultSet( def_sFaultSourceScoreRec* const pCtx,
const double dScore, const double dScore,
const def_eFaultSource eTMUFaultSource) const def_eFaultSource eTMUFaultSource)
{ {
WordBitFaultSet(pCtx,ErrorMark_w0w1, dScore, eTMUFaultSource + 0 + 1, eTMUFaultSource + 16 + 1); LWordBitFaultSet(pCtx,ErrorMark_w0w1, dScore, eTMUFaultSource + 0 + 1, eTMUFaultSource + 16 + 1);
WordBitFaultSet(pCtx,ErrorMark_w2w3, dScore, eTMUFaultSource + 32 + 1, eTMUFaultSource + 48 + 1); LWordBitFaultSet(pCtx,ErrorMark_w2w3, dScore, eTMUFaultSource + 32 + 1, eTMUFaultSource + 48 + 1);
} }
static inline void static inline void
TMUTexDataCtrlFaultSet( def_sFaultSourceScoreRec* const pCtx, TMUTexDataCtrlFaultSet( def_sFaultSourceScoreRec* const pCtx,
const uint32_t ErrorMark, const uint32_t ErrorMark,
@@ -1096,4 +1160,19 @@ TMUTexDataCtrlFaultSet( def_sFaultSourceScoreRec* const pCtx,
} }
} }
void
RGBToBus_Fault( def_sFaultSourceScoreRec* const pCtx,
const uint32_t ErrorMark,
const double dScore,
const def_eFaultSource eFaultSource);
void
RGBToBus_Fault_Quartets( def_sFaultSourceScoreRec* const pCtx,
const uint32_t ErrorMark,
const double dScore,
const def_eFaultSource eFaultSource1,
const def_eFaultSource eFaultSource2,
const def_eFaultSource eFaultSource3,
const def_eFaultSource eFaultSource4);
#endif //_DEF_FAULTSOURCES_H_ #endif //_DEF_FAULTSOURCES_H_

View File

@@ -13,8 +13,11 @@ OBJ=OBJs/main.o \
OBJs/Utils.o \ OBJs/Utils.o \
OBJs/Draw.o \ OBJs/Draw.o \
OBJs/Test_Common.o \ OBJs/Test_Common.o \
OBJs/Test_Control.o \
OBJs/Test_Address.o \ OBJs/Test_Address.o \
OBJs/Test_Data.o \ OBJs/Test_Data.o \
OBJs/Test_Data_NoMem_TestPatterns.o \
OBJs/Test_Data_NoMem.o \
OBJs/Test_Data_Huge.o OBJs/Test_Data_Huge.o
HEADERS := $(notdir $(wildcard *.h)) HEADERS := $(notdir $(wildcard *.h))

View File

@@ -27,6 +27,12 @@ As this is an open-source tool, feel free to Fork, Raise Tickets or to send Pull
## Requirements ## Requirements
### The Easiest way :
[RetroDebian Live](https://gitea.chacha.ddns.net/chacha/RetroDebian)
### The Hard way :
To build this tool you need GNU Make, GCC and Glide 2.x SDK. To build this tool you need GNU Make, GCC and Glide 2.x SDK.
Requirement to run this tools depends on the build platform and options. Requirement to run this tools depends on the build platform and options.
@@ -60,7 +66,7 @@ Here is the [hopefully updated] project status.
- [X] test data (random pattern) - [X] test data (random pattern)
- [X] test address - [X] test address
- [X] test data (huge block) - [X] test data (huge block)
- [ ] test draw triangle shape (no texture) - [X] test draw no-mem (no texture)
- [ ] CLI options - [ ] CLI options
- [X] help - [X] help
- [X] single test run - [X] single test run
@@ -68,7 +74,7 @@ Here is the [hopefully updated] project status.
- [X] log level - [X] log level
- [ ] log to file - [ ] log to file
- [X] fault analysis - [X] fault analysis
- [ ] standalone easy tool (.exe or iso) - [X] standalone easy tool (.exe or iso)
- [ ] Chore (might never be done...) - [ ] Chore (might never be done...)
- [ ] use fixed size types (***e.g. FxUINT32 or uint32_t instead of unsigned long***) - [ ] use fixed size types (***e.g. FxUINT32 or uint32_t instead of unsigned long***)
- [ ] port / test on more modern build system - [ ] port / test on more modern build system
@@ -105,20 +111,20 @@ Here is the [hopefully updated] project status.
- [ ] force 0 - [ ] force 0
- [ ] force 1 - [ ] force 1
- [ ] floating - [ ] floating
- [X] 1MB TMU test (faulty) - [X] 1MB TMU test (= faulty voodoo2)
- [X] 2MB TMU test (= 8MB Voodoo2) - [X] 2MB TMU test (= 8MB Voodoo2)
- [X] 4MB TMU test (= 12MB Voodoo2) - [X] 4MB TMU test (= 12MB Voodoo2)
- [X] TMU0 or TMU1 only* - [X] TMU0 or TMU1 only*
- [ ] FBI to TMU1 fault - [ ] FBI to TMU1 fault
- [ ] FBI to TMU0 fault - [ ] FBI to TMU0 fault
- [ ] TMU1 to TMU0 fault - [X] TMU1 to TMU0 fault
- [ ] TMU0 to FBI fault - [X] TMU0 to FBI fault
- [ ] Documentation - [ ] Documentation
- [X] CLI help (integrated in the bin) - [X] CLI help (integrated in the bin)
- [ ] short youtube video - [ ] short youtube video
- [ ] better explanation on how memory is accessed - [ ] better explanation on how memory is accessed
- [ ] Other / Ideas - [ ] Other / Ideas
- [ ] integration with (or in) Witchery ? - [ ] integration with Witchery ?
## TMU0 Memory test ## TMU0 Memory test
@@ -208,9 +214,6 @@ Here is a simplified data flow diagram:
8. The CPU requests the pixels using the Linear Frame Buffer access 8. The CPU requests the pixels using the Linear Frame Buffer access
9. The CPU can compare the rendered value with the original texture 9. The CPU can compare the rendered value with the original texture
## Accessing different memory regions
TBD
## Note on driver aspect ## Note on driver aspect

View File

@@ -14,13 +14,17 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include "cvg.h" #include "cvg.h"
#include <glide.h> #include <glide.h>
#include "sst1init.h" #include "sst1init.h"
#include "fxpci.h" #include "fxpci.h"
#include "Utils.h"
#include "V2MemTest.h"
#include "FaultSources.h" #include "FaultSources.h"
#include "Utils.h" #include "Utils.h"
#include "Draw.h" #include "Draw.h"
@@ -35,9 +39,9 @@ typedef struct _def_sTestAddress {
}def_sTestAddress; }def_sTestAddress;
unsigned long unsigned long
RenderTestAddress( sst1DeviceInfoStruct* devInfo, RenderTestAddress( sst1DeviceInfoStruct * const devInfo,
FxU32* sst, FxU32 * const sst,
SstRegs *sstregs, SstRegs * const sstregs,
const char ucNumTMU, const char ucNumTMU,
const unsigned char RamSizeMB, const unsigned char RamSizeMB,
def_sFaultSourceScoreRec* const pFaultSrcCtx) def_sFaultSourceScoreRec* const pFaultSrcCtx)
@@ -64,24 +68,24 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
{0x000004,0,0,0,0} {0x000004,0,0,0,0}
*/ */
{0x000008,0,1,0}, {0x000008,0,1,0},
/* {target pin}, { + previous adjacent pin} */ /* {target pin} */
{0x000010,0,2,0}, {0x000018,0,2,0}, {0x000010,0,2,0},
{0x000020,0,3,0}, {0x000030,0,3,0}, {0x000020,0,3,0},
{0x000040,0,4,0}, {0x000060,0,4,0}, {0x000040,0,4,0},
{0x000080,0,5,0}, {0x0000C0,0,5,0}, {0x000080,0,5,0},
{0x000100,0,6,0}, {0x000180,0,6,0}, {0x000100,0,6,0},
{0x000200,0,7,0}, {0x000300,0,7,0}, {0x000200,0,7,0},
{0x000400,0,8,0}, {0x000600,0,8,0}, {0x000400,0,8,0},
{0x000800,0,9,0}, {0x000C00,0,9,0}, {0x000800,0,9,0},
{0x001000,0,0,1}, {0x001800,0,0,1}, {0x001000,0,0,1},
{0x002000,0,0,2}, {0x003000,0,0,2}, {0x002000,0,0,2},
{0x004000,0,0,3}, {0x006000,0,0,3}, {0x004000,0,0,3},
{0x008000,0,0,4}, {0x00C000,0,0,4}, {0x008000,0,0,4},
{0x010000,0,0,5}, {0x018000,0,0,5}, {0x010000,0,0,5},
{0x020000,0,0,6}, {0x030000,0,0,6}, {0x020000,0,0,6},
{0x040000,0,0,7}, {0x060000,0,0,7}, {0x040000,0,0,7},
{0x080000,0,0,8}, {0x0C0000,0,0,8}, {0x080000,0,0,8},
{0x100000,0,0,9}, {0x180000,0,0,9}, {0x100000,0,0,9},
/* Bank1 */ /* Bank1 */
{0x200000,1,0,0}, {0x200000,1,0,0},
@@ -91,26 +95,27 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
{0x200004,1,0,0,0} {0x200004,1,0,0,0}
*/ */
{0x200008,1,1,0}, {0x200008,1,1,0},
/* {target pin}, { + previous adjacent pin} */ /* {target pin} */
{0x200010,1,2,0}, {0x200018,1,2,0}, {0x200010,1,2,0},
{0x200020,1,3,0}, {0x200030,1,3,0}, {0x200020,1,3,0},
{0x200040,1,4,0}, {0x200060,1,4,0}, {0x200040,1,4,0},
{0x200080,1,5,0}, {0x2000C0,1,5,0}, {0x200080,1,5,0},
{0x200100,1,6,0}, {0x200180,1,6,0}, {0x200100,1,6,0},
{0x200200,1,7,0}, {0x200300,1,7,0}, {0x200200,1,7,0},
{0x200400,1,8,0}, {0x200600,1,8,0}, {0x200400,1,8,0},
{0x200800,1,9,0}, {0x200C00,1,9,0}, {0x200800,1,9,0},
{0x201000,1,0,1}, {0x201800,1,0,1}, {0x201000,1,0,1},
{0x202000,1,0,2}, {0x203000,1,0,2}, {0x202000,1,0,2},
{0x204000,1,0,3}, {0x206000,1,0,3}, {0x204000,1,0,3},
{0x208000,1,0,4}, {0x20C000,1,0,4}, {0x208000,1,0,4},
{0x210000,1,0,5}, {0x218000,1,0,5}, {0x210000,1,0,5},
{0x220000,1,0,6}, {0x230000,1,0,6}, {0x220000,1,0,6},
{0x240000,1,0,7}, {0x260000,1,0,7}, {0x240000,1,0,7},
{0x280000,1,0,8}, {0x2C0000,1,0,8}, {0x280000,1,0,8},
{0x300000,1,0,9}, {0x380000,1,0,9}, {0x300000,1,0,9},
}; };
logT("testing %d MB of memory\n",RamSizeMB);
for(unsigned char idx=0; for(unsigned char idx=0;
idx < (sizeof(add_list)/sizeof(def_sTestAddress)); idx < (sizeof(add_list)/sizeof(def_sTestAddress));
idx++) idx++)
@@ -120,10 +125,40 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
if(RamSizeMB<3 && add_list[idx].u32Addr >= 0x200000) continue; if(RamSizeMB<3 && add_list[idx].u32Addr >= 0x200000) continue;
if(RamSizeMB<2 && add_list[idx].u32Addr >= 0x100000) continue; if(RamSizeMB<2 && add_list[idx].u32Addr >= 0x100000) continue;
logT("idx = %d\n",idx);
logT("u32Addr = 0x%08X\n",add_list[idx].u32Addr);
const uint32_t TestVal1 = get_notnull_random_balanced_mByte(); const uint32_t TestVal1 = get_notnull_random_balanced_mByte();
const uint32_t TestVal2 = get_notnull_random_balanced_mByte(); logT("TestVal1 = %08X\n",TestVal1);
const uint32_t TestValBlank1 = get_notnull_random_balanced_mByte();
const uint32_t TestValBlank2 = get_notnull_random_balanced_mByte(); uint32_t TestVal2 = 0;
do
{
TestVal2 = get_notnull_random_balanced_mByte();
}
while((count_bit32((TestVal2 ^ TestVal1)) < 12));
logT("TestVal2 = %08X\n",TestVal2);
uint32_t TestValBlank1 = 0;
do
{
TestValBlank1 = get_notnull_random_balanced_mByte();
}
while( (count_bit32((TestValBlank1 ^ TestVal1) & 0x0000FFFF) < 6)
|| (count_bit32((TestValBlank1 ^ TestVal1) & 0xFFFF0000) < 6)
|| (count_bit32((TestValBlank1 ^ TestVal2)) < 12));
logT("TestValBlank1 = %08X\n",TestValBlank1);
uint32_t TestValBlank2 = 0;
do
{
TestValBlank2 = get_notnull_random_balanced_mByte();
}
while( (count_bit32((TestValBlank2 ^ TestVal2) & 0x0000FFFF) < 6)
|| (count_bit32((TestValBlank2 ^ TestVal2) & 0xFFFF0000) < 6)
|| (count_bit32((TestValBlank2 ^ TestValBlank1)) < 12)
|| (count_bit32((TestValBlank2 ^ TestVal1)) < 12));
logT("TestValBlank2 = %08X\n",TestValBlank2);
/* Clearing memory targets */ /* Clearing memory targets */
for(unsigned char idxclr=0; for(unsigned char idxclr=0;
@@ -136,7 +171,7 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
if(RamSizeMB<2 && add_list[idxclr].u32Addr >= 0x100000) continue; if(RamSizeMB<2 && add_list[idxclr].u32Addr >= 0x100000) continue;
/* set base mem @ */ /* set base mem @ */
ISET(sstregs->texBaseAddr, (add_list[idxclr].u32Addr>>3)); ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, (add_list[idxclr].u32Addr>>3));
/* set @ to first line, using bits 00..31*/ /* set @ to first line, using bits 00..31*/
volatile const FxU32 *texAddrBlank volatile const FxU32 *texAddrBlank
@@ -157,7 +192,7 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
} }
/* set base mem @ */ /* set base mem @ */
ISET(sstregs->texBaseAddr, (add_list[idx].u32Addr>>3)); ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, (add_list[idx].u32Addr>>3));
/* set @ to first line, using bits 00..31*/ /* set @ to first line, using bits 00..31*/
volatile const FxU32 *texAddr volatile const FxU32 *texAddr
@@ -185,17 +220,17 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
if(RamSizeMB<3 && add_list[idxdraw].u32Addr >= 0x200000) continue; if(RamSizeMB<3 && add_list[idxdraw].u32Addr >= 0x200000) continue;
if(RamSizeMB<2 && add_list[idxdraw].u32Addr >= 0x100000) continue; if(RamSizeMB<2 && add_list[idxdraw].u32Addr >= 0x100000) continue;
/* testing copy beyond tested bit is useless & can raise logT("idxdraw = %d, row = %d; col = %d\n",idxdraw,add_list[idxdraw].nRowBit,add_list[idxdraw].nColBit);
false positive */
if(idxdraw > idx) break; //if(idxdraw > idx) break;
clearScreen(sstregs,0x00000000,2,2); clearScreen(sstregs,0x00000000,2,2);
/* set to mem addr */ /* set to mem addr */
ISET(sstregs->texBaseAddr, (add_list[idxdraw].u32Addr >> 3)); ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, (add_list[idxdraw].u32Addr >> 3));
/* draw a 2x2 square */ /* draw a 2x2 square */
drawSquare(sstregs, 0, 0, 2); drawSquare(sstregs, ucNumTMU, 0, 0, 2);
sst1InitIdle(sst); sst1InitIdle(sst);
/* first line, to use bits 00..31 */ /* first line, to use bits 00..31 */
@@ -206,93 +241,33 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
const uint32_t ErrorMark_L1 = (idxdraw == idx) ? (L1 ^ TestVal1) : (L1 ^ TestValBlank1); const uint32_t ErrorMark_L1 = (idxdraw == idx) ? (L1 ^ TestVal1) : (L1 ^ TestValBlank1);
const uint32_t ErrorMark_L2 = (idxdraw == idx) ? (L2 ^ TestVal2) : (L2 ^ TestValBlank2); const uint32_t ErrorMark_L2 = (idxdraw == idx) ? (L2 ^ TestVal2) : (L2 ^ TestValBlank2);
const uint32_t ErrorMarkBlank_L1 = (idxdraw == idx) ? (L1 ^ TestValBlank1) : (L1 ^ TestVal1); const uint32_t ErrorMarkOther_L1 = (idxdraw == idx) ? (L1 ^ TestValBlank1) : (L1 ^ TestVal1);
const uint32_t ErrorMarkBlank_L2 = (idxdraw == idx) ? (L2 ^ TestValBlank2) : (L2 ^ TestVal2) ; const uint32_t ErrorMarkOther_L2 = (idxdraw == idx) ? (L2 ^ TestValBlank2) : (L2 ^ TestVal2);
if(ErrorMark_L1 || ErrorMark_L2) if(ErrorMark_L1 || ErrorMark_L2)
{ {
const def_eFaultSource TMUTexADDR_0_0 = (ucNumTMU == 0) ? U9_TMU0_TEX_ADDR_0_0 : U8_TMU1_TEX_ADDR_0_0; const def_eFaultSource TMUTexADDR_0_0 = (ucNumTMU == 0) ? U9_TMU0_TEX_ADDR_0_0 : U8_TMU1_TEX_ADDR_0_0;
const def_eFaultSource TMUTexADDR_1_0 = (ucNumTMU == 0) ? U9_TMU0_TEX_ADDR_1_0 : U8_TMU1_TEX_ADDR_1_0; const def_eFaultSource TMUTexADDR_1_0 = (ucNumTMU == 0) ? U9_TMU0_TEX_ADDR_1_0 : U8_TMU1_TEX_ADDR_1_0;
const def_eFaultSource TMUTexADDR_2_0 = (ucNumTMU == 0) ? U9_TMU0_TEX_ADDR_2_0 : U8_TMU1_TEX_ADDR_2_0; const def_eFaultSource TMUTexADDR_2_0 = (ucNumTMU == 0) ? U9_TMU0_TEX_ADDR_2_0 : U8_TMU1_TEX_ADDR_2_0;
const def_eFaultSource TMUTexADDR_3_0 = (ucNumTMU == 0) ? U9_TMU0_TEX_ADDR_3_0 : U8_TMU1_TEX_ADDR_3_0; const def_eFaultSource TMUTexADDR_3_0 = (ucNumTMU == 0) ? U9_TMU0_TEX_ADDR_3_0 : U8_TMU1_TEX_ADDR_3_0;
const def_eFaultSource TMUTexWE = (ucNumTMU == 0) ? U9_TMU0_TEX_WE : U8_TMU1_TEX_WE; const def_eFaultSource _MEMChip_B0_0_A0 = (ucNumTMU == 0) ? U14_A0 : U13_A0;
const def_eFaultSource TMUTexCAS0 = (ucNumTMU == 0) ? U9_TMU0_TEX_CAS0 : U8_TMU1_TEX_CAS0; const def_eFaultSource _MEMChip_B0_1_A0 = (ucNumTMU == 0) ? U12_A0 : U11_A0;
const def_eFaultSource TMUTexCAS1 = (ucNumTMU == 0) ? U9_TMU0_TEX_CAS1 : U8_TMU1_TEX_CAS1; const def_eFaultSource _MEMChip_B0_2_A0 = (ucNumTMU == 0) ? U18_A0 : U16_A0;
const def_eFaultSource TMUTexCAS2 = (ucNumTMU == 0) ? U9_TMU0_TEX_CAS2 : U8_TMU1_TEX_CAS2; const def_eFaultSource _MEMChip_B0_3_A0 = (ucNumTMU == 0) ? U17_A0 : U15_A0;
const def_eFaultSource TMUTexCAS3 = (ucNumTMU == 0) ? U9_TMU0_TEX_CAS3 : U8_TMU1_TEX_CAS3; const def_eFaultSource _MEMChip_B1_0_A0 = (ucNumTMU == 0) ? U23_A0 : U27_A0;
const def_eFaultSource _TMUTexRAS0 = (ucNumTMU == 0) ? U9_TMU0_TEX_RAS0 : U8_TMU1_TEX_RAS0; const def_eFaultSource _MEMChip_B1_1_A0 = (ucNumTMU == 0) ? U24_A0 : U28_A0;
const def_eFaultSource _TMUTexRAS1 = (ucNumTMU == 0) ? U9_TMU0_TEX_RAS1 : U8_TMU1_TEX_RAS1; const def_eFaultSource _MEMChip_B1_2_A0 = (ucNumTMU == 0) ? U25_A0 : U29_A0;
const def_eFaultSource TMUTexRASCurrent = (add_list[idxdraw].nBank == 0) ? _TMUTexRAS0 : _TMUTexRAS1; const def_eFaultSource _MEMChip_B1_3_A0 = (ucNumTMU == 0) ? U26_A0 : U30_A0;
const def_eFaultSource _MEMChip_B0_0_A0 = (ucNumTMU == 0) ? U14_A0 : U13_A0;
const def_eFaultSource _MEMChip_B0_1_A0 = (ucNumTMU == 0) ? U12_A0 : U11_A0;
const def_eFaultSource _MEMChip_B0_2_A0 = (ucNumTMU == 0) ? U18_A0 : U16_A0;
const def_eFaultSource _MEMChip_B0_3_A0 = (ucNumTMU == 0) ? U17_A0 : U15_A0;
const def_eFaultSource _MEMChip_B1_0_A0 = (ucNumTMU == 0) ? U23_A0 : U27_A0;
const def_eFaultSource _MEMChip_B1_1_A0 = (ucNumTMU == 0) ? U24_A0 : U28_A0;
const def_eFaultSource _MEMChip_B1_2_A0 = (ucNumTMU == 0) ? U25_A0 : U29_A0;
const def_eFaultSource _MEMChip_B1_3_A0 = (ucNumTMU == 0) ? U26_A0 : U30_A0;
const def_eFaultSource MEMChip_0_A0 = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_0_A0 : _MEMChip_B1_0_A0; const def_eFaultSource MEMChip_0_A0 = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_0_A0 : _MEMChip_B1_0_A0;
const def_eFaultSource MEMChip_1_A0 = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_1_A0 : _MEMChip_B1_1_A0; const def_eFaultSource MEMChip_1_A0 = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_1_A0 : _MEMChip_B1_1_A0;
const def_eFaultSource MEMChip_2_A0 = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_2_A0 : _MEMChip_B1_2_A0; const def_eFaultSource MEMChip_2_A0 = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_2_A0 : _MEMChip_B1_2_A0;
const def_eFaultSource MEMChip_3_A0 = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_3_A0 : _MEMChip_B1_3_A0; const def_eFaultSource MEMChip_3_A0 = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_3_A0 : _MEMChip_B1_3_A0;
const def_eFaultSource _MEMChip_B0_0_CASL = (ucNumTMU == 0) ? U14_CASL : U13_CASL;
const def_eFaultSource _MEMChip_B0_1_CASL = (ucNumTMU == 0) ? U12_CASL : U11_CASL;
const def_eFaultSource _MEMChip_B0_2_CASL = (ucNumTMU == 0) ? U18_CASL : U16_CASL;
const def_eFaultSource _MEMChip_B0_3_CASL = (ucNumTMU == 0) ? U17_CASL : U15_CASL;
const def_eFaultSource _MEMChip_B1_0_CASL = (ucNumTMU == 0) ? U23_CASL : U27_CASL;
const def_eFaultSource _MEMChip_B1_1_CASL = (ucNumTMU == 0) ? U24_CASL : U28_CASL;
const def_eFaultSource _MEMChip_B1_2_CASL = (ucNumTMU == 0) ? U25_CASL : U29_CASL;
const def_eFaultSource _MEMChip_B1_3_CASL = (ucNumTMU == 0) ? U26_CASL : U30_CASL;
const def_eFaultSource MEMChip_0_CASL = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_0_CASL : _MEMChip_B1_0_CASL;
const def_eFaultSource MEMChip_1_CASL = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_1_CASL : _MEMChip_B1_1_CASL;
const def_eFaultSource MEMChip_2_CASL = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_2_CASL : _MEMChip_B1_2_CASL;
const def_eFaultSource MEMChip_3_CASL = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_3_CASL : _MEMChip_B1_3_CASL;
const def_eFaultSource _MEMChip_B0_0_CASH = (ucNumTMU == 0) ? U14_CASH : U13_CASH; const def_eFaultSource MEMChip_0_A0_Other = (add_list[idxdraw].nBank == 1) ? _MEMChip_B0_0_A0 : _MEMChip_B1_0_A0;
const def_eFaultSource _MEMChip_B0_1_CASH = (ucNumTMU == 0) ? U12_CASH : U11_CASH; const def_eFaultSource MEMChip_1_A0_Other = (add_list[idxdraw].nBank == 1) ? _MEMChip_B0_1_A0 : _MEMChip_B1_1_A0;
const def_eFaultSource _MEMChip_B0_2_CASH = (ucNumTMU == 0) ? U18_CASH : U16_CASH; const def_eFaultSource MEMChip_2_A0_Other = (add_list[idxdraw].nBank == 1) ? _MEMChip_B0_2_A0 : _MEMChip_B1_2_A0;
const def_eFaultSource _MEMChip_B0_3_CASH = (ucNumTMU == 0) ? U17_CASH : U15_CASH; const def_eFaultSource MEMChip_3_A0_Other = (add_list[idxdraw].nBank == 1) ? _MEMChip_B0_3_A0 : _MEMChip_B1_3_A0;
const def_eFaultSource _MEMChip_B1_0_CASH = (ucNumTMU == 0) ? U23_CASH : U27_CASH;
const def_eFaultSource _MEMChip_B1_1_CASH = (ucNumTMU == 0) ? U24_CASH : U28_CASH;
const def_eFaultSource _MEMChip_B1_2_CASH = (ucNumTMU == 0) ? U25_CASH : U29_CASH;
const def_eFaultSource _MEMChip_B1_3_CASH = (ucNumTMU == 0) ? U26_CASH : U30_CASH;
const def_eFaultSource MEMChip_0_CASH = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_0_CASH : _MEMChip_B1_0_CASH;
const def_eFaultSource MEMChip_1_CASH = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_1_CASH : _MEMChip_B1_1_CASH;
const def_eFaultSource MEMChip_2_CASH = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_2_CASH : _MEMChip_B1_2_CASH;
const def_eFaultSource MEMChip_3_CASH = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_3_CASH : _MEMChip_B1_3_CASH;
const def_eFaultSource _MEMChip_B0_0_RAS = (ucNumTMU == 0) ? U14_RAS : U13_RAS;
const def_eFaultSource _MEMChip_B0_1_RAS = (ucNumTMU == 0) ? U12_RAS : U11_RAS;
const def_eFaultSource _MEMChip_B0_2_RAS = (ucNumTMU == 0) ? U18_RAS : U16_RAS;
const def_eFaultSource _MEMChip_B0_3_RAS = (ucNumTMU == 0) ? U17_RAS : U15_RAS;
const def_eFaultSource _MEMChip_B1_0_RAS = (ucNumTMU == 0) ? U23_RAS : U27_RAS;
const def_eFaultSource _MEMChip_B1_1_RAS = (ucNumTMU == 0) ? U24_RAS : U28_RAS;
const def_eFaultSource _MEMChip_B1_2_RAS = (ucNumTMU == 0) ? U25_RAS : U29_RAS;
const def_eFaultSource _MEMChip_B1_3_RAS = (ucNumTMU == 0) ? U26_RAS : U30_RAS;
const def_eFaultSource MEMChip_0_RAS = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_0_RAS : _MEMChip_B1_0_RAS;
const def_eFaultSource MEMChip_1_RAS = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_1_RAS : _MEMChip_B1_1_RAS;
const def_eFaultSource MEMChip_2_RAS = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_2_RAS : _MEMChip_B1_2_RAS;
const def_eFaultSource MEMChip_3_RAS = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_3_RAS : _MEMChip_B1_3_RAS;
const def_eFaultSource _MEMChip_B0_0_WE = (ucNumTMU == 0) ? U14_WE : U13_WE;
const def_eFaultSource _MEMChip_B0_1_WE = (ucNumTMU == 0) ? U12_WE : U11_WE;
const def_eFaultSource _MEMChip_B0_2_WE = (ucNumTMU == 0) ? U18_WE : U16_WE;
const def_eFaultSource _MEMChip_B0_3_WE = (ucNumTMU == 0) ? U17_WE : U15_WE;
const def_eFaultSource _MEMChip_B1_0_WE = (ucNumTMU == 0) ? U23_WE : U27_WE;
const def_eFaultSource _MEMChip_B1_1_WE = (ucNumTMU == 0) ? U24_WE : U28_WE;
const def_eFaultSource _MEMChip_B1_2_WE = (ucNumTMU == 0) ? U25_WE : U29_WE;
const def_eFaultSource _MEMChip_B1_3_WE = (ucNumTMU == 0) ? U26_WE : U30_WE;
const def_eFaultSource MEMChip_0_WE = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_0_WE : _MEMChip_B1_0_WE;
const def_eFaultSource MEMChip_1_WE = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_1_WE : _MEMChip_B1_1_WE;
const def_eFaultSource MEMChip_2_WE = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_2_WE : _MEMChip_B1_2_WE;
const def_eFaultSource MEMChip_3_WE = (add_list[idxdraw].nBank == 0) ? _MEMChip_B0_3_WE : _MEMChip_B1_3_WE;
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_TEXADDR_0_L = (ucNumTMU == 0) ? RA35 : RA31; const def_eFaultSource RES_TEXADDR_0_L = (ucNumTMU == 0) ? RA35 : RA31;
const def_eFaultSource RES_TEXADDR_0_H = (ucNumTMU == 0) ? RA34 : RA30; const def_eFaultSource RES_TEXADDR_0_H = (ucNumTMU == 0) ? RA34 : RA30;
@@ -307,239 +282,165 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
const def_eFaultSource RES_TEXADDR_3_H = (ucNumTMU == 0) ? RA21 : RA19; const def_eFaultSource RES_TEXADDR_3_H = (ucNumTMU == 0) ? RA21 : RA19;
const def_eFaultSource RES_TEXADDR_3_8 = (ucNumTMU == 0) ? R98 : R97; const def_eFaultSource RES_TEXADDR_3_8 = (ucNumTMU == 0) ? R98 : R97;
if(count_bit32(ErrorMark_L1 & 0x0000FFFF) > 2) /* This test is simpler than I wanteed it to be. It focuses
{ * only on address lines. I thought that reading a totally
NbErr++; * unknown value can mean we have a control line issue but it
* is more complex. In case of 2 addresses lines shorted,
* the value we will get wont necessary be the one we wrote,
* at any place. I am not 100% sure why, but it might be
* because of EDO Ram Page mode... Or maybe lines are also used
* internally by the TMU.. or maybe I just missed something !
*
* Anyway, this test should do the job for @ lines (including
* shorted). And the Control lines will be tested in a different
* Module where @ lines wont change.
*/
if((idxdraw == idx) && count_bit32(ErrorMark_L1 & 0x0000FFFF) > 6)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, RES_WE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_WE, 1.0/1);
}
if(count_bit32(ErrorMarkBlank_L1 & 0x0000FFFF) < 3) /* Considering error only if more than 3 over 16 bits
{
if(add_list[idx].nColBit!=0)
{
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_A0 + add_list[idx].nColBit, 1.0/1);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_0_0 + add_list[idx].nColBit, 1.0/1);
if(add_list[idx].nColBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_L + add_list[idx].nColBit + 1, 1.0/2);
else if(add_list[idx].nColBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_H + add_list[idx].nColBit + 1, 1.0/2);
else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_8 + 1, 1.0/2);
}
if(add_list[idx].nRowBit!=0)
{
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_A0 + add_list[idx].nRowBit, 1.0/1);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_0_0 + add_list[idx].nRowBit, 1.0/1);
if(add_list[idx].nRowBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_L + add_list[idx].nRowBit + 1, 1.0/2);
else if(add_list[idx].nRowBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_H + add_list[idx].nRowBit + 1, 1.0/2);
else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_8 + 1, 1.0/2);
}
}
else
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0/8);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0/8);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_RAS, 1.0/4);
if(ErrorMark_L1 & 0x000000FF)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS0, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+1, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_CASL, 1.0/8);
}
if(ErrorMark_L1 & 0x0000FF00)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS1, 1.0/16);;
FaultSource_addScore(pFaultSrcCtx, RES_CAS+2, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_CASH, 1.0/8);
}
}
}
/* considering error only if more than 6 over 16 bits
* are wrong, because we are only testing addresses * are wrong, because we are only testing addresses
* lines here */ * lines here */
if(count_bit32(ErrorMark_L1 & 0xFFFF0000) > 2) if(count_bit32(ErrorMark_L1 & 0x0000FFFF) > 3)
{ {
NbErr++; NbErr++;
if((idxdraw == idx) && count_bit32(ErrorMark_L1 & 0xFFFF0000) > 6) /* If it matches the Other value with less than
{ * 3 error bits */
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4); if(count_bit32(ErrorMarkOther_L1 & 0x0000FFFF) < 3)
FaultSource_addScore(pFaultSrcCtx, RES_WE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_WE, 1.0/1);
}
if(count_bit32(ErrorMarkBlank_L1 & 0xFFFF0000) < 3)
{ {
if(add_list[idx].nColBit!=0) if(add_list[idx].nColBit!=0)
{ {
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_A0 + add_list[idx].nColBit, 1.0/1); FaultSource_addScore(pFaultSrcCtx, MEMChip_0_A0 + add_list[idx].nColBit - 1, 1.0 / 1);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_1_0 + add_list[idx].nColBit, 1.0/1); if(RamSizeMB>=2)
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_A0_Other + add_list[idx].nColBit - 1, 1.0 / 2);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_0_0 + add_list[idx].nColBit - 1, 1.0 / 2);
if(add_list[idx].nColBit < 4) if(add_list[idx].nColBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_L + add_list[idx].nColBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_L + add_list[idx].nColBit - 2, 1.0 / 2);
else if(add_list[idx].nColBit < 8) else if(add_list[idx].nColBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_H + add_list[idx].nColBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_H + add_list[idx].nColBit - 6, 1.0 / 2);
else else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_8 + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_8, 1.0 / 2);
} }
if(add_list[idx].nRowBit!=0) if(add_list[idx].nRowBit!=0)
{ {
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_A0 + add_list[idx].nRowBit, 1.0/1); FaultSource_addScore(pFaultSrcCtx, MEMChip_0_A0 + add_list[idx].nRowBit - 1, 1.0 / 1);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_1_0 + add_list[idx].nRowBit, 1.0/1); if(RamSizeMB>=2)
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_A0_Other + add_list[idx].nRowBit - 1, 1.0 / 2);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_0_0 + add_list[idx].nRowBit - 1, 1.0 / 2);
if(add_list[idx].nRowBit < 4) if(add_list[idx].nRowBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_L + add_list[idx].nRowBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_L + add_list[idx].nRowBit - 2, 1.0 / 2);
else if(add_list[idx].nRowBit < 8) else if(add_list[idx].nRowBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_H + add_list[idx].nRowBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_H + add_list[idx].nRowBit - 6, 1.0 / 2);
else else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_8 + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_0_8, 1.0 / 2);
}
}
else
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0/8);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0/8);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_RAS, 1.0/4);
if(ErrorMark_L1 & 0x00FF0000)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS0, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+1, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_CASL, 1.0/8);
}
if(ErrorMark_L1 & 0xFF000000)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS1, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+2, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_CASH, 1.0/8);
} }
} }
} }
if(count_bit32(ErrorMark_L2 & 0x0000FFFF) > 2) if(count_bit32(ErrorMark_L1 & 0xFFFF0000) > 3)
{ {
NbErr++; NbErr++;
if((idxdraw == idx) && count_bit32(ErrorMark_L2 & 0x0000FFFF) > 6) if(count_bit32(ErrorMarkOther_L1 & 0xFFFF0000) < 3)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, RES_WE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_WE, 1.0);
}
if(count_bit32(ErrorMarkBlank_L2 & 0x0000FFFF) < 3)
{ {
if(add_list[idx].nColBit!=0) if(add_list[idx].nColBit!=0)
{ {
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_A0 + add_list[idx].nColBit, 1.0/1); FaultSource_addScore(pFaultSrcCtx, MEMChip_1_A0 + add_list[idx].nColBit - 1, 1.0 / 1);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_2_0 + add_list[idx].nColBit, 1.0/1); if(RamSizeMB>=2)
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_A0_Other + add_list[idx].nColBit - 1, 1.0 / 2);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_1_0 + add_list[idx].nColBit - 1, 1.0 / 2);
if(add_list[idx].nColBit < 4) if(add_list[idx].nColBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_L + add_list[idx].nColBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_L + add_list[idx].nColBit - 2, 1.0 / 2);
else if(add_list[idx].nColBit < 8) else if(add_list[idx].nColBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_H + add_list[idx].nColBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_H + add_list[idx].nColBit - 6, 1.0 / 2);
else else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_8 + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_8, 1.0 / 2);
} }
if(add_list[idx].nRowBit!=0) if(add_list[idx].nRowBit!=0)
{ {
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_A0 + add_list[idx].nRowBit, 1.0/1); FaultSource_addScore(pFaultSrcCtx, MEMChip_1_A0 + add_list[idx].nRowBit - 1, 1.0 / 1);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_2_0 + add_list[idx].nRowBit, 1.0/1); if(RamSizeMB>=2)
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_A0_Other + add_list[idx].nRowBit - 1, 1.0 / 2);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_1_0 + add_list[idx].nRowBit - 1, 1.0 / 2);
if(add_list[idx].nRowBit < 4) if(add_list[idx].nRowBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_L + add_list[idx].nRowBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_L + add_list[idx].nRowBit - 2, 1.0 / 2);
else if(add_list[idx].nRowBit < 8) else if(add_list[idx].nRowBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_H + add_list[idx].nRowBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_H + add_list[idx].nRowBit - 6, 1.0 / 2);
else else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_8 + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_1_8, 1.0 / 2);
}
}
else
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0/8);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0/8);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_RAS, 1.0/4);
if(ErrorMark_L2 & 0x000000FF)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS2, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+3, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_CASL, 1.0/8);
}
if(ErrorMark_L2 & 0x0000FF00)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS3, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+4, 1.0/16);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_CASH, 1.0/8);
} }
} }
} }
if(count_bit32(ErrorMark_L2 & 0xFFFF0000) > 2) if(count_bit32(ErrorMark_L2 & 0x0000FFFF) > 3)
{ {
NbErr++; NbErr++;
if(count_bit32(ErrorMarkOther_L2 & 0x0000FFFF) < 3)
if((idxdraw == idx) && count_bit32(ErrorMark_L2 & 0xFFFF0000) > 6)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, RES_WE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_WE, 1.0);
}
if(count_bit32(ErrorMarkBlank_L2 & 0xFFFF0000) < 3)
{ {
if(add_list[idx].nColBit!=0) if(add_list[idx].nColBit!=0)
{ {
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_A0 + add_list[idx].nColBit, 1.0/1); FaultSource_addScore(pFaultSrcCtx, MEMChip_2_A0 + add_list[idx].nColBit - 1, 1.0 / 1);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_3_0 + add_list[idx].nColBit, 1.0/1); if(RamSizeMB>=2)
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_A0_Other + add_list[idx].nColBit - 1, 1.0 / 2);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_2_0 + add_list[idx].nColBit - 1, 1.0 / 2);
if(add_list[idx].nColBit < 4) if(add_list[idx].nColBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_L + add_list[idx].nColBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_L + add_list[idx].nColBit - 2, 1.0 / 2);
else if(add_list[idx].nColBit < 8) else if(add_list[idx].nColBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_H + add_list[idx].nColBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_H + add_list[idx].nColBit - 6, 1.0 / 2);
else else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_8 + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_8, 1.0 / 2);
} }
if(add_list[idx].nRowBit!=0) if(add_list[idx].nRowBit!=0)
{ {
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_A0 + add_list[idx].nRowBit, 1.0/1); FaultSource_addScore(pFaultSrcCtx, MEMChip_2_A0 + add_list[idx].nRowBit - 1, 1.0 / 1);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_3_0 + add_list[idx].nRowBit, 1.0/1); if(RamSizeMB>=2)
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_A0_Other + add_list[idx].nRowBit - 1, 1.0 / 2);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_2_0 + add_list[idx].nRowBit - 1, 1.0 / 2);
if(add_list[idx].nRowBit < 4) if(add_list[idx].nRowBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_L + add_list[idx].nRowBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_L + add_list[idx].nRowBit - 2, 1.0 / 2);
else if(add_list[idx].nRowBit < 8) else if(add_list[idx].nRowBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_H + add_list[idx].nRowBit + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_H + add_list[idx].nRowBit - 6, 1.0 / 2);
else else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_8 + 1, 1.0/2); FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_2_8, 1.0 / 2);
} }
} }
else }
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0/8);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0/8);
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_RAS, 1.0/4);
if(ErrorMark_L2 & 0x00FF0000) if(count_bit32(ErrorMark_L2 & 0xFFFF0000) > 3)
{
NbErr++;
if(count_bit32(ErrorMarkOther_L2 & 0xFFFF0000) < 3)
{
if(add_list[idx].nColBit!=0)
{ {
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS2, 1.0/16); FaultSource_addScore(pFaultSrcCtx, MEMChip_3_A0 + add_list[idx].nColBit - 1, 1.0 / 1);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+3, 1.0/16); if(RamSizeMB>=2)
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_CASL, 1.0/8); FaultSource_addScore(pFaultSrcCtx, MEMChip_3_A0_Other + add_list[idx].nColBit - 1, 1.0 / 2);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_3_0 + add_list[idx].nColBit - 1, 1.0 / 2);
if(add_list[idx].nColBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_L + add_list[idx].nColBit - 2, 1.0 / 2);
else if(add_list[idx].nColBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_H + add_list[idx].nColBit - 6, 1.0 / 2);
else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_8, 1.0 / 2);
} }
if(ErrorMark_L2 & 0xFF000000) if(add_list[idx].nRowBit!=0)
{ {
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS3, 1.0/16); FaultSource_addScore(pFaultSrcCtx, MEMChip_3_A0 + add_list[idx].nRowBit - 1, 1.0 / 1);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+4, 1.0/16); if(RamSizeMB>=2)
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_CASH, 1.0/8); FaultSource_addScore(pFaultSrcCtx, MEMChip_3_A0_Other + add_list[idx].nRowBit - 1, 1.0 / 2);
FaultSource_addScore(pFaultSrcCtx, TMUTexADDR_3_0 + add_list[idx].nRowBit - 1, 1.0 / 2);
if(add_list[idx].nRowBit < 4)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_L + add_list[idx].nRowBit - 2, 1.0 / 2);
else if(add_list[idx].nRowBit < 8)
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_H + add_list[idx].nRowBit - 6, 1.0 / 2);
else
FaultSource_addScore(pFaultSrcCtx, RES_TEXADDR_3_8, 1.0 / 2);
} }
} }
} }

View File

@@ -19,9 +19,9 @@
#define _DEF_TEST_ADDRESS_H_ #define _DEF_TEST_ADDRESS_H_
unsigned long unsigned long
RenderTestAddress( sst1DeviceInfoStruct* devInfo, RenderTestAddress( sst1DeviceInfoStruct * const devInfo,
FxU32* sst, FxU32 * const sst,
SstRegs *sstregs, SstRegs * const sstregs,
const char ucNumTMU, const char ucNumTMU,
const unsigned char RamSizeMB, const unsigned char RamSizeMB,
def_sFaultSourceScoreRec* const pFaultSrcCtx); def_sFaultSourceScoreRec* const pFaultSrcCtx);

View File

@@ -35,9 +35,9 @@
#define _DEF_PREHEAT_NB_PIXEL_COL 256 #define _DEF_PREHEAT_NB_PIXEL_COL 256
void void
HeatMemAndTMU( sst1DeviceInfoStruct* devInfo, HeatMemAndTMU( sst1DeviceInfoStruct * const devInfo,
FxU32* sst, FxU32 * const sst,
SstRegs *sstregs, SstRegs * const sstregs,
const char ucNumTMU, const char ucNumTMU,
const FxU32 mem) const FxU32 mem)
{ {
@@ -45,9 +45,9 @@ HeatMemAndTMU( sst1DeviceInfoStruct* devInfo,
for (int i=0; i<ucNumTMU; i++) for (int i=0; i<ucNumTMU; i++)
ISET(SST_TREX(sstregs,i)->textureMode, SST_TC_PASS | SST_TCA_PASS); ISET(SST_TREX(sstregs,i)->textureMode, SST_TC_PASS | SST_TCA_PASS);
/* Setting texture base address window for both CPU and TMU /* Setting texture base address window
*/ */
ISET(sstregs->texBaseAddr, (mem>>3)); ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, (mem>>3));
/* Setting texture base address (to access it from CPU). /* Setting texture base address (to access it from CPU).
* We wont draw anything bigger than the texture so we can just use LOD0 * We wont draw anything bigger than the texture so we can just use LOD0
@@ -75,7 +75,7 @@ HeatMemAndTMU( sst1DeviceInfoStruct* devInfo,
if(((sst1InitReturnStatus(sst) & SST_FIFOLEVEL)) >= 0x20) if(((sst1InitReturnStatus(sst) & SST_FIFOLEVEL)) >= 0x20)
{ {
/* draw a 256x256 square */ /* draw a 256x256 square */
drawSquare(sstregs, 0, 0, 256); drawSquare(sstregs, ucNumTMU, 0, 0, 256);
} }
} }
while(((double)(clock() - begin)/CLOCKS_PER_SEC) < _DEF_PREHEAT_TIME_S ); while(((double)(clock() - begin)/CLOCKS_PER_SEC) < _DEF_PREHEAT_TIME_S );

View File

@@ -19,10 +19,11 @@
#define _DEF_TEST_COMMON_H_ #define _DEF_TEST_COMMON_H_
void void
HeatMemAndTMU( sst1DeviceInfoStruct* devInfo, HeatMemAndTMU( sst1DeviceInfoStruct * const devInfo,
FxU32* sst, FxU32 * const sst,
SstRegs *sstregs, SstRegs * const sstregs,
const char ucNumTMU, const char ucNumTMU,
const FxU32 mem); const FxU32 mem);
#endif //_DEF_TEST_COMMON_H_ #endif //_DEF_TEST_COMMON_H_

457
Test_Control.c Normal file
View File

@@ -0,0 +1,457 @@
/* 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/>.
*/
#include <stdint.h>
#include <stdio.h>
#include "cvg.h"
#include <glide.h>
#include "sst1init.h"
#include "fxpci.h"
#include "Utils.h"
#include "V2MemTest.h"
#include "FaultSources.h"
#include "Utils.h"
#include "Draw.h"
#include "Test_Control.h"
static void
WriteTex( FxU32 * const sst,
SstRegs * const sstregs,
const uint32_t baseAddr,
const char ucNumTMU,
const uint32_t Val1,
const uint32_t Val2)
{
/* set base mem @ */
ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, (baseAddr>>3));
/* set @ to first line, using bits 00..31*/
volatile const FxU32 *texAddrBlank
= (ucNumTMU<<(21-2))
+ (((FxU32)0)<<(17-2)) /*LOD0*/
+ (FxU32 *)SST_TEX_ADDRESS(sst);
/* write the value */
ISET(texAddrBlank[0], Val1);
/* set @ to second line, to use bits 32..63*/
volatile const FxU32 *texAddrBlank2
= (ucNumTMU<<(21-2))
+ (((FxU32)0)<<(17-2)) /*LOD0*/
+ (1<<(9-2))
+ (FxU32 *)SST_TEX_ADDRESS(sst);
/* write the value */
ISET(texAddrBlank2[0], Val2);
}
unsigned long
CheckRead( FxU32 * const sst,
SstRegs * const sstregs,
const uint32_t baseAddr,
const char ucNumTMU,
const unsigned char bNominal,
const uint32_t Val1,
const uint32_t Val2,
const uint32_t ValOther1,
const uint32_t ValOther2,
def_sFaultSourceScoreRec* const pFaultSrcCtx)
{
unsigned long NbErr=0;
const unsigned char nBank = (baseAddr<0x200000) ? 0 : 1;
const def_eFaultSource TMUTexWE = (ucNumTMU == 0) ? U9_TMU0_TEX_WE : U8_TMU1_TEX_WE;
const def_eFaultSource TMUTexCAS0 = (ucNumTMU == 0) ? U9_TMU0_TEX_CAS0 : U8_TMU1_TEX_CAS0;
const def_eFaultSource TMUTexCAS1 = (ucNumTMU == 0) ? U9_TMU0_TEX_CAS1 : U8_TMU1_TEX_CAS1;
const def_eFaultSource TMUTexCAS2 = (ucNumTMU == 0) ? U9_TMU0_TEX_CAS2 : U8_TMU1_TEX_CAS2;
const def_eFaultSource TMUTexCAS3 = (ucNumTMU == 0) ? U9_TMU0_TEX_CAS3 : U8_TMU1_TEX_CAS3;
const def_eFaultSource _TMUTexRAS0 = (ucNumTMU == 0) ? U9_TMU0_TEX_RAS0 : U8_TMU1_TEX_RAS0;
const def_eFaultSource _TMUTexRAS1 = (ucNumTMU == 0) ? U9_TMU0_TEX_RAS1 : U8_TMU1_TEX_RAS1;
const def_eFaultSource TMUTexRASCurrent = (nBank == 0) ? _TMUTexRAS0 : _TMUTexRAS1;
const def_eFaultSource _MEMChip_B0_0_CASL = (ucNumTMU == 0) ? U14_CASL : U13_CASL;
const def_eFaultSource _MEMChip_B0_1_CASL = (ucNumTMU == 0) ? U12_CASL : U11_CASL;
const def_eFaultSource _MEMChip_B0_2_CASL = (ucNumTMU == 0) ? U18_CASL : U16_CASL;
const def_eFaultSource _MEMChip_B0_3_CASL = (ucNumTMU == 0) ? U17_CASL : U15_CASL;
const def_eFaultSource _MEMChip_B1_0_CASL = (ucNumTMU == 0) ? U23_CASL : U27_CASL;
const def_eFaultSource _MEMChip_B1_1_CASL = (ucNumTMU == 0) ? U24_CASL : U28_CASL;
const def_eFaultSource _MEMChip_B1_2_CASL = (ucNumTMU == 0) ? U25_CASL : U29_CASL;
const def_eFaultSource _MEMChip_B1_3_CASL = (ucNumTMU == 0) ? U26_CASL : U30_CASL;
const def_eFaultSource MEMChip_0_CASL = (nBank == 0) ? _MEMChip_B0_0_CASL : _MEMChip_B1_0_CASL;
const def_eFaultSource MEMChip_1_CASL = (nBank == 0) ? _MEMChip_B0_1_CASL : _MEMChip_B1_1_CASL;
const def_eFaultSource MEMChip_2_CASL = (nBank == 0) ? _MEMChip_B0_2_CASL : _MEMChip_B1_2_CASL;
const def_eFaultSource MEMChip_3_CASL = (nBank == 0) ? _MEMChip_B0_3_CASL : _MEMChip_B1_3_CASL;
const def_eFaultSource _MEMChip_B0_0_CASH = (ucNumTMU == 0) ? U14_CASH : U13_CASH;
const def_eFaultSource _MEMChip_B0_1_CASH = (ucNumTMU == 0) ? U12_CASH : U11_CASH;
const def_eFaultSource _MEMChip_B0_2_CASH = (ucNumTMU == 0) ? U18_CASH : U16_CASH;
const def_eFaultSource _MEMChip_B0_3_CASH = (ucNumTMU == 0) ? U17_CASH : U15_CASH;
const def_eFaultSource _MEMChip_B1_0_CASH = (ucNumTMU == 0) ? U23_CASH : U27_CASH;
const def_eFaultSource _MEMChip_B1_1_CASH = (ucNumTMU == 0) ? U24_CASH : U28_CASH;
const def_eFaultSource _MEMChip_B1_2_CASH = (ucNumTMU == 0) ? U25_CASH : U29_CASH;
const def_eFaultSource _MEMChip_B1_3_CASH = (ucNumTMU == 0) ? U26_CASH : U30_CASH;
const def_eFaultSource MEMChip_0_CASH = (nBank == 0) ? _MEMChip_B0_0_CASH : _MEMChip_B1_0_CASH;
const def_eFaultSource MEMChip_1_CASH = (nBank == 0) ? _MEMChip_B0_1_CASH : _MEMChip_B1_1_CASH;
const def_eFaultSource MEMChip_2_CASH = (nBank == 0) ? _MEMChip_B0_2_CASH : _MEMChip_B1_2_CASH;
const def_eFaultSource MEMChip_3_CASH = (nBank == 0) ? _MEMChip_B0_3_CASH : _MEMChip_B1_3_CASH;
const def_eFaultSource _MEMChip_B0_0_RAS = (ucNumTMU == 0) ? U14_RAS : U13_RAS;
const def_eFaultSource _MEMChip_B0_1_RAS = (ucNumTMU == 0) ? U12_RAS : U11_RAS;
const def_eFaultSource _MEMChip_B0_2_RAS = (ucNumTMU == 0) ? U18_RAS : U16_RAS;
const def_eFaultSource _MEMChip_B0_3_RAS = (ucNumTMU == 0) ? U17_RAS : U15_RAS;
const def_eFaultSource _MEMChip_B1_0_RAS = (ucNumTMU == 0) ? U23_RAS : U27_RAS;
const def_eFaultSource _MEMChip_B1_1_RAS = (ucNumTMU == 0) ? U24_RAS : U28_RAS;
const def_eFaultSource _MEMChip_B1_2_RAS = (ucNumTMU == 0) ? U25_RAS : U29_RAS;
const def_eFaultSource _MEMChip_B1_3_RAS = (ucNumTMU == 0) ? U26_RAS : U30_RAS;
const def_eFaultSource MEMChip_0_RAS = (nBank == 0) ? _MEMChip_B0_0_RAS : _MEMChip_B1_0_RAS;
const def_eFaultSource MEMChip_1_RAS = (nBank == 0) ? _MEMChip_B0_1_RAS : _MEMChip_B1_1_RAS;
const def_eFaultSource MEMChip_2_RAS = (nBank == 0) ? _MEMChip_B0_2_RAS : _MEMChip_B1_2_RAS;
const def_eFaultSource MEMChip_3_RAS = (nBank == 0) ? _MEMChip_B0_3_RAS : _MEMChip_B1_3_RAS;
const def_eFaultSource _MEMChip_B0_0_WE = (ucNumTMU == 0) ? U14_WE : U13_WE;
const def_eFaultSource _MEMChip_B0_1_WE = (ucNumTMU == 0) ? U12_WE : U11_WE;
const def_eFaultSource _MEMChip_B0_2_WE = (ucNumTMU == 0) ? U18_WE : U16_WE;
const def_eFaultSource _MEMChip_B0_3_WE = (ucNumTMU == 0) ? U17_WE : U15_WE;
const def_eFaultSource _MEMChip_B1_0_WE = (ucNumTMU == 0) ? U23_WE : U27_WE;
const def_eFaultSource _MEMChip_B1_1_WE = (ucNumTMU == 0) ? U24_WE : U28_WE;
const def_eFaultSource _MEMChip_B1_2_WE = (ucNumTMU == 0) ? U25_WE : U29_WE;
const def_eFaultSource _MEMChip_B1_3_WE = (ucNumTMU == 0) ? U26_WE : U30_WE;
const def_eFaultSource MEMChip_0_WE = (nBank == 0) ? _MEMChip_B0_0_WE : _MEMChip_B1_0_WE;
const def_eFaultSource MEMChip_1_WE = (nBank == 0) ? _MEMChip_B0_1_WE : _MEMChip_B1_1_WE;
const def_eFaultSource MEMChip_2_WE = (nBank == 0) ? _MEMChip_B0_2_WE : _MEMChip_B1_2_WE;
const def_eFaultSource MEMChip_3_WE = (nBank == 0) ? _MEMChip_B0_3_WE : _MEMChip_B1_3_WE;
const def_eFaultSource _RES_RAS0 = (ucNumTMU == 0) ? R118 : R115;
const def_eFaultSource _RES_RAS1 = (ucNumTMU == 0) ? R149 : R150;
const def_eFaultSource RES_RAS = (nBank == 0) ? _RES_RAS0 : _RES_RAS1;
const def_eFaultSource RES_CAS = (ucNumTMU == 0) ? RA36 : RA32;
const def_eFaultSource RES_WE = (ucNumTMU == 0) ? R117 : R114;
clearScreen(sstregs,0x00000000,2,2);
/* set to mem addr */
ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, (baseAddr >> 3));
/* draw a 2x2 square */
drawSquare(sstregs, ucNumTMU, 0, 0, 2);
sst1InitIdle(sst);
/* first line, to use bits 00..31 */
const uint32_t L1 = IGET(sst[(SST_LFB_ADDR>>2) + 0]);
/* second line, to use bits 32..63 */
const uint32_t L2 = IGET(sst[(SST_LFB_ADDR>>2) + (2048>>2) + 0]);
const uint32_t ErrorMark_L1 = (L1 ^ Val1);
const uint32_t ErrorMark_L2 = (L2 ^ Val2);
const uint32_t ErrorMark_L1_Other = (L1 ^ ValOther1);
const uint32_t ErrorMark_L2_Other = (L2 ^ ValOther2);
if(count_bit32(ErrorMark_L1 & 0x0000FFFF) > 4)
{
NbErr++;
/* If we are reading the value of the other Bank
* then it has to be a bank select problem*/
if(!bNominal && count_bit32(ErrorMark_L1_Other & 0x0000FFFF) < 4)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_RAS, 2.0);
}
else
{
/* WE can fail only in case of plain failure */
if(count_bit32(ErrorMark_L1 & 0x0000FFFF) > 8)
{
/*WE are shared accross all memory chips so
* we divide the weight by 4.*/
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, RES_WE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_WE, 1.0);
}
unsigned char bLSBFailed = false;
unsigned char bMSBFailed = false;
if(count_bit32(ErrorMark_L1 & 0x000000FF) > 2)
{
/*CAS are shared accross multiple memory chips so
* we divide the weight by 2.*/
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS0, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+1, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_CASL, 1.0);
bLSBFailed = true;
}
if(count_bit32(ErrorMark_L1 & 0x0000FF00) > 2)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS1, 1.0/2);;
FaultSource_addScore(pFaultSrcCtx, RES_CAS+2, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_CASH, 1.0);
bMSBFailed = true;
}
/* RAS is declared failed only if both CAS failed */
if(bLSBFailed && bMSBFailed)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0);
FaultSource_addScore(pFaultSrcCtx, MEMChip_0_RAS, 4.0);
}
}
}
if(count_bit32(ErrorMark_L1 & 0xFFFF0000) > 4)
{
NbErr++;
if(!bNominal && count_bit32(ErrorMark_L1_Other & 0xFFFF0000) < 4)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_RAS, 2.0);
}
else
{
if(count_bit32(ErrorMark_L1 & 0xFFFF0000) > 8)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, RES_WE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_WE, 1.0);
}
unsigned char bLSBFailed = false;
unsigned char bMSBFailed = false;
if(count_bit32(ErrorMark_L1 & 0x00FF0000) > 2)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS0, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+1, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_CASL, 1.0);
bLSBFailed = true;
}
if(count_bit32(ErrorMark_L1 & 0xFF000000) > 2)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS1, 1.0/2);;
FaultSource_addScore(pFaultSrcCtx, RES_CAS+2, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_CASH, 1.0);
bMSBFailed = true;
}
if(bLSBFailed && bMSBFailed)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0);
FaultSource_addScore(pFaultSrcCtx, MEMChip_1_RAS, 4.0);
}
}
}
if(count_bit32(ErrorMark_L2 & 0x0000FFFF) > 4)
{
NbErr++;
if(!bNominal && count_bit32(ErrorMark_L2_Other & 0x0000FFFF) < 4)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_RAS, 2.0);
}
else
{
if(count_bit32(ErrorMark_L2 & 0x0000FFFF) > 8)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, RES_WE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_WE, 1.0);
}
unsigned char bLSBFailed = false;
unsigned char bMSBFailed = false;
if(count_bit32(ErrorMark_L2 & 0x000000FF) > 2)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS2, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+3, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_CASL, 1.0);
bLSBFailed = true;
}
if(count_bit32(ErrorMark_L2 & 0x0000FF00) > 2)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS3, 1.0/2);;
FaultSource_addScore(pFaultSrcCtx, RES_CAS+4, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_CASH, 1.0);
bMSBFailed = true;
}
if(bLSBFailed && bMSBFailed)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0);
FaultSource_addScore(pFaultSrcCtx, MEMChip_2_RAS, 4.0);
}
}
}
if(count_bit32(ErrorMark_L2 & 0xFFFF0000) > 4)
{
NbErr++;
if(!bNominal && count_bit32(ErrorMark_L2_Other & 0xFFFF0000) < 4)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_RAS, 2.0);
}
else
{
if(count_bit32(ErrorMark_L2 & 0xFFFF0000) > 8)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexWE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, RES_WE, 1.0/4);
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_WE, 1.0);
}
unsigned char bLSBFailed = false;
unsigned char bMSBFailed = false;
if(count_bit32(ErrorMark_L2 & 0x00FF0000) > 2)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS2, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, RES_CAS+3, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_CASL, 1.0);
bLSBFailed = true;
}
if(count_bit32(ErrorMark_L2 & 0xFF000000) > 2)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexCAS3, 1.0/2);;
FaultSource_addScore(pFaultSrcCtx, RES_CAS+4, 1.0/2);
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_CASH, 1.0);
bMSBFailed = true;
}
if(bLSBFailed && bMSBFailed)
{
FaultSource_addScore(pFaultSrcCtx, TMUTexRASCurrent, 1.0);
FaultSource_addScore(pFaultSrcCtx, RES_RAS, 1.0);
FaultSource_addScore(pFaultSrcCtx, MEMChip_3_RAS, 4.0);
}
}
}
return NbErr;
}
unsigned long
TestControl( sst1DeviceInfoStruct * const devInfo,
FxU32 * const sst,
SstRegs * const sstregs,
const char ucNumTMU,
const unsigned char RamSizeMB,
def_sFaultSourceScoreRec * const pFaultSrcCtx)
{
unsigned long NbErr=0;
sst1InitIdle(sst);
unsigned long _trexInit0 = IGET(SST_TREX(sstregs,ucNumTMU)->trexInit0);
devInfo->tmuInit0[(int)ucNumTMU] = SST_TREXINIT0_DEFAULT ;
ISET(SST_TREX(sstregs,ucNumTMU)->trexInit0, devInfo->tmuInit0[(int)ucNumTMU]);
sst1InitIdle(sst);
/* set downstream TMUs to passthrough */
for (int i=0; i<ucNumTMU; i++)
ISET(SST_TREX(sstregs,i)->textureMode, SST_TC_PASS | SST_TCA_PASS);
const uint32_t TestVal1 = get_notnull_random_balanced_mByte();
logT("TestVal1 = %08X\n",TestVal1);
uint32_t TestVal2 = 0;
do
{
TestVal2 = get_notnull_random_balanced_mByte();
}
while((count_bit32((TestVal2 ^ TestVal1)) < 12));
logT("TestVal2 = %08X\n",TestVal2);
uint32_t TestValBlank1 = 0;
do
{
TestValBlank1 = get_notnull_random_balanced_mByte();
}
while( (count_bit32((TestValBlank1 ^ TestVal1) & 0x0000FFFF) < 6)
|| (count_bit32((TestValBlank1 ^ TestVal1) & 0xFFFF0000) < 6)
|| (count_bit32((TestValBlank1 ^ TestVal2)) < 12));
logT("TestValBlank1 = %08X\n", TestValBlank1);
uint32_t TestValBlank2 = 0;
do
{
TestValBlank2 = get_notnull_random_balanced_mByte();
}
while( (count_bit32((TestValBlank2 ^ TestVal2) & 0x0000FFFF) < 6)
|| (count_bit32((TestValBlank2 ^ TestVal2) & 0xFFFF0000) < 6)
|| (count_bit32((TestValBlank2 ^ TestValBlank1)) < 12)
|| (count_bit32((TestValBlank2 ^ TestVal1)) < 12));
logT("TestValBlank2 = %08X\n", TestValBlank2);
/* write initial Values */
/* Bank 0*/
WriteTex(sst, sstregs, 0x000000, ucNumTMU, TestValBlank1, TestValBlank2);
/* Bank 1*/
if(RamSizeMB>2)
{
WriteTex(sst, sstregs, 0x200000, ucNumTMU, TestValBlank1, TestValBlank2);
}
/* write to Bank 0 */
WriteTex(sst, sstregs, 0x000000, ucNumTMU, TestVal1, TestVal2);
/* read and check Bank 0 (nominal check)*/
NbErr += CheckRead(sst, sstregs, 0x000000, ucNumTMU,
true, TestVal1, TestVal2, TestValBlank1, TestValBlank2, pFaultSrcCtx);
/* if Bank 1 available*/
if(RamSizeMB>2)
{
/* read and check Bank 1(no modification check)*/
NbErr += CheckRead(sst, sstregs, 0x200000, ucNumTMU,
false, TestValBlank1, TestValBlank2, TestVal1, TestVal2, pFaultSrcCtx);
/* write initial Values */
/* Bank 0*/
WriteTex(sst, sstregs, 0x000000, ucNumTMU, TestValBlank1, TestValBlank2);
/* Bank 1*/
if(RamSizeMB>2)
{
WriteTex(sst, sstregs, 0x200000, ucNumTMU, TestValBlank1, TestValBlank2);
}
/* write to Bank 1 */
WriteTex(sst, sstregs, 0x200000, ucNumTMU, TestVal1, TestVal2);
/* read and check Bank 1 (nominal check)*/
NbErr += CheckRead(sst, sstregs, 0x200000, ucNumTMU,
true, TestVal1, TestVal2, TestValBlank1, TestValBlank2, pFaultSrcCtx);
/* read and check Bank 0 (no modification check)*/
NbErr += CheckRead(sst, sstregs, 0x000000, ucNumTMU,
false, TestValBlank1, TestValBlank2, TestVal1, TestVal2, pFaultSrcCtx);
}
clearScreen(sstregs,0x00000000,2,2);
sst1InitIdle(sst);
devInfo->tmuInit0[(int)ucNumTMU] = _trexInit0;
ISET(SST_TREX(sst,ucNumTMU)->trexInit0, devInfo->tmuInit0[(int)ucNumTMU]);
sst1InitIdle(sst);
return NbErr;
}

29
Test_Control.h Normal file
View File

@@ -0,0 +1,29 @@
/* 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_CONTROL_H_
#define _DEF_TEST_CONTROL_H_
unsigned long
TestControl(sst1DeviceInfoStruct * const devInfo,
FxU32 * const sst,
SstRegs * const sstregs,
const char ucNumTMU,
const unsigned char RamSizeMB,
def_sFaultSourceScoreRec * const pFaultSrcCtx);
#endif //_DEF_TEST_CONTROL_H_

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#define _BSD_SOURCE 1 #define _BSD_SOURCE 1
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
@@ -33,13 +34,14 @@
#include "Test_Data.h" #include "Test_Data.h"
static unsigned long long static unsigned long long
RenderTest( sst1DeviceInfoStruct* devInfo, RenderTest( sst1DeviceInfoStruct * const devInfo,
FxU32* sst, FxU32 * const sst,
SstRegs *sstregs, SstRegs * const sstregs,
const char ucNumTMU, const char ucNumTMU,
const FxU32 mem, const FxU32 mem,
const FxU32 value1, const FxU32 value1,
const FxU32 value2, const FxU32 value2,
const unsigned char RamSizeMB,
def_sFaultSourceScoreRec* const pFaultSrcCtx) def_sFaultSourceScoreRec* const pFaultSrcCtx)
{ {
unsigned long long NbErr = 0; unsigned long long NbErr = 0;
@@ -51,7 +53,7 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
ISET(SST_TREX(sstregs,ucNumTMU)->trexInit0, devInfo->tmuInit0[(int)ucNumTMU]); ISET(SST_TREX(sstregs,ucNumTMU)->trexInit0, devInfo->tmuInit0[(int)ucNumTMU]);
sst1InitIdle(sst); sst1InitIdle(sst);
ISET(sstregs->texBaseAddr, mem>>3); ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, mem>>3);
/* Writing to first texture line, to use RAM bits 0..31 */ /* Writing to first texture line, to use RAM bits 0..31 */
volatile FxU32 *texAddr volatile FxU32 *texAddr
@@ -67,22 +69,16 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
clearScreen(sstregs,0x00000000,8,2); clearScreen(sstregs,0x00000000,8,2);
/* draw a 8x2 rectangle */ /* draw a 2x2 rectangle */
drawRect(sstregs,0,0,2,2); drawRect(sstregs, ucNumTMU, 0, 0, 2, 2);
sst1InitIdle(sst); sst1InitIdle(sst);
const double dScoreFront = (mem >= 0x200000) ? 1.0 / 2 : 1.0 / 1;
const double dScoreBack = (mem >= 0x200000) ? 1.0 / 1 : 1.0 / 2;
/* reading back first line pixels addresses */ /* reading back first line pixels addresses */
const uint32_t L1_1 = IGET(sst[(SST_LFB_ADDR >> 2) + 0]); const uint32_t L1_1 = IGET(sst[(SST_LFB_ADDR >> 2) + 0]);
/* reading back second line pixels addresses */
const uint32_t L2_1 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 0]);
const uint32_t ErrorMark_L1 = L1_1 ^ ( value1 + 0 ); 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) if(ErrorMark_L1)
{ {
NbErr++; NbErr++;
@@ -90,62 +86,35 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
logD( "# fault on 1st line, value : 0x%04X [expected 0x%04X] !\n", logD( "# fault on 1st line, value : 0x%04X [expected 0x%04X] !\n",
value1, L1_1); value1, L1_1);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L1, 1.0/2, U9_TMU0_TF_DATA_0);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 0, 1.0 / 16, RA10_1); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L1, 1.0/2, U3_FBI_TF_DATA_0);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 4, 1.0 / 16, RA11_1); RGBToBus_Fault_Quartets(pFaultSrcCtx, ErrorMark_L1, 1.0/2,
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L1 >> 8, 1.0 / 16, RA12_1); RA10_1, RA11_1, RA12_1, RA13_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) if(ucNumTMU == 0)
{ {
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L1, 1.0/ 2, U9_TMU0_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreFront, U14, U12); MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreFront, U14, U12);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreBack, U23, U24); if(RamSizeMB>2)
WordBitFaultSet(pFaultSrcCtx,ErrorMark_L1, 1.0 / 4, U9_TMU0 + 1, U9_TMU0 + 16 + 1); MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreBack, U23, U24);
LWordBitFaultSet(pFaultSrcCtx,ErrorMark_L1, 1.0 / 1, U9_TMU0 + 1, U9_TMU0 + 16 + 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);
} }
else else
{ {
/* during TMU1 test, TMU0 doesnt receive any textures => ignoring these /* during TMU1 test, TMU0 doesnt receive any textures => ignoring these
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 2, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L1, 1.0/2, U9_TMU0_FT_DATA_0);
*/ */
/* U9_TMU0_TT_DATA_x is only tested when using TMU1 */ /* U9_TMU0_TT_DATA_x is only tested when using TMU1 */
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U9_TMU0_TT_DATA_0, U9_TMU0_TT_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L1, 1.0/2, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L1, 1.0/2, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L1, 1.0/2, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L1, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L1, 1.0/2, U8_TMU1_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreFront, U13, U11); MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreFront, U13, U11);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreBack, U27, U28); if(RamSizeMB>2)
WordBitFaultSet(pFaultSrcCtx,ErrorMark_L1, 1.0 / 4, U8_TMU1 + 1, U8_TMU1 + 16 + 1); MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L1, dScoreBack, U27, U28);
LWordBitFaultSet(pFaultSrcCtx,ErrorMark_L1, 1.0 / 1, U8_TMU1 + 1, U8_TMU1 + 16 + 1);
TMUTexDataCtrlFaultSet( pFaultSrcCtx,
ErrorMark_L1,
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);
} }
logD("## overall fault LW bit-map : \n"); logD("## overall fault LW bit-map : \n");
if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG) if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG)
{ {
@@ -154,6 +123,9 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
} }
} }
/* reading back second line pixels addresses */
const uint32_t L2_1 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 0]);
const uint32_t ErrorMark_L2 = L2_1 ^ ( value2 + 0 );
if(ErrorMark_L2) if(ErrorMark_L2)
{ {
NbErr++; NbErr++;
@@ -161,55 +133,33 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
logD( "# fault on 2nd line, value : 0x%04X [expected 0x%04X] !\n", logD( "# fault on 2nd line, value : 0x%04X [expected 0x%04X] !\n",
value2, L2_1); value2, L2_1);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U9_TMU0_TF_DATA_0, U9_TMU0_TF_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L2, 1.0/2, U9_TMU0_TF_DATA_0);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 0, 1.0 / 16, RA10_1); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L2, 1.0/2, U3_FBI_TF_DATA_0);
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 4, 1.0 / 16, RA11_1); RGBToBus_Fault_Quartets(pFaultSrcCtx, ErrorMark_L2, 1.0/2,
QuartetBitFaultSet(pFaultSrcCtx, ErrorMark_L2 >> 8, 1.0 / 16, RA12_1); RA10_1, RA11_1, RA12_1, RA13_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) if(ucNumTMU == 0)
{ {
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U9_TMU0_FT_DATA_0, U9_TMU0_FT_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L2, 1.0/2, U9_TMU0_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreFront, U18, U17); MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreFront, U18, U17);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreBack, U25, U26); if(RamSizeMB>2)
WordBitFaultSet(pFaultSrcCtx,ErrorMark_L1, 1.0 / 4, U9_TMU0 + 32 + 1, U9_TMU0 + 48 + 1); MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreBack, U25, U26);
LWordBitFaultSet(pFaultSrcCtx,ErrorMark_L2, 1.0 / 1, 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 else
{ {
/* during TMU1 test, TMU0 doesnt receive any textures => ignoring these /* 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); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L2, 1.0/2, U9_TMU0_FT_DATA_0);
*/ */
/* U9_TMU0_TT_DATA_x is only tested when using TMU1 */ /* 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); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L2, 1.0/2, U9_TMU0_TT_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, TT_TDATA_R131, TT_TDATA_R131); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L2, 1.0/2, TT_TDATA_R131);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U8_TMU1_TF_DATA_0, U8_TMU1_TF_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L2, 1.0/2, U8_TMU1_TF_DATA_0);
WordBitFaultSet(pFaultSrcCtx, ErrorMark_L2, 1.0 / 16, U8_TMU1_FT_DATA_0, U8_TMU1_FT_DATA_0); RGBToBus_Fault(pFaultSrcCtx, ErrorMark_L2, 1.0/2, U8_TMU1_FT_DATA_0);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreFront, U16, U15); MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreFront, U16, U15);
MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreBack, U29, U30); if(RamSizeMB>2)
WordBitFaultSet(pFaultSrcCtx,ErrorMark_L2, 1.0 / 4, U8_TMU1 + 32 + 1, U8_TMU1 + 48 + 1); MemChipDQFaultSet(pFaultSrcCtx, ErrorMark_L2, dScoreBack, U29, U30);
LWordBitFaultSet(pFaultSrcCtx,ErrorMark_L2, 1.0 / 1, 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"); logD("## overall fault LW bit-map : \n");
if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG) if(sOptions.eLogLevel >= E_LOGLEVEL__DEBUG)
@@ -231,9 +181,9 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
} }
unsigned long long unsigned long long
test_TMU_datalines( sst1DeviceInfoStruct* devInfo, test_TMU_datalines( sst1DeviceInfoStruct * const devInfo,
FxU32* sst, FxU32 * const sst,
SstRegs *sstregs, SstRegs * const sstregs,
const unsigned char ucNumTMU, const unsigned char ucNumTMU,
const unsigned char bRandom, const unsigned char bRandom,
const unsigned char RamSizeMB, const unsigned char RamSizeMB,
@@ -276,7 +226,7 @@ test_TMU_datalines( sst1DeviceInfoStruct* devInfo,
if(RamSizeMB < 2 && pMemBlk->ulAddStart >= 0x100000) continue; if(RamSizeMB < 2 && pMemBlk->ulAddStart >= 0x100000) continue;
logD("Testing @ 0x%08x to 0x%08x ...\n", logT("Testing @ 0x%08x to 0x%08x ...\n",
pMemBlk->ulAddStart, pMemBlk->ulAddStart,
pMemBlk->ulAddStart + pMemBlk->ulAddLength -4); pMemBlk->ulAddStart + pMemBlk->ulAddLength -4);
@@ -298,6 +248,7 @@ test_TMU_datalines( sst1DeviceInfoStruct* devInfo,
addrTest, addrTest,
bitTest, bitTest,
bitTest2, bitTest2,
RamSizeMB,
pFaultSrcCtx); pFaultSrcCtx);
ullNbErrorAll += ulNbError; ullNbErrorAll += ulNbError;

View File

@@ -19,9 +19,9 @@
#define _DEF_TEST_DATA_H_ #define _DEF_TEST_DATA_H_
unsigned long long unsigned long long
test_TMU_datalines( sst1DeviceInfoStruct* devInfo, test_TMU_datalines( sst1DeviceInfoStruct * const devInfo,
FxU32* sst, FxU32 * const sst,
SstRegs *sstregs, SstRegs * const sstregs,
const unsigned char ucNumTMU, const unsigned char ucNumTMU,
const unsigned char bRandom, const unsigned char bRandom,
const unsigned char RamSizeMB, const unsigned char RamSizeMB,

View File

@@ -95,7 +95,7 @@ static const def_sFaultSheet sFaultSheet[MAX_TMU][2] =
.Ux_TMUx_TEXDATA_x_0 = U8_TMU1+1+0, .Ux_TMUx_TEXDATA_x_0 = U8_TMU1+1+0,
}, },
{ /*EVEN row*/ { /*EVEN row*/
.ucNumTMU = 2, .ucNumTMU = 1,
.bEvenRow = 1, .bEvenRow = 1,
.Ux_MEMChip_MainMSB = U15, .Ux_MEMChip_MainMSB = U15,
.Ux_MEMChip_MainLSB = U16, .Ux_MEMChip_MainLSB = U16,
@@ -110,20 +110,20 @@ static const def_sFaultSheet sFaultSheet[MAX_TMU][2] =
}; };
static void static void
AssignFault(const def_sFaultSheet* psCurFaultSheet, AssignFault(const def_sFaultSheet * const
psCurFaultSheet,
const FxU32 mem, const FxU32 mem,
const unsigned char bitIdx, const unsigned char bitIdx,
const unsigned char _relbitIdx, const unsigned char _relbitIdx,
const unsigned char _relbitIdxWord, const unsigned char _relbitIdxWord,
const unsigned char _relbitIdxQuartet, const unsigned char _relbitIdxQuartet,
const unsigned char WordIdx, const unsigned char WordIdx,
def_sFaultSourceScoreRec* const pFaultSrcCtx) const unsigned char RamSizeMB,
def_sFaultSourceScoreRec * const
pFaultSrcCtx)
{ {
//const unsigned char relbitIdxQuartet= bitIdx%4;
const unsigned char relbitIdxQuartet = _relbitIdxQuartet; const unsigned char relbitIdxQuartet = _relbitIdxQuartet;
//const unsigned char relbitIdx = bitIdx%8;
const unsigned char relbitIdx = _relbitIdx; const unsigned char relbitIdx = _relbitIdx;
//const unsigned char relbitIdxWord = bitIdx%16;
const unsigned char relbitIdxWord = _relbitIdxWord; const unsigned char relbitIdxWord = _relbitIdxWord;
static unsigned char nbErrLWord = 0; static unsigned char nbErrLWord = 0;
@@ -141,61 +141,90 @@ AssignFault(const def_sFaultSheet* psCurFaultSheet,
logD("## fault on LW bit: %d\n",bitIdx); logD("## fault on LW bit: %d\n",bitIdx);
/* We need to remap the faulty bit to the ARGB Bus, from the RGB565 Value.
* Based on this code:
* uint16_t u16Bus_r8 = ((u16pix1>>11) & 0x1F) << 3;
* uint16_t u16Bus_g8 = ((u16pix1>>5) & 0x3F) << 2;
* uint16_t u16Bus_b8 = ((u16pix1>>0) & 0x1F) << 3;
* uint16_t u16Bus_a8 = 0;
*
* //uint16_t u16Fault_W1 = (u16Bus_g8<<8) + u16Bus_b8;
* //uint16_t u16Fault_W2 = (u16Bus_a8<<8) + u16Bus_r8;
*
*/
uint8_t ARGBrelbitIdx;
double dARGBScore = 1.0/4.0;
if(relbitIdxWord>=11) //RED
{
ARGBrelbitIdx = relbitIdxWord -11 +3;
//There is no Alpha channel so score shouldnt be divided by 2
}
else if(relbitIdxWord>=5) //GREEN
{
ARGBrelbitIdx = relbitIdxWord -5 +2 +8;
dARGBScore /= 2;
}
else //BLUE
{
ARGBrelbitIdx = relbitIdxWord +3;
dARGBScore /= 2;
}
logD("## ARGB Bus bit: %d\n",ARGBrelbitIdx);
logD("- TMU : %s\n",pFaultSrcCtx[psCurFaultSheet->Ux_TMU].szName); logD("- TMU : %s\n",pFaultSrcCtx[psCurFaultSheet->Ux_TMU].szName);
/* Texture Source path, FBI to TMUx*/ /* Texture Source path, FBI to TMUx*/
FaultSource_addScore( pFaultSrcCtx, FaultSource_addScore( pFaultSrcCtx,
psCurFaultSheet->Ux_TMU psCurFaultSheet->Ux_TMU
+ 81 //Ux_TMUx_FT_DATA_x + 81 //Ux_TMUx_FT_DATA_x
+ relbitIdxWord, + ARGBrelbitIdx,
1.0/4); dARGBScore);
/* Output path, TMU0 to FBI*/ /* Output path, TMU0 to FBI*/
FaultSource_addScore( pFaultSrcCtx, FaultSource_addScore( pFaultSrcCtx,
U9_TMU0 U9_TMU0
+ 97 //U9_TMU0_TF_DATA_x + 97 //U9_TMU0_TF_DATA_x
+ relbitIdxWord, + ARGBrelbitIdx,
1.0/4); dARGBScore);
switch(WordIdx)
FaultSource_addScore( pFaultSrcCtx,
U3_FBI_TF_DATA_0
+ ARGBrelbitIdx,
dARGBScore);
if(ARGBrelbitIdx>=12)
{ {
case 0: logD("- RA13_x : %s\n",pFaultSrcCtx[RA13_1+ARGBrelbitIdx-12].szName);
case 2: FaultSource_addScore( pFaultSrcCtx,
if(relbitIdx<=3) RA13_1
{ + ARGBrelbitIdx -12,
logD("- RA1x_x : %s\n",pFaultSrcCtx[RA10_1+relbitIdxQuartet].szName); dARGBScore);
FaultSource_addScore( pFaultSrcCtx, }
RA10_1 else if(ARGBrelbitIdx>=8)
+ relbitIdxQuartet, {
1.0/8); logD("- RA12_x : %s\n",pFaultSrcCtx[RA12_1+ARGBrelbitIdx-8].szName);
} FaultSource_addScore( pFaultSrcCtx,
else RA12_1
{ + ARGBrelbitIdx -8,
logD("- RA1x_x : %s\n",pFaultSrcCtx[RA11_1+relbitIdxQuartet].szName); dARGBScore);
FaultSource_addScore( pFaultSrcCtx, }
RA11_1 else if(ARGBrelbitIdx>=4)
+ relbitIdxQuartet, {
1.0/8); logD("- RA11_x : %s\n",pFaultSrcCtx[RA11_1+ARGBrelbitIdx-4].szName);
} FaultSource_addScore( pFaultSrcCtx,
break; RA11_1
case 1: + ARGBrelbitIdx -4,
case 3: dARGBScore);
if(relbitIdx<=3) }
{ else
logD("- RA1x_x : %s\n",pFaultSrcCtx[RA12_1+relbitIdxQuartet].szName); {
FaultSource_addScore( pFaultSrcCtx, logD("- RA10_x : %s\n",pFaultSrcCtx[RA10_1+ARGBrelbitIdx].szName);
RA12_1 FaultSource_addScore( pFaultSrcCtx,
+ relbitIdxQuartet, RA10_1
1.0/8); + ARGBrelbitIdx,
} dARGBScore);
else
{
logD("- RA1x_x : %s\n",pFaultSrcCtx[RA13_1+relbitIdxQuartet].szName);
FaultSource_addScore( pFaultSrcCtx,
RA13_1
+ relbitIdxQuartet,
1.0/8);
}
break;
} }
/* Transfert path, TMU1 to TMU0*/ /* Transfert path, TMU1 to TMU0*/
@@ -205,21 +234,21 @@ AssignFault(const def_sFaultSheet* psCurFaultSheet,
FaultSource_addScore( pFaultSrcCtx, FaultSource_addScore( pFaultSrcCtx,
U8_TMU1 U8_TMU1
+ 97 //U8_TMU1_TF_DATA_x + 97 //U8_TMU1_TF_DATA_x
+ relbitIdxWord, + ARGBrelbitIdx,
1.0/4); dARGBScore);
/* line adaptation resistors */ /* line adaptation resistors */
FaultSource_addScore( pFaultSrcCtx, FaultSource_addScore( pFaultSrcCtx,
TT_TDATA_R131 TT_TDATA_R131
+ 0 + 0
+ relbitIdxWord, + ARGBrelbitIdx,
1.0/4); dARGBScore);
/* TMU0 input */ /* TMU0 input */
/* Note: U9_TMU0_TT_DATA_x is only tested when using TMU1 */ /* Note: U9_TMU0_TT_DATA_x is only tested when using TMU1 */
FaultSource_addScore( pFaultSrcCtx, FaultSource_addScore( pFaultSrcCtx,
U9_TMU0 U9_TMU0
+ 65 //U9_TMU0_TT_DATA_x + 65 //U9_TMU0_TT_DATA_x
+ relbitIdxWord, + ARGBrelbitIdx,
1.0/4); dARGBScore);
} }
if(WordIdx>=2) if(WordIdx>=2)
@@ -234,11 +263,12 @@ AssignFault(const def_sFaultSheet* psCurFaultSheet,
+ 1 + 1
+ relbitIdxWord, + relbitIdxWord,
1.0/2); //ok 1.0/2); //ok
FaultSource_addScore( pFaultSrcCtx, if(RamSizeMB>2)
psCurFaultSheet->Ux_MEMChip_AltMSB FaultSource_addScore( pFaultSrcCtx,
+ 1 psCurFaultSheet->Ux_MEMChip_AltMSB
+ relbitIdxWord, + 1
1.0/4); + relbitIdxWord,
1.0/4);
} }
else else
{ {
@@ -251,11 +281,12 @@ AssignFault(const def_sFaultSheet* psCurFaultSheet,
+ 1 + 1
+ relbitIdxWord, + relbitIdxWord,
1.0/2); 1.0/2);
FaultSource_addScore( pFaultSrcCtx, if(RamSizeMB>2)
psCurFaultSheet->Ux_MEMChip_AltLSB FaultSource_addScore( pFaultSrcCtx,
+ 1 psCurFaultSheet->Ux_MEMChip_AltLSB
+ relbitIdxWord, + 1
1.0/4); + relbitIdxWord,
1.0/4);
} }
logD( "- TMUx_TEXDATA_x_x : %s\n", logD( "- TMUx_TEXDATA_x_x : %s\n",
@@ -265,7 +296,7 @@ AssignFault(const def_sFaultSheet* psCurFaultSheet,
+ bitIdx, + bitIdx,
1.0/2); 1.0/2);
if((relbitIdxWord==15) && (nbErrWord>16)) if((relbitIdxWord==15) && (nbErrWord>8))
{ {
logD("- too many errors on this Word, suspecting CAS/RAS/WE.\n"); logD("- too many errors on this Word, suspecting CAS/RAS/WE.\n");
switch(WordIdx) switch(WordIdx)
@@ -306,12 +337,15 @@ AssignFault(const def_sFaultSheet* psCurFaultSheet,
} }
static unsigned long long static unsigned long long
RenderTest( sst1DeviceInfoStruct* devInfo, RenderTest( sst1DeviceInfoStruct * const
FxU32* sst, devInfo,
SstRegs *sstregs, FxU32 * const sst,
const char ucNumTMU, SstRegs * const sstregs,
const FxU32 mem, const char ucNumTMU,
def_sFaultSourceScoreRec* const pFaultSrcCtx) const FxU32 mem,
const unsigned char RamSizeMB,
def_sFaultSourceScoreRec * const
pFaultSrcCtx)
{ {
unsigned long long NbErr = 0; unsigned long long NbErr = 0;
static char szBuff[1024]; static char szBuff[1024];
@@ -340,7 +374,7 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
/* Setting texture base address window for both CPU and TMU /* Setting texture base address window for both CPU and TMU
*/ */
ISET(sstregs->texBaseAddr, (mem>>3)); ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, (mem>>3));
/* Setting texture base address (to access it from CPU). /* Setting texture base address (to access it from CPU).
* We wont draw anything bigger than the texture so we can just use LOD0 * We wont draw anything bigger than the texture so we can just use LOD0
@@ -389,7 +423,7 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
#endif #endif
/* draw a 256x256 square */ /* draw a 256x256 square */
drawSquare(sstregs, 0, 0, 256); drawSquare(sstregs, ucNumTMU, 0, 0, 256);
sst1InitIdle(sst); sst1InitIdle(sst);
#ifdef _PROFILING #ifdef _PROFILING
@@ -479,34 +513,34 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
if(ErrorMark_Lx & 0x0000000Fu) if(ErrorMark_Lx & 0x0000000Fu)
{ {
/*All calls have a lot of pre-computed const values to fast things up.*/ /*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 & 0x00000001u) AssignFault(psCurFaultSheet,mem,0,0,0,0,0,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000002u) AssignFault(psCurFaultSheet,mem,1,1,1,1,0,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000002u) AssignFault(psCurFaultSheet,mem,1,1,1,1,0,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000004u) AssignFault(psCurFaultSheet,mem,2,2,2,2,0,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000004u) AssignFault(psCurFaultSheet,mem,2,2,2,2,0,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000008u) AssignFault(psCurFaultSheet,mem,3,3,3,3,0,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000008u) AssignFault(psCurFaultSheet,mem,3,3,3,3,0,RamSizeMB,pFaultSrcCtx);
} }
if(ErrorMark_Lx & 0x000000F0u) if(ErrorMark_Lx & 0x000000F0u)
{ {
if(ErrorMark_Lx & 0x00000010u) AssignFault(psCurFaultSheet,mem,4,4,4,0,0,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000010u) AssignFault(psCurFaultSheet,mem,4,4,4,0,0,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000020u) AssignFault(psCurFaultSheet,mem,5,5,5,1,0,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000020u) AssignFault(psCurFaultSheet,mem,5,5,5,1,0,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000040u) AssignFault(psCurFaultSheet,mem,6,6,6,2,0,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000040u) AssignFault(psCurFaultSheet,mem,6,6,6,2,0,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000080u) AssignFault(psCurFaultSheet,mem,7,7,7,3,0,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000080u) AssignFault(psCurFaultSheet,mem,7,7,7,3,0,RamSizeMB,pFaultSrcCtx);
} }
} }
if(ErrorMark_Lx & 0x0000FF00u) if(ErrorMark_Lx & 0x0000FF00u)
{ {
if(ErrorMark_Lx & 0x00000F00u) if(ErrorMark_Lx & 0x00000F00u)
{ {
if(ErrorMark_Lx & 0x00000100u) AssignFault(psCurFaultSheet,mem,8,0, 8, 0,1,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000100u) AssignFault(psCurFaultSheet,mem,8,0, 8, 0,1,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000200u) AssignFault(psCurFaultSheet,mem,9,1, 9, 1,1,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000200u) AssignFault(psCurFaultSheet,mem,9,1, 9, 1,1,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000400u) AssignFault(psCurFaultSheet,mem,10,2,10,2,1,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000400u) AssignFault(psCurFaultSheet,mem,10,2,10,2,1,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00000800u) AssignFault(psCurFaultSheet,mem,11,3,11,3,1,pFaultSrcCtx); if(ErrorMark_Lx & 0x00000800u) AssignFault(psCurFaultSheet,mem,11,3,11,3,1,RamSizeMB,pFaultSrcCtx);
} }
if(ErrorMark_Lx & 0x0000F000u) if(ErrorMark_Lx & 0x0000F000u)
{ {
if(ErrorMark_Lx & 0x00001000u) AssignFault(psCurFaultSheet,mem,12,4,12,0,1,pFaultSrcCtx); if(ErrorMark_Lx & 0x00001000u) AssignFault(psCurFaultSheet,mem,12,4,12,0,1,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00002000u) AssignFault(psCurFaultSheet,mem,13,5,13,1,1,pFaultSrcCtx); if(ErrorMark_Lx & 0x00002000u) AssignFault(psCurFaultSheet,mem,13,5,13,1,1,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00004000u) AssignFault(psCurFaultSheet,mem,14,6,14,2,1,pFaultSrcCtx); if(ErrorMark_Lx & 0x00004000u) AssignFault(psCurFaultSheet,mem,14,6,14,2,1,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00008000u) AssignFault(psCurFaultSheet,mem,15,7,15,3,1,pFaultSrcCtx); if(ErrorMark_Lx & 0x00008000u) AssignFault(psCurFaultSheet,mem,15,7,15,3,1,RamSizeMB,pFaultSrcCtx);
} }
} }
} }
@@ -521,34 +555,34 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
{ {
if(ErrorMark_Lx & 0x000F0000u) if(ErrorMark_Lx & 0x000F0000u)
{ {
if(ErrorMark_Lx & 0x00010000u) AssignFault(psCurFaultSheet,mem,16,0,0,0,2,pFaultSrcCtx); if(ErrorMark_Lx & 0x00010000u) AssignFault(psCurFaultSheet,mem,16,0,0,0,2,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00020000u) AssignFault(psCurFaultSheet,mem,17,1,1,1,2,pFaultSrcCtx); if(ErrorMark_Lx & 0x00020000u) AssignFault(psCurFaultSheet,mem,17,1,1,1,2,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00040000u) AssignFault(psCurFaultSheet,mem,18,2,2,2,2,pFaultSrcCtx); if(ErrorMark_Lx & 0x00040000u) AssignFault(psCurFaultSheet,mem,18,2,2,2,2,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00080000u) AssignFault(psCurFaultSheet,mem,19,3,3,3,2,pFaultSrcCtx); if(ErrorMark_Lx & 0x00080000u) AssignFault(psCurFaultSheet,mem,19,3,3,3,2,RamSizeMB,pFaultSrcCtx);
} }
if(ErrorMark_Lx & 0x00F00000u) if(ErrorMark_Lx & 0x00F00000u)
{ {
if(ErrorMark_Lx & 0x00100000u) AssignFault(psCurFaultSheet,mem,20,4,4,0,2,pFaultSrcCtx); if(ErrorMark_Lx & 0x00100000u) AssignFault(psCurFaultSheet,mem,20,4,4,0,2,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00200000u) AssignFault(psCurFaultSheet,mem,21,5,5,1,2,pFaultSrcCtx); if(ErrorMark_Lx & 0x00200000u) AssignFault(psCurFaultSheet,mem,21,5,5,1,2,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00400000u) AssignFault(psCurFaultSheet,mem,22,6,6,2,2,pFaultSrcCtx); if(ErrorMark_Lx & 0x00400000u) AssignFault(psCurFaultSheet,mem,22,6,6,2,2,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x00800000u) AssignFault(psCurFaultSheet,mem,23,7,7,3,2,pFaultSrcCtx); if(ErrorMark_Lx & 0x00800000u) AssignFault(psCurFaultSheet,mem,23,7,7,3,2,RamSizeMB,pFaultSrcCtx);
} }
} }
if(ErrorMark_Lx & 0xFF000000u) if(ErrorMark_Lx & 0xFF000000u)
{ {
if(ErrorMark_Lx & 0x0F000000u) if(ErrorMark_Lx & 0x0F000000u)
{ {
if(ErrorMark_Lx & 0x01000000u) AssignFault(psCurFaultSheet,mem,24,0,8, 0,3,pFaultSrcCtx); if(ErrorMark_Lx & 0x01000000u) AssignFault(psCurFaultSheet,mem,24,0,8, 0,3,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x02000000u) AssignFault(psCurFaultSheet,mem,25,1,9, 1,3,pFaultSrcCtx); if(ErrorMark_Lx & 0x02000000u) AssignFault(psCurFaultSheet,mem,25,1,9, 1,3,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x04000000u) AssignFault(psCurFaultSheet,mem,26,2,10,2,3,pFaultSrcCtx); if(ErrorMark_Lx & 0x04000000u) AssignFault(psCurFaultSheet,mem,26,2,10,2,3,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x08000000u) AssignFault(psCurFaultSheet,mem,27,3,11,3,3,pFaultSrcCtx); if(ErrorMark_Lx & 0x08000000u) AssignFault(psCurFaultSheet,mem,27,3,11,3,3,RamSizeMB,pFaultSrcCtx);
} }
if(ErrorMark_Lx & 0xF0000000u) if(ErrorMark_Lx & 0xF0000000u)
{ {
if(ErrorMark_Lx & 0x10000000u) AssignFault(psCurFaultSheet,mem,28,4,12,0,3,pFaultSrcCtx); if(ErrorMark_Lx & 0x10000000u) AssignFault(psCurFaultSheet,mem,28,4,12,0,3,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x20000000u) AssignFault(psCurFaultSheet,mem,29,5,13,1,3,pFaultSrcCtx); if(ErrorMark_Lx & 0x20000000u) AssignFault(psCurFaultSheet,mem,29,5,13,1,3,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x40000000u) AssignFault(psCurFaultSheet,mem,30,6,14,2,3,pFaultSrcCtx); if(ErrorMark_Lx & 0x40000000u) AssignFault(psCurFaultSheet,mem,30,6,14,2,3,RamSizeMB,pFaultSrcCtx);
if(ErrorMark_Lx & 0x80000000u) AssignFault(psCurFaultSheet,mem,31,7,15,3,3,pFaultSrcCtx); if(ErrorMark_Lx & 0x80000000u) AssignFault(psCurFaultSheet,mem,31,7,15,3,3,RamSizeMB,pFaultSrcCtx);
} }
} }
} }
@@ -569,13 +603,18 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
} }
#ifdef _PROFILING #ifdef _PROFILING
clock_t end = clock(); clock_t end = clock();
logI("time to create: %f\n",(double)(after_create-begin)/CLOCKS_PER_SEC); logI("time to create: %f\n",
logI("time to write: %f\n",(double)(after_write-after_create)/CLOCKS_PER_SEC); (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++) for(unsigned int i = 0; i<_NB_CHECK_LOOP; i++)
{ {
logI("time to draw [%d]: %f\n",i,(double)(after_draw[i]-before_draw[i])/CLOCKS_PER_SEC); logI("time to draw [%d]: %f\n",
logI("time to read [%d]: %f\n",i,(double)(after_read[i]-after_draw[i])/CLOCKS_PER_SEC); i, (double)(after_draw[i]-before_draw[i])/CLOCKS_PER_SEC);
logI("time to check [%d]: %f\n",i,(double)(after_check[i]-after_read[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);
} }
logI("overall: %f\n",(double)(end-begin)/CLOCKS_PER_SEC); logI("overall: %f\n",(double)(end-begin)/CLOCKS_PER_SEC);
#endif #endif
@@ -584,12 +623,14 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
} }
unsigned long long unsigned long long
test_TMU_datalines_Huge( sst1DeviceInfoStruct* devInfo, test_TMU_datalines_Huge( sst1DeviceInfoStruct * const
FxU32* sst, devInfo,
SstRegs *sstregs, FxU32 * const sst,
SstRegs * const sstregs,
const unsigned char ucNumTMU, const unsigned char ucNumTMU,
const unsigned char RamSizeMB, const unsigned char RamSizeMB,
def_sFaultSourceScoreRec* const pFaultSrcCtx) def_sFaultSourceScoreRec * const
pFaultSrcCtx)
{ {
typedef struct _def_sMemBlock{ typedef struct _def_sMemBlock{
uint32_t ulAddStart; uint32_t ulAddStart;
@@ -638,13 +679,14 @@ test_TMU_datalines_Huge( sst1DeviceInfoStruct* devInfo,
addrTest < (pMemBlk->ulAddStart + pMemBlk->ulAddLength); addrTest < (pMemBlk->ulAddStart + pMemBlk->ulAddLength);
addrTest += 131072) /* 256x256x2 (16bit pixels texture) */ addrTest += 131072) /* 256x256x2 (16bit pixels texture) */
{ {
logD("Testing memory block 0x%08x ...\n", addrTest); logT("Testing memory block 0x%08x ...\n", addrTest);
const unsigned long long const unsigned long long
ullNbError = RenderTest( devInfo, ullNbError = RenderTest( devInfo,
sst, sst,
sstregs, sstregs,
ucNumTMU, ucNumTMU,
addrTest, addrTest,
RamSizeMB,
pFaultSrcCtx); pFaultSrcCtx);
ullNbErrorAll += ullNbError; ullNbErrorAll += ullNbError;
if(ullNbError) if(ullNbError)
@@ -655,7 +697,7 @@ test_TMU_datalines_Huge( sst1DeviceInfoStruct* devInfo,
} }
} }
clearScreen(sstregs,0x00000000,256,256); clearScreen(sstregs, 0x00000000, 256, 256);
/* reset the Init0 register back to its previous value */ /* reset the Init0 register back to its previous value */
sst1InitIdle(sst); sst1InitIdle(sst);

View File

@@ -19,9 +19,9 @@
#define _DEF_TEST_DATA_HUGE_H_ #define _DEF_TEST_DATA_HUGE_H_
unsigned long long unsigned long long
test_TMU_datalines_Huge( sst1DeviceInfoStruct* devInfo, test_TMU_datalines_Huge( sst1DeviceInfoStruct * const devInfo,
FxU32* sst, FxU32 * const sst,
SstRegs *sstregs, SstRegs * const sstregs,
const unsigned char ucNumTMU, const unsigned char ucNumTMU,
const unsigned char RamSizeMB, const unsigned char RamSizeMB,
def_sFaultSourceScoreRec* const pFaultSrcCtx); def_sFaultSourceScoreRec* const pFaultSrcCtx);

659
Test_Data_NoMem.c Normal file
View File

@@ -0,0 +1,659 @@
/* 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 <math.h>
#include "cvg.h"
#include <glide.h>
#include "sst1init.h"
#include "fxpci.h"
#include "FaultSources.h"
#include "Utils.h"
#include "Draw.h"
#include "Test_Common.h"
#include "Test_Data_Huge.h"
#include "Test_Data_NoMem.h"
extern const def_sTestPattern ar_sExpectedPattern_Test3[];
extern const unsigned int uNbPattern_Test3;
extern const def_sTestPattern ar_sExpectedPattern_Test3_Dither[];
extern const unsigned int uNbPattern_Test3_Dither;
extern const def_sFaultSourceLineMap ar_sFaultSourceLineMap[];
void DisplayPattern(const def_sTestPattern * const pREF)
{
printf("RGB: %04X %04X %04X %04X\n",
pREF->data.access.u16Pix[0][0],
pREF->data.access.u16Pix[0][1],
pREF->data.access.u16Pix[0][2],
pREF->data.access.u16Pix[0][3]);
printf("RGB: %04X %04X %04X %04X\n",
pREF->data.access.u16Pix[1][0],
pREF->data.access.u16Pix[1][1],
pREF->data.access.u16Pix[1][2],
pREF->data.access.u16Pix[1][3]);
printf("RGB: %04X %04X %04X %04X\n",
pREF->data.access.u16Pix[2][0],
pREF->data.access.u16Pix[2][1],
pREF->data.access.u16Pix[2][2],
pREF->data.access.u16Pix[2][3]);
printf("RGB: %04X %04X %04X %04X\n",
pREF->data.access.u16Pix[3][0],
pREF->data.access.u16Pix[3][1],
pREF->data.access.u16Pix[3][2],
pREF->data.access.u16Pix[3][3]);
printf("Alpha: %02X %02X %02X %02X\n",
pREF->data.access.u8APix[0][0],
pREF->data.access.u8APix[0][1],
pREF->data.access.u8APix[0][2],
pREF->data.access.u8APix[0][3]);
printf("Alpha: %02X %02X %02X %02X\n",
pREF->data.access.u8APix[1][0],
pREF->data.access.u8APix[1][1],
pREF->data.access.u8APix[1][2],
pREF->data.access.u8APix[1][3]);
printf("Alpha: %02X %02X %02X %02X\n",
pREF->data.access.u8APix[2][0],
pREF->data.access.u8APix[2][1],
pREF->data.access.u8APix[2][2],
pREF->data.access.u8APix[2][3]);
printf("Alpha: %02X %02X %02X %02X\n",
pREF->data.access.u8APix[3][0],
pREF->data.access.u8APix[3][1],
pREF->data.access.u8APix[3][2],
pREF->data.access.u8APix[3][3]);
}
// Returns the distance between A & B, normalized between 0 and 1.
// 0 means they are perfectly identicals.
// 1 means they are entirely diferents.
double ComputePatternDistance( const def_sTestPattern * const pA,
const def_sTestPattern * const pB)
{
double dDistance = 0;
logT("========================\n");
logT("Compare A|B:\n");
for (unsigned int i = 0; i <12; i=i+4)
{
logT("%08X\t%08X\n",pA->data.raw[i],pB->data.raw[i]);
logT("%08X\t%08X\n",pA->data.raw[i+1],pB->data.raw[i+1]);
logT("%08X\t%08X\n",pA->data.raw[i+2],pB->data.raw[i+2]);
logT("%08X\t%08X\n",pA->data.raw[i+3],pB->data.raw[i+3]);
dDistance += dComputeDistance32(pA->data.raw[i], pB->data.raw[i]);
dDistance += dComputeDistance32(pA->data.raw[i+1],pB->data.raw[i+1]);
dDistance += dComputeDistance32(pA->data.raw[i+2],pB->data.raw[i+2]);
dDistance += dComputeDistance32(pA->data.raw[i+3],pB->data.raw[i+3]);
}
dDistance /= 12*4*32;
logT("dDistance: %f\n",dDistance);
return dDistance;
}
typedef struct _def_sScoreSet{
double dScore;
const def_sTestPattern * pREF;
}def_sScoreSet;
int scoreSetCmp(const void * const first, const void * const second)
{
const double scoreFirst = ((def_sScoreSet*)first)->dScore;
const double scoreSecond = ((def_sScoreSet*)second)->dScore;
return scoreFirst > scoreSecond ? -1 :
(scoreFirst < scoreSecond ? 1 : 0);
}
double inline ScaleScore(const double dIn,const double dK)
{
return (1.0-exp(-dK*dIn))/(1.0-exp(-dK));
//return log(1.0+(dK*dIn))/log(1.0+dK);
}
/* returns a def_sScoreSet array, containing ordered reference to testPattern
* plus the corresponding score.
*/
void GetNearestIndexes( const def_sTestPattern * const pREF,
const def_sTestPattern * const pSet,
def_sScoreSet * const ScoreSet,
const unsigned int uNbPattern)
{
for (unsigned int i = 0; i < uNbPattern; i++)
{
ScoreSet[i].pREF = &pSet[i];
ScoreSet[i].dScore = (1 - ScaleScore(ComputePatternDistance(pREF,pSet+i),100));
logT("ScoreSet[%d].dScore = %f\n",i,ScoreSet[i].dScore);
}
qsort(ScoreSet,uNbPattern,sizeof(def_sScoreSet),scoreSetCmp);
double dFirstScore = -INFINITY;
for (unsigned int i = 0; i < uNbPattern; i++)
{
if(i==0)
dFirstScore = ScoreSet[i].dScore;
ScoreSet[i].dScore = (ScoreSet[i].dScore / dFirstScore) * 100;
}
}
unsigned char DistributeFaults( const def_sTestPattern * const pREF,
const def_sTestPattern * const pREFPatterns,
const unsigned int uNbREFPatterns,
const unsigned char ucNumTMU,
def_sFaultSourceScoreRec* const pFaultSrcCtx)
{
def_sScoreSet * const ScoreSet
= (def_sScoreSet*)malloc(uNbREFPatterns*sizeof(def_sScoreSet));
if(ScoreSet==NULL)
{
logE("Cannot allocate memory...");
return 1;
}
GetNearestIndexes(pREF,pREFPatterns,ScoreSet,uNbREFPatterns);
for( int i = 0 ; i < uNbREFPatterns ; i++)
{
if( ScoreSet[i].pREF->bReferenceSet && ScoreSet[i].dScore==100)
{
//logD("No Fault found\n");
free(ScoreSet);
return 0;
}
}
logD("==========================\n");
logD("Read:\n");
if( sOptions.eLogLevel >= E_LOGLEVEL__DEBUG)
DisplayPattern(pREF);
for( int i = 0 ; i < uNbREFPatterns ; i++)
{
logD("==========================\n");
if((!ScoreSet[i].pREF->bReferenceSet) && (ScoreSet[i].dScore>=80))
{
logD( "%d Score = %f\n",
ScoreSet[i].pREF->u8FaultLineIdx,ScoreSet[i].dScore);
FaultSource_addScore( pFaultSrcCtx,
ar_sFaultSourceLineMap
[ScoreSet[i].pREF->u8FaultLineIdx]
.eTMUFaultSource_TMU0_RES,
ScoreSet[i].dScore);
FaultSource_addScore( pFaultSrcCtx,
ar_sFaultSourceLineMap
[ScoreSet[i].pREF->u8FaultLineIdx]
.eTMUFaultSource_FBI,
ScoreSet[i].dScore);
FaultSource_addScore( pFaultSrcCtx,
ar_sFaultSourceLineMap
[ScoreSet[i].pREF->u8FaultLineIdx]
.eTMUFaultSource_TMU0_FBI,
ScoreSet[i].dScore);
if(ucNumTMU==1)
{
FaultSource_addScore( pFaultSrcCtx,
ar_sFaultSourceLineMap
[ScoreSet[i].pREF->u8FaultLineIdx]
.eTMUFaultSource_TMU0_TMU1,
ScoreSet[i].dScore);
FaultSource_addScore( pFaultSrcCtx,
ar_sFaultSourceLineMap
[ScoreSet[i].pREF->u8FaultLineIdx]
.eTMUFaultSource_TMU1,
ScoreSet[i].dScore);
}
}
}
free(ScoreSet);
return 1;
}
void TestStep_NoMem(FxU32 * const sst,
SstRegs * const sstregs,
const unsigned char ucNumTMU,
const uint8_t bEnableRGB,
const uint8_t bEnbleAlpha,
const uint8_t bEnableDitherValues,
def_sTestPattern * const psResultPattern)
{
ISET(SST_TREX(sstregs,ucNumTMU)->texBaseAddr, (0x000000>>3));
volatile const FxU32 * const pLFB1 = sst + (SST_LFB_ADDR>>2);
volatile const FxU32 * const pLFB2 = pLFB1 +((2048)>>2) ;
volatile const FxU32 * const pLFB3 = pLFB2 +((2048)>>2) ;
volatile const FxU32 * const pLFB4 = pLFB3 +((2048)>>2) ;
ISET( SST_TREX(sstregs,ucNumTMU)->textureMode,
SST_RGB565
| (bEnableRGB ? SST_TC_ONE : SST_TC_ZERO)
| (bEnbleAlpha ? SST_TCA_ONE :SST_TCA_ZERO));
if(bEnableDitherValues)
{
/* We are using dithering to detect lsb Faults.
* We need a non-zero original LFB value for dithering to happen.
* Drawing a triangle make detection easier.*/
clearScreen(sstregs,(1 << 11) | (0<<5) |(1),8,8);
drawTriangle(sstregs, ucNumTMU, 0, 0, 3, 4);
}
else
{
clearScreen(sstregs,0x00000000,8,8);
drawRect2(sstregs, ucNumTMU, 0, 0, 4, 4);
}
sst1InitIdle(sst);
mmio_fastread32((uint32_t*)psResultPattern->data.access.u16Pix[0], pLFB1, 2);
mmio_fastread32((uint32_t*)psResultPattern->data.access.u16Pix[1], pLFB2, 2);
mmio_fastread32((uint32_t*)psResultPattern->data.access.u16Pix[2], pLFB3, 2);
mmio_fastread32((uint32_t*)psResultPattern->data.access.u16Pix[3], pLFB4, 2);
const uint32_t OldlfbMode = IGET(sstregs->lfbMode);
ISET(sstregs->lfbMode, (OldlfbMode & ~SST_LFB_READFRONTBUFFER) //SST_LFB_READBACKBUFFER
| SST_LFB_READDEPTHABUFFER);
psResultPattern->data.access.u8APix[0][0] = pLFB1[0] & 0xFF;
psResultPattern->data.access.u8APix[0][1] = (pLFB1[0]>>16) & 0xFF;
psResultPattern->data.access.u8APix[0][2] = pLFB1[1] & 0xFF;
psResultPattern->data.access.u8APix[0][3] = (pLFB1[1]>>16) & 0xFF;
psResultPattern->data.access.u8APix[1][0] = pLFB2[0] & 0xFF;
psResultPattern->data.access.u8APix[1][1] = (pLFB2[0]>>16) & 0xFF;
psResultPattern->data.access.u8APix[1][2] = pLFB2[1] & 0xFF;
psResultPattern->data.access.u8APix[1][3] = (pLFB2[1]>>16) & 0xFF;
psResultPattern->data.access.u8APix[2][0] = pLFB3[0] & 0xFF;
psResultPattern->data.access.u8APix[2][1] = (pLFB3[0]>>16) & 0xFF;
psResultPattern->data.access.u8APix[2][2] = pLFB3[1] & 0xFF;
psResultPattern->data.access.u8APix[2][3] = (pLFB3[1]>>16) & 0xFF;
psResultPattern->data.access.u8APix[3][0] = pLFB4[0] & 0xFF;
psResultPattern->data.access.u8APix[3][1] = (pLFB4[0]>>16) & 0xFF;
psResultPattern->data.access.u8APix[3][2] = pLFB4[1] & 0xFF;
psResultPattern->data.access.u8APix[3][3] = (pLFB4[1]>>16) & 0xFF;
ISET(sstregs->lfbMode, OldlfbMode);
ISET( SST_TREX(sstregs,ucNumTMU)->textureMode,
SST_RGB565 | SST_TC_REPLACE | SST_TCA_REPLACE);
}
#define N_LOOP_TEST 100
unsigned long long
test_TMU_datalines_NoMem( sst1DeviceInfoStruct * const devInfo,
FxU32 * const sst,
SstRegs * const sstregs,
const unsigned char ucNumTMU,
def_sFaultSourceScoreRec* const pFaultSrcCtx)
{
unsigned long long ullNbErrorAll = 0;
static def_sTestPattern ar_ResultPattern[N_LOOP_TEST][8];
sst1InitIdle(sst);
const uint32_t OldlfbMode = IGET(sstregs->lfbMode);//SST_LFB_READBACKBUFFER
ISET(sstregs->lfbMode, SST_LFB_565 | SST_LFB_READFRONTBUFFER | SST_LFB_RGBALANES_ARGB);
const uint32_t OldfbzMode = IGET(sstregs->fbzMode);
ISET(sstregs->fbzMode,
// SST_DRAWBUFFER_BACK
SST_DRAWBUFFER_FRONT
| SST_RGBWRMASK
| SST_ZAWRMASK
| SST_ENALPHABUFFER // <-for NoMEM test ?? Not needed
| SST_ENALPHAMASK); // <-for NoMEM test; Needed
const uint32_t OldtrexInit0 = IGET(SST_TREX(sstregs,ucNumTMU)->trexInit0);
devInfo->tmuInit0[(int)ucNumTMU] = SST_TREXINIT0_DEFAULT ;
ISET(SST_TREX(sstregs,ucNumTMU)->trexInit0, devInfo->tmuInit0[(int)ucNumTMU]);
sst1InitIdle(sst);
/* set downstream TMUs to passthrough */
for (int i=0; i< ucNumTMU; i++)
{
ISET(SST_TREX(sstregs,i)->textureMode, SST_RGB565 | SST_TC_PASS | SST_TCA_PASS);
}
/* Testing several time to exclude instabilities */
for(unsigned int i = 0; i < N_LOOP_TEST ; i++)
{
/* this test is using the only feature I found that can
* control TMUs output without using TMU's RAM. Using
* textureMode we can force a TMU to output RGB value to
* 0xFFFFFF or 0x000000 (only), and A(lpha) to 0xFF or 0x00 (Only).
* So we will try these 4 pattern and check what we get on the LFB.
* Then eventually we can make "smart" Fault recognition...
*
* To make things harder, the physical data bus is 16Bit (DDR?).
* So [AR] and [GB] or superposed.
* */
/***************/
/* RGB: 0, A: 0*/
/***************/
/* Not implemented because the "all on" test should be enough for now
TestStep_NoMem( sst, sstregs, ucNumTMU, 0 ,0, 0,
&ar_ResultPattern[i][0]);*/
/***************/
/* RGB: 1, A: 0*/
/***************/
/* Not implemented because the "all on" test should be enough for now
TestStep_NoMem( sst, sstregs, ucNumTMU, 1, 0, 0,
&ar_ResultPattern[i][1]);*/
/***************/
/* RGB: 1, A: 1*/
/***************/
TestStep_NoMem( sst, sstregs, ucNumTMU, 1, 1 , 0,
&ar_ResultPattern[i][2]);
/***************/
/* RGB: 0, A: 1*/
/***************/
/* Not implemented because the "all on" test should be enough for now
TestStep_NoMem( sst, sstregs, ucNumTMU, 0, 1 , 0,
&ar_ResultPattern[i][3]);*/
}
/* Same test but with dithering enabled to get bit 0-1 values */
ISET(sstregs->fbzMode,
// SST_DRAWBUFFER_BACK
SST_DRAWBUFFER_FRONT
| SST_ENDITHER // <- enabling Dithering for this test
| SST_RGBWRMASK
| SST_ZAWRMASK
| SST_ENALPHABUFFER
| SST_ENALPHAMASK);
for(unsigned int i = 0; i < N_LOOP_TEST ; i++)
{
/* this test is using the only feature I found that can
* control TMUs output without using TMU's RAM. Using
* textureMode we can force a TMU to output RGB value to
* 0xFFFFFF or 0x000000 (only), and A(lpha) to 0xFF or 0x00 (Only).
* So we will try these 4 pattern and check what we get on the LFB.
* Then eventually we can make "smart" Fault recognition...
*
* To make things harder, the physical data bus is 16Bit (DDR?).
* So [AR] and [GB] or superposed.
* */
/***************/
/* RGB: 0, A: 0*/
/***************/
/* Not implemented because the "all on" test should be enough for now
TestStep_NoMem( sst, sstregs, ucNumTMU, 0 ,0, 1,
&ar_ResultPattern[i][4]);*/
/***************/
/* RGB: 1, A: 0*/
/***************/
/* Not implemented because the "all on" test should be enough for now
TestStep_NoMem( sst, sstregs, ucNumTMU, 1, 0, 1,
&ar_ResultPattern[i][5]);*/
/***************/
/* RGB: 1, A: 1*/
/***************/
TestStep_NoMem( sst, sstregs, ucNumTMU, 1, 1 , 1,
&ar_ResultPattern[i][6]);
/***************/
/* RGB: 0, A: 1*/
/***************/
/* Not implemented because the "all on" test should be enough for now
TestStep_NoMem( sst, sstregs, ucNumTMU, 0, 1 , 1,
&ar_ResultPattern[i][7]);*/
}
/* Post processing test results */
for(unsigned int i = 0; i < N_LOOP_TEST ; i++)
{ /* Not implemented because the "all on" test should be enough for now
ullNbErrorAll +=
DistributeFaults( &ar_ResultPattern[i][0],
ar_sExpectedPattern_Test1,
uNbPattern_Test1,
ucNumTMU,
pFaultSrcCtx);*/
/* Not implemented because the "all on" test should be enough for now
ullNbErrorAll +=
DistributeFaults( &ar_ResultPattern[i][1],
ar_sExpectedPattern_Test2,
uNbPattern_Test2,
ucNumTMU,
pFaultSrcCtx);*/
ullNbErrorAll +=
DistributeFaults( &ar_ResultPattern[i][2],
ar_sExpectedPattern_Test3,
uNbPattern_Test3,
ucNumTMU,
pFaultSrcCtx);
/* Not implemented because the "all on" test should be enough for now
ullNbErrorAll +=
DistributeFaults( &ar_ResultPattern[i][3],
ar_sExpectedPattern_Test4,
uNbPattern_Test4,
ucNumTMU,
pFaultSrcCtx);*/
/* Not implemented because the "all on" test should be enough for now
ullNbErrorAll +=
DistributeFaults( &ar_ResultPattern[i][4],
ar_sExpectedPattern_Test1_Dither,
uNbPattern_Test1_Dither,
ucNumTMU,
pFaultSrcCtx);*/
/* Not implemented because the "all on" test should be enough for now
ullNbErrorAll +=
DistributeFaults( &ar_ResultPattern[i][5],
ar_sExpectedPattern_Test2_Dither,
uNbPattern_Test2_Dither,
ucNumTMU,
pFaultSrcCtx);*/
ullNbErrorAll +=
DistributeFaults( &ar_ResultPattern[i][6],
ar_sExpectedPattern_Test3_Dither,
uNbPattern_Test3_Dither,
ucNumTMU,
pFaultSrcCtx);
/* Not implemented because the "all on" test should be enough for now
ullNbErrorAll +=
DistributeFaults( &ar_ResultPattern[i][7],
ar_sExpectedPattern_Test4_Dither,
uNbPattern_Test4_Dither,
ucNumTMU,
pFaultSrcCtx);*/
}
/* reset the Init0 register back to its previous value */
ISET(sstregs->lfbMode,OldlfbMode);
ISET(sstregs->fbzMode, OldfbzMode);
sst1InitIdle(sst);
devInfo->tmuInit0[(int)ucNumTMU] = OldtrexInit0;
ISET(SST_TREX(sstregs,ucNumTMU)->trexInit0, devInfo->tmuInit0[(int)ucNumTMU]);
sst1InitIdle(sst);
return ullNbErrorAll;
}
/* This is an attempt to simulate TMU->FBI->LFB values exchange and
* computation. It partially works for normal mode (no dithering, alpha buffer
* enabled), with two exception: Alpha bit XX seems to have a special behaviour
* that just zeros the output. And the colour mixing hasnt been reverse
* enginered. The dithering algorithm hasnt been reversed either.
* Then, because we are using pattern distance matching, this function is not
* used anymore. I let it here in case one day we want/need to implement a more
* accurate test
*
int simuFault_step( uint8_t bRGB,
uint8_t bA,
uint16_t u16CurrentPixel,
uint8_t u8CurrentAPixel,
uint16_t * const pu16RenderedPixel,
uint8_t * const pu8RenderedAPixel,
uint16_t u16BUSFaultMap )
{
// TMU Output force set
const uint8_t u8TMU_r8 = bRGB ? 0xFF : 0;
const uint8_t u8TMU_g8 = bRGB ? 0xFF : 0;
const uint8_t u8TMU_b8 = bRGB ? 0xFF : 0;
const uint8_t u8TMU_a8 = bA ? 0xFF : 0;
// TMU Output values packing (useless as its only all 0 or 1, but for brain model..)
const uint16_t u16Sent_W1 = (u8TMU_g8<<8) + u8TMU_b8;
const uint16_t u16Sent_W2 = (u8TMU_a8<<8) + u8TMU_r8;
// FBI receiving + Error aplication
const uint16_t u16received_W1 = u16Sent_W1 & ~u16BUSFaultMap;
const uint16_t u16received_W2 = u16Sent_W2 & ~u16BUSFaultMap;
// FBI received colours unpacking (!!! to be checked)
uint16_t u16FBI_Input_r8 = (u16received_W2 & 0xFF);
uint16_t u16FBI_Input_g8 = (u16received_W1 >> 8);
uint16_t u16FBI_Input_b8 = (u16received_W1 & 0xFF);
uint16_t u16FBI_Input_a8 = (u16received_W2 >> 8);
// FBI LFB current colours unpacking
const uint16_t u16FBI_Current_r8 = ((u16CurrentPixel>>11) & 0x1F) << 3;
const uint16_t u16FBI_Current_g8 = ((u16CurrentPixel>>5) & 0x3F) << 2;
const uint16_t u16FBI_Current_b8 = ((u16CurrentPixel>>0) & 0x1F) << 3;
const uint16_t u16FBI_Current_a8 = u8CurrentAPixel;
// Mixing current and new colours
//u16FBI_Input_r8 *= u16FBI_Input_a8;
// This does not work
//u16FBI_Input_r8 += u16FBI_Current_r8 * (255-u16FBI_Input_a8);
//u16FBI_Input_r8 >>=8;
//u16FBI_Input_g8 *= u16FBI_Input_a8;
//u16FBI_Input_g8 += u16FBI_Current_g8 * (255-u16FBI_Input_a8);
//u16FBI_Input_g8 >>=8;
//u16FBI_Input_b8 *= u16FBI_Input_a8;
//u16FBI_Input_b8 += u16FBI_Current_b8 * (255-u16FBI_Input_a8);
//u16FBI_Input_b8 >>=8;
//u16FBI_Input_a8 *= u16FBI_Input_a8;
//u16FBI_Input_a8 += u16FBI_Current_a8*(255-u16FBI_Input_a8);
//u16FBI_Input_a8 >>=8;
const uint16_t u16LFB_R5G6B5_r5 = (u16FBI_Input_r8>>3) & 0x1F;
const uint16_t u16LFB_R5G6B5_g6 = (u16FBI_Input_g8>>2) & 0x3F;
const uint16_t u16LFB_R5G6B5_b5 = (u16FBI_Input_b8>>3) & 0x1F;
const uint16_t u8LFB_R5G6B5_a8 = (u16FBI_Input_a8>>0) & 0xFF;
const uint16_t u16LBF_R5G6B5_Pixel = (u16LFB_R5G6B5_r5 <<11)
+ (u16LFB_R5G6B5_g6<<5)
+ (u16LFB_R5G6B5_b5);
const uint8_t u8LBF_R5G6B5_APixel = u8LFB_R5G6B5_a8;
*pu16RenderedPixel = u16LBF_R5G6B5_Pixel;
*pu8RenderedAPixel = u8LBF_R5G6B5_APixel;
return 0;
}
*/
/* In conjonction to the previous function, the idea here was to precompute all
* the possible fault pattern and use them as a comparison to find the actual
* one using real measurement. It is now deprecated in favor of the pattern
* distance matching.
*
void simuFault( uint8_t bRGB,
uint8_t bA )
{
uint16_t u16RenderedPixel;
uint8_t u8RenderedAPixel;
uint32_t u16PreviousPixel = 0;
uint16_t u8PreviousAPixel = 0;
//for(char bitPos1 = -1; bitPos1 <= 15 ; ++bitPos1)
//for(u8PreviousAPixel= 0; u8PreviousAPixel <= 0xFF ; ++u8PreviousAPixel)
{
//for(u16PreviousPixel= 0; u16PreviousPixel <= 0xFFFF ; ++u16PreviousPixel)
{
//u16PreviousPixel += (bitPos1 ==-1) ? 0 : (1u << bitPos1);
uint16_t Pattern_OK;
uint16_t APattern_OK;
for(char bitPos = -1; bitPos <= 15 ; ++bitPos)
{
const uint16_t u16FaultMap = (bitPos ==-1) ? 0 : (1u << bitPos);
simuFault_step( bRGB,
bA,
u16PreviousPixel,
u8PreviousAPixel,
&u16RenderedPixel,
&u8RenderedAPixel,
u16FaultMap);
//if(u16FaultMap==0)
//{
// Pattern_OK = u16RenderedPixel;
// APattern_OK = u8RenderedAPixel;
//}
//else if(u16FaultMap==0x100)
//{
// if((u16RenderedPixel!=Pattern_OK) && (u8RenderedAPixel!=APattern_OK))
// {
// printf("bRGB %d\n",bRGB);
// printf("bA, %d\n",bA);
// printf("u16PreviousPixel %04X\n",u16PreviousPixel);
// printf("u8PreviousAPixel %02X\n",u8PreviousAPixel);
// printf("SIMU: %04X\n",u16FaultMap);
// printf("\t0x%04X | 0x%02X %c\n",
// u16RenderedPixel,
// u8RenderedAPixel,
// (u16RenderedPixel==0xFFFF)
// && (u8RenderedAPixel==0xFF) ? '!' : ' ');
// }
//}
printf("bRGB %d\n",bRGB);
printf("bA, %d\n",bA);
printf("u16PreviousPixel %04X\n",u16PreviousPixel);
printf("u8PreviousAPixel %02X\n",u8PreviousAPixel);
printf("SIMU: %04X\n",u16FaultMap);
printf("\t0x%04X | 0x%02X %c\n",
u16RenderedPixel,
u8RenderedAPixel,
(u16RenderedPixel==0xFFFF)
&& (u8RenderedAPixel==0xFF) ? '!' : ' ');
}
}
}
}
*/

56
Test_Data_NoMem.h Normal file
View File

@@ -0,0 +1,56 @@
/* 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_DATA_NOMEM_H_
#define _DEF_TEST_DATA_NOMEM_H_
#include <stdint.h>
#include "cvg.h"
#include "FaultSources.h"
typedef union _def_uTestPatternData{
struct {
uint16_t u16Pix[4][4]; //value in LFB after Blend
uint8_t u8APix[4][4]; //value in LFB after Blend
}access;
uint32_t raw[8+4];
}def_uTestPatternData;
typedef struct _def_sFaultSourceLineMap
{
def_eFaultSource eTMUFaultSource_FBI;
def_eFaultSource eTMUFaultSource_TMU0_RES;
def_eFaultSource eTMUFaultSource_TMU0_FBI;
def_eFaultSource eTMUFaultSource_TMU0_TMU1;
def_eFaultSource eTMUFaultSource_TMU1;
}def_sFaultSourceLineMap;
typedef struct _def_sTestPattern
{
uint8_t bReferenceSet;
uint8_t u8FaultLineIdx;
def_uTestPatternData data; // expected value in LFB after Blend
}def_sTestPattern;
unsigned long long
test_TMU_datalines_NoMem( sst1DeviceInfoStruct * const devInfo,
FxU32 * const sst,
SstRegs * const sstregs,
const unsigned char ucNumTMU,
def_sFaultSourceScoreRec* const pFaultSrcCtx);
#endif //_DEF_TEST_DATA_NOMEM_H_

View File

@@ -0,0 +1,761 @@
/* 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/>.
*/
#include "Test_Data_NoMem.h"
const def_sFaultSourceLineMap ar_sFaultSourceLineMap[] =
{
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_0,
.eTMUFaultSource_TMU0_RES = RA10_1,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_0,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_0,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_0,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_1,
.eTMUFaultSource_TMU0_RES = RA10_2,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_1,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_1,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_1,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_2,
.eTMUFaultSource_TMU0_RES = RA10_3,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_2,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_2,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_2,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_3,
.eTMUFaultSource_TMU0_RES = RA10_4,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_3,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_3,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_3,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_4,
.eTMUFaultSource_TMU0_RES = RA11_1,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_4,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_4,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_4,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_5,
.eTMUFaultSource_TMU0_RES = RA11_2,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_5,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_5,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_5,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_6,
.eTMUFaultSource_TMU0_RES = RA11_3,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_6,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_6,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_6,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_7,
.eTMUFaultSource_TMU0_RES = RA11_4,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_7,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_7,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_7,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_8,
.eTMUFaultSource_TMU0_RES = RA12_1,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_8,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_8,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_8,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_9,
.eTMUFaultSource_TMU0_RES = RA12_2,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_9,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_9,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_9,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_10,
.eTMUFaultSource_TMU0_RES = RA12_3,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_10,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_10,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_10,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_11,
.eTMUFaultSource_TMU0_RES = RA12_4,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_11,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_11,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_11,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_12,
.eTMUFaultSource_TMU0_RES = RA13_1,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_12,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_12,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_12,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_13,
.eTMUFaultSource_TMU0_RES = RA13_2,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_13,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_13,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_13,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_14,
.eTMUFaultSource_TMU0_RES = RA13_3,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_14,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_14,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_14,
},
{
.eTMUFaultSource_FBI = U3_FBI_TF_DATA_15,
.eTMUFaultSource_TMU0_RES = RA13_4,
.eTMUFaultSource_TMU0_FBI = U9_TMU0_TF_DATA_15,
.eTMUFaultSource_TMU0_TMU1 = U9_TMU0_FT_DATA_15,
.eTMUFaultSource_TMU1 = U8_TMU1_TF_DATA_15,
},
};
const def_sTestPattern ar_sExpectedPattern_Test3[] =
{
{
.bReferenceSet = true, // Nominal set
.u8FaultLineIdx = 0,
.data = {
.access = {
.u16Pix = { {0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 0,
.data = {
.access = {
.u16Pix = { {0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 1,
.data = {
.access = {
.u16Pix = { {0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 2,
.data = {
.access = {
.u16Pix = { {0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 3,
.data = {
.access = {
.u16Pix = { {0xF7FE,0xF7FF,0xFFFF,0xFFFF},
{0xF7FE,0xF7FE,0xF7FF,0xFFFF},
{0xF7FE,0xF7FE,0xF7FE,0xF7FE},
{0xF7FE,0xF7FE,0xF7FE,0xF7FE}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 4,
.data = {
.access = {
.u16Pix = { {0xEFFD,0xEFFF,0xFFFF,0xFFFF},
{0xEFFD,0xEFFD,0xEFFF,0xFFFF},
{0xEFFD,0xEFFD,0xEFFD,0xEFFD},
{0xEFFD,0xEFFD,0xEFFD,0xEFFD}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 5,
.data = {
.access = {
.u16Pix = { {0xDFFB,0xDFFF,0xFFFF,0xFFFF},
{0xDFFB,0xDFFB,0xDFFF,0xFFFF},
{0xDFFB,0xDFFB,0xDFFB,0xDFFB},
{0xDFFB,0xDFFB,0xDFFB,0xDFFB}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 6,
.data = {
.access = {
.u16Pix = { {0xBFF7,0xBFFF,0xFFFF,0xFFFF},
{0xBFF7,0xBFF7,0xBFFF,0xFFFF},
{0xBFF7,0xBFF7,0xBFF7,0xBFF7},
{0xBFF7,0xBFF7,0xBFF7,0xBFF7}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 7,
.data = {
.access = {
.u16Pix = { {0x7FEF,0x7FFF,0xFFFF,0xFFFF},
{0x7FEF,0x7FEF,0x7FFF,0xFFFF},
{0x7FEF,0x7FEF,0x7FEF,0x7FEF},
{0x7FEF,0x7FEF,0x7FEF,0x7FEF}
},
.u8APix = { {0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF},
{0xFF,0xFF,0xFF,0xFF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 8,
.data = {
.access = {
.u16Pix = { {0x0000,0x0000,0xFFFF,0xFFFF},
{0x0000,0x0000,0x0000,0xFFFF},
{0x0000,0x0000,0x0000,0x0000},
{0x0000,0x0000,0x0000,0x0000}
},
.u8APix = { {0x00,0x00,0xFF,0xFF},
{0x00,0x00,0x00,0xFF},
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 9,
.data = {
.access = {
.u16Pix = { {0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF}
},
.u8APix = { {0xFD,0xFD,0xFF,0xFF},
{0xFD,0xFD,0xFD,0xFF},
{0xFD,0xFD,0xFD,0xFD},
{0xFD,0xFD,0xFD,0xFD}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 10,
.data = {
.access = {
.u16Pix = { {0xFFDF,0xFFFF,0xFFFF,0xFFFF},
{0xFFDF,0xFFDF,0xFFFF,0xFFFF},
{0xFFDF,0xFFDF,0xFFDF,0xFFFF},
{0xFFDF,0xFFDF,0xFFDF,0xFFDF}
},
.u8APix = { {0xFB,0xFB,0xFB,0xFB},
{0xFB,0xFB,0xFB,0xFB},
{0xFB,0xFB,0xFB,0xFB},
{0xFB,0xFB,0xFB,0xFB}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 11,
.data = {
.access = {
.u16Pix = { {0xFFBF,0xFFFF,0xFFFF,0xFFFF},
{0xFFBF,0xFFBF,0xFFFF,0xFFFF},
{0xFFBF,0xFFBF,0xFFBF,0xFFBF},
{0xFFBF,0xFFBF,0xFFBF,0xFFBF}
},
.u8APix = { {0xF7,0xF7,0xFF,0xFF},
{0xF7,0xF7,0xF7,0xFF},
{0xF7,0xF7,0xF7,0xF7},
{0xF7,0xF7,0xF7,0xF7}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 12,
.data = {
.access = {
.u16Pix = { {0xFF7F,0xFFFF,0xFFFF,0xFFFF},
{0xFF7F,0xFF7F,0xFFFF,0xFFFF},
{0xFF7F,0xFF7F,0xFF7F,0xFF7F},
{0xFF7F,0xFF7F,0xFF7F,0xFF7F}
},
.u8APix = { {0xEF,0xEF,0xFF,0xFF},
{0xEF,0xEF,0xEF,0xFF},
{0xEF,0xEF,0xEF,0xEF},
{0xEF,0xEF,0xEF,0xEF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 13,
.data = {
.access = {
.u16Pix = { {0xFEFF,0xFFFF,0xFFFF,0xFFFF},
{0xFEFF,0xFEFF,0xFFFF,0xFFFF},
{0xFEFF,0xFEFF,0xFEFF,0xFEFF},
{0xFEFF,0xFEFF,0xFEFF,0xFEFF}
},
.u8APix = { {0xDF,0xDF,0xFF,0xFF},
{0xDF,0xDF,0xDF,0xFF},
{0xDF,0xDF,0xDF,0xDF},
{0xDF,0xDF,0xDF,0xDF}
},
}
}
},
{ //OK
.bReferenceSet = false,
.u8FaultLineIdx = 14,
.data = {
.access = {
.u16Pix = { {0xFDFF,0xFFFF,0xFFFF,0xFFFF},
{0xFDFF,0xFDFF,0xFFFF,0xFFFF},
{0xFDFF,0xFDFF,0xFDFF,0xFDFF},
{0xFDFF,0xFDFF,0xFDFF,0xFDFF}
},
.u8APix = { {0xBF,0xBF,0xFF,0xFF},
{0xBF,0xBF,0xBF,0xFF},
{0xBF,0xBF,0xBF,0xBF},
{0xBF,0xBF,0xBF,0xBF}
},
}
}
},
{//OK
.bReferenceSet = false,
.u8FaultLineIdx = 15,
.data = {
.access = {
.u16Pix = { {0xFBFF,0xFFFF,0xFFFF,0xFFFF},
{0xFBFF,0xFBFF,0xFFFF,0xFFFF},
{0xFBFF,0xFBFF,0xFBFF,0xFBFF},
{0xFBFF,0xFBFF,0xFBFF,0xFBFF}
},
.u8APix = { {0x7F,0x7F,0xFF,0xFF},
{0x7F,0x7F,0x7F,0xFF},
{0x7F,0x7F,0x7F,0x7F},
{0x7F,0x7F,0x7F,0x7F}
},
}
}
},
};
const unsigned int uNbPattern_Test3 =
sizeof(ar_sExpectedPattern_Test3)/sizeof(def_sTestPattern);
const def_sTestPattern ar_sExpectedPattern_Test3_Dither[] =
{
{
.bReferenceSet = true, // Nominal set
.u8FaultLineIdx = 0,
.data = {
.access = {
.u16Pix = { {0xFFFF,0xFFFF,0xFFFF,0x0040},
{0xFFFF,0xFFFF,0x0040,0x0040},
{0xFFFF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 0,
.data = {
.access = {
.u16Pix = { {0xF7FE,0xFFFF,0xFFFF,0x0040},
{0xFFFF,0xFFFF,0x0040,0x0040},
{0xFFFF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 1,
.data = {
.access = {
.u16Pix = { {0xF7FE,0xFFFF,0xFFFF,0x0040},
{0xFFFF,0xFFFF,0x0040,0x0040},
{0xF7FE,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 2,
.data = {
.access = {
.u16Pix = { {0xF7FE,0xFFFF,0xFFFF,0x0040},
{0xFFFF,0xF7FE,0x0040,0x0040},
{0xF7FE,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 3,
.data = {
.access = {
.u16Pix = { {0xF7FE,0xF7FF,0xFFFF,0x0040},
{0xF7FE,0xF7FE,0x0040,0x0040},
{0xF7FE,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 4,
.data = {
.access = {
.u16Pix = { {0xEFFD,0xEFFF,0xFFFF,0x0040},
{0xEFFD,0xEFFD,0x0040,0x0040},
{0xEFFD,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 5,
.data = {
.access = {
.u16Pix = { {0xDFFB,0xDFFF,0xFFFF,0x0040},
{0xDFFB,0xDFFB,0x0040,0x0040},
{0xDFFB,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 6,
.data = {
.access = {
.u16Pix = { {0xBFF7,0xBFFF,0xFFFF,0x0040},
{0xC7F8,0xBFF7,0x0040,0x0040},
{0xBFF7,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 7,
.data = {
.access = {
.u16Pix = { {0x7FEF,0x7FEF,0xFFFF,0x0040},
{0x87F0,0x7FEF,0x0040,0x0040},
{0x7FEF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFF,0xFF,0xFF,0x0F},
{0xFF,0xFF,0x0F,0x0F},
{0xFF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 8,
.data = {
.access = {
.u16Pix = { {0x0040,0x0040,0xFFFF,0x0040},
{0x0040,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0x0F,0x0F,0xFF,0x0F},
{0x0F,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 9,
.data = {
.access = {
.u16Pix = { {0xFFDF,0xFFFF,0xFFFF,0x0040},
{0xFFFF,0xFFDF,0x0040,0x0040},
{0xFFDF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFD,0xFD,0xFF,0x0F},
{0xFD,0xFD,0x0F,0x0F},
{0xFD,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 10,
.data = {
.access = {
.u16Pix = { {0xFFDF,0xFFFF,0xFFFF,0x0040},
{0xFFDF,0xFFDF,0x0040,0x0040},
{0xFFDF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xFB,0xFB,0xFF,0x0F},
{0xFB,0xFB,0x0F,0x0F},
{0xFB,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 11,
.data = {
.access = {
.u16Pix = { {0xFFBF,0xFFFF,0xFFFF,0x0040},
{0xFFBF,0xFFBF,0x0040,0x0040},
{0xFFBF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xF7,0xF7,0xFF,0x0F},
{0xF7,0xF7,0x0F,0x0F},
{0xF7,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 12,
.data = {
.access = {
.u16Pix = { {0xFF7F,0xFFFF,0xFFFF,0x0040},
{0xFF7F,0xFF7F,0x0040,0x0040},
{0xFF7F,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xEF,0xEF,0xFF,0x0F},
{0xEF,0xEF,0x0F,0x0F},
{0xEF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 13,
.data = {
.access = {
.u16Pix = { {0xFEFF,0xFFFF,0xFFFF,0x0040},
{0xFEFF,0xFEFF,0x0040,0x0040},
{0xFEFF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xDF,0xDF,0xFF,0x0F},
{0xDF,0xDF,0x0F,0x0F},
{0xDF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{ //OK !
.bReferenceSet = false,
.u8FaultLineIdx = 14,
.data = {
.access = {
.u16Pix = { {0xFDFF,0xFFFF,0xFFFF,0x0040},
{0xFDFF,0xFDFF,0x0040,0x0040},
{0xFDFF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0xBF,0xBF,0xFF,0x0F},
{0xBF,0xBF,0x0F,0x0F},
{0xBF,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
{//OK
.bReferenceSet = false,
.u8FaultLineIdx = 15,
.data = {
.access = {
.u16Pix = { {0xFBFF,0xFFFF,0xFFFF,0x0040},
{0xFC1F,0xFBFF,0x0040,0x0040},
{0xFBFF,0x0040,0x0040,0x0040},
{0x0040,0x0040,0x0040,0x0040}
},
.u8APix = { {0x7F,0xFF,0xFF,0x0F},
{0x7F,0x7F,0x0F,0x0F},
{0x7F,0x0F,0x0F,0x0F},
{0x0F,0x0F,0x0F,0x0F}
},
}
}
},
};
const unsigned int uNbPattern_Test3_Dither =
sizeof(ar_sExpectedPattern_Test3_Dither)/sizeof(def_sTestPattern);

View File

@@ -23,7 +23,7 @@
#include "Utils.h" #include "Utils.h"
void void
sprintbin32( char* szBuff, sprintbin32( char * szBuff,
const uint32_t ulVal, const uint32_t ulVal,
const unsigned char bGroupByBytes) const unsigned char bGroupByBytes)
{ {
@@ -53,7 +53,7 @@ printbin32( const uint32_t ulVal,
} }
void void
sprintbin32Info(char* szBuff, sprintbin32Info(char * szBuff,
const uint32_t ulVal, const uint32_t ulVal,
const unsigned short uhb, const unsigned short uhb,
const unsigned short ulb) const unsigned short ulb)

17
Utils.h
View File

@@ -55,25 +55,31 @@
static inline unsigned char static inline unsigned char
count_bit32(const uint32_t ulVal) count_bit32(const uint32_t ulVal)
{ {
/*
unsigned char cpt = 0; unsigned char cpt = 0;
for(uint32_t idxBit = 0x8000000u; idxBit != 0; idxBit >>= 1) for(uint32_t idxBit = 0x80000000u; idxBit != 0; idxBit >>= 1)
if(ulVal & idxBit) if(ulVal & idxBit)
cpt++; cpt++;
return cpt; return cpt;
*/
return __builtin_popcount(ulVal);
} }
static inline unsigned char static inline unsigned char
count_bit8(const uint8_t ulVal) count_bit8(const uint8_t ulVal)
{ {
/*
unsigned char cpt = 0; unsigned char cpt = 0;
for(uint8_t idxBit = 0x80u; idxBit != 0; idxBit >>= 1) for(uint8_t idxBit = 0x80u; idxBit != 0; idxBit >>= 1)
if(ulVal & idxBit) if(ulVal & idxBit)
cpt++; cpt++;
return cpt; return cpt;
*/
return __builtin_popcount(ulVal);
} }
void void
sprintbin32( char* szBuff, sprintbin32( char * const szBuff,
const uint32_t ulVal, const uint32_t ulVal,
const unsigned char bGroupByBytes); const unsigned char bGroupByBytes);
@@ -82,7 +88,7 @@ printbin32( const uint32_t ulVal,
const unsigned char bGroupByBytes); const unsigned char bGroupByBytes);
void void
sprintbin32Info(char* szBuff, sprintbin32Info(char * const szBuff,
const uint32_t ulVal, const uint32_t ulVal,
const unsigned short uhb, const unsigned short uhb,
const unsigned short ulb); const unsigned short ulb);
@@ -142,4 +148,9 @@ mmio_fastwrite32( volatile uint32_t * dst,
} }
} }
static inline double dComputeDistance32(const uint32_t u32A,const uint32_t u32B)
{
return (double)__builtin_popcount( u32A ^ u32B);
}
#endif //_DEF_UTILS_H_ #endif //_DEF_UTILS_H_

View File

@@ -1,8 +1,25 @@
/* 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_V2MEMTEST_H_ #ifndef _DEF_V2MEMTEST_H_
#define _DEF_V2MEMTEST_H_ #define _DEF_V2MEMTEST_H_
#define V2MEMTEST__VERSION__MAJOR 0 #define V2MEMTEST__VERSION__MAJOR 0
#define V2MEMTEST__VERSION__MINOR 1 #define V2MEMTEST__VERSION__MINOR 5
#define V2MEMTEST__VERSION__PATCH 0 #define V2MEMTEST__VERSION__PATCH 0
#include <stdbool.h> #include <stdbool.h>
@@ -41,6 +58,7 @@ typedef enum _def_eErrorCode {
E_ERROR__NOT_ENOUGH_FBI_RAM, E_ERROR__NOT_ENOUGH_FBI_RAM,
E_ERROR__TMU_NOT_FOUND, E_ERROR__TMU_NOT_FOUND,
E_ERROR__NO_TMU_SELECTED, E_ERROR__NO_TMU_SELECTED,
E_ERROR__WRONG_TMU_SELECTED,
E_INVALID_ERROR_CODE, E_INVALID_ERROR_CODE,
}def_eErrorCode; }def_eErrorCode;
@@ -50,16 +68,19 @@ typedef struct _def_sOptions
{ {
def_eLogLevel eLogLevel; def_eLogLevel eLogLevel;
int bSilent; int bSilent;
char szLogFileName[2048];
char szTSVFile[2048];
long lNumLoops; long lNumLoops;
int bTestTMU0; int bTestTMU0;
def_eTMURamLimit eTMU0RamLimit; def_eTMURamLimit eTMU0RamLimit;
int bTestTMU1; int bTestTMU1;
def_eTMURamLimit eTMU1RamLimit; def_eTMURamLimit eTMU1RamLimit;
int bTestTMUControl;
int bTestTMUAddress; int bTestTMUAddress;
int bTestTMUData; int bTestTMUData;
int bTestTMUDataHuge; int bTestTMUDataHuge;
int bTestNoMem;
int bQuick;
int bForce;
int bContinue;
} def_sOptions; } def_sOptions;
extern def_sOptions sOptions; extern def_sOptions sOptions;

395
main.c
View File

@@ -35,9 +35,11 @@
#include "Draw.h" #include "Draw.h"
#include "Test_Common.h" #include "Test_Common.h"
#include "Test_Control.h"
#include "Test_Address.h" #include "Test_Address.h"
#include "Test_Data.h" #include "Test_Data.h"
#include "Test_Data_Huge.h" #include "Test_Data_Huge.h"
#include "Test_Data_NoMem.h"
const char* szErrorMsg[] = const char* szErrorMsg[] =
{ {
@@ -50,6 +52,7 @@ const char* szErrorMsg[] =
"not enough FBI RAM to process TMU tests.", // E_ERROR__NOT_ENOUGH_FBI_RAM, "not enough FBI RAM to process TMU tests.", // E_ERROR__NOT_ENOUGH_FBI_RAM,
"TMU not found.", // E_ERROR__TMU_NOT_FOUND, "TMU not found.", // E_ERROR__TMU_NOT_FOUND,
"no TMU selected.", // E_ERROR__NO_TMU_SELECTED, "no TMU selected.", // E_ERROR__NO_TMU_SELECTED,
"wrong number of TMU selected.", // E_ERROR__WRONG_TMU_SELECTED
}; };
const char szTitle[] = const char szTitle[] =
@@ -77,9 +80,10 @@ const char szHelp[] =
" -h, --help Show this help and exit.\n" " -h, --help Show this help and exit.\n"
" --version Print version (MAJOR.MINOR.PATCH) and exit.\n" " --version Print version (MAJOR.MINOR.PATCH) and exit.\n"
" -n, --num <N> Number of loops (default: 1).\n" " -n, --num <N> Number of loops (default: 1).\n"
" -l, --log <file> Log file path.\n" " -q, --quick Quicker test (no pre-heat).\n"
" -c, --continue Continue testing even when error found.\n"
" -f, --force Force test (not detected TMU / RAM).\n"
" --silent Silent mode (suppress normal output).\n" " --silent Silent mode (suppress normal output).\n"
/*" -t, --tsv <file> TSV output file path.\n"*/
"\n" "\n"
"Verbosity:\n" "Verbosity:\n"
" -v Increase log level by one step (repeatable).\n" " -v Increase log level by one step (repeatable).\n"
@@ -91,6 +95,8 @@ const char szHelp[] =
" --tmu1 Enable only tests for TMU1.\n" " --tmu1 Enable only tests for TMU1.\n"
"\n" "\n"
"Test selection [ all if none set ] :\n" "Test selection [ all if none set ] :\n"
" --no-mem Run no-mem test.\n"
" --control Run control lines tests.\n"
" --address Run address tests.\n" " --address Run address tests.\n"
" --data Run data tests.\n" " --data Run data tests.\n"
" --data-huge Run large/extended data tests.\n" " --data-huge Run large/extended data tests.\n"
@@ -100,7 +106,6 @@ const char szHelp[] =
" --tmu1-ram <MB> Force TMU1 RAM size: -1=auto, 1..4=MB.\n" " --tmu1-ram <MB> Force TMU1 RAM size: -1=auto, 1..4=MB.\n"
"\n" "\n"
"Examples:\n" "Examples:\n"
/*" ./v2-tmu-memtester --tmu0 --address -v --tsv out.tsv\n"*/
" ./v2-tmu-memtester --tmu0 --address -v\n" " ./v2-tmu-memtester --tmu0 --address -v\n"
" ./v2-tmu-memtester --tmu0-ram 2 --tmu1-ram -1 -n 10\n" " ./v2-tmu-memtester --tmu0-ram 2 --tmu1-ram -1 -n 10\n"
" ./v2-tmu-memtester --tmu1 --data-huge\n"; " ./v2-tmu-memtester --tmu1 --data-huge\n";
@@ -108,45 +113,75 @@ const char szHelp[] =
def_sOptions sOptions = { def_sOptions sOptions = {
.eLogLevel = E_LOGLEVEL__INFO, .eLogLevel = E_LOGLEVEL__INFO,
.bSilent = false, .bSilent = false,
.szLogFileName = {0},
.szTSVFile = {0},
.lNumLoops = 1, .lNumLoops = 1,
.bTestTMU0 = false, .bTestTMU0 = false,
.eTMU0RamLimit = E_TMU_RAMSIZE__AUTO, .eTMU0RamLimit = E_TMU_RAMSIZE__AUTO,
.bTestTMU1 = false, .bTestTMU1 = false,
.eTMU1RamLimit = E_TMU_RAMSIZE__AUTO, .eTMU1RamLimit = E_TMU_RAMSIZE__AUTO,
.bTestTMUAddress = false, .bTestTMUAddress = false,
.bTestTMUControl = false,
.bTestTMUData = false, .bTestTMUData = false,
.bTestTMUDataHuge = false, .bTestTMUDataHuge = false,
.bTestNoMem = false,
.bQuick = false,
.bForce = false,
.bContinue = false,
}; };
static struct option long_args[] = { static struct option long_args[] = {
/* {<NAME>, <HAS_ARG>, <FLAG>, <VAL> */ /* {<NAME>, <HAS_ARG>, <FLAG>, <VAL> */
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
{"num", required_argument, NULL, 'n'}, {"num", required_argument, NULL, 'n'},
{"log", required_argument, NULL, 'l'}, {"force", no_argument, NULL, 'f'},
{"continue", no_argument, NULL, 'c'},
{"silent", no_argument, &sOptions.bSilent, true}, {"silent", no_argument, &sOptions.bSilent, true},
/*{"tsv", required_argument, NULL, 't'},*/ {"quick", no_argument, NULL, 'q'},
{"tmu0", no_argument, &sOptions.bTestTMU0, true}, {"tmu0", no_argument, &sOptions.bTestTMU0, true},
{"tmu1", no_argument, &sOptions.bTestTMU1, true}, {"tmu1", no_argument, &sOptions.bTestTMU1, true},
{"control", no_argument, &sOptions.bTestTMUControl, true},
{"address", no_argument, &sOptions.bTestTMUAddress, true}, {"address", no_argument, &sOptions.bTestTMUAddress, true},
{"data", no_argument, &sOptions.bTestTMUData, true}, {"data", no_argument, &sOptions.bTestTMUData, true},
{"data-huge", no_argument, &sOptions.bTestTMUDataHuge, true}, {"data-huge", no_argument, &sOptions.bTestTMUDataHuge, true},
{"no-mem", no_argument, &sOptions.bTestNoMem, true},
{"tmu0-ram", required_argument, NULL, 3}, {"tmu0-ram", required_argument, NULL, 3},
{"tmu1-ram", required_argument, NULL, 1}, {"tmu1-ram", required_argument, NULL, 1},
{"version", no_argument, NULL, 2}, {"version", no_argument, NULL, 2},
}; };
def_sFaultSourceScoreRec static def_sFaultSourceScoreRec
ar_dFaultScores[NB_FAULT_SOURCE]; ar_dFaultScores_no_mem[NB_FAULT_SOURCE];
def_sFaultSourceScoreRec static def_sFaultSourceScoreRec
ar_dFaultScores_control[NB_FAULT_SOURCE];
static def_sFaultSourceScoreRec
ar_dFaultScores_address[NB_FAULT_SOURCE];
static def_sFaultSourceScoreRec
ar_dFaultScores_data[NB_FAULT_SOURCE];
static def_sFaultSourceScoreRec
ar_dFaultScores_data_random[NB_FAULT_SOURCE];
static def_sFaultSourceScoreRec
ar_dFaultScores_data_huge[NB_FAULT_SOURCE];
static def_sFaultSourceScoreRec*
ar_dFaultScores_Set[6];
const unsigned int uNb_dFaultScores_Set =
sizeof(ar_dFaultScores_Set)/sizeof(def_sFaultSourceScoreRec*);
static def_sFaultSourceScoreRec
ar_dFaultScores_ALL[NB_FAULT_SOURCE];
static def_sFaultSourceScoreRec
ar_dFaultScores_sorted[NB_FAULT_SOURCE]; ar_dFaultScores_sorted[NB_FAULT_SOURCE];
#define _DEF_TEST_TIME_PER_MB_S 5 #define _DEF_TEST_TIME_PER_MB_S 5
int main(int argc, char **argv) int main(const int argc, char ** const argv)
{ {
int Status = 0; int Status = 0;
unsigned long long ullNbErrorAll = 0; unsigned long long ullNbErrorAll = 0;
@@ -156,7 +191,14 @@ int main(int argc, char **argv)
bool bQuit = false; bool bQuit = false;
FxU32* sst = NULL; FxU32* sst = NULL;
while((opt=getopt_long(argc,argv,"hvn:t:l:",long_args,&option_index)) != -1) ar_dFaultScores_Set[0] = ar_dFaultScores_no_mem;
ar_dFaultScores_Set[1] = ar_dFaultScores_control;
ar_dFaultScores_Set[2] = ar_dFaultScores_address;
ar_dFaultScores_Set[3] = ar_dFaultScores_data;
ar_dFaultScores_Set[4] = ar_dFaultScores_data_random;
ar_dFaultScores_Set[5] = ar_dFaultScores_data_huge;
while((opt=getopt_long(argc,argv,"chvfqn:",long_args,&option_index)) != -1)
{ {
switch(opt) switch(opt)
{ {
@@ -198,15 +240,15 @@ int main(int argc, char **argv)
Status = E_ERROR__UNKNOWN_ARGUMENT; Status = E_ERROR__UNKNOWN_ARGUMENT;
ErrorCheck_gotoCleanUp(); ErrorCheck_gotoCleanUp();
break; break;
case 'q':
case 'l': sOptions.bQuick = true;
strncpy(sOptions.szLogFileName, optarg, 2048);
break; break;
/* case 'c':
case 't': sOptions.bContinue = true;
strncpy(sOptions.szTSVFile, optarg, 2048); break;
case 'f':
sOptions.bForce = true;
break; break;
*/
case 'h': case 'h':
puts(szHelp); puts(szHelp);
bQuit = true; bQuit = true;
@@ -244,11 +286,15 @@ int main(int argc, char **argv)
if( !sOptions.bTestTMUAddress && if( !sOptions.bTestTMUAddress &&
!sOptions.bTestTMUData && !sOptions.bTestTMUData &&
!sOptions.bTestTMUDataHuge) !sOptions.bTestTMUDataHuge &&
!sOptions.bTestTMUControl&&
!sOptions.bTestNoMem)
{ {
sOptions.bTestTMUControl = true;
sOptions.bTestTMUAddress = true; sOptions.bTestTMUAddress = true;
sOptions.bTestTMUData = true; sOptions.bTestTMUData = true;
sOptions.bTestTMUDataHuge = true; sOptions.bTestTMUDataHuge = true;
sOptions.bTestNoMem = true;
} }
sst1DeviceInfoStruct devInfo; sst1DeviceInfoStruct devInfo;
@@ -265,7 +311,14 @@ int main(int argc, char **argv)
srandom(time(NULL)); srandom(time(NULL));
FaultSource_reset(ar_dFaultScores); FaultSource_reset(ar_dFaultScores_no_mem);
FaultSource_reset(ar_dFaultScores_control);
FaultSource_reset(ar_dFaultScores_address);
FaultSource_reset(ar_dFaultScores_data);
FaultSource_reset(ar_dFaultScores_data_random);
FaultSource_reset(ar_dFaultScores_data_huge);
FaultSource_reset(ar_dFaultScores_ALL);
FaultSource_reset(ar_dFaultScores_sorted);
for(long j=0; j < sOptions.lNumLoops; j++) for(long j=0; j < sOptions.lNumLoops; j++)
{ {
@@ -299,6 +352,21 @@ int main(int argc, char **argv)
ErrorCheck_gotoCleanUp(); ErrorCheck_gotoCleanUp();
} }
if(devInfo.numberTmus>2) //FixMe: This case can happen if U8_TMU1_TF_DATA_9 is wrong
{
logE("Only 2 TMUs are supported\n");
if(sOptions.bForce)
{
logW("Forcing one TMU");
devInfo.numberTmus = 1;
}
else
{
Status = E_ERROR__WRONG_TMU_SELECTED;
ErrorCheck_gotoCleanUp();
}
}
for (int tmu = 0; tmu < devInfo.numberTmus; tmu++) for (int tmu = 0; tmu < devInfo.numberTmus; tmu++)
logI("TMU%d detected memory:\t%ld MB\n", tmu, (unsigned long)devInfo.tmuMemSize[tmu]); logI("TMU%d detected memory:\t%ld MB\n", tmu, (unsigned long)devInfo.tmuMemSize[tmu]);
@@ -315,25 +383,38 @@ int main(int argc, char **argv)
if(sOptions.bTestTMU0 && devInfo.numberTmus<1) if(sOptions.bTestTMU0 && devInfo.numberTmus<1)
{ {
logE("TMU0 not Found\n"); logE("TMU0 not Found\n");
Status = E_ERROR__TMU_NOT_FOUND; if(sOptions.bForce)
ErrorCheck_gotoCleanUp(); {
logW("Forcing TMU0 test");
}
else
{
Status = E_ERROR__TMU_NOT_FOUND;
ErrorCheck_gotoCleanUp();
}
} }
if(sOptions.bTestTMU1 && devInfo.numberTmus<2) if(sOptions.bTestTMU1 && devInfo.numberTmus<2)
{ {
logE("TMU1 not Found\n"); logE("TMU1 not Found\n");
Status = E_ERROR__TMU_NOT_FOUND; if(sOptions.bForce)
ErrorCheck_gotoCleanUp(); {
logW("Forcing TMU1 test");
}
else
{
Status = E_ERROR__TMU_NOT_FOUND;
ErrorCheck_gotoCleanUp();
}
} }
const bool bTestTMU0 = (devInfo.numberTmus > 0) const bool bTestTMU0 = ( (devInfo.numberTmus > 0)
&& (devInfo.tmuMemSize[0] > 0) || sOptions.bForce)
&& sOptions.bTestTMU0; && sOptions.bTestTMU0;
const bool bTestTMU1 = (devInfo.numberTmus > 1)
&& (devInfo.tmuMemSize[1] > 0)
&& sOptions.bTestTMU1;
const bool bTestTMU1 = ( (devInfo.numberTmus > 1)
|| sOptions.bForce)
&& sOptions.bTestTMU1;
if(!bTestTMU0 && !bTestTMU1) if(!bTestTMU0 && !bTestTMU1)
{ {
logE("no TMU selected.\n"); logE("no TMU selected.\n");
@@ -345,10 +426,26 @@ int main(int argc, char **argv)
logW("/!\\ make sure you did test TMU0 BEFORE TMU1.\n\n"); logW("/!\\ make sure you did test TMU0 BEFORE TMU1.\n\n");
} }
ISET(sstregs->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER); ISET(sstregs->lfbMode,
ISET(sstregs->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK); SST_LFB_RGBALANES_ARGB
ISET(sstregs->fbzColorPath, SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP); | SST_LFB_READFRONTBUFFER);
ISET(sstregs->textureMode, SST_RGB565 | SST_TC_REPLACE | SST_TCA_REPLACE);
ISET(sstregs->fbzMode,
SST_DRAWBUFFER_FRONT
| SST_RGBWRMASK); // <-for NoMEM test
ISET( sstregs->fbzColorPath,
SST_RGBSEL_TMUOUT
| SST_ASEL_TMUOUT // <-for NoMEM test
| SST_ENTEXTUREMAP);
for (int tmu = 0; tmu < devInfo.numberTmus; tmu++)
{
ISET( SST_TREX(sstregs,tmu)->textureMode,
SST_RGB565
| SST_TC_REPLACE
| SST_TCA_REPLACE);
}
ISET(sstregs->tLOD, 0); ISET(sstregs->tLOD, 0);
for (int tmu = 0; tmu < devInfo.numberTmus; tmu++) for (int tmu = 0; tmu < devInfo.numberTmus; tmu++)
@@ -356,53 +453,169 @@ int main(int argc, char **argv)
if((tmu == 0) && !bTestTMU0) continue; if((tmu == 0) && !bTestTMU0) continue;
if((tmu == 1) && !bTestTMU1) 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) if(sOptions.bTestNoMem)
{ {
unsigned long long err=0; unsigned long long err=0;
logI("### pre-heating\n"); if(!sOptions.bQuick)
HeatMemAndTMU(&devInfo,sst,sstregs,tmu,0x000000); {
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo, sst, sstregs, tmu, 0x000000);
}
logI("### address & control lines test - cumulated\n"); logI("### data test - no mem\n");
clearScreen(sstregs,0x00000000,256,256); clearScreen(sstregs, 0x00000000, 256, 256);
clock_t test_begin = clock(); clock_t test_begin = clock();
do do
{ {
err = RenderTestAddress(&devInfo, err = test_TMU_datalines_NoMem( &devInfo,
sst, sst,
sstregs, sstregs,
tmu, tmu ,
devInfo.tmuMemSize[tmu], ar_dFaultScores_no_mem);
ar_dFaultScores);
ullNbErrorAll += err; ullNbErrorAll += err;
logI( err ? "E" : "."); logI( err ? "E" : ".");
fflush(stdout); fflush(stdout);
} }
while(!err while( (!err || sOptions.bContinue) &&
&& (((double)(clock() - test_begin)/CLOCKS_PER_SEC) (((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S))); < _DEF_TEST_TIME_PER_MB_S));
logI("\n"); logI("\n");
FaultSource_nomalize(ar_dFaultScores_no_mem);
if(err) if(err)
{ {
logW("error detected on address line !\n"); logW("error detected on TMUs tex lines (no-mem test) !\n");
logW("skiping next tests.\n\n"); if(!sOptions.bContinue)
continue; {
logW("skiping next tests.\n\n");
continue;
}
} }
} }
logI("\n");
if(sOptions.bTestTMUData) ISET(sstregs->lfbMode,
SST_LFB_RGBALANES_ARGB
| SST_LFB_READFRONTBUFFER);
if(sOptions.bTestTMUControl && (devInfo.tmuMemSize[tmu]>0))
{ {
unsigned long long err=0; unsigned long long err=0;
logI("### pre-heating\n"); if(!sOptions.bQuick)
HeatMemAndTMU(&devInfo,sst,sstregs,tmu,0x000000); {
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo, sst, sstregs, tmu, 0x000000);
}
logI("### control lines test - simple\n");
clearScreen(sstregs, 0x00000000, 256, 256);
clock_t test_begin = clock();
int i=0;
do
{
err = TestControl(&devInfo,
sst,
sstregs,
tmu,
devInfo.tmuMemSize[tmu],
ar_dFaultScores_control);
ullNbErrorAll += err;
if(err || (((i++)%1000)==0))
{
logI( err ? "E" : ".");
fflush(stdout);
}
}
while( (!err || sOptions.bContinue) &&
(((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< _DEF_TEST_TIME_PER_MB_S));
logI("\n");
FaultSource_nomalize(ar_dFaultScores_control);
if(err)
{
logW("error detected on control line !\n");
if(!sOptions.bContinue)
{
logW("skiping next tests.\n\n");
continue;
}
}
}
if(sOptions.bTestTMUAddress && (devInfo.tmuMemSize[tmu]>0))
{
unsigned long long err=0;
if(!sOptions.bQuick)
{
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo, sst, sstregs, tmu,0x000000);
}
logI("### address lines test - cumulated\n");
clearScreen(sstregs, 0x00000000, 256, 256);
clock_t test_begin = clock();
int i=0;
do
{
err = 0;
for( unsigned char stepMemSize=1;
(stepMemSize <= devInfo.tmuMemSize[tmu]) && !err;
stepMemSize++)
{
err = RenderTestAddress(&devInfo,
sst,
sstregs,
tmu,
stepMemSize,
ar_dFaultScores_address);
ullNbErrorAll += err;
if(err || (((i++)%28)==0))
{
logI( err ? "E" : ".");
fflush(stdout);
}
}
}
while( (!err || sOptions.bContinue) &&
(((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S)));
logI("\n");
FaultSource_nomalize(ar_dFaultScores_address);
if(err)
{
logW("error detected on address line !\n");
if(!sOptions.bContinue)
{
logW("skiping next tests.\n\n");
continue;
}
}
}
if(sOptions.bTestTMUData && (devInfo.tmuMemSize[tmu]>0))
{
unsigned long long err=0;
if(!sOptions.bQuick)
{
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo, sst, sstregs, tmu, 0x000000);
}
logI("### data test - single bit move\n"); logI("### data test - single bit move\n");
clearScreen(sstregs,0x00000000,256,256); clearScreen(sstregs, 0x00000000, 256, 256);
clock_t test_begin = clock(); clock_t test_begin = clock();
do do
@@ -413,28 +626,35 @@ int main(int argc, char **argv)
tmu , tmu ,
0, /* bit shift mode */ 0, /* bit shift mode */
devInfo.tmuMemSize[tmu], devInfo.tmuMemSize[tmu],
ar_dFaultScores); ar_dFaultScores_data);
ullNbErrorAll += err; ullNbErrorAll += err;
logI( err ? "E" : "."); logI( err ? "E" : ".");
fflush(stdout); fflush(stdout);
} }
while(!err && while( (!err || sOptions.bContinue) &&
(((double)(clock() - test_begin)/CLOCKS_PER_SEC) (((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S))); < (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S)));
logI("\n"); logI("\n");
FaultSource_nomalize(ar_dFaultScores_data);
if(err) if(err)
{ {
logW("error detected on data line (single bit move) !\n"); logW("error detected on data line (single bit move) !\n");
logW("skiping next tests.\n\n"); if(!sOptions.bContinue)
continue; {
logW("skiping next tests.\n\n");
continue;
}
} }
logI("### pre-heating\n"); if(!sOptions.bQuick)
HeatMemAndTMU(&devInfo,sst,sstregs,tmu,0x000000); {
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo, sst, sstregs, tmu, 0x000000);
}
logI("### data test - random patterns\n"); logI("### data test - random patterns\n");
clearScreen(sstregs,0x00000000,256,256); clearScreen(sstregs, 0x00000000, 256, 256);
test_begin = clock(); test_begin = clock();
do do
@@ -445,33 +665,40 @@ int main(int argc, char **argv)
tmu , tmu ,
1, /* random mode */ 1, /* random mode */
devInfo.tmuMemSize[tmu], devInfo.tmuMemSize[tmu],
ar_dFaultScores); ar_dFaultScores_data_random);
ullNbErrorAll += err; ullNbErrorAll += err;
logI( err ? "E" : "."); logI( err ? "E" : ".");
fflush(stdout); fflush(stdout);
} }
while(!err && while( (!err || sOptions.bContinue) &&
(((double)(clock() - test_begin)/CLOCKS_PER_SEC) (((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S))); < (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S)));
logI("\n"); logI("\n");
FaultSource_nomalize(ar_dFaultScores_data_random);
if(err) if(err)
{ {
logW("error detected on data line (random patterns) !\n"); logW("error detected on data line (random patterns) !\n");
logW("skiping next tests.\n\n"); if(!sOptions.bContinue)
continue; {
logW("skiping next tests.\n\n");
continue;
}
} }
} }
if(sOptions.bTestTMUDataHuge) if(sOptions.bTestTMUDataHuge && (devInfo.tmuMemSize[tmu]>0))
{ {
unsigned long long err=0; unsigned long long err=0;
logI("### pre-heating\n"); if(!sOptions.bQuick)
HeatMemAndTMU(&devInfo,sst,sstregs,tmu,0x000000); {
logI("### pre-heating\n");
HeatMemAndTMU(&devInfo, sst, sstregs, tmu, 0x000000);
}
logI("### data test - huge data set\n"); logI("### data test - huge data set\n");
clearScreen(sstregs,0x00000000,256,256); clearScreen(sstregs, 0x00000000, 256, 256);
clock_t test_begin = clock(); clock_t test_begin = clock();
do do
@@ -481,28 +708,40 @@ int main(int argc, char **argv)
sstregs, sstregs,
tmu , tmu ,
devInfo.tmuMemSize[tmu], devInfo.tmuMemSize[tmu],
ar_dFaultScores); ar_dFaultScores_data_huge);
ullNbErrorAll += err; ullNbErrorAll += err;
logI( err ? "E" : "."); logI( err ? "E" : ".");
fflush(stdout); fflush(stdout);
} }
while(!err && while( (!err || sOptions.bContinue) &&
(((double)(clock() - test_begin)/CLOCKS_PER_SEC) (((double)(clock() - test_begin)/CLOCKS_PER_SEC)
< (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S))); < (devInfo.tmuMemSize[tmu]*_DEF_TEST_TIME_PER_MB_S)));
logI("\n"); logI("\n");
FaultSource_nomalize(ar_dFaultScores_data_huge);
if(err) if(err)
{ {
logW("error detected on data line (huge data set) !\n"); logW("error detected on data line (huge data set) !\n");
logW("skiping next tests.\n\n"); if(!sOptions.bContinue)
continue; {
logW("skiping next tests.\n\n");
continue;
}
} }
} }
logI("\n"); logI("\n");
} }
sst1InitShutdown(sst);
sst = NULL;
} }
FaultSource_getSorted(ar_dFaultScores_sorted,ar_dFaultScores); FaultSource_sum(ar_dFaultScores_Set,
uNb_dFaultScores_Set,
ar_dFaultScores_ALL);
FaultSource_getSorted(ar_dFaultScores_sorted,ar_dFaultScores_ALL);
FaultSource_nomalize(ar_dFaultScores_sorted);
FaultSource_divideAll(ar_dFaultScores_sorted,0.01);
FaultSource_display(ar_dFaultScores_sorted); FaultSource_display(ar_dFaultScores_sorted);
logI("test completed, ullNbErrorAll = %lld\n",ullNbErrorAll); logI("test completed, ullNbErrorAll = %lld\n",ullNbErrorAll);