Comparing Pipes and Streams
Input/Output Methods
6-3
Data pipes are used to buffer streams of input and output data. These data
pipes provide a consistent software data structure you can use to drive I/O
between the DSP device and all kinds of real-time peripheral devices. There is
more overhead with a data pipe than with streams, and notification is
automatically handled by the pipe manager. All I/O operations on a pipe deal
with one frame at a time; although each frame has a fixed length, the application
can put a variable amount of data in each frame up to the length of the frame.
Separate pipes should be used for each data transfer thread, and a pipe
should only have a single reader and a single writer, providing point to point
communication. Often one end of a pipe is controlled by an HWI and the other
end is controlled by an SWI function. Pipes can also transfer data between
two application threads.
Message queues allow for the structured sending and receiving of variable
length messages. This module can be used for messaging between multiple
processors. See section 6.5,
for a description of message
queues.
Host channel objects allow an application to stream data between the target
and the host. Host channels are statically configured for input or output. Each
host channel is internally implemented using a data pipe object.
6.2 Comparing Pipes and Streams
DSP/BIOS supports two different models for data transfer. The pipe model is
used by the PIP and HST modules. The stream model is used by the SIO and
DEV modules.
Both models require that a pipe or stream have a single reader thread and a
single writer thread. Both models transfer buffers within the pipe or stream by
copying pointers rather than by copying data between buffers.
In general, the pipe model supports low-level communication, while the
stream model supports high-level, device-independent I/O. Table 6-1
compares the two models in more detail.
Table 6-1 Comparison of Pipes and Streams
Pipes
(PIP and HST)
Streams
(SIO and DEV)
Programmer must create own
driver structure.
Provides a more structured approach to
device-driver creation.
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...