Digital Signal Processing Reference
In-Depth Information
ARM tile 1
ARM tile N
instruction
and data
memory
instruction
and data
memory
ARM
core
ARM
core
scratchpad
memory
DMA
controller
scratchpad
memory
DMA
controller
S
M
M
S
M
M
bus
Fig. 8
Block diagram of the MPARM architecture
synthesis for the Cell Broadband Engine is described in [ 24 ] in the context of the
DOL design flow, and in [ 66 ] in the context of the SHIM design flow, for instance.
Listing 1 shows parts of a main file for a producer-consumer type application
running on MPARM. In lines 2 - 3 , memory is allocated for the local data of the
producer and consumer processes. In lines 6 - 9 , two tasks are created for the
processes by allocating a task control block, by assigning a task name and a task
ID, by allocating a stack, and by setting initial attributes like the task priority and
the task mode. Lines 11 - 12 show the creation of a message queue. In lines 14 - 18 ,
the rtems task start directive puts the tasks into the ready state, enabling the
scheduler to execute them. Finally, the initialization tasks deletes itself (line 20 ) .
Listing 1 RTEMS initialization task in which two tasks are bootstrapped to run a producer and
consumer process of a process network
rtems task
Init ( rtems task argument
arg )
{
1
producer wrapper malloc ( sizeof ( RtemsProcessWrapper ) ) ;
2
consumer wrapper malloc ( sizeof ( RtemsProcessWrapper ) ) ;
3
4
5
for
(j 0;
j < 2;
j ++)
{
status rtems task create ( j
+ 1,
128,
6
RTEMS MINIMUM STACK SIZE ,
RTEMS DEFAULT MODES ,
7
RTEMS DEFAULT ATTRIBUTES ,
&( t a s k
id [j ]));
8
}
9
10
11
status
rtems message queue create (1 ,
10,
1,
RTEMS DEFAULT ATTRIBUTES ,
&q u e u e
id [0]);
12
13
14
status
rtems task start ( task id [1] ,
producer task ,
(rtems task argument ) producer wrapper );
15
16
17
status
rtems task start ( task id [2] ,
consumer task ,
(rtems task argument ) consumer wrapper );
18
19
20
rtems task d e l e t e ( RTEMS SELF ) ;
}
21
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search