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

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

Rev 6 Rev 54
Line 76... Line 76...
    }
    }
 
 
    brd->brd_init();
    brd->brd_init();
    brd->brd_pld_info();
    brd->brd_pld_info();
 
 
    std::cout << "Reset FPGA..." << std::endl;
 
    brd->brd_reg_poke_ind(0,0,1);
 
    brd->brd_delay(100);
 
    brd->brd_reg_poke_ind(0,0,0);
 
    brd->brd_delay(100);
 
 
 
    std::cout << "Init FPGA..." << std::endl;
 
    for( int trd=0; trd<8; trd++ ) {
 
        brd->brd_reg_poke_ind( trd, 0, 1 );
 
    }
 
    for( int trd=0; trd<8; trd++ ) {
 
        for( int ii=1; ii<32; ii++ ) {
 
            brd->brd_reg_poke_ind( trd, ii, 0 );
 
        }
 
    }
 
    for( int trd=0; trd<8; trd++ ) {
 
        brd->brd_reg_poke_ind( trd, 0, 0 );
 
    }
 
 
 
    std ::cout << "Press enter to allocate DMA memory..." << endl;
    std ::cout << "Press enter to allocate DMA memory..." << endl;
    getchar();
    getchar();
 
 
    int DmaChan = 1;
    int DmaChan = 1;
 
 
Line 110... Line 91...
        BLOCK_SIZE,
        BLOCK_SIZE,
        pBuffers,
        pBuffers,
        NULL,
        NULL,
    };
    };
 
 
    brd->dma_alloc(dmaChan, &sSCA);
    brd->dma_allocate_memory(dmaChan, &sSCA);
 
 
    brd->dma_set_local_addr(DmaChan, 0x1000);
    brd->dma_set_local_addr(DmaChan, 0x1000);
    brd->dma_stop(DmaChan);
    brd->dma_stop(DmaChan);
    brd->dma_reset_fifo(DmaChan);
    brd->dma_reset_fifo(DmaChan);
    brd->dma_reset_fifo(DmaChan);
 
 
 
    std ::cout << "Press enter to start DMA channel..." << endl;
    std ::cout << "Press enter to start DMA channel..." << endl;
    getchar();
    getchar();
 
 
    // fill data buffers
    // fill data buffers
Line 141... Line 121...
    // show data buffers
    // show data buffers
    for(int j=0; j<NUM_BLOCK; j++) {
    for(int j=0; j<NUM_BLOCK; j++) {
 
 
        std ::cout << "DMA data buffer " << j << ":" << endl;
        std ::cout << "DMA data buffer " << j << ":" << endl;
        buffer = (u32*)pBuffers[j];
        buffer = (u32*)pBuffers[j];
        for(unsigned i=0; i<32; i++) {
        for(unsigned i=0; i<8; i++) {
            std::cout << hex << buffer[i] << " ";
            std::cout << hex << buffer[i] << " ";
        }
        }
        std ::cout << endl;
        std ::cout << endl;
    }
    }
    std::cout << dec << endl;
    std::cout << dec << endl;

powered by: WebSVN 2.1.0

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