Changes between Version 24 and Version 25 of library_mwmr
- Timestamp:
- Nov 21, 2015, 1:28:21 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_mwmr
v24 v25 8 8 Each MWMR (Multi-Writer Multi-Reader) channel can be accessed concurently by one or several writer(s) and by one or several reader(s). It is implemented as a software FIFO, protected by a build-in, user-level spin_lock. 9 9 10 This software FIFO can be directly accessed by an hardware coprocessor, thanks to the vci_mwmr_controller, but we only describe here the software API that can be used by a software applications.10 This software FIFO can be directly accessed by an hardware coprocessor, thanks to the vci_mwmr_controller, but we only describe here the software API that can be used by a fully software application. 11 11 12 12 An MWMR transaction transfer an integer number of items between a thread private buffer and the MWMR communication channel. An item is the smallest quantity of data that can be atomically transfered. It is an integer number of 32 bits words (uint32_t). 13 13 14 14 An '''mwmr_channel_t''' communication channel is therefore defined by two parameters: 15 * The '''width''' parameter define the number of words contained in an item (can be 1).15 * The '''width''' parameter define the number of 32 bits words contained in an item (can be 1). 16 16 * The '''nitems''' parameter define the max number of items that can be stored in the FIFO. 17 17 … … 27 27 28 28 The '''nb_mwmr_read()''' and '''nb_mwmr_write()''' non blocking functions can be used to implement various higher level communication protocols. 29 30 31 Besides the MWMR channels, the MWMR library provide another - optional - service: The '''mwmr_bufio_t''' buffer (and the associated access functions) can be used to implement a private input or output buffer, and move data to or from a shared MWMR communication channel. This buffer can be declared as a local variable in the stack of the reader/writer thread, and simplifies the access to the MWMR channel when the transferred data is actually a byte stream, that must be analysed or produced byte per byte: 32 * the bufio descriptor contains an hidden byte pointer. 33 * an input bufio is automatically refill from the associated MWMR channel when it becomes empty. 34 * an output bufio is automatically transferred to the associated MWMR channel when it becomes full. 29 35 30 36 … … 76 82 77 83 78 Besides the MWMR channels, the MWMR library provide another - optional - service: The '''mwmr_bufio_t''' buffer (and the associated access functions) can be used to implement a private input or output buffer, and move data to or from a shared MWMR communication channel. This buffer can be declared as a local variable in the stack of the reader/writer thread, and simplifies the access to the MWMR channel when the transfered data have a non fixed format, and must be analysed or produced byte per byte:79 * the buffer descriptor contains a byte pointer.80 * an input buffer is automatically refill from the associated MWMR channel when it becomes empty.81 * an output buffer is automatically transferred to the associated MWMR channel when it becomes full.82 84 83 85 == __Bufio Initialization and Debug__ ==