Changeset 511 for soft/giet_vm/giet_xml/xml_driver.c
- Timestamp:
- Feb 14, 2015, 5:08:13 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_xml/xml_driver.c
r491 r511 21 21 { 22 22 // mnemonics defined in mapping_info.h 23 const char * v obj_type[] =23 const char * vseg_type[] = 24 24 { 25 25 "ELF", // binary code generated by GCC … … 41 41 { 42 42 "RAM", 43 "ROM", // deprecated => use PERI44 43 "PERI", 45 44 }; … … 129 128 unsigned int pseg_id; 130 129 unsigned int vseg_id; 131 unsigned int vobj_id;132 130 unsigned int task_id; 133 131 unsigned int proc_id; … … 141 139 mapping_vspace_t * vspace; 142 140 mapping_vseg_t * vseg; 143 mapping_vobj_t * vobj;144 141 mapping_task_t * task; 145 142 mapping_proc_t * proc; … … 171 168 MAPPING_VSPACE_SIZE * header->vspaces); 172 169 173 // computes the base adresss for vobjs array,174 vobj = (mapping_vobj_t *) ((char *) header +175 MAPPING_HEADER_SIZE +176 MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +177 MAPPING_PSEG_SIZE * header->psegs +178 MAPPING_VSPACE_SIZE * header->vspaces +179 MAPPING_VSEG_SIZE * header->vsegs);180 181 170 // computes the base address for tasks array 182 171 task = (mapping_task_t *) ((char *) header + … … 185 174 MAPPING_PSEG_SIZE * header->psegs + 186 175 MAPPING_VSPACE_SIZE * header->vspaces + 187 MAPPING_VOBJ_SIZE * header->vobjs +188 176 MAPPING_VSEG_SIZE * header->vsegs); 189 177 … … 194 182 MAPPING_PSEG_SIZE * header->psegs + 195 183 MAPPING_VSPACE_SIZE * header->vspaces + 196 MAPPING_VOBJ_SIZE * header->vobjs +197 184 MAPPING_VSEG_SIZE * header->vsegs + 198 185 MAPPING_TASK_SIZE * header->tasks); … … 204 191 MAPPING_PSEG_SIZE * header->psegs + 205 192 MAPPING_VSPACE_SIZE * header->vspaces + 206 MAPPING_VOBJ_SIZE * header->vobjs +207 193 MAPPING_VSEG_SIZE * header->vsegs + 208 194 MAPPING_TASK_SIZE * header->tasks + … … 215 201 MAPPING_PSEG_SIZE * header->psegs + 216 202 MAPPING_VSPACE_SIZE * header->vspaces + 217 MAPPING_VOBJ_SIZE * header->vobjs +218 203 MAPPING_VSEG_SIZE * header->vsegs + 219 204 MAPPING_TASK_SIZE * header->tasks + … … 227 212 MAPPING_PSEG_SIZE * header->psegs + 228 213 MAPPING_VSPACE_SIZE * header->vspaces + 229 MAPPING_VOBJ_SIZE * header->vobjs +230 214 MAPPING_VSEG_SIZE * header->vsegs + 231 215 MAPPING_TASK_SIZE * header->tasks + … … 240 224 MAPPING_PSEG_SIZE * header->psegs + 241 225 MAPPING_VSPACE_SIZE * header->vspaces + 242 MAPPING_VOBJ_SIZE * header->vobjs +243 226 MAPPING_VSEG_SIZE * header->vsegs + 244 227 MAPPING_TASK_SIZE * header->tasks + … … 305 288 port_id++) 306 289 { 307 unsigned int v obj_id = cp_port[port_id].mwmr_vobj_id;290 unsigned int vseg_id = cp_port[port_id].mwmr_vseg_id; 308 291 fprintf(fpout, " <port direction=\"%s\"", port_direction[cp_port[port_id].direction]); 309 292 fprintf(fpout, " vspacename=\"%s\"", vspace[cp_port[port_id].vspaceid].name); 310 fprintf(fpout, " v objname=\"%s\" />\n", vobj[vobj_id].name);293 fprintf(fpout, " vsegname=\"%s\" />\n", vseg[vseg_id].name); 311 294 } 312 295 fprintf(fpout, " </coproc>\n" ); … … 356 339 fprintf(fpout, " <vseg name=\"%s\"", vseg[vseg_id].name); 357 340 fprintf(fpout, " vbase=\"0x%x\"", vseg[vseg_id].vbase); 341 fprintf(fpout, " length=\"0x%x\"", vseg[vseg_id].length); 342 fprintf(fpout, " type=\"%s\"", vseg_type[vseg[vseg_id].type]); 358 343 fprintf(fpout, " mode=\"%s\"", mode_str[vseg[vseg_id].mode]); 344 fprintf(fpout, "\n "); 359 345 fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x); 360 346 fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); 361 347 fprintf(fpout, " psegname=\"%s\"", pseg[pseg_id].name); 362 if( vseg[vseg_id].ident ) fprintf(fpout, " ident=\"1\""); 363 if( vseg[vseg_id].local ) fprintf(fpout, " local=\"1\""); 348 if( vseg[vseg_id].ident ) 349 fprintf(fpout, " ident=\"1\""); 350 if( vseg[vseg_id].local ) 351 fprintf(fpout, " local=\"1\""); 352 if( vseg[vseg_id].big ) 353 fprintf(fpout, " big=\"1\""); 354 if( vseg[vseg_id].binpath[0] != 0 ) 355 fprintf(fpout, " binpath=\"%s\"", vseg[vseg_id].binpath); 364 356 fprintf(fpout, " >\n"); 365 366 for (vobj_id = vseg[vseg_id].vobj_offset;367 vobj_id < (vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs);368 vobj_id++)369 {370 fprintf(fpout, " <vobj name=\"%s\"", vobj[vobj_id].name);371 fprintf(fpout, " type=\"%s\"", vobj_type[vobj[vobj_id].type]);372 fprintf(fpout, " length=\"0x%x\"", vobj[vobj_id].length);373 if( vobj[vobj_id].align )374 fprintf(fpout, " align=\"%d\"", vobj[vobj_id].align);375 if( vobj[vobj_id].binpath[0] != 0 )376 fprintf(fpout, " binpath=\"%s\"", vobj[vobj_id].binpath);377 if( (vobj[vobj_id].type == VOBJ_TYPE_BARRIER) ||378 (vobj[vobj_id].type == VOBJ_TYPE_MWMR ) ||379 (vobj[vobj_id].type == VOBJ_TYPE_CONST ) )380 fprintf(fpout, " init=\"%d\"", vobj[vobj_id].init);381 fprintf(fpout, " />\n");382 }383 fprintf(fpout, " </vseg>\n");384 357 } 385 358 fprintf(fpout, " </globalset>\n" ); … … 390 363 for (vspace_id = 0; vspace_id < header->vspaces; vspace_id++) 391 364 { 392 unsigned int v obj_id = vspace[vspace_id].start_vobj_id;365 unsigned int vseg_id = vspace[vspace_id].start_vseg_id; 393 366 fprintf(fpout, " <vspace name = \"%s\" ", vspace[vspace_id].name); 394 fprintf(fpout, " startname = \"%s\" >\n", v obj[vobj_id].name);367 fprintf(fpout, " startname = \"%s\" >\n", vseg[vseg_id].name); 395 368 396 369 //////////////////// vsegs ////////////////////////////////////////////// … … 405 378 fprintf(fpout, " <vseg name=\"%s\"", vseg[vseg_id].name); 406 379 fprintf(fpout, " vbase=\"0x%x\"", vseg[vseg_id].vbase); 380 fprintf(fpout, " length=\"0x%x\"", vseg[vseg_id].length); 381 fprintf(fpout, " type=\"%s\"", vseg_type[vseg[vseg_id].type]); 407 382 fprintf(fpout, " mode=\"%s\"", mode_str[vseg[vseg_id].mode]); 383 fprintf(fpout, "\n "); 408 384 fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x); 409 385 fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); 410 386 fprintf(fpout, " psegname=\"%s\"", pseg[pseg_id].name); 411 if( vseg[vseg_id].ident ) fprintf(fpout, " ident=\"1\""); 412 if( vseg[vseg_id].local ) fprintf(fpout, " local=\"1\""); 387 if( vseg[vseg_id].ident ) 388 fprintf(fpout, " ident=\"1\""); 389 if( vseg[vseg_id].local ) 390 fprintf(fpout, " local=\"1\""); 391 if( vseg[vseg_id].big ) 392 fprintf(fpout, " big=\"1\""); 393 if( vseg[vseg_id].binpath[0] != 0 ) 394 fprintf(fpout, " binpath=\"%s\"", vseg[vseg_id].binpath); 413 395 fprintf(fpout, " >\n"); 414 415 for (vobj_id = vseg[vseg_id].vobj_offset;416 vobj_id < (vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs);417 vobj_id++)418 {419 fprintf(fpout, " <vobj name=\"%s\"", vobj[vobj_id].name);420 fprintf(fpout, " type=\"%s\"", vobj_type[vobj[vobj_id].type]);421 fprintf(fpout, " length=\"0x%x\"", vobj[vobj_id].length);422 if( vobj[vobj_id].align )423 fprintf(fpout, " align=\"%d\"", vobj[vobj_id].align);424 if( vobj[vobj_id].binpath[0] != 0 )425 fprintf(fpout, " binpath=\"%s\"", vobj[vobj_id].binpath);426 if( (vobj[vobj_id].type == VOBJ_TYPE_BARRIER) ||427 (vobj[vobj_id].type == VOBJ_TYPE_MWMR ) ||428 (vobj[vobj_id].type == VOBJ_TYPE_CONST ) )429 fprintf(fpout, " init=\"%d\"", vobj[vobj_id].init);430 fprintf(fpout, " />\n");431 }432 fprintf(fpout, " </vseg>\n\n");433 396 } 434 397 … … 439 402 task_id++) 440 403 { 441 unsigned int stack_v obj_id = task[task_id].stack_vobj_id;442 unsigned int heap_v obj_id = task[task_id].heap_vobj_id;404 unsigned int stack_vseg_id = task[task_id].stack_vseg_id; 405 unsigned int heap_vseg_id = task[task_id].heap_vseg_id; 443 406 unsigned int cluster_id = task[task_id].clusterid; 444 407 … … 448 411 fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); 449 412 fprintf(fpout, " p=\"%d\"", task[task_id].proclocid); 450 fprintf(fpout, " stackname=\"%s\"", vobj[stack_vobj_id].name); 451 if (heap_vobj_id != -1) 452 { 453 fprintf(fpout, " heapname=\"%s\"", vobj[heap_vobj_id].name); 454 } 413 fprintf(fpout, "\n "); 414 fprintf(fpout, " stackname=\"%s\"", vseg[stack_vseg_id].name); 415 if (heap_vseg_id != -1) 416 fprintf(fpout, " heapname=\"%s\"", vseg[heap_vseg_id].name); 455 417 fprintf(fpout, " startid = \"%d\"", task[task_id].startid); 456 418 fprintf(fpout, " />\n");
Note: See TracChangeset
for help on using the changeset viewer.