I have attempted to define ap_stream across several files and received no warning from AutoESL.
However, the resulting RTL is incorrect; it does not pass my testbench (while it did pass when all parts of the design were in a single file).
The internal ap_stream is converted to an ap_vld interface for subfunction outputs and an ap_none interface for subfunction inputs, whereas I would expect ap_fifo.
What is happening?
Sharing internal AP_STREAMs between source files is not supported.
AP_STREAMS can be used in functions defined in different files.
However, if the AP_STREAM does not appear in the design interface, it is defined as being only internal by using the static qualifier.
This, by definition of the 'static' qualifier, makes the stream private to the source file in which it is defined.
As a result, any functions that require access to the stream must be defined in the same file.
For 2011.4.2 AutoESL and before, all internal (static) AP_STREAMs need to also be defined in the top-level source file in order to be implemented correctly as FIFOs.
Even if all functions using the internal AP_STREAM are defined in the same source file, this file must include the top-level function.
This limitation is fixed in the 2012.1 release of AutoESL.
The use of the AP_STREAM_SIZE() macro for internal streams is recommended for size specification of the underlying memory.