OpenCores
URL https://opencores.org/ocsvn/pcie_ds_dma/pcie_ds_dma/trunk

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [soft/] [linux/] [application/] [adm_test/] [src/] [work/] [tf_teststrmout.cpp] - Diff between revs 2 and 27

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 27
Line 23... Line 23...
#define TRDIND_MODE2                                    0xA
#define TRDIND_MODE2                                    0xA
#define TRDIND_SPD_CTRL                                 0x204
#define TRDIND_SPD_CTRL                                 0x204
#define TRDIND_SPD_ADDR                                 0x205
#define TRDIND_SPD_ADDR                                 0x205
#define TRDIND_SPD_DATA                                 0x206
#define TRDIND_SPD_DATA                                 0x206
 
 
 
int GetTickCount(void);
 
 
TF_TestStrmOut::TF_TestStrmOut( BRDCHAR* fname, CL_AMBPEX *fotr )
TF_TestStrmOut::TF_TestStrmOut( BRDCHAR* fname, CL_AMBPEX *fotr )
{
{
    lc_status=0;
    lc_status=0;
 
 
Line 96... Line 97...
void TF_TestStrmOut::Step( void )
void TF_TestStrmOut::Step( void )
{
{
    if( isTest )
    if( isTest )
        TestCtrlReadStatus( &tr0 );
        TestCtrlReadStatus( &tr0 );
 
 
 
    long currentTime = GetTickCount();
 
    int min, sec_all, sec;
 
    sec_all= currentTime-tr0.time_start;
 
    sec_all/=1000;
 
    sec=sec_all%60;
 
    min=sec_all/60;
 
 
 
 
    U32 status = pBrd->RegPeekDir( tr0.trd, 0 ) & 0xFFFF;
    U32 status = pBrd->RegPeekDir( tr0.trd, 0 ) & 0xFFFF;
    BRDC_fprintf( stderr, "%6s %3d %10d %10d %10d %10d  %9.1f %10.1f     0x%.4X  \r", "TRD :", tr0.trd, tr0.BlockWr, tr0.BlockRd, tr0.BlockOk, tr0.BlockError, tr0.VelocityCurrent, tr0.VelocityAvarage, status );
    BRDC_fprintf( stderr, "%6s %3d %10d %10d %10d %10d  %9.1f %10.1f     0x%.4X       %u:%.2u  \r", "TRD :", tr0.trd, tr0.BlockWr, tr0.BlockRd, tr0.BlockOk, tr0.BlockError, tr0.VelocityCurrent, tr0.VelocityAvarage, status, min, sec );
}
}
 
 
int TF_TestStrmOut::isComplete( void )
int TF_TestStrmOut::isComplete( void )
{
{
    if( (lc_status==4)  )
    if( (lc_status==4)  )
Line 114... Line 123...
    //if(pkg_in.BlockRd!=0 && pkg_in.BlockError!=0)
    //if(pkg_in.BlockRd!=0 && pkg_in.BlockError!=0)
    //  printf("%s\n", pkg_in.testBuf.report_word_error());
    //  printf("%s\n", pkg_in.testBuf.report_word_error());
 
 
    if( isTest )
    if( isTest )
    {
    {
        BRDC_fprintf( stderr, "\n\nResult of transmitted data via tetrad %d \n", trdNo );
        BRDC_fprintf( stderr, "\n\nResult of transmitted data via trd %d \n", trdNo );
        TestCtrlResult( &tr0 );
        TestCtrlResult( &tr0 );
    }
    }
    BRDC_fprintf( stderr, "\n\n" );
    BRDC_fprintf( stderr, "\n\n" );
}
}
 
 
Line 222... Line 231...
    }
    }
 
 
 
 
 
 
 
 
    pBrd->RegPokeInd( tr0.trd, 0, 0x2030 );
    pBrd->RegPokeInd( tr0.trd, 0, 0x2000 );
 
 
 
 
    pBrd->StreamStart( tr0.Strm );
    pBrd->StreamStart( tr0.Strm );
 
 
 
    Sleep( 100 );
 
 
 
 
    tr0.BlockLast=tr0.BlockStart=tr0.BlockWr;
    tr0.BlockLast=tr0.BlockStart=tr0.BlockWr;
 
 
    pBrd->RegPokeInd( tr0.trd, 0, 0x2038 );
    pBrd->RegPokeInd( tr0.trd, 0, 0x2038 );
 
 
    Sleep( 100 );
    isDmaStart=1;
 
 
 
 
 
 
    tr0.time_last=tr0.time_start=0;//GetTickCount();
    tr0.time_last=tr0.time_start=GetTickCount();
 
 
 
 
    for( ; ; )
    for( ; ; )
    {
    {
        if( Terminate )
        if( Terminate )
Line 312... Line 321...
            //break;
            //break;
        }
        }
    }
    }
    //Sleep( 0 );
    //Sleep( 0 );
 
 
/*
 
    U32 currentTime = GetTickCount();
 
    if( (currentTime - pr->time_last)>4000 )
 
    {
 
        float t1 = currentTime - pr->time_last;
 
        float t2 = currentTime - pr->time_start;
 
        float v = 1000.0*(pr->BlockWr-pr->BlockLast)*SizeBlockOfBytes/t1;
 
        v/=1024*1024;
 
        pr->VelocityCurrent=v;
 
 
 
        v = 1000.0*(pr->BlockWr-pr->BlockStart)*SizeBlockOfBytes/t2;
 
        v/=1024*1024;
 
        pr->VelocityAvarage=v;
 
        pr->time_last = currentTime;
 
        pr->BlockLast = pr->BlockWr;
 
        pr->freeCycleZ=pr->freeCycle;
 
        pr->freeCycle=0;
 
 
 
    }
    U32 currentTime = GetTickCount();
    //Sleep(1);
    if( (currentTime - pr->time_last)>4000 )
*/
    {
 
        float t1 = currentTime - pr->time_last;
 
        float t2 = currentTime - pr->time_start;
 
        float v = 1000.0*(pr->BlockWr-pr->BlockLast)*SizeBlockOfBytes/t1;
 
        v/=1024*1024;
 
        pr->VelocityCurrent=v;
 
 
 
        v = 1000.0*(pr->BlockWr-pr->BlockStart)*SizeBlockOfBytes/t2;
 
        v/=1024*1024;
 
        pr->VelocityAvarage=v;
 
        pr->time_last = currentTime;
 
        pr->BlockLast = pr->BlockWr;
 
        pr->freeCycleZ=pr->freeCycle;
 
        pr->freeCycle=0;
 
 
 
    }
 
    //Sleep(1);
 
 
 
 
}
}
 
 
 
 
void TF_TestStrmOut::PrepareAdm( void )
void TF_TestStrmOut::PrepareAdm( void )
Line 449... Line 458...
    pr->BlockOk=block_ok;
    pr->BlockOk=block_ok;
    pr->BlockError=block_error;
    pr->BlockError=block_error;
    pr->TotalError=total_error;
    pr->TotalError=total_error;
 
 
    BRDC_fprintf( stderr, "\n Recieved blocks : %d \n",  block_rd );
    BRDC_fprintf( stderr, "\n Recieved blocks : %d \n",  block_rd );
    BRDC_fprintf( stderr, " Valid blocks: %d \n", block_ok );
    BRDC_fprintf( stderr,   " Correct blocks  :   %d \n", block_ok );
    BRDC_fprintf( stderr, " Invalid blocks: %d \n", block_error );
    BRDC_fprintf( stderr,   " Incorrect blocks:   %d \n", block_error );
    BRDC_fprintf( stderr, " Total errors:      %d \n\n", total_error );
    BRDC_fprintf( stderr, " Total errors:      %d \n\n", total_error );
 
    BRDC_fprintf( stderr,   " Speed           :   %.1f [Mbytes/s] \n", pr->VelocityAvarage );
 
 
 
    U32 currentTime = GetTickCount();
 
    int min, sec_all, sec;
 
    sec_all= currentTime-pr->time_start;
 
    sec_all/=1000;
 
    sec=sec_all%60;
 
    min=sec_all/60;
 
 
 
    BRDC_fprintf( stderr,   " Time of test    :   %d min %.2d sec\n\n", min, sec );
 
 
 
 
    if( total_error>0 )
    if( total_error>0 )
    {
    {
        BRDC_fprintf( stderr, " Error list:\n" );
        BRDC_fprintf( stderr, " Error list:\n" );
        int cnt=total_error;
        int cnt=total_error;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.