| | 1 | = Application = |
| | 2 | |
| | 3 | To create an application for DSX-VM we need to: |
| | 4 | * write the code of different task and describe the task in a python file |
| | 5 | * describe the TCG (task and communication graph) of the application |
| | 6 | |
| | 7 | |
| | 8 | == Task writing == |
| | 9 | |
| | 10 | To define a task you need to write down a least two files: |
| | 11 | - a *.c file containing the code of the task : the task is writed using the [https://www-asim.lip6.fr/trac/dsx/wiki/DsxvmSRL_API "SRL API"] |
| | 12 | - example : |
| | 13 | {{{ |
| | 14 | /* those two first header must be declared */ |
| | 15 | #include <srl.h> // same for all task and contain the definition of the SRL API functions |
| | 16 | #include "hello_proto.h" // containing specific definition for the task |
| | 17 | |
| | 18 | FUNC(hello_func) |
| | 19 | { |
| | 20 | while(1) |
| | 21 | { |
| | 22 | srl_log_printf(NONE, "Hello world\n"); |
| | 23 | } |
| | 24 | } |
| | 25 | |
| | 26 | }}} |
| | 27 | |
| | 28 | - a *.tsk file containing a python description (metadata) of the the task. The task is described by using TaskModel python class: |
| | 29 | {{{ |
| | 30 | TaskModel( name, ports, impls, uses) |
| | 31 | }}} |
| | 32 | - name : a string, describing the name of the application |
| | 33 | - ports : a dictionary, describing the ports of communication and their names. Different port exist: |
| | 34 | - !MwmrInput : a mwmr input port |
| | 35 | - !MwmrOutput : a mwmr output port |
| | 36 | - !BarrierPort : a barrier port |
| | 37 | - !LockPort : a lock port |
| | 38 | - !MemspacePort : a memspace port |
| | 39 | - impls : a list, describing the available implementations supported by the task |
| | 40 | - swtask |
| | 41 | - uses : a list of string, describing the used resources by the task (example: 'tty') |
| | 42 | |
| | 43 | |
| | 44 | == TCG == |
| | 45 | |
| | 46 | The application is described by a TCG (task an communication graph). |
| | 47 | The TCG describe the flow of the application. It describe |
| | 48 | * the interconnection |
| | 49 | * the mean of communication (generally mwmr channel) |
| | 50 | beetween task. |
| | 51 | |
| | 52 | Example : This is a TCG of an application, with three task communicating through mwmrs channels. |
| | 53 | [[Image()]] |