Changeset 522
- Timestamp:
- Mar 10, 2015, 3:17:57 PM (10 years ago)
- Location:
- soft/giet_vm/giet_xml
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_xml/mapping_info.h
r511 r522 8 8 // 9 9 // 1) a description of a clusterized hardware architecture. 10 // The number of cluster is variable (can be one). The number of processors11 // per cluster is variable (can be one). The number of peripherals per cluser12 // and coprocessor per cluster is variable. The number of physical memory13 // banksper cluster is variable.10 // The number of cluster is variable (can be one). 11 // The number of processors per cluster is variable (can be zero). 12 // The number of peripherals per cluster is variable (can be zero), 13 // The number of physical memory bank per cluster is variable. 14 14 // 15 15 // 2/ a description of the applications (called vspaces) to be - statically - 16 16 // launched on the platform. The number of parallel tasks per application is 17 // variable (can be one). Multi-Writer/Multi-Reader communication channels 18 // betwwen tasks are supported. Each vspace contains a variable number 19 // of virtual segments (called vsegs). The number of virtual space can be one. 17 // variable (can be one). Each vspace contains a variable number 18 // of virtual segments (called vsegs). 20 19 // 21 20 // 3/ the mapping directives: both tasks on processors, and software objects 22 // ( called vsegs) on the physical memory banks (calledpsegs).21 // (vsegs) on the physical memory banks (psegs). 23 22 // 24 23 // The mapping_info data structure is organised as the concatenation of 25 // a fixed size header, and 11variable size arrays:24 // a fixed size header, and 8 variable size arrays: 26 25 // 27 26 // - mapping_cluster_t cluster[] … … 32 31 // - mapping_proc_t proc[] 33 32 // - mapping_irq_t irq[] 34 // - mapping_coproc_t coproc[]35 // - mapping_cp_port_t cp_port[]36 33 // - mapping_periph_t periph[] 37 34 // … … 50 47 #define MAPPING_PROC_SIZE sizeof(mapping_proc_t) 51 48 #define MAPPING_IRQ_SIZE sizeof(mapping_irq_t) 52 #define MAPPING_COPROC_SIZE sizeof(mapping_coproc_t) 53 #define MAPPING_CP_PORT_SIZE sizeof(mapping_cp_port_t) 49 #define MAPPING_PERIPH_SIZE sizeof(mapping_periph_t) 54 50 55 51 #define C_MODE_MASK 0b1000 // cacheable … … 86 82 }; 87 83 84 88 85 enum psegType 89 86 { 90 87 PSEG_TYPE_RAM = 0, 91 PSEG_TYPE_ROM = 1, // deprecated => you should use PSEG_TYPE_PERI92 88 PSEG_TYPE_PERI = 2, 93 89 }; 94 90 95 // The enum definitions for psegType and periphType must be kept 96 // consistent with the definitions in the xml_driver.c file... 97 98 enum periphType 91 92 //////////////////////////////////////////////////////////////////// 93 // These enum must be coherent with the values in 94 // xml_driver.c / xml_parser.c / mapping.py 95 /////////////////////////////////////////////////////////////////// 96 enum periphTypes 99 97 { 100 98 PERIPH_TYPE_CMA = 0, … … 117 115 }; 118 116 119 enum periphSubtype 120 { 121 PERIPH_SUBTYPE_BDV = 0, 122 PERIPH_SUBTYPE_HBA = 1, 123 PERIPH_SUBTYPE_SPI = 2, 124 PERIPH_SUBTYPE_NONE = 3, 125 }; 126 127 enum mwmrPortDirection 128 { 129 PORT_TO_COPROC = 0, // status register 130 PORT_FROM_COPROC = 1, // config register 131 }; 132 117 enum iocTypes 118 { 119 IOC_SUBTYPE_BDV = 0, 120 IOC_SUBTYPE_HBA = 1, 121 IOC_SUBTYPE_SPI = 2, 122 IOC_SUBTYPE_NONE = 3, 123 }; 124 125 enum mwrTypes 126 { 127 MWR_SUBTYPE_GCD = 0, 128 MWR_SUBTYPE_DCT = 1, 129 }; 130 131 ////////////////////////////////////////////////////////// 132 // This enum must be coherent with the values in 133 // mwr_driver.h 134 ////////////////////////////////////////////////////////// 135 enum MwmrDmaModes 136 { 137 MODE_MWMR = 0, 138 MODE_DMA_IRQ = 1, 139 MODE_DMA_NO_IRQ = 2, 140 }; 133 141 134 142 //////////////////////////////////////////////////////// … … 149 157 unsigned int vsegs; // total number of virtual segments 150 158 unsigned int tasks; // total number of tasks 151 unsigned int procs; // total number of proc s159 unsigned int procs; // total number of processors 152 160 unsigned int irqs; // total number of irqs 153 unsigned int coprocs; // total number of coprocs154 unsigned int cp_ports; // total number of cp_ports155 161 unsigned int periphs; // total number of peripherals 156 162 char name[32]; // mapping name … … 165 171 166 172 unsigned int psegs; // number of psegs in cluster 167 unsigned int pseg_offset; // global index of first pseg in psegs173 unsigned int pseg_offset; // global index of first pseg in cluster 168 174 169 175 unsigned int procs; // number of processors in cluster 170 unsigned int proc_offset; // global index of first proc in procs176 unsigned int proc_offset; // global index of first proc in cluster 171 177 172 unsigned int coprocs; // number of coprocessors in cluster173 unsigned int coproc_offset; // global index of first coproc in coprocs174 175 178 unsigned int periphs; // number of peripherals in cluster 176 unsigned int periph_offset; // global index of first coproc in periphs179 unsigned int periph_offset; // global index of first coproc in cluster 177 180 } mapping_cluster_t; 178 181 … … 241 244 242 245 //////////////////////////////////////////////////////// 243 typedef struct __attribute__((packed)) mapping_coproc_s244 {245 char name[32]; // coprocessor name (probablement inutile AG)246 unsigned int psegid; // global pseg index247 unsigned int ports; // number of MWMR ports used by coprocessor248 unsigned int port_offset; // global index of first MWMR port249 } mapping_coproc_t;250 251 252 /////////////////////////////////////////////////////////253 typedef struct __attribute__((packed)) mapping_cp_port_s254 {255 unsigned int direction; // TO_COPROC == 0 / FROM_COPROC == 1256 unsigned int vspaceid; // index of the vspace containing MWMR channel257 unsigned int mwmr_vseg_id; // global index of vseg containing MWMR channel258 } mapping_cp_port_t;259 260 261 ////////////////////////////////////////////////////////262 246 typedef struct __attribute__((packed)) mapping_periph_s 263 247 { … … 266 250 unsigned int psegid; // pseg index in cluster 267 251 unsigned int channels; // number of channels 268 unsigned int arg; // argument depending on peripheral type 252 unsigned int arg0; // semantic depends on peripheral type 253 unsigned int arg1; // semantic depends on peripheral type 254 unsigned int arg2; // semantic depends on peripheral type 255 unsigned int arg3; // semantic depends on peripheral type 269 256 unsigned int irqs; // number of input IRQs (for XCU or PIC) 270 257 unsigned int irq_offset; // index of first IRQ -
soft/giet_vm/giet_xml/xml_driver.c
r511 r522 24 24 { 25 25 "ELF", // binary code generated by GCC 26 "BLOB", // binary code generated by GCC26 "BLOB", // binary 27 27 "PTAB", // page table 28 28 "PERI", // hardware component … … 52 52 }; 53 53 54 // mnemonics defined in irq_handler.h 54 // These mnemonics must be consistent with values in 55 // irq_handler.h / irq_handler.c / mapping.py 55 56 const char * isr_type[] = 56 57 { … … 68 69 "ISR_DMA", 69 70 "ISR_SPI", 70 }; 71 72 // mnemonics defined in mapping_info.h 71 "ISR_MWR", 72 }; 73 74 const char * mwr_subtype[] = 75 { 76 "GCD", 77 "DCT", 78 }; 79 73 80 const char * periph_type[] = 74 81 { … … 96 103 "SPI", 97 104 "NONE", 98 };99 100 const char * port_direction[] =101 {102 "TO_COPROC",103 "FROM_COPROC",104 105 }; 105 106 … … 131 132 unsigned int proc_id; 132 133 unsigned int irq_id; 133 unsigned int coproc_id;134 unsigned int port_id;135 134 unsigned int periph_id; 136 135 … … 142 141 mapping_proc_t * proc; 143 142 mapping_irq_t * irq; 144 mapping_coproc_t * coproc;145 mapping_cp_port_t * cp_port;146 143 mapping_periph_t * periph; 147 144 … … 195 192 MAPPING_PROC_SIZE * header->procs); 196 193 197 // computes the base address for coprocs array198 coproc = (mapping_coproc_t *) ((char *) header +194 // computes the base address for periphs array 195 periph = (mapping_periph_t *) ((char *) header + 199 196 MAPPING_HEADER_SIZE + 200 197 MAPPING_CLUSTER_SIZE * header->x_size * header->y_size + … … 205 202 MAPPING_PROC_SIZE * header->procs + 206 203 MAPPING_IRQ_SIZE * header->irqs); 207 208 // computes the base address for cp_ports array209 cp_port = (mapping_cp_port_t *) ((char *) header +210 MAPPING_HEADER_SIZE +211 MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +212 MAPPING_PSEG_SIZE * header->psegs +213 MAPPING_VSPACE_SIZE * header->vspaces +214 MAPPING_VSEG_SIZE * header->vsegs +215 MAPPING_TASK_SIZE * header->tasks +216 MAPPING_PROC_SIZE * header->procs +217 MAPPING_IRQ_SIZE * header->irqs +218 MAPPING_COPROC_SIZE * header->coprocs);219 220 // computes the base address for periphs array221 periph = (mapping_periph_t *) ((char *) header +222 MAPPING_HEADER_SIZE +223 MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +224 MAPPING_PSEG_SIZE * header->psegs +225 MAPPING_VSPACE_SIZE * header->vspaces +226 MAPPING_VSEG_SIZE * header->vsegs +227 MAPPING_TASK_SIZE * header->tasks +228 MAPPING_PROC_SIZE * header->procs +229 MAPPING_IRQ_SIZE * header->irqs +230 MAPPING_COPROC_SIZE * header->coprocs +231 MAPPING_CP_PORT_SIZE * header->cp_ports);232 204 233 205 ///////////////////////// header ///////////////////////////////////////////// … … 276 248 } 277 249 278 ///////////////////// coprocessors ///////////////////////////////////////////279 280 for (coproc_id = cluster[cluster_id].coproc_offset;281 coproc_id < cluster[cluster_id].coproc_offset + cluster[cluster_id].coprocs;282 coproc_id++)283 {284 fprintf(fpout, " <coproc name=\"%s\"", coproc[coproc_id].name);285 fprintf(fpout, " psegname=\"%s\" >\n", pseg[coproc[coproc_id].psegid].name);286 for (port_id = coproc[coproc_id].port_offset;287 port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports;288 port_id++)289 {290 unsigned int vseg_id = cp_port[port_id].mwmr_vseg_id;291 fprintf(fpout, " <port direction=\"%s\"", port_direction[cp_port[port_id].direction]);292 fprintf(fpout, " vspacename=\"%s\"", vspace[cp_port[port_id].vspaceid].name);293 fprintf(fpout, " vsegname=\"%s\" />\n", vseg[vseg_id].name);294 }295 fprintf(fpout, " </coproc>\n" );296 }297 298 250 ///////////////////// periphs /////////////////////////////////////////////// 299 251 … … 307 259 fprintf(fpout, " subtype=\"%s\"", ioc_subtype[periph[periph_id].subtype]); 308 260 261 if (periph[periph_id].type == PERIPH_TYPE_MWR) 262 fprintf(fpout, " subtype=\"%s\"", mwr_subtype[periph[periph_id].subtype]); 263 309 264 fprintf(fpout, " psegname=\"%s\"", pseg[periph[periph_id].psegid].name); 310 265 fprintf(fpout, " channels=\"%d\"", periph[periph_id].channels); 311 fprintf(fpout, " arg=\"%d\" >\n", periph[periph_id].arg); 266 fprintf(fpout, " arg0=\"%d\" >\n", periph[periph_id].arg0); 267 fprintf(fpout, " arg1=\"%d\" >\n", periph[periph_id].arg1); 268 fprintf(fpout, " arg2=\"%d\" >\n", periph[periph_id].arg2); 269 fprintf(fpout, " arg3=\"%d\" >\n", periph[periph_id].arg3); 312 270 if ( (periph[periph_id].type == PERIPH_TYPE_PIC) || 313 271 (periph[periph_id].type == PERIPH_TYPE_XCU) ) -
soft/giet_vm/giet_xml/xml_parser.c
r511 r522 34 34 #define MAX_PROCS 1024 35 35 #define MAX_IRQS 8192 36 #define MAX_COPROCS 409637 #define MAX_CP_PORTS 819238 36 #define MAX_PERIPHS 8192 39 37 … … 52 50 mapping_proc_t * proc[MAX_PROCS]; // proc array 53 51 mapping_irq_t * irq[MAX_IRQS]; // irq array 54 mapping_coproc_t * coproc[MAX_COPROCS]; // coproc array55 mapping_cp_port_t * cp_port[MAX_CP_PORTS]; // coproc port array56 52 mapping_periph_t * periph[MAX_PERIPHS]; // peripheral array 57 53 … … 69 65 unsigned int irq_loc_index = 0; 70 66 71 unsigned int coproc_index = 0;72 unsigned int coproc_loc_index = 0;73 74 unsigned int cp_port_index = 0;75 unsigned int cp_port_loc_index = 0;76 77 67 unsigned int periph_index = 0; 78 68 unsigned int periph_loc_index = 0; … … 83 73 unsigned int task_index = 0; 84 74 unsigned int task_loc_index = 0; 85 86 87 //////////////////////////////88 // for replicated peripheral89 //////////////////////////////90 char found_timer = 0;91 char found_icu = 0;92 char found_xcu = 0;93 char found_dma = 0;94 char found_mmc = 0;95 96 /*97 ////////////////////////////////////////////////////////////////////////98 // These variables are used to generate the hard_config.h file.99 ////////////////////////////////////////////////////////////////////////100 101 102 unsigned int tim_channels = 0; // number of user timers (per cluster)103 unsigned int dma_channels = 0; // number of DMA channels (per cluster)104 105 unsigned int tty_channels = 0; // number of TTY channels106 unsigned int ioc_channels = 0; // number of HBA channels107 unsigned int nic_channels = 0; // number of NIC channels108 unsigned int cma_channels = 0; // number of CMA channels109 unsigned int pic_channels = 0; // number of PIC channels110 111 unsigned int use_iob = 0; // using IOB component112 unsigned int use_pic = 0; // using PIC component113 unsigned int use_xcu = 0; // using XCU (not ICU)114 unsigned int use_fbf = 0; // using Frame Buffer115 116 // These variables define the IOC peripheral subtype117 118 unsigned int use_hba = 0; // using SoClib AHCI controller119 unsigned int use_bdv = 0; // using SoCLIB block device controller120 unsigned int use_spi = 0; // using SDCard-SPI121 122 ////////////////////////////////////////////////////////////////123 // These variables are used to generate the giet_vseg.ld file124 ////////////////////////////////////////////////////////////////125 126 unsigned int periph_vbase_array[PERIPH_TYPE_MAX_VALUE]127 = { [0 ... (PERIPH_TYPE_MAX_VALUE - 1)] = 0xFFFFFFFF };128 */129 75 130 76 … … 967 913 968 914 969 970 ////////////////////////////////////////971 void cpPortNode(xmlTextReaderPtr reader)972 {973 char * str;974 unsigned int ok;975 976 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return;977 978 if (cp_port_index >= MAX_CP_PORTS)979 {980 printf("[XML ERROR] The number of ports (for coprocs) is larger than %d\n",981 MAX_CP_PORTS);982 exit(1);983 }984 985 #if XML_PARSER_DEBUG986 printf("\n port %d\n", cp_port_index);987 #endif988 989 cp_port[cp_port_index] = (mapping_cp_port_t *) malloc(sizeof(mapping_cp_port_t));990 991 ///////// get direction attribute992 str = getStringValue(reader, "direction", &ok);993 if (ok)994 {995 #if XML_PARSER_DEBUG996 printf(" direction = %s\n", str);997 #endif998 if (strcmp(str, "TO_COPROC") == 0)999 {1000 cp_port[cp_port_index]->direction = PORT_TO_COPROC;1001 }1002 else if (strcmp(str, "FROM_COPROC") == 0)1003 {1004 cp_port[cp_port_index]->direction = PORT_FROM_COPROC;1005 }1006 else1007 {1008 printf("[XML ERROR] illegal <direction> for cp_port %d in cluster %d\n",1009 cp_port_index, cluster_index);1010 exit(1);1011 }1012 }1013 else1014 {1015 printf("[XML ERROR] missing <direction> for cp_port %d in cluster %d\n",1016 cp_port_index, cluster_index);1017 exit(1);1018 }1019 1020 cp_port_index++;1021 cp_port_loc_index++;1022 } // end cpPortNode()1023 1024 915 //////////////////////////////////////// 1025 916 void periphNode(xmlTextReaderPtr reader) … … 1059 950 } 1060 951 1061 ///////// get arg attribute (optionnal : 0 if missing) 1062 value = getIntValue(reader, "arg", &ok); 1063 if (ok) 1064 { 1065 #if XML_PARSER_DEBUG 1066 printf(" arg = %d\n", value); 1067 #endif 1068 periph[periph_index]->arg = value; 1069 } 1070 else 1071 { 1072 periph[periph_index]->arg = 1; 952 ///////// get arg0 attribute (optionnal : undefined if missing) 953 value = getIntValue(reader, "arg0", &ok); 954 if (ok) 955 { 956 #if XML_PARSER_DEBUG 957 printf(" arg0 = %d\n", value); 958 #endif 959 periph[periph_index]->arg0 = value; 960 } 961 962 ///////// get arg1 attribute (optionnal : undefined if missing) 963 value = getIntValue(reader, "arg1", &ok); 964 if (ok) 965 { 966 #if XML_PARSER_DEBUG 967 printf(" arg1 = %d\n", value); 968 #endif 969 periph[periph_index]->arg1 = value; 970 } 971 972 ///////// get arg2 attribute (optionnal : undefined if missing) 973 value = getIntValue(reader, "arg2", &ok); 974 if (ok) 975 { 976 #if XML_PARSER_DEBUG 977 printf(" arg2 = %d\n", value); 978 #endif 979 periph[periph_index]->arg2 = value; 980 } 981 982 ///////// get arg3 attribute (optionnal : undefined if missing) 983 value = getIntValue(reader, "arg3", &ok); 984 if (ok) 985 { 986 #if XML_PARSER_DEBUG 987 printf(" arg3 = %d\n", value); 988 #endif 989 periph[periph_index]->arg3 = value; 1073 990 } 1074 991 … … 1108 1025 #endif 1109 1026 if (strcmp(str, "CMA" ) == 0) periph[periph_index]->type = PERIPH_TYPE_CMA; 1027 else if (strcmp(str, "DMA" ) == 0) periph[periph_index]->type = PERIPH_TYPE_DMA; 1110 1028 else if (strcmp(str, "FBF" ) == 0) periph[periph_index]->type = PERIPH_TYPE_FBF; 1111 1029 else if (strcmp(str, "IOB" ) == 0) periph[periph_index]->type = PERIPH_TYPE_IOB; 1112 1030 else if (strcmp(str, "IOC" ) == 0) periph[periph_index]->type = PERIPH_TYPE_IOC; 1031 else if (strcmp(str, "MMC" ) == 0) periph[periph_index]->type = PERIPH_TYPE_MMC; 1032 else if (strcmp(str, "MWR" ) == 0) periph[periph_index]->type = PERIPH_TYPE_MWR; 1113 1033 else if (strcmp(str, "NIC" ) == 0) periph[periph_index]->type = PERIPH_TYPE_NIC; 1114 1034 else if (strcmp(str, "ROM" ) == 0) periph[periph_index]->type = PERIPH_TYPE_ROM; 1115 1035 else if (strcmp(str, "SIM" ) == 0) periph[periph_index]->type = PERIPH_TYPE_SIM; 1036 else if (strcmp(str, "SIM" ) == 0) periph[periph_index]->type = PERIPH_TYPE_TIM; 1116 1037 else if (strcmp(str, "TTY" ) == 0) periph[periph_index]->type = PERIPH_TYPE_TTY; 1038 else if (strcmp(str, "XCU" ) == 0) periph[periph_index]->type = PERIPH_TYPE_XCU; 1117 1039 else if (strcmp(str, "PIC" ) == 0) periph[periph_index]->type = PERIPH_TYPE_PIC; 1118 else if (strcmp(str, "DMA" ) == 0) periph[periph_index]->type = PERIPH_TYPE_DMA;1119 else if (strcmp(str, "MMC" ) == 0) periph[periph_index]->type = PERIPH_TYPE_MMC;1120 else if (strcmp(str, "XCU" ) == 0) periph[periph_index]->type = PERIPH_TYPE_XCU;1121 1040 else if (strcmp(str, "DROM") == 0) periph[periph_index]->type = PERIPH_TYPE_DROM; 1122 1041 else … … 1138 1057 #endif 1139 1058 if (strcmp(subtype, "BDV") == 0) 1140 periph[periph_index]->subtype = PERIPH_SUBTYPE_BDV;1059 periph[periph_index]->subtype = IOC_SUBTYPE_BDV; 1141 1060 else if (strcmp(subtype, "HBA") == 0) 1142 periph[periph_index]->subtype = PERIPH_SUBTYPE_HBA;1061 periph[periph_index]->subtype = IOC_SUBTYPE_HBA; 1143 1062 else if (strcmp(subtype, "SPI") == 0) 1144 periph[periph_index]->subtype = PERIPH_SUBTYPE_SPI;1063 periph[periph_index]->subtype = IOC_SUBTYPE_SPI; 1145 1064 } 1146 1065 else 1147 1066 { 1148 1067 printf("[XML ERROR] illegal subtype for IOC peripheral\n"); 1068 exit(1); 1069 } 1070 } 1071 else 1072 { 1073 periph[periph_index]->subtype = 0XFFFFFFFF; 1074 } 1075 1076 ////////// get subtype if MWR 1077 if (periph[periph_index]->type == PERIPH_TYPE_MWR ) 1078 { 1079 char* subtype = getStringValue(reader, "subtype", &ok); 1080 if (ok) 1081 { 1082 #if XML_PARSER_DEBUG 1083 printf(" subtype = %s\n", str); 1084 #endif 1085 if (strcmp(subtype, "GCD") == 0) 1086 periph[periph_index]->subtype = MWR_SUBTYPE_GCD; 1087 else if (strcmp(subtype, "DCT") == 0) 1088 periph[periph_index]->subtype = MWR_SUBTYPE_DCT; 1089 } 1090 else 1091 { 1092 printf("[XML ERROR] illegal subtype for MWR peripheral\n"); 1149 1093 exit(1); 1150 1094 } … … 1203 1147 } // end periphNode 1204 1148 1205 ////////////////////////////////////////1206 void coprocNode(xmlTextReaderPtr reader)1207 {1208 char * str;1209 unsigned int ok;1210 1211 cp_port_loc_index = 0;1212 1213 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return;1214 1215 if (coproc_index >= MAX_COPROCS)1216 {1217 printf("[XML ERROR] The number of coprocs is larger than %d\n", MAX_COPROCS);1218 exit(1);1219 }1220 1221 #if XML_PARSER_DEBUG1222 printf("\n coproc %d\n", coproc_index);1223 #endif1224 1225 coproc[coproc_index] = (mapping_coproc_t *) malloc(sizeof(mapping_coproc_t));1226 1227 /////////// get name attribute1228 str = getStringValue(reader, "name", &ok);1229 if (ok)1230 {1231 #if XML_PARSER_DEBUG1232 printf(" name = %s\n", str);1233 #endif1234 strncpy(coproc[coproc_index]->name, str, 31);1235 }1236 else1237 {1238 printf("[XML ERROR] illegal or missing <name> for coproc %d in cluster %d\n",1239 coproc_index, cluster_index);1240 exit(1);1241 }1242 1243 /////////// get psegname attribute1244 str = getStringValue(reader, "psegname", &ok);1245 if (ok == 0)1246 {1247 printf("[XML ERROR] illegal or missing <psegname> for coproc %d in cluster %d\n",1248 coproc_index, cluster_index);1249 exit(1);1250 }1251 1252 /////////// set psegid attribute1253 int index = getPsegId( cluster[cluster_index]->x, cluster[cluster_index]->y, str);1254 if (index >= 0)1255 {1256 #if XML_PARSER_DEBUG1257 printf(" clusterid = %d\n", cluster_index);1258 printf(" psegname = %s\n", str);1259 printf(" psegid = %d\n", index);1260 #endif1261 coproc[coproc_index]->psegid = index;1262 assert(pseg[index]->type == PSEG_TYPE_PERI &&1263 "coproc psegname attribute must refer to a pseg of type PERI" );1264 }1265 else1266 {1267 printf("[XML ERROR] pseg not found for coproc %d / clusterid = %d / psegname = %s\n",1268 coproc_index, cluster_index, str );1269 exit(1);1270 }1271 1272 ////////// set port_offset1273 coproc[coproc_index]->port_offset = cp_port_index;1274 1275 #if XML_PARSER_DEBUG1276 printf(" port_offset = %d\n", cp_port_index);1277 #endif1278 1279 int status = xmlTextReaderRead(reader);1280 while (status == 1)1281 {1282 const char * tag = (const char *) xmlTextReaderConstName(reader);1283 1284 if (strcmp(tag, "port") == 0 )1285 {1286 cpPortNode(reader);1287 }1288 else if (strcmp(tag, "#text") == 0 ) { }1289 else if (strcmp(tag, "#comment") == 0 ) { }1290 else if (strcmp(tag, "coproc") == 0 )1291 {1292 coproc[coproc_index]->ports = cp_port_loc_index;1293 cluster[cluster_index]->coprocs++;1294 coproc_loc_index++;1295 coproc_index++;1296 return;1297 }1298 else1299 {1300 printf("[XML ERROR] Unknown tag %s", tag);1301 exit(1);1302 }1303 status = xmlTextReaderRead(reader);1304 }1305 } // end coprocNode()1306 1307 1308 1149 ////////////////////////////////////// 1309 1150 void procNode(xmlTextReaderPtr reader) … … 1455 1296 coproc_loc_index = 0; 1456 1297 periph_loc_index = 0; 1457 1458 // for replicated periph1459 found_timer = 0;1460 found_icu = 0;1461 found_xcu = 0;1462 found_dma = 0;1463 found_mmc = 0;1464 1298 1465 1299 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; … … 1578 1412 header->irqs = irq_index; 1579 1413 header->coprocs = coproc_index; 1580 header->cp_ports = cp_port_index;1581 1414 header->periphs = periph_index; 1582 1415 return; … … 1838 1671 header->irqs = 0; 1839 1672 header->coprocs = 0; 1840 header->cp_ports = 0;1841 1673 header->periphs = 0; 1842 1674 … … 1965 1797 //building coprocs array 1966 1798 BuildTable(fdout, "coproc", coproc_index, sizeof(mapping_coproc_t), (char **) coproc); 1967 //building cp_ports array1968 BuildTable(fdout, "cp_port", cp_port_index, sizeof(mapping_cp_port_t),(char **) cp_port);1969 1799 //building periphs array 1970 1800 BuildTable(fdout, "periph", periph_index, sizeof(mapping_periph_t), (char **) periph);
Note: See TracChangeset
for help on using the changeset viewer.