dol: initial dol commit
[jump.git] / dol / src / dol / visitor / rtems / lib / README
1 How-to for running code in MPARM environment:
2
3 One-to-one mapping:
4 - Generate the code: ant -f runexample -Dnumber=? mparm
5 - Copy the generated dir 'systemc' to <MPARM>/MPARM/apps
6 - Copy the library 'queue_lib' into dir 'systemc'
7 - Compile the code: make
8 - Link the binary: ln -sf o-optimize/app.exe TargetMem_<?>.mem
9     ? depends on how many processors
10 - Run: $SWARMDIR/bin/mpsim.x -c <?> --intc=i  -C -S -D
11     ? is number of processors
12
13
14 Multi-to-one mapping:
15 - Modify main.c
16     - number_of_processes: each field is number of processes per processor
17     - xxx_PROCESSOR: set to a same number if mapping to common processor
18     - processor_init(): leave  one for each processor (not necessary)
19 - system.c
20     - macro CONFIGURE_MAXIMUM_TASKS should be two times larger than the 
21       maximum number of processes mapped to one processor.
22 - MAXQUEUE
23     - where should we put this macro ?
24 - If using the dol mapping specification, the processor 1 should be reserved
25   in the case of enabling macro QUEUE_BUFF_SHAPER !
26
27 MPARM queue_lib spec:
28 - Always use interrupt
29 - Always use memcpy
30 - DMA always enables, the switch is in the Makefile
31 - Token size is always 32 bits
32 - Default Queue size is 4, can be redefined
33
34
35 Segment wide Calibration:
36 - Modify Makefile:
37     - enable macro PERFORMANCE_EXTRACT (default disable)
38     - uncomment line: 
39       CXXSRCS += lib/xmlParser.cpp lib/Performance_Extraction.cpp
40 - main.c: Map all processes into one processor
41 - Run: $SWARMDIR/bin/mpsim.x -c 1 --intc=i  -C -S -D  
42
43
44 Communication exploration:
45 - Modify Makefile:
46   - enable one of below macro exclusively:
47     - QUEUE_BUFF_IN_PRODUCER (default)
48     - QUEUE_BUFF_IN_PRODUCER_DMA
49     - QUEUE_BUFF_IN_CONSUMER
50     - QUEUE_BUFF_IN_CONSUMER_DMA
51     - QUEUE_BUFF_SHAPER
52
53 Running mpeg2 decoder on MPARM:
54 - copy dol.h from other case studies
55 - add macro _DOL_ETHZ_GEN_ to Makefile
56 - change queue size to 4096 in system.h
57 - call mpsim.x with option --s-size=19 (scratchpad size=1Mbyts)
58
59 Running mjpeg-2000 decoder on MPARM:
60 - jpeg.h
61     - disable macro VIEWER
62     - disable macros VERBOSE and INFO
63 - scratch_queue.h
64     - macro MAXQUEUE > 24, if mapping all to one processor
65 - system.h
66     - macro CONFIGURE_MAXIMUM_TASKS > 9
67
68
69 Tricks:
70 - CONFIGURE_MAXIMUM_TASKS in system.h
71 - MAXQUEUE in scratch_queue.h 
72 - Token size should be multiple of 4 bytes
73 - W/R operations should be the same size, otherwise token size should be
74   gcd(Write_token, Read_token).
75
76 BUGS & TODO:
77 - free() in wrapper not correct
78 - Iterated port not tested yet
79 - Shaper not finished!
80 - Timeslice works?  (Yes)