improve data type and inlining (static)
This commit is contained in:
@@ -180,79 +180,4 @@ FaultSource_Display()
|
|||||||
ar_dFaultScores_sorted[eFaultSourceCurrent].szName,
|
ar_dFaultScores_sorted[eFaultSourceCurrent].szName,
|
||||||
buff );
|
buff );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
WordBitFaultSet( const unsigned long ErrorMark,
|
|
||||||
const double dScore,
|
|
||||||
const def_eFaultSource eFaultSourceL,
|
|
||||||
const def_eFaultSource eFaultSourceH)
|
|
||||||
{
|
|
||||||
for(unsigned long bitPos = 0; bitPos <= 31 ; bitPos++)
|
|
||||||
if(ErrorMark & (1 << bitPos))
|
|
||||||
{
|
|
||||||
if(bitPos < 16)
|
|
||||||
FaultSource_AddScore(eFaultSourceL + bitPos, dScore);
|
|
||||||
else
|
|
||||||
FaultSource_AddScore(eFaultSourceH + bitPos - 16, dScore);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
QuartetBitFaultSet( const unsigned long ErrorMark,
|
|
||||||
const double dScore,
|
|
||||||
const def_eFaultSource eFaultSource)
|
|
||||||
{
|
|
||||||
for(unsigned char bitPos = 0; bitPos <= 4 ; bitPos++)
|
|
||||||
if(ErrorMark & (1 << bitPos))
|
|
||||||
FaultSource_AddScore(eFaultSource + bitPos, dScore);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void
|
|
||||||
MemChipDQFaultSet( const unsigned long ErrorMark,
|
|
||||||
const double dScore,
|
|
||||||
const def_eFaultSource eFaultSourceL,
|
|
||||||
const def_eFaultSource eFaultSourceH)
|
|
||||||
{
|
|
||||||
WordBitFaultSet(ErrorMark, dScore, eFaultSourceL + 1, eFaultSourceH + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void
|
|
||||||
TMUTexDataFaultSet( const unsigned long ErrorMark_w0w1,
|
|
||||||
const unsigned long ErrorMark_w2w3,
|
|
||||||
const double dScore,
|
|
||||||
const def_eFaultSource eTMUFaultSource)
|
|
||||||
{
|
|
||||||
WordBitFaultSet(ErrorMark_w0w1, dScore, eTMUFaultSource + 0 + 1, eTMUFaultSource + 16 + 1);
|
|
||||||
WordBitFaultSet(ErrorMark_w2w3, dScore, eTMUFaultSource + 32 + 1, eTMUFaultSource + 48 + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void
|
|
||||||
TMUTexDataCtrlFaultSet( const unsigned long ErrorMark,
|
|
||||||
double dScore,
|
|
||||||
const def_eFaultSource eFaultSourceCASL,
|
|
||||||
const def_eFaultSource eFaultSourceCASH,
|
|
||||||
const def_eFaultSource eFaultSourceRAS,
|
|
||||||
const def_eFaultSource eFaultSourceWE
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if( ErrorMark && (count_bit32(ErrorMark) > 16) )
|
|
||||||
{
|
|
||||||
if(ErrorMark & 0x000000FF)
|
|
||||||
FaultSource_AddScore(eFaultSourceCASL,dScore);
|
|
||||||
if(ErrorMark & 0x0000FF00)
|
|
||||||
FaultSource_AddScore(eFaultSourceCASH,dScore);
|
|
||||||
if(ErrorMark & 0x00FF0000)
|
|
||||||
FaultSource_AddScore(eFaultSourceCASL,dScore);
|
|
||||||
if(ErrorMark & 0xFF000000)
|
|
||||||
FaultSource_AddScore(eFaultSourceCASH,dScore);
|
|
||||||
|
|
||||||
FaultSource_AddScore(eFaultSourceRAS,dScore / 2);
|
|
||||||
FaultSource_AddScore(eFaultSourceWE,dScore / 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -997,47 +997,94 @@ typedef struct _def_sFaultSourceScoreRec{
|
|||||||
}def_sFaultSourceScoreRec;
|
}def_sFaultSourceScoreRec;
|
||||||
|
|
||||||
extern def_sFaultSourceScoreRec ar_dFaultScores[NB_FAULT_SOURCE];
|
extern def_sFaultSourceScoreRec ar_dFaultScores[NB_FAULT_SOURCE];
|
||||||
extern def_sFaultSourceScoreRec ar_dFaultScores_sorted[NB_FAULT_SOURCE];
|
extern def_sFaultSourceScoreRecar_dFaultScores_sorted[NB_FAULT_SOURCE];
|
||||||
|
|
||||||
void FaultSource_Reset();
|
void
|
||||||
void FaultSource_AddScore(def_eFaultSource eFaultSource, double dScore);
|
FaultSource_Reset();
|
||||||
void FaultSource_Sort();
|
|
||||||
void FaultSource_GetLoc(def_eFaultSource eFaultSource, char* loc);
|
void
|
||||||
void FaultSource_Display();
|
FaultSource_AddScore(def_eFaultSource eFaultSource, double dScore);
|
||||||
|
|
||||||
|
void
|
||||||
|
FaultSource_Sort();
|
||||||
|
|
||||||
|
void
|
||||||
|
FaultSource_GetLoc(def_eFaultSource eFaultSource, char* loc);
|
||||||
|
|
||||||
|
void
|
||||||
|
FaultSource_Display();
|
||||||
|
|
||||||
|
|
||||||
void
|
static inline
|
||||||
WordBitFaultSet( const unsigned long ErrorMark,
|
WordBitFaultSet( const uint32_t ErrorMark,
|
||||||
const double dScore,
|
const double dScore,
|
||||||
const def_eFaultSource eFaultSourceL,
|
const def_eFaultSource eFaultSourceL,
|
||||||
const def_eFaultSource eFaultSourceH);
|
const def_eFaultSource eFaultSourceH)
|
||||||
|
{
|
||||||
void
|
for(unsigned char bitPos = 0; bitPos <= 31 ; bitPos++)
|
||||||
QuartetBitFaultSet( const unsigned long ErrorMark,
|
if(ErrorMark & (1u << bitPos))
|
||||||
const double dScore,
|
{
|
||||||
const def_eFaultSource eFaultSource);
|
if(bitPos < 16)
|
||||||
|
FaultSource_AddScore(eFaultSourceL + bitPos, dScore);
|
||||||
|
else
|
||||||
|
FaultSource_AddScore(eFaultSourceH + bitPos - 16, dScore);
|
||||||
|
}
|
||||||
|
|
||||||
inline void
|
}
|
||||||
MemChipDQFaultSet( const unsigned long ErrorMark,
|
|
||||||
|
static inline void
|
||||||
|
QuartetBitFaultSet( const uint8_t ErrorMark,
|
||||||
|
const double dScore,
|
||||||
|
const def_eFaultSource eFaultSource)
|
||||||
|
{
|
||||||
|
for(uint8_t bitPos = 0; bitPos <= 4 ; bitPos++)
|
||||||
|
if(ErrorMark & (1u << bitPos))
|
||||||
|
FaultSource_AddScore(eFaultSource + bitPos, dScore);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
MemChipDQFaultSet( const uint32_t ErrorMark,
|
||||||
const double dScore,
|
const double dScore,
|
||||||
const def_eFaultSource eFaultSourceL,
|
const def_eFaultSource eFaultSourceL,
|
||||||
const def_eFaultSource eFaultSourceH);
|
const def_eFaultSource eFaultSourceH)
|
||||||
|
{
|
||||||
|
WordBitFaultSet(ErrorMark, dScore, eFaultSourceL + 1, eFaultSourceH + 1);
|
||||||
|
}
|
||||||
|
|
||||||
inline void
|
static inline void
|
||||||
TMUTexDataFaultSet( const unsigned long ErrorMark_w0w1,
|
TMUTexDataFaultSet( const uint32_t ErrorMark_w0w1,
|
||||||
const unsigned long ErrorMark_w2w3,
|
const uint32_t ErrorMark_w2w3,
|
||||||
const double dScore,
|
const double dScore,
|
||||||
const def_eFaultSource eTMUFaultSource);
|
const def_eFaultSource eTMUFaultSource)
|
||||||
|
{
|
||||||
|
WordBitFaultSet(ErrorMark_w0w1, dScore, eTMUFaultSource + 0 + 1, eTMUFaultSource + 16 + 1);
|
||||||
|
WordBitFaultSet(ErrorMark_w2w3, dScore, eTMUFaultSource + 32 + 1, eTMUFaultSource + 48 + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void
|
static inline void
|
||||||
TMUTexDataCtrlFaultSet( const unsigned long ErrorMark,
|
TMUTexDataCtrlFaultSet( const uint32_t ErrorMark,
|
||||||
double dScore,
|
double dScore,
|
||||||
const def_eFaultSource eFaultSourceCASL,
|
const def_eFaultSource eFaultSourceCASL,
|
||||||
const def_eFaultSource eFaultSourceCASH,
|
const def_eFaultSource eFaultSourceCASH,
|
||||||
const def_eFaultSource eFaultSourceRAS,
|
const def_eFaultSource eFaultSourceRAS,
|
||||||
const def_eFaultSource eFaultSourceWE
|
const def_eFaultSource eFaultSourceWE
|
||||||
);
|
)
|
||||||
|
{
|
||||||
|
if( count_bit32(ErrorMark) > 16 )
|
||||||
|
{
|
||||||
|
if(ErrorMark & 0x000000FF)
|
||||||
|
FaultSource_AddScore(eFaultSourceCASL,dScore);
|
||||||
|
if(ErrorMark & 0x0000FF00)
|
||||||
|
FaultSource_AddScore(eFaultSourceCASH,dScore);
|
||||||
|
if(ErrorMark & 0x00FF0000)
|
||||||
|
FaultSource_AddScore(eFaultSourceCASL,dScore);
|
||||||
|
if(ErrorMark & 0xFF000000)
|
||||||
|
FaultSource_AddScore(eFaultSourceCASH,dScore);
|
||||||
|
|
||||||
|
FaultSource_AddScore(eFaultSourceRAS,dScore / 2);
|
||||||
|
FaultSource_AddScore(eFaultSourceWE,dScore / 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif //_DEF_FAULTSOURCES_H_
|
#endif //_DEF_FAULTSOURCES_H_
|
||||||
|
|||||||
@@ -124,10 +124,10 @@ 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;
|
||||||
|
|
||||||
const FxU32 TestVal1 = get_notnull_random_balanced_mByte();
|
const uint32_t TestVal1 = get_notnull_random_balanced_mByte();
|
||||||
const FxU32 TestVal2 = get_notnull_random_balanced_mByte();
|
const uint32_t TestVal2 = get_notnull_random_balanced_mByte();
|
||||||
const FxU32 TestValBlank1 = get_notnull_random_balanced_mByte();
|
const uint32_t TestValBlank1 = get_notnull_random_balanced_mByte();
|
||||||
const FxU32 TestValBlank2 = get_notnull_random_balanced_mByte();
|
const uint32_t TestValBlank2 = get_notnull_random_balanced_mByte();
|
||||||
|
|
||||||
// Clearing memory targets
|
// Clearing memory targets
|
||||||
for(unsigned char idxclr=0;
|
for(unsigned char idxclr=0;
|
||||||
@@ -170,20 +170,22 @@ RenderTestAddress( sst1DeviceInfoStruct* devInfo,
|
|||||||
// false positive
|
// false positive
|
||||||
if(idxdraw > idx) break;
|
if(idxdraw > idx) break;
|
||||||
|
|
||||||
/* set to mem addr */
|
/* set to mem addr */ //TODO: 4x2
|
||||||
ISET(sstregs->texBaseAddr, (add_list[idxdraw].u32Addr >> 3));
|
ISET(sstregs->texBaseAddr, (add_list[idxdraw].u32Addr >> 3));
|
||||||
drawTriangle(sstregs, 0, 0, 4); /* draw a 4x4 triangle */
|
/* draw a 4x4 triangle */
|
||||||
|
drawSquare(sstregs, 0, 0, 4);
|
||||||
|
sst1InitIdle(sst);
|
||||||
|
|
||||||
// First line, to use bits 00..31
|
// First line, to use bits 00..31
|
||||||
const FxU32 L1 = IGET(sst[(SST_LFB_ADDR>>2) + 0]);
|
const uint32_t L1 = IGET(sst[(SST_LFB_ADDR>>2) + 0]);
|
||||||
// Second line,to use bits 32..63
|
// Second line,to use bits 32..63
|
||||||
const FxU32 L2 = IGET(sst[(SST_LFB_ADDR>>2) + (2048>>2) + 0]);
|
const uint32_t L2 = IGET(sst[(SST_LFB_ADDR>>2) + (2048>>2) + 0]);
|
||||||
|
|
||||||
const unsigned long ErrorMark_L1 = (idxdraw == idx) ? (L1 ^ TestVal1) : (L1 ^ TestValBlank1);
|
const uint32_t ErrorMark_L1 = (idxdraw == idx) ? (L1 ^ TestVal1) : (L1 ^ TestValBlank1);
|
||||||
const unsigned long ErrorMark_L2 = (idxdraw == idx) ? (L2 ^ TestVal2) : (L2 ^ TestValBlank2);
|
const uint32_t ErrorMark_L2 = (idxdraw == idx) ? (L2 ^ TestVal2) : (L2 ^ TestValBlank2);
|
||||||
|
|
||||||
const unsigned long ErrorMarkBlank_L1 = (idxdraw == idx) ? (L1 ^ TestValBlank1) : (L1 ^ TestVal1);
|
const uint32_t ErrorMarkBlank_L1 = (idxdraw == idx) ? (L1 ^ TestValBlank1) : (L1 ^ TestVal1);
|
||||||
const unsigned long ErrorMarkBlank_L2 = (idxdraw == idx) ? (L2 ^ TestValBlank2) : (L2 ^ TestVal2) ;
|
const uint32_t ErrorMarkBlank_L2 = (idxdraw == idx) ? (L2 ^ TestValBlank2) : (L2 ^ TestVal2) ;
|
||||||
|
|
||||||
if(ErrorMark_L1 || ErrorMark_L2)
|
if(ErrorMark_L1 || ErrorMark_L2)
|
||||||
{
|
{
|
||||||
|
|||||||
51
Test_Data.c
51
Test_Data.c
@@ -54,31 +54,32 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
|
|||||||
ISET(texAddr[0], value2); ISET(texAddr[1], value2 + 1);
|
ISET(texAddr[0], value2); ISET(texAddr[1], value2 + 1);
|
||||||
ISET(texAddr[2], value2 + 2); ISET(texAddr[3], value2 + 3);
|
ISET(texAddr[2], value2 + 2); ISET(texAddr[3], value2 + 3);
|
||||||
|
|
||||||
/* draw a 8x8triangle */
|
/* draw a 8x8 square */ //TODO: 4x2
|
||||||
drawTriangle(sstregs,0,0,8);
|
drawSquare(sstregs,0,0,8);
|
||||||
|
sst1InitIdle(sst);
|
||||||
|
|
||||||
/* reading back first line pixels addresses */
|
/* reading back first line pixels addresses */
|
||||||
const FxU32 L1_1 = IGET(sst[(SST_LFB_ADDR >> 2) + 0]);
|
const uint32_t L1_1 = IGET(sst[(SST_LFB_ADDR >> 2) + 0]);
|
||||||
const FxU32 L1_2 = IGET(sst[(SST_LFB_ADDR >> 2) + 1]);
|
const uint32_t L1_2 = IGET(sst[(SST_LFB_ADDR >> 2) + 1]);
|
||||||
const FxU32 L1_3 = IGET(sst[(SST_LFB_ADDR >> 2) + 2]);
|
const uint32_t L1_3 = IGET(sst[(SST_LFB_ADDR >> 2) + 2]);
|
||||||
const FxU32 L1_4 = IGET(sst[(SST_LFB_ADDR >> 2) + 3]);
|
const uint32_t L1_4 = IGET(sst[(SST_LFB_ADDR >> 2) + 3]);
|
||||||
|
|
||||||
/* reading back second line pixels addresses */
|
/* reading back second line pixels addresses */
|
||||||
const FxU32 L2_1 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 0]);
|
const uint32_t L2_1 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 0]);
|
||||||
const FxU32 L2_2 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 1]);
|
const uint32_t L2_2 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 1]);
|
||||||
const FxU32 L2_3 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 2]);
|
const uint32_t L2_3 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 2]);
|
||||||
const FxU32 L2_4 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 3]);
|
const uint32_t L2_4 = IGET(sst[(SST_LFB_ADDR >> 2) + (2048 >> 2) + 3]);
|
||||||
|
|
||||||
unsigned long long NbErr = 0;
|
unsigned long long NbErr = 0;
|
||||||
|
|
||||||
const unsigned long ErrorMark_L1_1 = L1_1 ^ ( value1 + 0 );
|
const uint32_t ErrorMark_L1_1 = L1_1 ^ ( value1 + 0 );
|
||||||
const unsigned long ErrorMark_L1_2 = L1_2 ^ ( value1 + 1 );
|
const uint32_t ErrorMark_L1_2 = L1_2 ^ ( value1 + 1 );
|
||||||
const unsigned long ErrorMark_L1_3 = L1_3 ^ ( value1 + 2 );
|
const uint32_t ErrorMark_L1_3 = L1_3 ^ ( value1 + 2 );
|
||||||
const unsigned long ErrorMark_L1_4 = L1_4 ^ ( value1 + 3 );
|
const uint32_t ErrorMark_L1_4 = L1_4 ^ ( value1 + 3 );
|
||||||
const unsigned long ErrorMark_L2_1 = L2_1 ^ ( value2 + 0 );
|
const uint32_t ErrorMark_L2_1 = L2_1 ^ ( value2 + 0 );
|
||||||
const unsigned long ErrorMark_L2_2 = L2_2 ^ ( value2 + 1 );
|
const uint32_t ErrorMark_L2_2 = L2_2 ^ ( value2 + 1 );
|
||||||
const unsigned long ErrorMark_L2_3 = L2_3 ^ ( value2 + 2 );
|
const uint32_t ErrorMark_L2_3 = L2_3 ^ ( value2 + 2 );
|
||||||
const unsigned long ErrorMark_L2_4 = L2_4 ^ ( value2 + 3 );
|
const uint32_t ErrorMark_L2_4 = L2_4 ^ ( value2 + 3 );
|
||||||
|
|
||||||
if( ErrorMark_L1_1 || ErrorMark_L1_2 || ErrorMark_L1_3 || ErrorMark_L1_4
|
if( ErrorMark_L1_1 || ErrorMark_L1_2 || ErrorMark_L1_3 || ErrorMark_L1_4
|
||||||
|| ErrorMark_L2_1 || ErrorMark_L2_2 || ErrorMark_L2_3 || ErrorMark_L2_4)
|
|| ErrorMark_L2_1 || ErrorMark_L2_2 || ErrorMark_L2_3 || ErrorMark_L2_4)
|
||||||
@@ -459,9 +460,9 @@ test_TMU_datalines( sst1DeviceInfoStruct* devInfo,
|
|||||||
const unsigned char RamSizeMB)
|
const unsigned char RamSizeMB)
|
||||||
{
|
{
|
||||||
typedef struct _def_sMemBlock{
|
typedef struct _def_sMemBlock{
|
||||||
unsigned long ulAddStart;
|
uint32_t ulAddStart;
|
||||||
unsigned long ulAddEnd;
|
uint32_t ulAddEnd;
|
||||||
unsigned long ulAddLength;
|
uint32_t ulAddLength;
|
||||||
}def_sMemBlock;
|
}def_sMemBlock;
|
||||||
|
|
||||||
const def_sMemBlock ar_memBlocks[] = {
|
const def_sMemBlock ar_memBlocks[] = {
|
||||||
@@ -491,9 +492,9 @@ test_TMU_datalines( sst1DeviceInfoStruct* devInfo,
|
|||||||
{
|
{
|
||||||
const def_sMemBlock* pMemBlk = &ar_memBlocks[iMemBlock];
|
const def_sMemBlock* pMemBlk = &ar_memBlocks[iMemBlock];
|
||||||
|
|
||||||
if(RamSizeMB<4 && pMemBlk->ulAddStart >= 0x300000) continue;
|
if(RamSizeMB < 4 && pMemBlk->ulAddStart >= 0x300000) continue;
|
||||||
if(RamSizeMB<3 && pMemBlk->ulAddStart >= 0x200000) continue;
|
if(RamSizeMB < 3 && pMemBlk->ulAddStart >= 0x200000) continue;
|
||||||
if(RamSizeMB<2 && pMemBlk->ulAddStart >= 0x100000) continue;
|
if(RamSizeMB < 2 && pMemBlk->ulAddStart >= 0x100000) continue;
|
||||||
/*
|
/*
|
||||||
printf("Testing memory block 0x%08x to 0x%08x ...\n",
|
printf("Testing memory block 0x%08x to 0x%08x ...\n",
|
||||||
pMemBlk->ulAddStart,
|
pMemBlk->ulAddStart,
|
||||||
@@ -528,7 +529,7 @@ test_TMU_datalines( sst1DeviceInfoStruct* devInfo,
|
|||||||
|
|
||||||
//printf("Done @ 0x%08x\n",dataTest);
|
//printf("Done @ 0x%08x\n",dataTest);
|
||||||
|
|
||||||
const FxU32 new_addrTest = pMemBlk->ulAddStart | (1 << ucAddMovingBit);
|
const FxU32 new_addrTest = pMemBlk->ulAddStart | (1u << ucAddMovingBit);
|
||||||
if(new_addrTest == pMemBlk->ulAddStart) break;
|
if(new_addrTest == pMemBlk->ulAddStart) break;
|
||||||
addrTest = new_addrTest;
|
addrTest = new_addrTest;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,45 @@
|
|||||||
#define _NB_CHECK_LOOP 3
|
#define _NB_CHECK_LOOP 3
|
||||||
|
|
||||||
//#define _PROFILING
|
//#define _PROFILING
|
||||||
|
|
||||||
|
#define _DEF_PREHEAT_TIME_S 10
|
||||||
|
static void
|
||||||
|
HeatMemAndTMU( sst1DeviceInfoStruct* devInfo,
|
||||||
|
FxU32* sst,
|
||||||
|
SstRegs *sstregs,
|
||||||
|
const char ucNumTMU,
|
||||||
|
const FxU32 mem)
|
||||||
|
{
|
||||||
|
|
||||||
|
ISET(sstregs->texBaseAddr, (mem>>3)); /* set to mem addr */
|
||||||
|
|
||||||
|
volatile FxU32 *texRowAddr
|
||||||
|
= (ucNumTMU<<(21-2)) + (((FxU32)0/*LOD0*/)<<(17-2))
|
||||||
|
+ (FxU32 *)SST_TEX_ADDRESS(sst);
|
||||||
|
|
||||||
|
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
|
||||||
|
{
|
||||||
|
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=2)
|
||||||
|
{
|
||||||
|
ISET(texRowAddr[iter_col/2], get_notnull_random_balanced_mByte());
|
||||||
|
}
|
||||||
|
texRowAddr += (1<<(9-2)); //jump to next line
|
||||||
|
}
|
||||||
|
|
||||||
|
clock_t begin = clock();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if(((sst1InitReturnStatus(sst) & SST_FIFOLEVEL)) >= 0x20)
|
||||||
|
{
|
||||||
|
/* draw a 252x256 square */
|
||||||
|
drawSquare(sstregs, 0, 0, 256);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while(((double)(clock() - begin)/CLOCKS_PER_SEC) < _DEF_PREHEAT_TIME_S );
|
||||||
|
|
||||||
|
sst1InitIdle(sst);
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned long long
|
static unsigned long long
|
||||||
RenderTest( sst1DeviceInfoStruct* devInfo,
|
RenderTest( sst1DeviceInfoStruct* devInfo,
|
||||||
FxU32* sst,
|
FxU32* sst,
|
||||||
@@ -50,18 +88,18 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
|
|||||||
#endif
|
#endif
|
||||||
ISET(sstregs->texBaseAddr, (mem>>3)); /* set to mem addr */
|
ISET(sstregs->texBaseAddr, (mem>>3)); /* set to mem addr */
|
||||||
|
|
||||||
static unsigned short
|
static uint16_t
|
||||||
ar_u16Pixels[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL];
|
ar_u16Pixels[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL];
|
||||||
static unsigned long
|
static uint32_t
|
||||||
ar_u16PixelsRaw[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL/2];
|
ar_u16PixelsRaw[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL/2];
|
||||||
static unsigned short
|
static uint16_t
|
||||||
ar_u16PixelsReRead[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL];
|
ar_u16PixelsReRead[_DEF_NB_PIXEL_ROW][_DEF_NB_PIXEL_COL];
|
||||||
|
|
||||||
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
|
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
|
||||||
{
|
{
|
||||||
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=2)
|
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=2)
|
||||||
{
|
{
|
||||||
const unsigned long NewData = get_notnull_random_balanced_mByte();
|
const uint32_t NewData = get_notnull_random_balanced_mByte();
|
||||||
ar_u16PixelsRaw[iter_row][iter_col/2] = NewData;
|
ar_u16PixelsRaw[iter_row][iter_col/2] = NewData;
|
||||||
ar_u16Pixels[iter_row][iter_col] = NewData >>16;
|
ar_u16Pixels[iter_row][iter_col] = NewData >>16;
|
||||||
ar_u16Pixels[iter_row][iter_col+1] = NewData & 0xFFFF;
|
ar_u16Pixels[iter_row][iter_col+1] = NewData & 0xFFFF;
|
||||||
@@ -100,51 +138,20 @@ RenderTest( sst1DeviceInfoStruct* devInfo,
|
|||||||
#ifdef _PROFILING
|
#ifdef _PROFILING
|
||||||
before_draw[i] = clock();
|
before_draw[i] = clock();
|
||||||
#endif
|
#endif
|
||||||
|
/* draw a 252x256 square */
|
||||||
drawTriangle(sstregs, 0, 0, 512); /* draw a 252x512 triangle */
|
drawSquare(sstregs, 0, 0, 256);
|
||||||
|
sst1InitIdle(sst);
|
||||||
|
|
||||||
#ifdef _PROFILING
|
#ifdef _PROFILING
|
||||||
after_draw[i] = clock();
|
after_draw[i] = clock();
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
printf("rdy.\n");
|
|
||||||
GrLfbInfo_t info;
|
|
||||||
if(grLfbLock( GR_LFB_READ_ONLY,
|
|
||||||
GR_BUFFER_BACKBUFFER,
|
|
||||||
GR_LFBWRITEMODE_ANY,
|
|
||||||
GR_ORIGIN_UPPER_LEFT,
|
|
||||||
FXFALSE,
|
|
||||||
&info)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
printf("got LFB access.\n");
|
|
||||||
FxU32 *rptr;
|
|
||||||
rptr = info.lfbPtr;
|
|
||||||
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
|
|
||||||
{
|
|
||||||
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=8)
|
|
||||||
{
|
|
||||||
ar_u16PixelsReRead[iter_row][iter_col] = *rptr >> 16;
|
|
||||||
ar_u16PixelsReRead[iter_row][iter_col+1] = *rptr & 0xFFFF;
|
|
||||||
rptr+=1;
|
|
||||||
}
|
|
||||||
rptr+=info.strideInBytes>>2;
|
|
||||||
}
|
|
||||||
grLfbUnlock(GR_LFB_READ_ONLY,GR_BUFFER_FRONTBUFFER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("NOT LFB access.\n");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
volatile FxU32* pLFB = sst + (SST_LFB_ADDR>>2);
|
volatile FxU32* pLFB = sst + (SST_LFB_ADDR>>2);
|
||||||
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
|
for(unsigned short iter_row = 0; iter_row < _DEF_NB_PIXEL_ROW; iter_row++)
|
||||||
{
|
{
|
||||||
|
|
||||||
//printf("reading row %d\n",iter_row);
|
//printf("reading row %d\n",iter_row);
|
||||||
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=2)
|
for(unsigned short iter_col = 0; iter_col < _DEF_NB_PIXEL_COL; iter_col+=2)
|
||||||
{
|
{
|
||||||
const FxU32 u32Data = *pLFB++;
|
const uint32_t u32Data = *pLFB++;
|
||||||
ar_u16PixelsReRead[iter_row][iter_col] = u32Data >> 16;
|
ar_u16PixelsReRead[iter_row][iter_col] = u32Data >> 16;
|
||||||
ar_u16PixelsReRead[iter_row][iter_col+1] = u32Data & 0xFFFF;
|
ar_u16PixelsReRead[iter_row][iter_col+1] = u32Data & 0xFFFF;
|
||||||
|
|
||||||
@@ -208,9 +215,9 @@ test_TMU_datalines_Huge( sst1DeviceInfoStruct* devInfo,
|
|||||||
const unsigned char RamSizeMB)
|
const unsigned char RamSizeMB)
|
||||||
{
|
{
|
||||||
typedef struct _def_sMemBlock{
|
typedef struct _def_sMemBlock{
|
||||||
unsigned long ulAddStart;
|
uint32_t ulAddStart;
|
||||||
unsigned long ulAddEnd;
|
uint32_t ulAddEnd;
|
||||||
unsigned long ulAddLength;
|
uint32_t ulAddLength;
|
||||||
}def_sMemBlock;
|
}def_sMemBlock;
|
||||||
|
|
||||||
const def_sMemBlock ar_memBlocks[] = {
|
const def_sMemBlock ar_memBlocks[] = {
|
||||||
|
|||||||
70
Utils.c
70
Utils.c
@@ -21,46 +21,26 @@
|
|||||||
|
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
|
||||||
inline void
|
void
|
||||||
printbin32( const unsigned long ulVal,
|
printbin32( const uint32_t ulVal,
|
||||||
const unsigned char bGroupByBytes)
|
const unsigned char bGroupByBytes)
|
||||||
{
|
{
|
||||||
for(unsigned long idxBit = 1<<31;idxBit>0;idxBit>>=1)
|
for(uint32_t idxBit = 1u<<31 ; idxBit > 0 ; idxBit >>= 1)
|
||||||
{
|
{
|
||||||
if(bGroupByBytes)
|
if(bGroupByBytes)
|
||||||
switch(idxBit)
|
switch(idxBit)
|
||||||
{
|
{
|
||||||
case 1<<23:
|
case 1u << 23:
|
||||||
case 1<<15:
|
case 1u << 15:
|
||||||
case 1<<7:
|
case 1u << 7:
|
||||||
putchar(' ');
|
putchar(' ');
|
||||||
}
|
}
|
||||||
putchar(ulVal & idxBit ? '1' : '0');
|
putchar(ulVal & idxBit ? '1' : '0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned char
|
void
|
||||||
count_bit32(const unsigned long ulVal)
|
printbin32Info( const uint32_t ulVal,
|
||||||
{
|
|
||||||
unsigned char cpt = 0;
|
|
||||||
for(unsigned long idxBit = 1<<31;idxBit>0;idxBit>>=1)
|
|
||||||
if(ulVal & idxBit)
|
|
||||||
cpt++;
|
|
||||||
return cpt;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline unsigned char
|
|
||||||
count_bit8(const unsigned char ulVal)
|
|
||||||
{
|
|
||||||
unsigned char cpt = 0;
|
|
||||||
for(unsigned char idxBit = 1<<7;idxBit>0;idxBit>>=1)
|
|
||||||
if(ulVal & idxBit)
|
|
||||||
cpt++;
|
|
||||||
return cpt;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void
|
|
||||||
printbin32Info( const unsigned long ulVal,
|
|
||||||
const unsigned short uhb,
|
const unsigned short uhb,
|
||||||
const unsigned short ulb)
|
const unsigned short ulb)
|
||||||
{
|
{
|
||||||
@@ -68,48 +48,48 @@ printbin32Info( const unsigned long ulVal,
|
|||||||
putchar('\n');
|
putchar('\n');
|
||||||
printf("%02d....%02d %02d....%02d %02d....%02d %02d....%02d\n",
|
printf("%02d....%02d %02d....%02d %02d....%02d %02d....%02d\n",
|
||||||
uhb,
|
uhb,
|
||||||
3*(uhb+ulb+1)/4, 3*((uhb+ulb+1)/4)-1,
|
3 * (uhb+ulb+1) / 4, 3 * ( (uhb+ulb+1) / 4) - 1,
|
||||||
(uhb+ulb+1)/2, ((uhb+ulb+1)/2)-1,
|
(uhb+ulb+1) / 2, ( (uhb+ulb+1) / 2) - 1,
|
||||||
(uhb+ulb+1)/4, ((uhb+ulb+1)/4)-1,
|
(uhb+ulb+1) / 4, ( (uhb+ulb+1) / 4) - 1,
|
||||||
ulb);
|
ulb);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long get_notnull_random()
|
uint32_t get_notnull_random()
|
||||||
{
|
{
|
||||||
unsigned long val;
|
uint32_t val;
|
||||||
do
|
do
|
||||||
val = random()<<1 ^ random();
|
val = (random() << 1) ^ random();
|
||||||
while(!val);
|
while(!val);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long get_notnull_random_balanced()
|
uint32_t get_notnull_random_balanced()
|
||||||
{
|
{
|
||||||
unsigned long val;
|
uint32_t val;
|
||||||
do
|
do
|
||||||
val = random()<<1 ^ random();
|
val = (random() << 1) ^ random();
|
||||||
while(count_bit32(val) != 16);
|
while(count_bit32(val) != 16);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned char get_notnull8_random_balanced()
|
uint8_t get_notnull8_random_balanced()
|
||||||
{
|
{
|
||||||
unsigned char val;
|
uint8_t val;
|
||||||
static unsigned char prev = 0;
|
static uint8_t prev = 0;
|
||||||
do
|
do
|
||||||
val = random()<<1 ^ random();
|
val = (random() << 1) ^ random();
|
||||||
while((count_bit8(val) != 4) || (val == prev));
|
while((count_bit8(val) != 4) || (val == prev));
|
||||||
prev = val;
|
prev = val;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long get_notnull_random_balanced_mByte()
|
uint32_t get_notnull_random_balanced_mByte()
|
||||||
{
|
{
|
||||||
unsigned long val;
|
uint32_t val;
|
||||||
static unsigned long prev = 0;
|
static uint32_t prev = 0;
|
||||||
do
|
do
|
||||||
val = (get_notnull8_random_balanced() << 24)
|
val = (get_notnull8_random_balanced() << 24)
|
||||||
| (get_notnull8_random_balanced() << 16)
|
| (get_notnull8_random_balanced() << 16)
|
||||||
| (get_notnull8_random_balanced() << 8)
|
| (get_notnull8_random_balanced() << 8)
|
||||||
| (get_notnull8_random_balanced() << 0);
|
| (get_notnull8_random_balanced() << 0);
|
||||||
|
|||||||
50
Utils.h
50
Utils.h
@@ -18,13 +18,47 @@
|
|||||||
#ifndef _DEF_UTILS_H_
|
#ifndef _DEF_UTILS_H_
|
||||||
#define _DEF_UTILS_H_
|
#define _DEF_UTILS_H_
|
||||||
|
|
||||||
inline void printbin32(const unsigned long ulVal,const unsigned char bGroupByBytes);
|
#include <stdint.h>
|
||||||
inline unsigned char count_bit32(const unsigned long ulVal);
|
|
||||||
inline unsigned char count_bit8(const unsigned char ulVal);
|
static inline unsigned char
|
||||||
inline void printbin32Info(const unsigned long ulVal, const unsigned short uhb, const unsigned short ulb);
|
count_bit32(const uint32_t ulVal)
|
||||||
unsigned long get_notnull_random();
|
{
|
||||||
unsigned long get_notnull_random_balanced();
|
unsigned char cpt = 0;
|
||||||
unsigned char get_notnull8_random_balanced();
|
for(uint32_t idxBit = 1<<31;idxBit>0;idxBit>>=1)
|
||||||
unsigned long get_notnull_random_balanced_mByte();
|
if(ulVal & idxBit)
|
||||||
|
cpt++;
|
||||||
|
return cpt;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline unsigned char
|
||||||
|
count_bit8(const uint8_t ulVal)
|
||||||
|
{
|
||||||
|
unsigned char cpt = 0;
|
||||||
|
for(uint8_t idxBit = 1<<7;idxBit>0;idxBit>>=1)
|
||||||
|
if(ulVal & idxBit)
|
||||||
|
cpt++;
|
||||||
|
return cpt;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
printbin32( const uint32_t ulVal,
|
||||||
|
const unsigned char bGroupByBytes);
|
||||||
|
|
||||||
|
void
|
||||||
|
printbin32Info( const uint32_t ulVal,
|
||||||
|
const unsigned short uhb,
|
||||||
|
const unsigned short ulb);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
get_notnull_random();
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
get_notnull_random_balanced();
|
||||||
|
|
||||||
|
uint8_t
|
||||||
|
get_notnull8_random_balanced();
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
get_notnull_random_balanced_mByte();
|
||||||
|
|
||||||
#endif //_DEF_UTILS_H_
|
#endif //_DEF_UTILS_H_
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ typedef enum _def_eLogLevel {
|
|||||||
|
|
||||||
typedef struct _def_sOptions
|
typedef struct _def_sOptions
|
||||||
{
|
{
|
||||||
def_eLogLevel ucLogLevel;
|
|
||||||
unsigned char bLogStdOut;
|
unsigned char bLogStdOut;
|
||||||
char szLogFileName[2048];
|
char szLogFileName[2048];
|
||||||
char szTSVFile[2048];
|
char szTSVFile[2048];
|
||||||
|
|||||||
2
main.c
2
main.c
@@ -76,7 +76,7 @@ def_sOptions sOptions = {
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
unsigned long long ullNbErrorAll = 0;
|
unsigned long long ullNbErrorAll = 0;
|
||||||
const FxU32 boardNum = 0;
|
const unsigned char boardNum = 0;
|
||||||
|
|
||||||
sst1DeviceInfoStruct devInfo;
|
sst1DeviceInfoStruct devInfo;
|
||||||
FxU32* sst;
|
FxU32* sst;
|
||||||
|
|||||||
Reference in New Issue
Block a user