Changeset 289 for soft/giet_vm/giet_xml/xml_parser.c
- Timestamp:
- Feb 4, 2014, 2:16:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_xml/xml_parser.c
r287 r289 123 123 unsigned int use_iob = 0; // using IOB component 124 124 unsigned int use_xcu = 0; // using XCU (not ICU) 125 126 // These variables define the IOC peripheral subtype 125 127 unsigned int use_hba = 0; // using HBA 128 unsigned int use_bdv = 0; // using SoCLIB block device 129 unsigned int use_spi = 0; // using SD Card-SPI 126 130 127 131 //////////////////////////////////////////////////////////////// … … 1252 1256 unsigned int error = 0; 1253 1257 1258 // initialize peripheral subtype 1259 periph[periph_index]->subtype = 0xFFFFFFFF; 1260 1254 1261 // The CMA, FBF, HBA, IOB, IOC, NIC, ROM, SIM, TTY, peripherals are not 1255 1262 // replicated in all clusters but can be replicated in two clusters (fault tolerance) … … 1294 1301 } 1295 1302 ///////////////////////////////// 1296 else if (strcmp(str, "HBA") == 0)1297 {1298 periph[periph_index]->type = PERIPH_TYPE_HBA;1299 use_hba = 1;1300 if (header->hba_cluster == 0xFFFFFFFF)1301 {1302 header->hba_cluster = cluster_index;1303 hba_channels = periph[periph_index]->channels;1304 }1305 else if (header->hba_cluster_bis == 0xFFFFFFFF)1306 {1307 header->hba_cluster_bis = cluster_index;1308 assert( (hba_channels == periph[periph_index]->channels) &&1309 "[XML ERROR] unconsistent non replicated peripheral");1310 }1311 else1312 {1313 error = 1;1314 }1315 }1316 /////////////////////////////////1317 1303 else if (strcmp(str, "IOB") == 0) 1318 1304 { … … 1346 1332 else 1347 1333 { 1348 error = 1; 1334 printf("[XML ERROR] At most two copies for non replicated " 1335 "peripheral\n"); 1336 exit(1); 1337 } 1338 1339 str = getStringValue(reader, "subtype", &ok); 1340 1341 if (!ok) 1342 { 1343 printf("[XML ERROR] IOC peripheral needs a subtype parameter: " 1344 "BDV, HBA or SPI\n"); 1345 exit(1); 1346 } 1347 1348 if (strcmp(str, "BDV") == 0) 1349 { 1350 periph[periph_index]->subtype = PERIPH_SUBTYPE_BDV; 1351 use_bdv = 1; 1352 } 1353 else if (strcmp(str, "HBA") == 0) 1354 { 1355 periph[periph_index]->subtype = PERIPH_SUBTYPE_HBA; 1356 1357 if (use_hba == 0) 1358 { 1359 use_hba = 1; 1360 hba_channels = periph[periph_index]->channels; 1361 } 1362 else 1363 { 1364 assert( (hba_channels == periph[periph_index]->channels) && 1365 "[XML ERROR] unconsistent non replicated peripheral"); 1366 } 1367 } 1368 else if (strcmp(str, "SPI") == 0) 1369 { 1370 periph[periph_index]->subtype = PERIPH_SUBTYPE_SPI; 1371 use_spi = 1; 1372 } 1373 else 1374 { 1375 printf("[XML ERROR] illegal subtype for IOC peripheral\n"); 1376 exit(1); 1349 1377 } 1350 1378 } … … 2325 2353 header->fbf_cluster = 0xFFFFFFFF; 2326 2354 header->fbf_cluster_bis = 0xFFFFFFFF; 2327 2328 header->hba_cluster = 0xFFFFFFFF;2329 header->hba_cluster_bis = 0xFFFFFFFF;2330 2355 2331 2356 header->iob_cluster = 0xFFFFFFFF; … … 2589 2614 def_int_write(fdout, "USE_IOB ", use_iob); 2590 2615 def_int_write(fdout, "USE_HBA ", use_hba); 2616 def_int_write(fdout, "USE_BDV ", use_bdv); 2617 def_int_write(fdout, "USE_SPI ", use_spi); 2591 2618 2592 2619 file_write(fdout, "\n"); … … 2720 2747 ld_write(fdout, "seg_cma_base ", periph_vbase_array[PERIPH_TYPE_CMA]); 2721 2748 ld_write(fdout, "seg_fbf_base ", periph_vbase_array[PERIPH_TYPE_FBF]); 2722 ld_write(fdout, "seg_hba_base ", periph_vbase_array[PERIPH_TYPE_HBA]);2723 2749 ld_write(fdout, "seg_iob_base ", periph_vbase_array[PERIPH_TYPE_IOB]); 2724 2750 ld_write(fdout, "seg_ioc_base ", periph_vbase_array[PERIPH_TYPE_IOC]);
Note: See TracChangeset
for help on using the changeset viewer.