CO_MEMORY_READBLOCK


 void co_memory_readblock(co_memory mem,                          unsigned int offset,                          void *buf,                          size_t buffersize); 

Header File

co.h

Description

This function reads a block of data from a shared memory. This function must be called from within a process run function.

Arguments

The arguments for co_memory_readblock are as follows:

co_memory mem

A pointer to a memory as passed on the process argument list.

unsigned int offset

The memory offset from which to begin reading, in bytes.

void *buf

A pointer to the local memory that will receive the shared memory data. In hardware processes, this argument must be an array identifier.

size_t buffersize

The number of bytes to transfer in the block read operation.


Return Value

None.

Notes

co_memory_readblock performs a block DMA transfer between shared memories and local memories. The third argument, buf, is an array that represents a block of local RAM. Note that co_memory_readblock is not designed for efficient random access of individual memory locations. Note also that stream interfaces may actually provide better performance than memory block reads and writes if the system contains a CPU.

The co_errno variable is set to CO_EMEM_OUT_OF_BOUNDS if the offset is outside the bounds of the memory. co_errno is set to CO_ENULL_PTR if the argument mem is NULL.



    Practical FPGA Programming in C
    Practical FPGA Programming in C
    ISBN: 0131543180
    EAN: 2147483647
    Year: 2005
    Pages: 208

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net