CO_STREAM_CREATE


 co_stream co_stream_create(const char *name,                            co_type type,                            int numelements); 

Header File

co.h

Description

This function creates a stream. Streams created using co_stream_create are subsequently used to connect processes. This function must be called from within the configuration function of your application.

Arguments

The arguments for co_stream_create are as follows:

const char *name

A programmer-defined name. This name may be any text string. It is used to identify the stream externally, such as when using the Application Monitor.

co_type type

The type of the stream, including its width. The type is normally expressed as a signed or unsigned integer of a specific width using the INT_TYPE(n), UINT_TYPE(n), or CHAR_TYPE macros.

int numelements

Specifies the size of the stream buffer. Streams are implemented using first-in-first-out (FIFO) buffers. The size of this buffer in bytes is the value of the numelements argument multiplied by the size (in bytes) of the type specified in the preceding argument. Note that the size you specify for streams may have a dramatic impact on the size of the resulting logic after compilation to hardware.


Return Value

A pointer to the created stream. This return value may subsequently be used as an argument to function co_process_create.

Notes

Stream names, as specified in the first argument to co_stream_create, must be unique across the application when using the Application Monitor.

In simulation, this function prints an error message and terminates the application if it is called from outside the configuration function, or if the Application Monitor is being used and a name argument is not supplied (== NULL), or if a type wider than 64 bits is specified.



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

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