Changes between Version 24 and Version 25 of library_mwmr


Ignore:
Timestamp:
Nov 21, 2015, 1:28:21 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • library_mwmr

    v24 v25  
    88Each 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.
    99
    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.
     10This 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.
    1111
    1212An 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).
    1313
    1414An '''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).
    1616 * The '''nitems''' parameter define the max number of items that can be stored in the FIFO.
    1717
     
    2727 
    2828The '''nb_mwmr_read()''' and '''nb_mwmr_write()''' non blocking functions can be used to implement various higher level communication protocols.
     29
     30
     31Besides 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.
    2935
    3036
     
    7682
    7783
    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.
    8284
    8385== __Bufio Initialization and Debug__ ==