Changeset 627 for soft/giet_vm/giet_xml/xml_parser.c
- Timestamp:
- Jul 18, 2015, 2:48:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.