Streaming Data to Multiple Clients
Streaming I/O and Device Drivers
7-25
7.7 Streaming Data to Multiple Clients
A common problem in multiprocessing systems is the simultaneous
transmission of a single data buffer to multiple tasks in the system. Such
multi-cast transmission, or scattering of data, can be done easily with
DSP/BIOS SIO streams. Consider the situation in which a single processor
sends data to four client processors.
Streaming data between processors in this context is somewhat different
from streaming data to or from an acquisition device, such as an A/D
converter, in that a single buffer of data must go to one or more clients. The
DSP/BIOS SIO functions SIO_get/SIO_put are used for data I/O.
SIO_put automatically performs a buffer exchange between the buffer
already at the device level and the application buffer. As a result, the user no
longer has control over the buffer since it is enqueued for I/O, and this I/O
happens asynchronously at the interrupt level. This forces the user to copy
data in order to send it to multiple clients. This is shown in Example 7-15.
Example 7-15.
Using SIO_put to Send Data to Multiple Clients
Copying the data wastes CPU cycles and requires more memory, since each
stream needs buffers. If you were double-buffering, Example 7-15 would
require eight buffers (two for each stream).
Example 7-16, illustrates the advantage of SIO_issue and SIO_reclaim in this
situation. The application performs no copying, and it uses only two buffers.
In each call, SIO_issue simply enqueues the buffer pointed to by bufA onto
outStream’s todevice queue without blocking. Since there is no copying or
blocking, this method greatly reduces the time between having a buffer of
data ready for transmission and the time the buffer can be sent to all clients.
In order to remove the buffers from the output devices, corresponding
SIO_reclaim functions must be called.
SIO_put(inStream, (Ptr)&bufA, npoints);
`fill bufA with data`
for (`all data points`) {
bufB[i] = bufC[i] = bufD[i] ... = bufA[i];
}
SIO_put(outStreamA, (Ptr)&bufA, npoints);
SIO_put(outStreamB, (Ptr)&bufB, npoints);
SIO_put(outStreamC, (Ptr)&bufC, npoints);
SIO_put(outStreamD, (Ptr)&bufD, npoints);
Содержание TMS320 Series
Страница 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Страница 16: ...xvi ...
Страница 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Страница 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Страница 202: ...5 20 ...
Страница 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Страница 288: ...Index 10 Index ...