Changeset 289 for soft/giet_vm/giet_xml
- Timestamp:
- Feb 4, 2014, 2:16:37 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
r287 r289 104 104 PERIPH_TYPE_DMA = 1, 105 105 PERIPH_TYPE_FBF = 2, 106 PERIPH_TYPE_HBA = 3, 107 PERIPH_TYPE_ICU = 4, 108 PERIPH_TYPE_IOB = 5, 109 PERIPH_TYPE_IOC = 6, 110 PERIPH_TYPE_MMC = 7, 111 PERIPH_TYPE_MWR = 8, 112 PERIPH_TYPE_NIC = 9, 113 PERIPH_TYPE_ROM = 10, 114 PERIPH_TYPE_SIM = 11, 115 PERIPH_TYPE_TIM = 12, 116 PERIPH_TYPE_TTY = 13, 117 PERIPH_TYPE_XCU = 14, 118 119 PERIPH_TYPE_MAX_VALUE = 15, 120 }; 121 106 PERIPH_TYPE_ICU = 3, 107 PERIPH_TYPE_IOB = 4, 108 PERIPH_TYPE_IOC = 5, 109 PERIPH_TYPE_MMC = 6, 110 PERIPH_TYPE_MWR = 7, 111 PERIPH_TYPE_NIC = 8, 112 PERIPH_TYPE_ROM = 9, 113 PERIPH_TYPE_SIM = 10, 114 PERIPH_TYPE_TIM = 11, 115 PERIPH_TYPE_TTY = 12, 116 PERIPH_TYPE_XCU = 13, 117 118 PERIPH_TYPE_MAX_VALUE = 14, 119 }; 120 121 enum periphSubtype 122 { 123 PERIPH_SUBTYPE_BDV = 0, 124 PERIPH_SUBTYPE_HBA = 1, 125 PERIPH_SUBTYPE_SPI = 2, 126 127 PERIPH_SUBTYPE_MAX_VALUE = 3, 128 }; 122 129 123 130 enum mwmrPortDirection … … 146 153 unsigned int fbf_cluster; // index of cluster containing FBF controler 147 154 unsigned int fbf_cluster_bis; // index of cluster containing second FBF controler 148 149 unsigned int hba_cluster; // index of cluster containing HBA controler150 unsigned int hba_cluster_bis; // index of cluster containing second HBA controler151 155 152 156 unsigned int iob_cluster; // index of cluster containing IOB controler … … 320 324 { 321 325 unsigned int type; 326 unsigned int subtype; // periph specialization 322 327 unsigned int psegid; // pseg index in cluster 323 328 unsigned int channels; // number of channels -
soft/giet_vm/giet_xml/xml_driver.c
r287 r289 63 63 "DMA", 64 64 "FBF", 65 "HBA",66 65 "ICU", 67 66 "IOB", … … 75 74 "TTY", 76 75 "XCU", 76 }; 77 78 const char * periph_subtype[] = 79 { 80 "BDV", 81 "HBA", 82 "SPI", 77 83 }; 78 84 … … 308 314 { 309 315 fprintf(fpout, " <periph type = \"%s\" ", periph_type[periph[periph_id].type]); 316 317 if (periph[periph_id].subtype < PERIPH_SUBTYPE_MAX_VALUE) 318 fprintf(fpout, " subtype = \"%s\" ", periph_subtype[periph[periph_id].subtype]); 319 310 320 fprintf(fpout, " psegname = \"%s\" ", pseg[periph[periph_id].psegid].name); 311 321 fprintf(fpout, " channels = \"%d\" />\n", periph[periph_id].channels); -
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.