Changes between Version 6 and Version 7 of DsxDocumentation


Ignore:
Timestamp:
Jan 28, 2008, 12:21:28 AM (16 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DsxDocumentation

    v6 v7  
    2424 * The coarse grain parallelism of the software application must be statically defined as  a '''Task & Communications Graph (TCG)'''. The number of tasks, and the communication channels between tasks should not change during execution.
    2525 * The software tasks are supposed to be written in C or C++, but - for portability reasons - the tasks must use an abstract '''System Resource Layer (SRL)''' API to access the communication and synchronizations resources.
    26  * Each task in the TCG can be implemented as a ''software task'' (software running on an embedded processor), or can be implemented as an ''hardware task'', (running as a dedicated hardware coprocessor).
    27  * DSX allows the programmer to use unprotected shared memory spaces, but the prefered inter-tasks communication mechanism use the MWMR middleware. The MWMR (Multi-Writer, Multi-Reader) channels, are implemented as software FIFOs and can be shared by ''software tasks'', and by ''hardware tasks.
     26 * Each task in the TCG can be implemented as a '''software task''' (software running on an embedded processor), or can be implemented as an '''hardware task''', (running as a dedicated hardware coprocessor).
     27 * DSX allows the programmer to use unprotected shared memory spaces, but the prefered inter-tasks communication mechanism use the '''MWMR middleware'''. The MWMR (Multi-Writer, Multi-Reader) channels, are implemented as software FIFOs and can be shared by ''software tasks'', and by ''hardware tasks''.
    2828 * DSX provides classical synchronization mechanisms such as barriers and locks, but inter-task synchronisation is mainly done through the data availability in the MWMR channels.
    2929 * The target hardware architecture is a shared memory multi-processor system on chip (MP-SoC) using the SoCLib library of IP cores. But - in order to validate the multi-threaded software application - DSX is able to generate an executable binary code for a standard POSIX workstation.
     
    8383== C)  Defining the software application ==
    8484
    85 This chapter describes the DSX/L constructs used to define the Task & Communication Graph structure.
     85This chapter describes the DSX/L syntax used to define the Task & Communication Graph structure.
    8686The TCG is a bipartite graph: the two types of nodes are the tasks and the communication channels.
    87 The following figure describes the TCG corresponding to an MJPEG decoder application. The two TG & RAMDAC tasks will be implemented as hardware coprocessors : the TG component implements a wire-less receiver, and the RAMDAC component is a graphic display controller. The 5 other tasks can be implemented as ''software tasks'' or 
    88 as ''hardware tasks''. In this example, all MWMR communication channels have one single producer, and one
     87
     88As an example, the following figure describes the TCG corresponding to an MJPEG decoder application.
     89The two TG & RAMDAC tasks will be implemented as hardware coprocessors : the TG component implements a wire-less receiver for the MJPEG stream, and the RAMDAC component is a graphic display controller.
     90The 5 other tasks can be implemented as ''software tasks'' or  as ''hardware tasks''. In this particular example,
     91all MWMR communication channels have one single producer, and one
    8992single consumer, which is frequent for stream oriented multi-media applications.
    9093
     
    9396As a software application can instanciate several instances of the same task, we must distinguish the task, and the task model. A task model defines the code associated to the task, and the task interface (corresponding to the system resources used by the task : MWMR communications channels, synchronization barriers, locks, and memspaces).
    9497{{{
    95 Task_model = Task( 'model_name',
     98Task_Model = TaskModel( 'model_name',
    9699                    infifos = [ 'inport_name', ... ] ,
    97100                    outfifos = [ 'outport_name', ... ] ,
     
    102105                    impls = [ SwTask( 'func', stack_size = 1024 , sources = [ 'func.c' ] )
    103106}}}   
    104 I a task does not use a given type of resource, the corresponding parameter can be skipped.
     107If a task does not use a given type of resource, the corresponding parameter can be skipped.
    105108
    106109=== C2) MWMR communication channel definition ===
    107110
     111A MWMR communication channel is a memory buffer handled as a software FIFO that can have several producers and several consumers. Each channel is protected by an implicit lock for exclusive access. Any MWMR transaction
     112can be decomposed in five memory access:
     113 1.  get the lock protecting the MWMR (READ access). 
     114 1.  test the status of the MWMR (READ access).
     115 1.  transfer a burst of data between a local buffer and the MWMR (READ/WRITE access).
     116 1.  update the status of the MWMR (WRITE access).
     117 1.  release the lock (WRITE access).
     118
     119Any data transfer to or from a MWMR channel mut be an integer number of items. The item width is an
     120intrinsic property of the channel. It is defined as a number of bytes, and it defines the channel ''width''.
     121The channel ''depth'' is a number of items, and defines the total channel capacity.
     122For performances reasons the channel ''width'' itself must be a multiple of 4 bytes.
     123{{{ 
     124My_Channel = Mwmr( 'channel_name', width, depth )
     125}}}
     126In the mapping section of the DSX/L program, the 4 following software objects must be placed :
     127 1. ''desc'' :  read only informations regarding the communication channel
     128 1. ''status'' : channel state (number of stored items, read & write pointers)
     129 1. ''buffer'' : channel buffer containing the data
     130 1. ''lock'' : lock protecting exclusive access
     131
    108132=== C3) Synchronization barrier definition ===
    109133
    110 === C4) Synchronization lock definition ===
    111 
    112 === C5) Signal definition ===
    113 
    114 === C6) Task instanciation ===
     134The synchronization barriers can be used when the synchronization through the data availability in
     135the MWMR communication channels in not enough. The set of tasks that are linked to a given barrier
     136is defined when the the tasks are intanciated. Exclusive access to the barrier is protected by an implicit lock.
     137{{{
     138My_Barrier = Barrier( 'barrier_name' )
     139}}}
     140In the mapping section of the DSX/L program, the 3 following software objects must be placed :
     141 1. ''desc'' : read only informations regarding the synchronization barrier
     142 1. ''status'' : barrier state
     143 1. ''lock'' : lock protecting exclusive access
     144
     145=== C4) Memspace definition
     146
     147Direct communication through shared memory buffers is supported by DSX, but there is no protection mechanism, and the synchronization is the programmer responsability.
     148A shared memory space is defined by two parameters : ''memspace_name'' is the name, and ''size'' defines
     149the number of bytes to be reserved.
     150{{{
     151My_Shared_Buffer = Memspave( ''memspace_name', size )
     152}}}
     153In the mapping section of the DSX/L program, the 2 following software objects must be placed :
     154 1. ''desc'' : read only informations regarding the memspace
     155 1. ''mem'' : the shared memory buffer
     156
     157=== C5) lock definition ===
     158
     159A lock is a variable that can be used to protect exclusive access to a shared resource such as a shared
     160memory space. It is implemented as a spinlock : the ''srl_lock_lock()'' funtion returns only when the lock
     161has been obtained.
     162{{{
     163My_Lock = Lock( 'lock_name' )
     164}}}
     165In the mapping section of the DSX/L program, the lock can be explicitely placed in the memory space.
     166
     167=== C6) Signal definition ===
     168
     169The DSX signals are used to signal a special event that is not synchronized with the data. The signal is transmitted
     170to all registered tasks. The tasks are interrupted to execute the corresponding signal handler. Signals are mainlly
     171used to implement soft real time constraints, a task can receive a signal, but cannot send a signal.
     172{{{
     173My_signal = Signal( 'signal_name' )
     174}}}
     175There is nothing to place in the mapping section.
     176
     177=== C7) Task instanciation ===
     178
     179A task is an instance of a task model. The constructor arguments are the task name ''task_name'', the task model
     180''Task_Model'' (created by the TaskModel() function), a list of resources (MWMR channels, synchronization barriers,
     181locks or memspaces), and the list of the signals that can be received by the task . DSX performs type checking between the port name and the associated resource.
     182{{{
     183My_Task = Task( 'task_name',
     184                              Task_Model ,
     185                             { 'port_name' : My_Channel, 'barrier_name' : My_Barrier, ... } ,
     186                             { 'signal_name : My_signal, ... } )
     187}}}
     188In the mapping section of the DSX/L program, 4 software objects must be placed :
     189 1. ''desc'' : read-only informations associated to the task
     190 1. ''status'' : state of the task
     191 1. ''stack'' : execution stack
     192 1. ''run'' : processor running the task
     193
     194A task that has real time constraints must be instanciated by a special constructor.
     195There is two extra arguments : ''cond_activate'' is the signal definig the activation condition, and ''cond_deadline''
     196is the signal defining the dead_line condition.
     197{{{
     198My_RT_Task = RtTask( 'task_name',
     199                              Task_Model ,
     200                             { 'port_name' : My_Channel, 'barrier_name' : My_Barrier, ... } ,
     201                             { 'signal_name : My_signal, ... } ,
     202                             cond_activate ,
     203                             cond_deadline )
     204}}}
     205
    115206== D)  Defining the hardware architecture ==
    116207