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 54 and 55

Show entire file | Details | Blame | View Log

Rev 54 Rev 55
Line 79... Line 79...
    brd->brd_pld_info();
    brd->brd_pld_info();
 
 
    std ::cout << "Press enter to allocate DMA memory..." << endl;
    std ::cout << "Press enter to allocate DMA memory..." << endl;
    getchar();
    getchar();
 
 
    int DmaChan = 1;
 
 
 
    // Check BRDSHELL DMA interface
    // Check BRDSHELL DMA interface
    BRDctrl_StreamCBufAlloc sSCA = {
    BRDctrl_StreamCBufAlloc sSCA = {
        1,      //dir
        1,      //dir
        1,
        1,
        NUM_BLOCK,
        NUM_BLOCK,
Line 93... Line 91...
        NULL,
        NULL,
    };
    };
 
 
    brd->dma_allocate_memory(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->brd_reg_poke_dir(0, 0x1, 0x1);
 
    brd->brd_reg_poke_dir(0, 0x1, 0x1);
 
    brd->brd_reg_poke_ind(0, 0xC, 0x1);
 
    brd->brd_reg_poke_ind(0, 0x0, 0x2);
 
    brd->brd_reg_poke_ind(0, 0x0, 0x0);
 
 
    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 119... Line 123...
    brd->dma_stop(dmaChan);
    brd->dma_stop(dmaChan);
 
 
    // 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;
        fprintf(stdout, "DMA BLOCK %d\n", j);
        buffer = (u32*)pBuffers[j];
        buffer = (u32*)pBuffers[j];
        for(unsigned i=0; i<8; i++) {
        for(unsigned i=0; i<8; i++) {
            std::cout << hex << buffer[i] << " ";
            fprintf(stdout, "0x%08X ", buffer[i]);
        }
        }
        std ::cout << endl;
        fprintf(stdout, "\n\n");
    }
    }
    std::cout << dec << endl;
    std::cout << dec << endl;
 
 
    std ::cout << "Press enter to free DMA memory..." << endl;
    std ::cout << "Press enter to free DMA memory..." << endl;
    getchar();
    getchar();

powered by: WebSVN 2.1.0

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