10 | | The main advantage of this static approach is to provide the system designed a full control on the placement of tasks on processors but also of the data (software objects) on the distributed physical memory banks. It supports replication of critical objects such as kernel code, or page tables. |
11 | | |
12 | | To control the mapping, the system designer must provide a '''map.bin''' file containing a dedicated C binary data structure, that is loaded in memory by the bootloader. |
| 10 | The main advantage of this static approach is to provide the system designed a full control on the placement of tasks on processors but also of the data (software objects) on the distributed physical memory banks. It supports replication of (read-only) critical objects such as kernel code, user code, or page tables (the page tables are statically initialised in the boot phase, and are not modified anymore in the execution phase). |
| 11 | |
| 12 | To define the mapping, the system designer must provide a '''map.bin''' file containing a dedicated C binary data structure, that is loaded in memory by the bootloader. |
161 | | As a global vseg can be mapped (replicated) in more than one cluster, the local argumentpage tables can be r, the ''local'' argument |
162 | | |
163 | | |
164 | | == __Python application description__ == |
| 160 | A global vseg must be defined for each addressable peripheral. |
| 161 | As a general rule, we use big physical page(s) for each external peripheral, and one small physical page for each replicated peripheral. |
| 162 | |
| 163 | == __Python user application mapping__ == |
| 164 | |
| 165 | The mapping of a given application must be defined in the ''application.py'' file. |
| 166 | |
| 167 | A vspace, containing a variable number of tasks, and a variable number of vsegs, must be defined for each application. |
| 168 | |
| 169 | There is several types of user vseg |
| 170 | * The '''code''' vseg can be optionally replicated in all clusters. |
| 171 | * The '''data''' vseg is not replicated. It must contain the ''start_vector'' defining the entry points of the application tasks. |
| 172 | * It must exist as many '''stack'''' vseg as the number of tasks. |
| 173 | * One or several '''heap''' vseg(s), can be used by the malloc user library. |
| 174 | * One or several '''mwmr''' vseg(s) |
| 175 | |
| 176 | === create the vspace === |
| 177 | |
| 178 | The '''mapping.addvspace( )''' construct define a vspace. It has the following arguments: |
| 179 | || name || vspace name == application name || |
| 180 | || startname || name of || |
| 181 | |
| 182 | === vseg mapping === |
| 183 | |
| 184 | The '''mapping.addVseg( )''' construct define the mapping of a vseg in the vspace. It has the following arguments: |
| 185 | || vspace || vspace containing the vseg || |
| 186 | || name || vseg name || |
| 187 | || vbase || virtual base address || |
| 188 | || size || vseg size (bytes) || |
| 189 | || mode || access rights (CXWU) || |
| 190 | || vtype || vseg type || |
| 191 | || x || destination cluster X coordinate || |
| 192 | || y || destination cluster Y coordinate || |
| 193 | || pseg || destination pseg name || |
| 194 | || binpath || pathname for binary file if required (default = ' ') || |
| 195 | || align || alignment constraint if required (default = 0) || |
| 196 | || local || only mapped in local page table if true (default = False) || |
| 197 | || big || to be mapped in big pages (default = False) || |
| 198 | |
| 199 | The supported values for the ''mode'' argument, and for the ''vtype'' arguments are defined in the [source:soft/giet_vm/giet_python/mapping.py mapping.py] file. |
| 200 | The ''x'', ''y'', and ''pseg'' arguments define actually the mapping. |
| 201 | |
| 202 | === task mapping === |
| 203 | |
| 204 | The '''mapping.addVseg( )''' construct define the mapping of a task in the vspace. It has the following arguments: |
| 205 | || vspace || vspace containing the task || |
| 206 | || name || task name (unique in vspace) || |
| 207 | || trdid || thread index (unique in vspace] || |
| 208 | || x || destination cluster X coordinate || |
| 209 | || y || destination cluster Y coordinate || |
| 210 | || lpid || destination processor local index || |
| 211 | || stackname || name of vseg containing stack || |
| 212 | || heapname || name of vseg containing heap || |
| 213 | || startid || index in start vector (defining the task entry point virtual address) || |
| 214 | |
| 215 | The ''x'', ''y'', ''lpid'' arguments define actually the task placement. |
| 216 | |
| 217 | |
| 218 | |
| 219 | |