Changeset 306
- Timestamp:
- Apr 21, 2014, 5:14:17 AM (11 years ago)
- Location:
- soft/giet_vm/giet_xml
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_xml/mapping_info.h
r295 r306 79 79 VOBJ_TYPE_MEMSPACE = 9, // Memspace (descriptor must be initialised) 80 80 VOBJ_TYPE_SCHED = 10, // Array of schedulers (one per cluster) 81 VOBJ_TYPE_BOOT = 11, // loader by the preloader82 81 }; 83 82 … … 149 148 unsigned int y_io; // y coordinate for cluster_io_ext 150 149 unsigned int irq_per_proc; // number of IRQ per processor 151 unsigned int use_ram disk;// does not use IOC peripheral if non zero150 unsigned int use_ram_disk; // does not use IOC peripheral if non zero 152 151 unsigned int increment; // vbase address increment (replicated peripherals) 153 152 -
soft/giet_vm/giet_xml/xml_driver.c
r295 r306 254 254 fprintf(fpout, " y_width = \"%d\" \n" , header->y_width); 255 255 fprintf(fpout, " irq_per_proc = \"%d\" \n" , header->irq_per_proc); 256 fprintf(fpout, " use_ram disk = \"%d\" \n" , header->use_ramdisk);256 fprintf(fpout, " use_ram_disk = \"%d\" \n" , header->use_ram_disk); 257 257 fprintf(fpout, " x_io = \"%d\" \n" , header->x_io); 258 258 fprintf(fpout, " y_io = \"%d\" >\n\n", header->y_io); … … 263 263 for (cluster_id = 0; cluster_id < (header->x_size * header->y_size); cluster_id++) 264 264 { 265 fprintf(fpout, " <cluster x = \"%d\" y =\"%d\" >\n",265 fprintf(fpout, " <cluster x=\"%d\" y=\"%d\" >\n", 266 266 cluster[cluster_id].x, cluster[cluster_id].y ); 267 267 … … 272 272 pseg_id++) 273 273 { 274 fprintf(fpout, " <pseg name = \"%s\"", pseg[pseg_id].name);275 fprintf(fpout, " type = \"%s\"", pseg_type[pseg[pseg_id].type]);276 fprintf(fpout, " base = \"0x%llx\"", pseg[pseg_id].base);277 fprintf(fpout, " length = \"0x%llx\" />\n",pseg[pseg_id].length);274 fprintf(fpout, " <pseg name=\"%s\"", pseg[pseg_id].name); 275 fprintf(fpout, " type=\"%s\"", pseg_type[pseg[pseg_id].type]); 276 fprintf(fpout, " base=\"0x%llx\"", pseg[pseg_id].base); 277 fprintf(fpout, " length=\"0x%llx\" />\n", pseg[pseg_id].length); 278 278 } 279 279 … … 285 285 proc_id++, proc_index++) 286 286 { 287 fprintf(fpout, " <proc index =\"%d\" />\n", proc_index);287 fprintf(fpout, " <proc index=\"%d\" />\n", proc_index); 288 288 } 289 289 … … 294 294 coproc_id++) 295 295 { 296 fprintf(fpout, " <coproc name = \"%s\"", coproc[coproc_id].name);297 fprintf(fpout, " psegname =\"%s\" >\n", pseg[coproc[coproc_id].psegid].name);296 fprintf(fpout, " <coproc name=\"%s\"", coproc[coproc_id].name); 297 fprintf(fpout, " psegname=\"%s\" >\n", pseg[coproc[coproc_id].psegid].name); 298 298 for (port_id = coproc[coproc_id].port_offset; 299 299 port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports; … … 301 301 { 302 302 unsigned int vobj_id = cp_port[port_id].mwmr_vobjid + vspace[cp_port[port_id].vspaceid].vobj_offset; 303 fprintf(fpout, " <port direction = \"%s\"", port_direction[cp_port[port_id].direction]);304 fprintf(fpout, " vspacename = \"%s\"", vspace[cp_port[port_id].vspaceid].name);305 fprintf(fpout, " vobjname =\"%s\" />\n", vobj[vobj_id].name);303 fprintf(fpout, " <port direction=\"%s\"", port_direction[cp_port[port_id].direction]); 304 fprintf(fpout, " vspacename=\"%s\"", vspace[cp_port[port_id].vspaceid].name); 305 fprintf(fpout, " vobjname=\"%s\" />\n", vobj[vobj_id].name); 306 306 } 307 307 fprintf(fpout, " </coproc>\n" ); … … 314 314 periph_id++) 315 315 { 316 fprintf(fpout, " <periph type = \"%s\" ", periph_type[periph[periph_id].type]); 317 318 if (periph[periph_id].subtype < PERIPH_SUBTYPE_MAX_VALUE) 319 fprintf(fpout, " subtype = \"%s\" ", ioc_subtype[periph[periph_id].subtype]); 320 321 fprintf(fpout, " psegname = \"%s\" ", pseg[periph[periph_id].psegid].name); 322 fprintf(fpout, " channels = \"%d\" >\n", periph[periph_id].channels); 323 for (irq_id = periph[periph_id].irq_offset; 324 irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs; 325 irq_id++) 316 fprintf(fpout, " <periph type=\"%s\"", periph_type[periph[periph_id].type]); 317 318 if (periph[periph_id].type == PERIPH_TYPE_IOC) 319 fprintf(fpout, " subtype=\"%s\"", ioc_subtype[periph[periph_id].subtype]); 320 321 fprintf(fpout, " psegname=\"%s\"", pseg[periph[periph_id].psegid].name); 322 fprintf(fpout, " channels=\"%d\" >\n", periph[periph_id].channels); 323 if ( periph[periph_id].type == PERIPH_TYPE_PIC ) 326 324 { 327 fprintf(fpout, " <irq srctype = \"%s\" ", irq_type[irq[irq_id].srctype]); 328 fprintf(fpout, " srcid = \"%d\" ", irq[irq_id].srcid); 329 fprintf(fpout, " isr = \"%s\" ", isr_type[irq[irq_id].isr]); 330 fprintf(fpout, " channel = \"%d\" ", irq[irq_id].channel); 331 fprintf(fpout, " dstx = \"%d\" ", irq[irq_id].dstx); 332 fprintf(fpout, " dsty = \"%d\" ", irq[irq_id].dsty); 333 fprintf(fpout, " dstid = \"%d\" />\n", irq[irq_id].dstid); 325 for (irq_id = periph[periph_id].irq_offset; 326 irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs; 327 irq_id++) 328 { 329 fprintf(fpout, " <irq srcid=\"%d\" ", irq[irq_id].srcid); 330 fprintf(fpout, " dstx=\"%d\"", irq[irq_id].dstx); 331 fprintf(fpout, " dsty=\"%d\"", irq[irq_id].dsty); 332 fprintf(fpout, " dstid=\"%d\" />\n", irq[irq_id].dstid); 333 } 334 } 335 if ( (periph[periph_id].type == PERIPH_TYPE_XCU ) || 336 (periph[periph_id].type == PERIPH_TYPE_ICU ) ) 337 { 338 for (irq_id = periph[periph_id].irq_offset; 339 irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs; 340 irq_id++) 341 { 342 fprintf(fpout, " <irq srctype=\"%s\"", irq_type[irq[irq_id].srctype]); 343 fprintf(fpout, " srcid=\"%d\"", irq[irq_id].srcid); 344 fprintf(fpout, " isr=\"%s\"", isr_type[irq[irq_id].isr]); 345 fprintf(fpout, " channel=\"%d\"", irq[irq_id].channel); 346 fprintf(fpout, " dstid=\"%d\" />\n", irq[irq_id].dstid); 347 } 334 348 } 335 349 fprintf(fpout, " </periph>\n"); … … 344 358 for (vseg_id = 0; vseg_id < header->globals; vseg_id++) 345 359 { 346 unsigned int pseg_id = vseg[vseg_id].psegid; 347 348 fprintf(fpout, " <vseg name = \"%s\" ", vseg[vseg_id].name); 349 fprintf(fpout, "vbase = \"0x%x\" ", vseg[vseg_id].vbase); 350 fprintf(fpout, "mode = \"%s\" ", mode_str[vseg[vseg_id].mode]); 351 fprintf(fpout, "clusterid = \"%d\" ", pseg[pseg_id].clusterid); 352 fprintf(fpout, "psegname = \"%s\" ", pseg[pseg_id].name); 353 fprintf(fpout, "ident = \"%d\" >\n", vseg[vseg_id].ident); 360 unsigned int pseg_id = vseg[vseg_id].psegid; 361 unsigned int cluster_id = pseg[pseg_id].clusterid; 362 363 fprintf(fpout, " <vseg name=\"%s\"", vseg[vseg_id].name); 364 fprintf(fpout, " vbase=\"0x%x\"", vseg[vseg_id].vbase); 365 fprintf(fpout, " mode=\"%s\"", mode_str[vseg[vseg_id].mode]); 366 fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x); 367 fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); 368 fprintf(fpout, " psegname=\"%s\"", pseg[pseg_id].name); 369 if( vseg[vseg_id].ident ) fprintf(fpout, " ident=\"1\""); 370 fprintf(fpout, " >\n"); 371 354 372 for (vobj_id = vseg[vseg_id].vobj_offset; 355 373 vobj_id < (vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs); 356 374 vobj_id++) 357 375 { 358 fprintf(fpout, " <vobj name = \"%s\" ", vobj[vobj_id].name); 359 fprintf(fpout, "type = \"%s\" ", vobj_type[vobj[vobj_id].type]); 360 fprintf(fpout, "length = \"0x%x\" ", vobj[vobj_id].length); 361 fprintf(fpout, "align = \"%d\" ", vobj[vobj_id].align); 362 fprintf(fpout, "init = \"%d\" ", vobj[vobj_id].init); 363 fprintf(fpout, "binpath = \"%s\" />\n", vobj[vobj_id].binpath); 376 fprintf(fpout, " <vobj name=\"%s\"", vobj[vobj_id].name); 377 fprintf(fpout, " type=\"%s\"", vobj_type[vobj[vobj_id].type]); 378 fprintf(fpout, " length=\"0x%x\"", vobj[vobj_id].length); 379 if( vobj[vobj_id].align ) 380 fprintf(fpout, " align=\"%d\"", vobj[vobj_id].align); 381 if( vobj[vobj_id].binpath[0] != 0 ) 382 fprintf(fpout, " binpath=\"%s\"", vobj[vobj_id].binpath); 383 if( (vobj[vobj_id].type == VOBJ_TYPE_BARRIER) || 384 (vobj[vobj_id].type == VOBJ_TYPE_MWMR ) || 385 (vobj[vobj_id].type == VOBJ_TYPE_CONST ) ) 386 fprintf(fpout, " init=\"%d\"", vobj[vobj_id].init); 387 fprintf(fpout, " />\n"); 364 388 } 365 389 fprintf(fpout, " </vseg>\n"); … … 384 408 unsigned int pseg_id = vseg[vseg_id].psegid; 385 409 unsigned int cluster_id = pseg[pseg_id].clusterid; 386 unsigned int x = cluster_id >> header->y_width; 387 unsigned int y = cluster_id & ((1<<header->y_width)-1); 388 389 fprintf(fpout, " <vseg name = \"%s\" ", vseg[vseg_id].name); 390 fprintf(fpout, "vbase = \"0x%x\" ", vseg[vseg_id].vbase); 391 fprintf(fpout, "mode = \"%s\" ", mode_str[vseg[vseg_id].mode]); 392 fprintf(fpout, "x = \"%d\" ", x); 393 fprintf(fpout, "y = \"%d\" ", y); 394 fprintf(fpout, "psegname = \"%s\" ", pseg[pseg_id].name); 395 fprintf(fpout, "ident = \"%d\" >\n", vseg[vseg_id].ident); 410 411 fprintf(fpout, " <vseg name=\"%s\"", vseg[vseg_id].name); 412 fprintf(fpout, " vbase=\"0x%x\"", vseg[vseg_id].vbase); 413 fprintf(fpout, " mode=\"%s\"", mode_str[vseg[vseg_id].mode]); 414 fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x); 415 fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); 416 fprintf(fpout, " psegname=\"%s\"", pseg[pseg_id].name); 417 if( vseg[vseg_id].ident ) fprintf(fpout, " ident=\"1\""); 418 fprintf(fpout, " >\n"); 396 419 397 420 for (vobj_id = vseg[vseg_id].vobj_offset; … … 399 422 vobj_id++) 400 423 { 401 fprintf(fpout, " <vobj name = \"%s\" ", vobj[vobj_id].name); 402 fprintf(fpout, "type = \"%s\" ", vobj_type[vobj[vobj_id].type]); 403 fprintf(fpout, "length = \"0x%x\" ", vobj[vobj_id].length); 404 fprintf(fpout, "align = \"%d\" ", vobj[vobj_id].align); 405 fprintf(fpout, "init = \"%d\" ", vobj[vobj_id].init); 406 fprintf(fpout, "binpath = \"%s\" />\n", vobj[vobj_id].binpath); 424 fprintf(fpout, " <vobj name=\"%s\"", vobj[vobj_id].name); 425 fprintf(fpout, " type=\"%s\"", vobj_type[vobj[vobj_id].type]); 426 fprintf(fpout, " length=\"0x%x\"", vobj[vobj_id].length); 427 if( vobj[vobj_id].align ) 428 fprintf(fpout, " align=\"%d\"", vobj[vobj_id].align); 429 if( vobj[vobj_id].binpath[0] != 0 ) 430 fprintf(fpout, " binpath=\"%s\"", vobj[vobj_id].binpath); 431 if( (vobj[vobj_id].type == VOBJ_TYPE_BARRIER) || 432 (vobj[vobj_id].type == VOBJ_TYPE_MWMR ) || 433 (vobj[vobj_id].type == VOBJ_TYPE_CONST ) ) 434 fprintf(fpout, " init=\"%d\"", vobj[vobj_id].init); 435 fprintf(fpout, " />\n"); 407 436 } 408 437 fprintf(fpout, " </vseg>\n\n"); … … 418 447 unsigned int heap_vobj_id = task[task_id].heap_vobjid + vspace[vspace_id].vobj_offset; 419 448 unsigned int cluster_id = task[task_id].clusterid; 420 unsigned int x = cluster_id >> header->y_width; 421 unsigned int y = cluster_id & ((1<<header->y_width)-1); 422 423 fprintf(fpout, " <task name = \"%s\" ", task[task_id].name); 424 fprintf(fpout, "x = \"%d\" ", x); 425 fprintf(fpout, "y = \"%d\" ", y); 426 fprintf(fpout, "proclocid = \"%d\" ", task[task_id].proclocid); 427 fprintf(fpout, "stackname = \"%s\" ", vobj[stack_vobj_id].name); 449 450 fprintf(fpout, " <task name=\"%s\"", task[task_id].name); 451 fprintf(fpout, " trdid=\"%d\"", task[task_id].trdid); 452 fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x); 453 fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y); 454 fprintf(fpout, " p=\"%d\"", task[task_id].proclocid); 455 fprintf(fpout, " stackname=\"%s\"", vobj[stack_vobj_id].name); 428 456 if (heap_vobj_id != -1) 429 457 { 430 fprintf(fpout, " heapname = \"%s\"", vobj[heap_vobj_id].name);458 fprintf(fpout, " heapname=\"%s\"", vobj[heap_vobj_id].name); 431 459 } 432 fprintf(fpout, "startid = \"%d\" ", task[task_id].startid); 433 fprintf(fpout, "usetty = \"%d\" ", task[task_id].use_tty); 434 fprintf(fpout, "usenic = \"%d\" ", task[task_id].use_nic); 435 fprintf(fpout, "usecma = \"%d\" ", task[task_id].use_cma); 436 fprintf(fpout, "usetim = \"%d\" ", task[task_id].use_tim); 437 fprintf(fpout, "usehba = \"%d\" />\n", task[task_id].use_hba); 460 fprintf(fpout, " startid = \"%d\"", task[task_id].startid); 461 if( task[task_id].use_tty ) fprintf(fpout, " usetty=\"1\""); 462 if( task[task_id].use_nic ) fprintf(fpout, " usenic=\"1\""); 463 if( task[task_id].use_cma ) fprintf(fpout, " usecma=\"1\""); 464 if( task[task_id].use_tim ) fprintf(fpout, " usetim=\"1\""); 465 if( task[task_id].use_hba ) fprintf(fpout, " usehba=\"1\""); 466 fprintf(fpout, " />\n"); 438 467 } 439 468 fprintf(fpout, " </vspace>\n\n"); … … 445 474 446 475 ///////////////////////////////////// 447 int main(int argc, char * argv[]) { 448 if (argc < 2) { 476 int main(int argc, char * argv[]) 477 { 478 if (argc < 2) 479 { 449 480 printf("Usage: bin2xml <input_file_path> <output_file_path>\n"); 450 481 return 1; … … 454 485 455 486 int fdin = open(argv[1], O_RDONLY); 456 if (fdin < 0) { 487 if (fdin < 0) 488 { 457 489 perror("open"); 458 490 exit(1); … … 460 492 461 493 FILE * fpout = fopen( argv[2], "w"); 462 if (fpout == NULL) { 494 if (fpout == NULL) 495 { 463 496 perror("open"); 464 497 exit(1); … … 467 500 unsigned int length = read(fdin, bin, 0x40000); 468 501 469 if (length <= 0) { 502 if (length <= 0) 503 { 470 504 perror("read"); 471 505 exit(1); 472 506 } 473 507 474 if (bin[0] == IN_MAPPING_SIGNATURE) { 508 if (bin[0] == IN_MAPPING_SIGNATURE) 509 { 475 510 buildXml((mapping_header_t *) bin, fpout); 476 511 } 477 else { 512 else 513 { 478 514 printf("[ERROR] Wrong file format\n"); 479 515 exit(1); -
soft/giet_vm/giet_xml/xml_parser.c
r299 r306 1 ////////////////////////////////////////////////////////////////////////////////////// /1 ////////////////////////////////////////////////////////////////////////////////////// 2 2 // File : xml_parser.c 3 3 // Date : 14/04/2012 … … 124 124 unsigned int use_pic = 0; // using PIC component 125 125 unsigned int use_xcu = 0; // using XCU (not ICU) 126 unsigned int use_fbf = 0; // using Frame Buffer 126 127 127 128 // These variables define the IOC peripheral subtype … … 622 623 } 623 624 624 ////////// get p roclocidattribute625 value = getIntValue(reader, "p roclocid", &ok);625 ////////// get p attribute 626 value = getIntValue(reader, "p", &ok); 626 627 if (ok) 627 628 { … … 639 640 else 640 641 { 641 printf("[XML ERROR] illegal or missing < locprocid> attribute for task (%d,%d)\n",642 printf("[XML ERROR] illegal or missing <p> attribute for task (%d,%d)\n", 642 643 vspace_index, task_loc_index); 643 644 exit(1); … … 805 806 else if (ok && (strcmp(str, "MEMSPACE") == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_MEMSPACE; } 806 807 else if (ok && (strcmp(str, "SCHED") == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_SCHED; } 807 else if (ok && (strcmp(str, "BOOT") == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_BOOT; }808 808 else 809 809 { … … 850 850 } 851 851 852 ////////// get binpath attribute (optional : '\0'if missing)852 ////////// get binpath attribute (optional : "" if missing) 853 853 str = getStringValue(reader, "binpath", &ok); 854 854 if (ok) … … 859 859 strncpy(vobj[vobj_index]->binpath, str, 63); 860 860 } 861 else { 862 vobj[vobj_index]->binpath[0] = '\0'; 863 } 864 865 ////////// get init attribute (mandatory for mwmr and barrier) 861 else 862 { 863 vobj[vobj_index]->binpath[0] = 0; 864 } 865 866 ////////// get init attribute (optional, mandatory for mwmr and barrier) 866 867 value = getIntValue(reader, "init", &ok); 867 868 if (ok) … … 915 916 vseg[vseg_index] = (mapping_vseg_t *) malloc(sizeof(mapping_vseg_t)); 916 917 917 ////////// set vobj_offset attribute s918 ////////// set vobj_offset attribute 918 919 vseg[vseg_index]->vobj_offset = vobj_index; 919 920 … … 1015 1016 printf(" psegid = %d\n", psegid); 1016 1017 #endif 1017 if ( index>= 0)1018 if (psegid >= 0) 1018 1019 { 1019 1020 vseg[vseg_index]->psegid = psegid; … … 1211 1212 char * str; 1212 1213 1214 unsigned int is_pic = (periph[periph_index]->type == PERIPH_TYPE_PIC); 1215 unsigned int is_icu = (periph[periph_index]->type == PERIPH_TYPE_ICU) || 1216 (periph[periph_index]->type == PERIPH_TYPE_XCU); 1217 1213 1218 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1214 1219 … … 1223 1228 1224 1229 irq[irq_index] = (mapping_irq_t *) malloc(sizeof(mapping_irq_t)); 1225 1226 ///////// get srctype attribute1227 str = getStringValue(reader, "srctype", &ok);1228 if (ok)1229 {1230 #if XML_PARSER_DEBUG1231 printf(" srctype = %s\n", str);1232 #endif1233 if ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI;1234 else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI;1235 else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI;1236 else1237 {1238 printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n",1239 cluster_index, periph_loc_index);1240 exit(1);1241 }1242 }1243 else1244 {1245 printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n",1246 cluster_index, periph_loc_index);1247 exit(1);1248 }1249 1230 1250 1231 ///////// get srcid attribute … … 1265 1246 else 1266 1247 { 1267 printf("[XML ERROR] missing IRQ < icuid> for periph %d in cluster %d\n",1248 printf("[XML ERROR] missing IRQ <srcid> for periph %d in cluster %d\n", 1268 1249 cluster_index, periph_loc_index); 1269 1250 exit(1); 1270 1251 } 1271 1252 1272 ///////// get isr attribute 1273 str = getStringValue(reader, "isr", &ok); 1274 if (ok) 1275 { 1253 ///////// get srctype attribute ... if ICU or XCU 1254 if ( is_icu ) 1255 { 1256 str = getStringValue(reader, "srctype", &ok); 1257 if (ok) 1258 { 1259 #if XML_PARSER_DEBUG 1260 printf(" srctype = %s\n", str); 1261 #endif 1262 if ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI; 1263 else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI; 1264 else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI; 1265 else 1266 { 1267 printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n", 1268 cluster_index, periph_loc_index); 1269 exit(1); 1270 } 1271 } 1272 else 1273 { 1274 printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n", 1275 cluster_index, periph_loc_index); 1276 exit(1); 1277 } 1278 } 1279 1280 ///////// get isr attribute ... if ICU or XCU 1281 if ( is_icu ) 1282 { 1283 str = getStringValue(reader, "isr", &ok); 1284 if (ok) 1285 { 1276 1286 #if XML_PARSER_DEBUG 1277 1287 printf(" isr = %s\n", str); 1278 1288 #endif 1279 if (strcmp(str, "ISR_TICK" ) == 0) irq[irq_index]->isr = ISR_TICK; 1280 else if (strcmp(str, "ISR_BDV" ) == 0) irq[irq_index]->isr = ISR_BDV; 1281 else if (strcmp(str, "ISR_CMA" ) == 0) irq[irq_index]->isr = ISR_CMA; 1282 else if (strcmp(str, "ISR_TTY_RX" ) == 0) irq[irq_index]->isr = ISR_TTY_RX; 1283 else if (strcmp(str, "ISR_TTY_TX" ) == 0) irq[irq_index]->isr = ISR_TTY_TX; 1284 else if (strcmp(str, "ISR_TIMER" ) == 0) irq[irq_index]->isr = ISR_TIMER; 1285 else if (strcmp(str, "ISR_WAKUP" ) == 0) irq[irq_index]->isr = ISR_WAKUP; 1286 else if (strcmp(str, "ISR_NIC_RX" ) == 0) irq[irq_index]->isr = ISR_NIC_RX; 1287 else if (strcmp(str, "ISR_NIC_TX" ) == 0) irq[irq_index]->isr = ISR_NIC_TX; 1288 else if (strcmp(str, "ISR_MMC" ) == 0) irq[irq_index]->isr = ISR_MMC; 1289 else if (strcmp(str, "ISR_DEFAULT") == 0) irq[irq_index]->isr = ISR_DEFAULT; 1289 if (strcmp(str, "ISR_TICK" ) == 0) irq[irq_index]->isr = ISR_TICK; 1290 else if (strcmp(str, "ISR_BDV" ) == 0) irq[irq_index]->isr = ISR_BDV; 1291 else if (strcmp(str, "ISR_CMA" ) == 0) irq[irq_index]->isr = ISR_CMA; 1292 else if (strcmp(str, "ISR_TTY_RX" ) == 0) irq[irq_index]->isr = ISR_TTY_RX; 1293 else if (strcmp(str, "ISR_TTY_TX" ) == 0) irq[irq_index]->isr = ISR_TTY_TX; 1294 else if (strcmp(str, "ISR_TIMER" ) == 0) irq[irq_index]->isr = ISR_TIMER; 1295 else if (strcmp(str, "ISR_WAKUP" ) == 0) irq[irq_index]->isr = ISR_WAKUP; 1296 else if (strcmp(str, "ISR_NIC_RX" ) == 0) irq[irq_index]->isr = ISR_NIC_RX; 1297 else if (strcmp(str, "ISR_NIC_TX" ) == 0) irq[irq_index]->isr = ISR_NIC_TX; 1298 else if (strcmp(str, "ISR_MMC" ) == 0) irq[irq_index]->isr = ISR_MMC; 1299 else if (strcmp(str, "ISR_DEFAULT") == 0) irq[irq_index]->isr = ISR_DEFAULT; 1300 else 1301 { 1302 printf("[XML ERROR] illegal IRQ <isr> for periph %d in cluster %d\n", 1303 periph_loc_index, cluster_index ); 1304 exit(1); 1305 } 1306 } 1290 1307 else 1291 1308 { 1292 printf("[XML ERROR] illegalIRQ <isr> for periph %d in cluster %d\n",1293 periph_loc_index, cluster_index);1309 printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n", 1310 cluster_index, periph_loc_index); 1294 1311 exit(1); 1295 1312 } 1296 }1297 else1298 {1299 printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n",1300 cluster_index, periph_loc_index);1301 exit(1);1302 1313 } 1303 1314 … … 1316 1327 } 1317 1328 1318 ///////// get dstx attribute 1319 value = getIntValue(reader, "dstx", &ok); 1320 if (ok) 1321 { 1329 ///////// get dstx attribute ... if PIC 1330 if ( is_pic ) 1331 { 1332 value = getIntValue(reader, "dstx", &ok); 1333 if (ok) 1334 { 1322 1335 #if XML_PARSER_DEBUG 1323 1336 printf(" dstx = %d\n", value); 1324 1337 #endif 1325 1338 1326 if ( value < header->x_size ) 1327 { 1328 irq[irq_index]->dstx = value; 1329 } 1330 else 1331 { 1332 printf("[XML ERROR] IRQ <dstx> too large for periph %d in cluster %d\n", 1339 if ( value < header->x_size ) 1340 { 1341 irq[irq_index]->dstx = value; 1342 } 1343 else 1344 { 1345 printf("[XML ERROR] IRQ <dstx> too large for periph %d in cluster %d\n", 1346 cluster_index, periph_loc_index); 1347 exit(1); 1348 } 1349 } 1350 else 1351 { 1352 printf("[XML ERROR] missing IRQ <dstx> for periph %d in cluster %d\n", 1353 cluster_index, periph_loc_index); 1354 exit(1); 1355 } 1356 } 1357 1358 ///////// get dsty attribute ... if PIC 1359 if ( is_pic ) 1360 { 1361 value = getIntValue(reader, "dsty", &ok); 1362 if (ok) 1363 { 1364 #if XML_PARSER_DEBUG 1365 printf(" dsty = %d\n", value); 1366 #endif 1367 1368 if ( value < header->y_size ) 1369 { 1370 irq[irq_index]->dsty = value; 1371 } 1372 else 1373 { 1374 printf("[XML ERROR] IRQ <dsty> too large for periph %d in cluster %d\n", 1375 cluster_index, periph_loc_index); 1376 exit(1); 1377 } 1378 } 1379 else 1380 { 1381 printf("[XML ERROR] missing IRQ <dsty> for periph %d in cluster %d\n", 1333 1382 cluster_index, periph_loc_index); 1334 1383 exit(1); 1335 1384 } 1336 }1337 else1338 {1339 printf("[XML ERROR] missing IRQ <dstx> for periph %d in cluster %d\n",1340 cluster_index, periph_loc_index);1341 exit(1);1342 }1343 1344 ///////// get dsty attribute1345 value = getIntValue(reader, "dsty", &ok);1346 if (ok)1347 {1348 #if XML_PARSER_DEBUG1349 printf(" dsty = %d\n", value);1350 #endif1351 1352 if ( value < header->y_size )1353 {1354 irq[irq_index]->dsty = value;1355 }1356 else1357 {1358 printf("[XML ERROR] IRQ <dsty> too large for periph %d in cluster %d\n",1359 cluster_index, periph_loc_index);1360 exit(1);1361 }1362 }1363 else1364 {1365 printf("[XML ERROR] missing IRQ <dsty> for periph %d in cluster %d\n",1366 cluster_index, periph_loc_index);1367 exit(1);1368 1385 } 1369 1386 … … 1575 1592 { 1576 1593 periph[periph_index]->type = PERIPH_TYPE_FBF; 1594 use_fbf = 1; 1577 1595 } 1578 1596 ///////////////////////////////// … … 1597 1615 periph[periph_index]->subtype = PERIPH_SUBTYPE_BDV; 1598 1616 ioc_channels = 1; 1599 if ( header->use_ram disk == 0 ) use_bdv = 1;1617 if ( header->use_ram_disk == 0 ) use_bdv = 1; 1600 1618 } 1601 1619 else if ( strcmp(subtype, "HBA") == 0 ) … … 1604 1622 periph[periph_index]->subtype = PERIPH_SUBTYPE_HBA; 1605 1623 ioc_channels = periph[periph_index]->channels; 1606 if ( header->use_ram disk == 0 ) use_hba = 1;1624 if ( header->use_ram_disk == 0 ) use_hba = 1; 1607 1625 } 1608 1626 else if ( strcmp(subtype, "SPI") == 0 ) … … 1611 1629 periph[periph_index]->subtype = PERIPH_SUBTYPE_SPI; 1612 1630 ioc_channels = periph[periph_index]->channels; 1613 if ( header->use_ram disk == 0 ) use_spi = 1;1631 if ( header->use_ram_disk == 0 ) use_spi = 1; 1614 1632 } 1615 1633 else … … 1924 1942 if (ok && (value != proc_loc_index)) 1925 1943 { 1926 printf("[XML ERROR] wrong proc index / expected value is %d",1944 printf("[XML ERROR] wrong local proc index / expected value is %d", 1927 1945 proc_loc_index); 1928 1946 exit(1); … … 2124 2142 { 2125 2143 ///////// TIMER and ICU peripheral are mandatory when nprocs != 0 2144 2126 2145 unsigned int procs = cluster[cluster_index]->procs; 2127 2146 if ( procs && !found_timer && !found_xcu) … … 2439 2458 } 2440 2459 2441 ///////// get use_ram disk attribute (default = 0)2442 value = getIntValue(reader, "use_ram disk", &ok);2443 if (ok) 2444 { 2445 #if XML_PARSER_DEBUG 2446 printf(" use_ram disk = %d\n", value);2447 #endif 2448 header->use_ram disk = value;2449 } 2450 else 2451 { 2452 header->use_ram disk = 0;2460 ///////// get use_ram_disk attribute (default = 0) 2461 value = getIntValue(reader, "use_ram_disk", &ok); 2462 if (ok) 2463 { 2464 #if XML_PARSER_DEBUG 2465 printf(" use_ram_disk = %d\n", value); 2466 #endif 2467 header->use_ram_disk = value; 2468 } 2469 else 2470 { 2471 header->use_ram_disk = 0; 2453 2472 } 2454 2473 … … 2707 2726 def_int_write(fdout, "USE_IOB ", use_iob); 2708 2727 def_int_write(fdout, "USE_PIC ", use_pic); 2728 def_int_write(fdout, "USE_FBF ", use_fbf); 2709 2729 2710 2730 file_write(fdout, "\n"); 2711 2731 2712 def_int_write(fdout, "USE_IOC_RDK ", header->use_ram disk);2732 def_int_write(fdout, "USE_IOC_RDK ", header->use_ram_disk); 2713 2733 def_int_write(fdout, "USE_IOC_HBA ", use_hba); 2714 2734 def_int_write(fdout, "USE_IOC_BDV ", use_bdv);
Note: See TracChangeset
for help on using the changeset viewer.