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/] [main.cpp] - Diff between revs 2 and 6

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

Rev 2 Rev 6
Line 29... Line 29...
 
 
#include "cl_ambpex.h"
#include "cl_ambpex.h"
#include "tf_test.h"
#include "tf_test.h"
#include "tf_teststrm.h"
#include "tf_teststrm.h"
#include "tf_teststrmout.h"
#include "tf_teststrmout.h"
//#include "useful.h"
 
 
 
#define DEVICE_NAME "/dev/AMBPEXARM_DEVID0"
#define DEVICE_NAME "/dev/pexdrv0"
//#define DEVICE_NAME "/dev/AMBPEX50"
 
CL_AMBPEX *pBrd = NULL;
CL_AMBPEX *pBrd = NULL;
U32 isTwoTest=0;
U32 isTwoTest=0;
static volatile int exit_flag = 0;
static volatile int exit_flag = 0;
 
 
void signa_handler(int signo)
void signa_handler(int signo)
Line 72... Line 71...
 
 
        if( 0==ret )
        if( 0==ret )
        {
        {
            BRDC_fprintf( stderr, _BRDC("Module "DEVICE_NAME" successfuly opened\n") );
            BRDC_fprintf( stderr, _BRDC("Module "DEVICE_NAME" successfuly opened\n") );
 
 
 
 
            for( int trd=0; trd<8; trd++ )
            for( int trd=0; trd<8; trd++ )
                pBrd->RegPokeInd( trd, 0, 1 );
                pBrd->RegPokeInd( trd, 0, 1 );
 
 
            for( int trd=0; trd<8; trd++ )
            for( int trd=0; trd<8; trd++ )
                for( int ii=1; ii<32; ii++ )
                for( int ii=1; ii<32; ii++ )
Line 83... Line 83...
 
 
            for( int trd=0; trd<8; trd++ )
            for( int trd=0; trd<8; trd++ )
                pBrd->RegPokeInd( trd, 0, 0 );
                pBrd->RegPokeInd( trd, 0, 0 );
 
 
 
 
 
 
        } else
        } else
        {
        {
            BRDC_fprintf( stderr, _BRDC("Error open module "DEVICE_NAME": ret=0x%.8X\n"), ret );
            BRDC_fprintf( stderr, _BRDC("Error open module "DEVICE_NAME": ret=0x%.8X\n"), ret );
            exit(-1);
            exit(-1);
        }
        }
Line 117... Line 118...
        if( pTest2 )
        if( pTest2 )
            pTest2->Start();
            pTest2->Start();
 
 
        //int key;
        //int key;
        int isFirstCallStep=1;
        int isFirstCallStep=1;
 
        int isStopped = 0;
        for( ; ; )
        for( ; ; )
        {
        {
            //if( kbhit() )
 
            //{
 
                //int key=getch();
 
                if( exit_flag )
                if( exit_flag )
                {
                {
 
                if(!isStopped) {
                    pTest->Stop();
                    pTest->Stop();
                    if( pTest2 )
                    if( pTest2 ) {
                        pTest2->Stop();
                        pTest2->Stop();
 
                    }
                    BRDC_fprintf( stderr, _BRDC("\n\nCancel\n") );
                    BRDC_fprintf( stderr, _BRDC("\n\nCancel\n") );
 
                    isStopped = 1;
 
                }
                }
                }
/*
 
                if( key=='i' )
 
                {
 
                    pBrd->RegPokeInd( 4, TRDIND_DELAY_CTRL, 0x12 );
 
                    pBrd->RegPokeInd( 4, TRDIND_DELAY_CTRL, 0x10 );
 
                    g_DelayCnt--; BRDC_fprintf( stderr, "\n\ng_DelayCnt = %d ", g_DelayCnt );
 
                }
 
 
 
                if( key=='o' )
 
                {
 
                    pBrd->RegPokeInd( 4, TRDIND_DELAY_CTRL, 0x13 );
 
                    pBrd->RegPokeInd( 4, TRDIND_DELAY_CTRL, 0x11 );
 
                    g_DelayCnt++; BRDC_fprintf( stderr, "\n\ng_DelayCnt = %d ", g_DelayCnt );
 
                }
 
*/
 
            //}
 
 
 
            ret=pTest->isComplete();
            if( exit_flag )
            if( ret )
 
            {
 
                if( pTest2 )
 
                {
                {
                    ret=pTest2->isComplete();
                if(isStopped) {
                    if( ret )
 
 
                    if( pTest->isComplete() ) {
 
 
 
                        if( pTest2 ) {
 
                            if( pTest2->isComplete() )
                        break;
                        break;
                } else
                        } else {
                {
 
                    break;
                    break;
                }
                }
 
                    }
 
                }
            }
            }
 
 
            //SetConsoleCursorPosition(hConsoleOut, rCursorPosition);
 
            if( isFirstCallStep || isTwoTest )
            if( isFirstCallStep || isTwoTest )
            {
            {
 
 
                BRDC_fprintf( stderr, _BRDC("%10s %10s %10s %10s %10s %10s %10s %10s\n"), _BRDC(""), _BRDC("BLOCK_WR"), _BRDC("BLOCK_RD"), _BRDC("BLOCK_OK"), _BRDC("BLOCK_ERR"), _BRDC("SPD_CURR"), _BRDC("SPD_AVR"), _BRDC("STATUS"));
                BRDC_fprintf( stderr, _BRDC("%10s %10s %10s %10s %10s %10s %10s %10s\n"), _BRDC(""), _BRDC("BLOCK_WR"), _BRDC("BLOCK_RD"), _BRDC("BLOCK_OK"), _BRDC("BLOCK_ERR"), _BRDC("SPD_CURR"), _BRDC("SPD_AVR"), _BRDC("STATUS"));
                BRDC_fprintf( stderr, _BRDC("\n"));
                BRDC_fprintf( stderr, _BRDC("\n"));
Line 182... Line 169...
            if( pTest2 )
            if( pTest2 )
                pTest2->Step();
                pTest2->Step();
            if( isTwoTest )
            if( isTwoTest )
                BRDC_fprintf( stderr, "\n\n" );
                BRDC_fprintf( stderr, "\n\n" );
 
 
            Sleep( 400 );
            Sleep( 1400 );
 
 
            fflush( stdout );
            fflush( stdout );
 
 
            if(exit_flag)
 
                break;
 
        }
        }
        pTest->GetResult();
        pTest->GetResult();
        if( pTest2 )
        if( pTest2 )
            pTest2->GetResult();
            pTest2->GetResult();
 
 
 
 
        delete pTest; pTest=NULL;
        delete pTest; pTest=NULL;
        delete pTest2; pTest2=NULL;
        delete pTest2; pTest2=NULL;
 
 
    }
    }
    catch( BRDCHAR* str )
    catch( BRDCHAR* str )
Line 207... Line 190...
    catch( ... )
    catch( ... )
    {
    {
        BRDC_fprintf( stderr, _BRDC("Неизвестная ошибка выполнения программы\n") );
        BRDC_fprintf( stderr, _BRDC("Неизвестная ошибка выполнения программы\n") );
    }
    }
 
 
    BRDC_fprintf( stderr, "\n Press any key\n" );
    BRDC_fprintf( stderr, "Exit program\n" );
 
 
    return 0;
    return 0;
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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