Changes between Version 3 and Version 4 of library_mwmr


Ignore:
Timestamp:
Nov 6, 2014, 6:03:30 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • library_mwmr

    v3 v4  
    33The [source:soft/giet_vm/giet_libs/mwmr_channel.c mwmr_channel.c] and [source:soft/giet_vm/giet_libs/mwmr_channel.h mwmr_channel.h] files define an user-level communication middleware.
    44
    5 This middleware supports channelized communications in a parallel multi-tasks application, where the communication scheme can be explicitely and statically described by a Task and Communication Graph.
     5It supports channelized communications in a parallel multi-tasks application, where the communication scheme can be explicitely and statically described by a Task and Communication Graph.
    66Each 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 lock.
     7
     8This software FIFO can be directly accessed by an hardware coprocessor, thanks to the vc_mwmr_controller, but be describe here the the software API that can be used by a software application.
    79
    810An MWMR transaction transfer an integer number of items, and an item is an integer number of unsigned int (32 bits words). The max number of words that can be stored in a MWMR channel is defined by the"depth" parameter. The "width" parameter define the minimal number of words contained in an atomic item. Therefore, the "depth" parameter must be a multiple of the "width" parameter.
     
    2224 * '''mwmr''' : MWMR channel virtual base address.
    2325 * '''nitems''' : number of items to be transfered.
    24  * '''buffer''' : virtual base address of local buffer
     26 * '''buffer''' : virtual base address of local buffer.
    2527It takes the lock for exclusive access before testing the channel state. If there is not enough space in mwmr channel to write nitems, it writes as many items as possible, releases the lock, and retry  after a random delay.
    2628
    27 === void '''mwmr_read'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int    nitems ) ===
     29=== void '''mwmr_read'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int nitems ) ===
    2830This function transfer (nitems * width) 32 bits words from the MWMR channel to a task private buffer.
    2931 * '''mwmr''' : MWMR channel virtual base address.
    3032 * '''nitems''' : number of items to be transfered.
    31  * '''buffer''' : virtual base address of local buffer
     33 * '''buffer''' : virtual base address of local buffer.
    3234It takes the lock for exclusive access before testing the channel state. If there is not enough space in mwmr channel to write nitems, it writes as many items as possible, releases the lock, and retry  after a random delay.
    3335
     
    3739The ''nb_mwmr_read()'' and ''nb_mwmr_write()'' functions are non-blocking functions.
    3840
    39 === unsigned int '''nb_mwmr_write'''() ===
    40 // This is a non-blocking function.
    41 // The nitems parameter is the number of items to be transfered.
    42 // The requested transfer is therefore (nitems * width) words.
    43 // It takes the lock for exclusive access before testing the channel state.
    44 // If there is not enough data in mwmr channel to read nitems,
    45 // it reads as many items as possible, releases the lock, and returns
    46 // the number of read items (it can be 0).
    47 ///////////////////////////////////////////////////////////////////////////////////
     41=== unsigned int '''nb_mwmr_write'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int nitems ) ===
     42This function request to transfer (nitems * width) 32 bits words from a task private buffer tot he MWMR channel.
     43 * '''mwmr''' : MWMR channel virtual base address.
     44 * '''nitems''' : number of items to be transfered.
     45 * '''buffer''' : virtual base address of local buffer.
     46It takes the lock for exclusive access before testing the channel state. If there is not enough free space in the channel, it transfer as many items as possible, releases the lock, and returns the number of actually transfered items (it can be 0).
     47
     48=== unsigned int '''nb_mwmr_write'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int nitems ) ===
     49This function request to transfer (nitems * width) 32 bits words from the MWMR channel to a task private buffer.
     50 * '''mwmr''' : MWMR channel virtual base address.
     51 * '''nitems''' : number of items to be transfered.
     52 * '''buffer''' : virtual base address of local buffer.
     53It takes the lock for exclusive access before testing the channel state. If there is not enough data in the channel, it transfer as many items as possible, releases the lock, and returns the number of actually transfered items (it can be 0).
     54