Changeset 627 for soft/giet_vm/giet_xml
- Timestamp:
- Jul 18, 2015, 2:48:16 PM (9 years ago)
- Location:
- soft/giet_vm/giet_xml
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_xml/Makefile
r262 r627 3 3 4 4 bin2xml: xml_driver.c mapping_info.h 5 gcc -Wall -I. -I.. /sysxml_driver.c -o bin2xml5 gcc -Wall -I. -I.. xml_driver.c -o bin2xml 6 6 7 xml2bin: xml_parser.c mapping_info.h 8 gcc -Wall -I. -I.. /giet_kernel -I/usr/include/libxml2 xml_parser.c -o xml2bin -lxml27 xml2bin: xml_parser.c mapping_info.h 8 gcc -Wall -I. -I.. -I../giet_kernel -I/usr/include/libxml2 xml_parser.c -o xml2bin -lxml2 9 9 10 10 test: -
soft/giet_vm/giet_xml/mapping_info.h
r566 r627 229 229 unsigned int heap_vseg_id; // global index for vseg containing heap 230 230 unsigned int startid; // index in start_vector 231 unsigned int ltid; // task index in scheduler (dynamically defined) 231 232 } mapping_task_t; 232 233 -
soft/giet_vm/giet_xml/xml_driver.c
r567 r627 136 136 mapping_vseg_t * vseg; 137 137 mapping_task_t * task; 138 mapping_proc_t * proc;139 138 mapping_irq_t * irq; 140 139 mapping_periph_t * periph; … … 169 168 MAPPING_VSPACE_SIZE * header->vspaces + 170 169 MAPPING_VSEG_SIZE * header->vsegs); 171 172 // computes the base address for procs array173 proc = (mapping_proc_t *) ((char *) header +174 MAPPING_HEADER_SIZE +175 MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +176 MAPPING_PSEG_SIZE * header->psegs +177 MAPPING_VSPACE_SIZE * header->vspaces +178 MAPPING_VSEG_SIZE * header->vsegs +179 MAPPING_TASK_SIZE * header->tasks);180 170 181 171 // computes the base address for irqs array … … 261 251 fprintf(fpout, " psegname=\"%s\"", pseg[periph[periph_id].psegid].name); 262 252 fprintf(fpout, " channels=\"%d\"", periph[periph_id].channels); 263 fprintf(fpout, " arg0=\"%d\" >\n", periph[periph_id].arg0);264 fprintf(fpout, " arg1=\"%d\" >\n", periph[periph_id].arg1);265 fprintf(fpout, " arg2=\"%d\" >\n", periph[periph_id].arg2);253 fprintf(fpout, " arg0=\"%d\"", periph[periph_id].arg0); 254 fprintf(fpout, " arg1=\"%d\"", periph[periph_id].arg1); 255 fprintf(fpout, " arg2=\"%d\"", periph[periph_id].arg2); 266 256 fprintf(fpout, " arg3=\"%d\" >\n", periph[periph_id].arg3); 267 257 if ( (periph[periph_id].type == PERIPH_TYPE_PIC) || -
soft/giet_vm/giet_xml/xml_parser.c
r567 r627 26 26 #include <mapping_info.h> 27 27 #include <irq_handler.h> 28 #include <giet_config.h> 28 29 29 30 #define MAX_CLUSTERS 1024 … … 313 314 314 315 ///////// get trdid attribute (optional) 315 task[task_index]->trdid = getIntValue(reader, "trdid", &ok); 316 #if XML_PARSER_DEBUG 317 printf(" trdid = %d\n", x); 318 #endif 319 if ( !ok ) 320 { 321 task[task_index]->trdid = task_loc_index; 322 } 316 value = getIntValue(reader, "trdid", &ok); 317 #if XML_PARSER_DEBUG 318 printf(" trdid = %d\n", value ); 319 #endif 320 if ( ok ) task[task_index]->trdid = value; 321 else task[task_index]->trdid = task_loc_index; 323 322 324 323 ///////// get x coordinate … … 996 995 if (ok == 0) 997 996 { 998 printf("[XML ERROR] illegal or missing <psegname> for coproc%d in cluster %d\n",999 coproc_index, cluster_index);997 printf("[XML ERROR] illegal or missing <psegname> for periph %d in cluster %d\n", 998 periph_index, cluster_index); 1000 999 exit(1); 1001 1000 } … … 1232 1231 #endif 1233 1232 if (ok && (strcmp(str, "RAM" ) == 0)) { pseg[pseg_index]->type = PSEG_TYPE_RAM; } 1234 else if (ok && (strcmp(str, "ROM" ) == 0)) { pseg[pseg_index]->type = PSEG_TYPE_ROM; }1235 else if (ok && (strcmp(str, "DROM" ) == 0)) { pseg[pseg_index]->type = PSEG_TYPE_ROM; }1236 1233 else if (ok && (strcmp(str, "PERI") == 0)) { pseg[pseg_index]->type = PSEG_TYPE_PERI; } 1237 1234 else … … 1295 1292 cluster[cluster_index]->psegs = 0; 1296 1293 cluster[cluster_index]->procs = 0; 1297 cluster[cluster_index]->coprocs = 0;1298 1294 cluster[cluster_index]->periphs = 0; 1299 1295 1300 1296 //initialise global variables 1301 1297 proc_loc_index = 0; 1302 coproc_loc_index = 0;1303 1298 periph_loc_index = 0; 1304 1299 … … 1344 1339 cluster[cluster_index]->pseg_offset = pseg_index; 1345 1340 cluster[cluster_index]->proc_offset = proc_index; 1346 cluster[cluster_index]->coproc_offset = coproc_index;1347 1341 cluster[cluster_index]->periph_offset = periph_index; 1348 1342 … … 1350 1344 printf(" pseg_offset = %d\n", pseg_index); 1351 1345 printf(" proc_offset = %d\n", proc_index); 1352 printf(" coproc_offset = %d\n", coproc_index); 1353 printf(" periph_offset = %d\n", coproc_index); 1354 #endif 1355 1356 ////////// get psegs, procs, coprocs and periphs 1346 printf(" periph_offset = %d\n", periph_index); 1347 #endif 1348 1349 ////////// get psegs, procs, and periphs 1357 1350 int status = xmlTextReaderRead(reader); 1358 1351 … … 1363 1356 if (strcmp(tag, "pseg") == 0) psegNode(reader); 1364 1357 else if (strcmp(tag, "proc") == 0) procNode(reader); 1365 else if (strcmp(tag, "coproc") == 0) coprocNode(reader);1366 1358 else if (strcmp(tag, "periph") == 0) periphNode(reader); 1367 1359 else if (strcmp(tag, "#text") == 0) { } … … 1373 1365 printf(" psegs = %d\n", cluster[cluster_index]->psegs); 1374 1366 printf(" procs = %d\n", cluster[cluster_index]->procs); 1375 printf(" coprocs = %d\n", cluster[cluster_index]->coprocs);1376 1367 printf(" periphs = %d\n", cluster[cluster_index]->periphs); 1377 1368 printf(" end cluster %d\n", cluster_index); … … 1414 1405 printf(" end cluster set\n\n"); 1415 1406 #endif 1416 header->psegs = pseg_index; 1417 header->procs = proc_index; 1418 header->irqs = irq_index; 1419 header->coprocs = coproc_index; 1407 header->psegs = pseg_index; 1408 header->procs = proc_index; 1409 header->irqs = irq_index; 1420 1410 header->periphs = periph_index; 1421 1411 return; … … 1676 1666 header->procs = 0; 1677 1667 header->irqs = 0; 1678 header->coprocs = 0;1679 1668 header->periphs = 0; 1680 1681 1669 1682 1670 int status = xmlTextReaderRead(reader); … … 1775 1763 printf("procs = %d\n", header->procs); 1776 1764 printf("irqs = %d\n", header->irqs); 1777 printf("coprocs = %d\n", header->coprocs);1778 1765 printf("periphs = %d\n", header->periphs); 1779 1766 #endif … … 1801 1788 //building irqs array 1802 1789 BuildTable(fdout, "irq", irq_index, sizeof(mapping_irq_t), (char **) irq); 1803 //building coprocs array1804 BuildTable(fdout, "coproc", coproc_index, sizeof(mapping_coproc_t), (char **) coproc);1805 1790 //building periphs array 1806 1791 BuildTable(fdout, "periph", periph_index, sizeof(mapping_periph_t), (char **) periph);
Note: See TracChangeset
for help on using the changeset viewer.