Changeset 323 for soft/giet_vm
- Timestamp:
- Jun 10, 2014, 1:31:01 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
r306 r323 124 124 PERIPH_SUBTYPE_HBA = 1, 125 125 PERIPH_SUBTYPE_SPI = 2, 126 127 PERIPH_SUBTYPE_MAX_VALUE = 3, 126 PERIPH_SUBTYPE_NONE = 3, 128 127 }; 129 128 … … 138 137 typedef struct __attribute__((packed)) mapping_header_s 139 138 { 140 unsigned int signature; // must contain MAPPING_SIGNATURE139 unsigned int signature; // must contain IN_MAPPING_SIGNATURE 141 140 unsigned int x_size; // actual number of clusters in a row 142 141 unsigned int y_size; // actual number of clusters in a column 143 142 unsigned int x_width; // number of bits to encode x coordinate 144 143 unsigned int y_width; // number of bits to encode y coordinate 145 unsigned int globals; // number of vsegs mapped in all vspaces146 unsigned int vspaces; // number of virtual spaces147 144 unsigned int x_io; // x coordinate for cluster_io_ext 148 145 unsigned int y_io; // y coordinate for cluster_io_ext 149 146 unsigned int irq_per_proc; // number of IRQ per processor 150 147 unsigned int use_ram_disk; // does not use IOC peripheral if non zero 151 unsigned int increment; // vbase address increment (replicated peripherals)152 148 unsigned int globals; // total number of global vsegs 149 unsigned int vspaces; // total number of virtual spaces 153 150 unsigned int psegs; // total number of physical segments (for all clusters) 154 151 unsigned int vsegs; // total number of virtual segments (for all vspaces) … … 172 169 173 170 unsigned int psegs; // number of psegs in cluster 174 unsigned int pseg_offset; // index of first pseg in psegset171 unsigned int pseg_offset; // global index of first pseg in psegs set 175 172 176 173 unsigned int procs; // number of processors in cluster 177 unsigned int proc_offset; // index of first proc in procset174 unsigned int proc_offset; // global index of first proc in procs set 178 175 179 176 unsigned int coprocs; // number of coprocessors in cluster 180 unsigned int coproc_offset; // index of first coproc in coprocset177 unsigned int coproc_offset; // global index of first coproc in coprocs set 181 178 182 179 unsigned int periphs; // number of peripherals in cluster 183 unsigned int periph_offset; // index of first coproc in coprocset180 unsigned int periph_offset; // global index of first coproc in periphs set 184 181 } mapping_cluster_t; 185 182 … … 189 186 { 190 187 char name[32]; // virtual space name 191 unsigned int start_ offset; // offset of thevobj containing start vector188 unsigned int start_vobj_id; // global index for vobj containing start vector 192 189 unsigned int vsegs; // number of vsegs in vspace 193 190 unsigned int vobjs; // number of vobjs in vspace 194 191 unsigned int tasks; // number of tasks in vspace 195 unsigned int vseg_offset; // index of first vseg in vspace196 unsigned int vobj_offset; // index of first vobjsin vspace197 unsigned int task_offset; // index of first task in vspace192 unsigned int vseg_offset; // global index of first vseg in vspace 193 unsigned int vobj_offset; // global index of first vobj in vspace 194 unsigned int task_offset; // global index of first task in vspace 198 195 } mapping_vspace_t; 199 196 … … 209 206 unsigned int mode; // C-X-W-U flags 210 207 unsigned int vobjs; // number of vobjs in vseg 211 unsigned int vobj_offset; // index of first vobj in vseg208 unsigned int vobj_offset; // global index of first vobj in vseg 212 209 unsigned int next_vseg; // linked list of vsegs mapped on pseg 213 210 char mapped; // mapped if non zero … … 225 222 paddr_t length; // size (bytes) 226 223 unsigned int type; // RAM / PERI 227 unsigned int clusterid; // linear index in array of clusters224 unsigned int clusterid; // global index in clusters set 228 225 unsigned int next_vseg; // linked list of vsegs mapped on pseg 229 226 } mapping_pseg_t; … … 234 231 { 235 232 char name[32]; // task name (unique in vspace) 236 unsigned int clusterid; // linear index in array of clusters233 unsigned int clusterid; // global index in clusters set 237 234 unsigned int proclocid; // processor local index (inside cluster) 238 235 unsigned int trdid; // thread index in vspace 239 unsigned int stack_vobj id; // stack vobj index in vspace240 unsigned int heap_vobj id; // heap vobj index in vspace236 unsigned int stack_vobj_id; // global index for vobj containing stack 237 unsigned int heap_vobj_id; // global index for vobj containing heap 241 238 unsigned int startid; // index in start_vector 242 239 unsigned int use_tty; // TTY channel required (global) … … 272 269 typedef struct __attribute__((packed)) mapping_coproc_s 273 270 { 274 char name[32]; // coprocessor name 271 char name[32]; // coprocessor name (probablement inutile AG) 275 272 unsigned int psegid; // global pseg index 276 273 unsigned int ports; // number of MWMR ports used by coprocessor 277 unsigned int port_offset; // index of first MWMR port used by coprocessor274 unsigned int port_offset; // global index of first MWMR port 278 275 } mapping_coproc_t; 279 276 … … 283 280 { 284 281 unsigned int direction; // TO_COPROC == 0 / FROM_COPROC == 1 285 unsigned int vspaceid; // index of the vspace containing theMWMR channel286 unsigned int mwmr_vobj id; // local index of the vobj containing theMWMR channel282 unsigned int vspaceid; // index of the vspace containing MWMR channel 283 unsigned int mwmr_vobj_id; // global index of vobj containing MWMR channel 287 284 } mapping_cp_port_t; 288 285 … … 295 292 unsigned int psegid; // pseg index in cluster 296 293 unsigned int channels; // number of channels 297 unsigned int irqs; // number of input IRQs (for ICU, XCU or PIC) 298 unsigned int irq_offset; // index of first IRQ (can be HWI/PTI/WTI) 294 unsigned int arg; // argument depending on peripheral type 295 unsigned int irqs; // number of input IRQs (for XCU or PIC) 296 unsigned int irq_offset; // index of first IRQ 299 297 } mapping_periph_t; 300 298 … … 304 302 { 305 303 unsigned int srctype; // source IRQ type (HWI / WTI / PTI) 306 unsigned int srcid; // source IRQ index (for ICU/PIC component)304 unsigned int srcid; // source IRQ index (for XCU/PIC component) 307 305 unsigned int isr; // ISR type (defined in irq_handler.h) 308 unsigned int channel; // channel index (for multi-channels peripherals) 309 unsigned int dstx; // x coordinate of destination cluster 310 unsigned int dsty; // y coordinate of destination cluster 311 unsigned int dstid; // destination IRQ index (can be PROC or ICU) 306 unsigned int channel; // channel index (for multi-channels ISR) 307 unsigned int dest_xy; // destination cluster (set by GIET_VM) 308 unsigned int dest_id; // destination port (set by GIET_VM) 312 309 } mapping_irq_t; 313 310 -
soft/giet_vm/giet_xml/xml_driver.c
r306 r323 65 65 "ISR_NIC_TX", 66 66 "ISR_CMA", 67 "ISR_MMC", 68 "ISR_DMA", 69 "ISR_SPI", 67 70 }; 68 71 … … 92 95 "HBA", 93 96 "SPI", 97 "NONE", 94 98 }; 95 99 … … 300 304 port_id++) 301 305 { 302 unsigned int vobj_id = cp_port[port_id].mwmr_vobj id + vspace[cp_port[port_id].vspaceid].vobj_offset;303 fprintf(fpout, " <port direction=\"%s\"", 306 unsigned int vobj_id = cp_port[port_id].mwmr_vobj_id; 307 fprintf(fpout, " <port direction=\"%s\"", port_direction[cp_port[port_id].direction]); 304 308 fprintf(fpout, " vspacename=\"%s\"", vspace[cp_port[port_id].vspaceid].name); 305 309 fprintf(fpout, " vobjname=\"%s\" />\n", vobj[vobj_id].name); … … 320 324 321 325 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 ) 324 { 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 ) ) 326 fprintf(fpout, " channels=\"%d\"", periph[periph_id].channels); 327 fprintf(fpout, " arg=\"%d\" >\n", periph[periph_id].arg); 328 if ( (periph[periph_id].type == PERIPH_TYPE_PIC) || 329 (periph[periph_id].type == PERIPH_TYPE_XCU) || 330 (periph[periph_id].type == PERIPH_TYPE_ICU) ) 337 331 { 338 332 for (irq_id = periph[periph_id].irq_offset; … … 343 337 fprintf(fpout, " srcid=\"%d\"", irq[irq_id].srcid); 344 338 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); 339 fprintf(fpout, " channel=\"%d\" />\n", irq[irq_id].channel); 347 340 } 348 341 } … … 396 389 for (vspace_id = 0; vspace_id < header->vspaces; vspace_id++) 397 390 { 398 unsigned int func_id = vspace[vspace_id].vobj_offset + vspace[vspace_id].start_offset;391 unsigned int vobj_id = vspace[vspace_id].start_vobj_id; 399 392 fprintf(fpout, " <vspace name = \"%s\" ", vspace[vspace_id].name); 400 fprintf(fpout, " startname = \"%s\" >\n", vobj[ func_id].name);393 fprintf(fpout, " startname = \"%s\" >\n", vobj[vobj_id].name); 401 394 402 395 //////////////////// vsegs ////////////////////////////////////////////// … … 444 437 task_id++) 445 438 { 446 unsigned int stack_vobj_id = task[task_id].stack_vobj id + vspace[vspace_id].vobj_offset;447 unsigned int heap_vobj_id = task[task_id].heap_vobjid + vspace[vspace_id].vobj_offset;448 unsigned int cluster_id = task[task_id].clusterid;439 unsigned int stack_vobj_id = task[task_id].stack_vobj_id; 440 unsigned int heap_vobj_id = task[task_id].heap_vobj_id; 441 unsigned int cluster_id = task[task_id].clusterid; 449 442 450 443 fprintf(fpout, " <task name=\"%s\"", task[task_id].name); -
soft/giet_vm/giet_xml/xml_parser.c
r306 r323 294 294 // 295 295 // - For replicated peripherals the virtual base address must be: 296 // vbase = seg_type_base & 0XFF000000 + (cluster_xy * increment) & 0x00FF0000296 // vbase = seg_type_base & 0XFF000000 + (cluster_xy * 0x00010000) & 0x00FF0000 297 297 // 298 298 // - For non-replicated peripherals, the cluster index must be cluster_io. … … 307 307 unsigned int type; // peripheral type 308 308 309 unsigned int type_mask = 0xFF000000; 310 unsigned int cluster_mask = 0x00FF0000; 309 unsigned int type_mask = 0xFF000000; 310 unsigned int cluster_mask = 0x00FF0000; 311 unsigned int vseg_increment = 0x00010000; 311 312 312 313 #if XML_PARSER_DEBUG … … 348 349 349 350 if( (vseg[vseg_id]->vbase & cluster_mask) != 350 ( header->increment * cluster_xy) )351 (vseg_increment * cluster_xy) ) 351 352 { 352 353 printf("[XML ERROR] All replicated peripherals " … … 444 445 } 445 446 446 //////////////////////////////////////////////////////////////////////////////// ///447 int getVobj LocId(unsigned int vspace_id, char * vobj_name, unsigned int vspace_max)447 //////////////////////////////////////////////////////////////////////////////// 448 int getVobjId(unsigned int vspace_id, char * vobj_name, unsigned int vspace_max) 448 449 { 449 450 unsigned int vobj_id; … … 453 454 for (vobj_id = vobj_min; vobj_id < vobj_max; vobj_id++) 454 455 { 455 if (strcmp(vobj[vobj_id]->name, vobj_name) == 0) return (vobj_id - vobj_min);456 if (strcmp(vobj[vobj_id]->name, vobj_name) == 0) return vobj_id; 456 457 } 457 458 return -1; … … 649 650 if (ok) 650 651 { 651 int index = getVobj LocId(vspace_index, str , vobj_loc_index);652 int index = getVobjId(vspace_index, str , vobj_loc_index); 652 653 if (index >= 0) 653 654 { 654 655 #if XML_PARSER_DEBUG 655 656 printf(" stackname = %s\n", str); 656 printf(" stack id= %d\n", index);657 #endif 658 task[task_index]->stack_vobj id = index;657 printf(" stack_id = %d\n", index); 658 #endif 659 task[task_index]->stack_vobj_id = index; 659 660 } 660 661 else … … 676 677 if (ok) 677 678 { 678 int index = getVobj LocId(vspace_index, str, vobj_loc_index);679 int index = getVobjId(vspace_index, str, vobj_loc_index); 679 680 if (index >= 0) 680 681 { 681 682 #if XML_PARSER_DEBUG 682 683 printf(" heapname = %s\n", str); 683 printf(" heap id = %d\n", index);684 #endif 685 task[task_index]->heap_vobj id = index;684 printf(" heap_id = %d\n", index ); 685 #endif 686 task[task_index]->heap_vobj_id = index; 686 687 } 687 688 else … … 694 695 else 695 696 { 696 task[task_index]->heap_vobj id = -1;697 task[task_index]->heap_vobj_id = -1; 697 698 } 698 699 … … 1129 1130 ////////// get startname attribute 1130 1131 str = getStringValue(reader, "startname", &ok); 1131 if (ok) { 1132 if (ok) 1133 { 1132 1134 //used after parsing the vobjs 1133 1135 } … … 1162 1164 1163 1165 // get index of the vobj containing the start vector 1164 int index = getVobj LocId(vspace_index, str , vobj_loc_index);1166 int index = getVobjId(vspace_index, str , vobj_loc_index); 1165 1167 if (index == -1) 1166 1168 { … … 1171 1173 else 1172 1174 { 1173 vspace[vspace_index]->start_ offset= index;1175 vspace[vspace_index]->start_vobj_id = index; 1174 1176 #if XML_PARSER_DEBUG 1175 1177 printf(" startname = %s\n", str); 1176 printf(" start id= %d\n", index);1178 printf(" start_id = %d\n", index); 1177 1179 printf(" end vspace %d\n\n", vspace_index); 1178 1180 #endif 1179 1181 } 1180 1182 1181 // checking startid values for all tasks in vspace 1183 // checking for all tasks that the startid 1184 // is smaller than the number of tasks in vspace 1182 1185 int task_id; 1183 1186 int task_min = vspace[vspace_index]->task_offset; 1184 1187 int task_max = task_min + vspace[vspace_index]->tasks; 1185 for (task_id = task_min; task_id < task_max; task_id++) { 1188 for (task_id = task_min; task_id < task_max; task_id++) 1189 { 1186 1190 if (task[task_id]->startid >= vspace[vspace_index]->tasks) 1187 1191 { … … 1212 1216 char * str; 1213 1217 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 1218 1218 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1219 1219 … … 1251 1251 } 1252 1252 1253 ///////// get srctype attribute ... if ICU or XCU 1254 if ( is_icu ) 1255 { 1256 str = getStringValue(reader, "srctype", &ok); 1257 if (ok) 1258 { 1253 ///////// get srctype attribute 1254 str = getStringValue(reader, "srctype", &ok); 1255 if (ok) 1256 { 1259 1257 #if XML_PARSER_DEBUG 1260 1258 printf(" srctype = %s\n", str); 1261 1259 #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", 1260 if ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI; 1261 else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI; 1262 else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI; 1263 else 1264 { 1265 printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n", 1275 1266 cluster_index, periph_loc_index); 1276 1267 exit(1); 1277 1268 } 1278 1269 } 1279 1280 ///////// get isr attribute ... if ICU or XCU 1281 if ( is_icu ) 1282 { 1283 str = getStringValue(reader, "isr", &ok); 1284 if (ok) 1285 { 1270 else 1271 { 1272 printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n", 1273 cluster_index, periph_loc_index); 1274 exit(1); 1275 } 1276 1277 ///////// get isr attribute 1278 str = getStringValue(reader, "isr", &ok); 1279 if (ok) 1280 { 1286 1281 #if XML_PARSER_DEBUG 1287 1282 printf(" isr = %s\n", str); 1288 1283 #endif 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 } 1284 if (strcmp(str, "ISR_TICK" ) == 0) irq[irq_index]->isr = ISR_TICK; 1285 else if (strcmp(str, "ISR_BDV" ) == 0) irq[irq_index]->isr = ISR_BDV; 1286 else if (strcmp(str, "ISR_CMA" ) == 0) irq[irq_index]->isr = ISR_CMA; 1287 else if (strcmp(str, "ISR_TTY_RX" ) == 0) irq[irq_index]->isr = ISR_TTY_RX; 1288 else if (strcmp(str, "ISR_TTY_TX" ) == 0) irq[irq_index]->isr = ISR_TTY_TX; 1289 else if (strcmp(str, "ISR_TIMER" ) == 0) irq[irq_index]->isr = ISR_TIMER; 1290 else if (strcmp(str, "ISR_WAKUP" ) == 0) irq[irq_index]->isr = ISR_WAKUP; 1291 else if (strcmp(str, "ISR_NIC_RX" ) == 0) irq[irq_index]->isr = ISR_NIC_RX; 1292 else if (strcmp(str, "ISR_NIC_TX" ) == 0) irq[irq_index]->isr = ISR_NIC_TX; 1293 else if (strcmp(str, "ISR_MMC" ) == 0) irq[irq_index]->isr = ISR_MMC; 1294 else if (strcmp(str, "ISR_DMA" ) == 0) irq[irq_index]->isr = ISR_DMA; 1295 else if (strcmp(str, "ISR_SPI" ) == 0) irq[irq_index]->isr = ISR_SPI; 1296 else if (strcmp(str, "ISR_DEFAULT") == 0) irq[irq_index]->isr = ISR_DEFAULT; 1307 1297 else 1308 1298 { 1309 printf("[XML ERROR] missingIRQ <isr> for periph %d in cluster %d\n",1310 cluster_index, periph_loc_index);1299 printf("[XML ERROR] illegal IRQ <isr> for periph %d in cluster %d\n", 1300 periph_loc_index, cluster_index ); 1311 1301 exit(1); 1312 1302 } 1303 } 1304 else 1305 { 1306 printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n", 1307 cluster_index, periph_loc_index); 1308 exit(1); 1313 1309 } 1314 1310 … … 1325 1321 { 1326 1322 irq[irq_index]->channel = 0; 1327 }1328 1329 ///////// get dstx attribute ... if PIC1330 if ( is_pic )1331 {1332 value = getIntValue(reader, "dstx", &ok);1333 if (ok)1334 {1335 #if XML_PARSER_DEBUG1336 printf(" dstx = %d\n", value);1337 #endif1338 1339 if ( value < header->x_size )1340 {1341 irq[irq_index]->dstx = value;1342 }1343 else1344 {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 else1351 {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 PIC1359 if ( is_pic )1360 {1361 value = getIntValue(reader, "dsty", &ok);1362 if (ok)1363 {1364 #if XML_PARSER_DEBUG1365 printf(" dsty = %d\n", value);1366 #endif1367 1368 if ( value < header->y_size )1369 {1370 irq[irq_index]->dsty = value;1371 }1372 else1373 {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 else1380 {1381 printf("[XML ERROR] missing IRQ <dsty> for periph %d in cluster %d\n",1382 cluster_index, periph_loc_index);1383 exit(1);1384 }1385 }1386 1387 ///////// get dstid attribute1388 value = getIntValue(reader, "dstid", &ok);1389 if (ok)1390 {1391 #if XML_PARSER_DEBUG1392 printf(" dstid = %d\n", value);1393 #endif1394 irq[irq_index]->dstid = value;1395 if (value >= 32)1396 {1397 printf("[XML ERROR] IRQ <dstid> too large for periph %d in cluster %d\n",1398 cluster_index, periph_loc_index);1399 exit(1);1400 }1401 }1402 else1403 {1404 printf("[XML ERROR] missing IRQ <dstid> for periph %d in cluster %d\n",1405 cluster_index, periph_loc_index);1406 exit(1);1407 1323 } 1408 1324 … … 1535 1451 { 1536 1452 periph[periph_index]->channels = 1; 1453 } 1454 1455 ///////// get arg attribute (optionnal : 0 if missing) 1456 value = getIntValue(reader, "arg", &ok); 1457 if (ok) 1458 { 1459 #if XML_PARSER_DEBUG 1460 printf(" arg = %d\n", value); 1461 #endif 1462 periph[periph_index]->arg = value; 1463 } 1464 else 1465 { 1466 periph[periph_index]->arg = 1; 1537 1467 } 1538 1468 … … 2473 2403 2474 2404 ///////// set other header fields 2475 header->increment = 0x10000;2476 2405 header->globals = 0; 2477 2406 header->vspaces = 0; … … 2619 2548 2620 2549 2621 /////////////////////////////////////////////////////////////////////// 2622 // this function set the value the vobj_id fiels ofall cp_ports2623 /////////////////////////////////////////////////////////////////////// 2550 /////////////////////////////////////////////////////////////////////////////////// 2551 // this function set the values of vspace_id and vobj_id fields for all cp_ports 2552 /////////////////////////////////////////////////////////////////////////////////// 2624 2553 void prepareBuild() 2625 2554 { 2626 2555 unsigned int i; 2627 //asign for all cp_ports the correct vspaceid and vobjid 2628 for (i = 0; i < cp_port_index; i++) { 2556 2557 for (i = 0; i < cp_port_index; i++) 2558 { 2629 2559 int vspace_id = getVspaceId(cp_port_vobj_ref[i]->vspace_name); 2630 if (vspace_id < 0) { 2560 if (vspace_id < 0) 2561 { 2631 2562 printf("[XML ERROR] illegal <vspacename> for cp_port %d,\n", i); 2632 2563 exit(1); … … 2634 2565 cp_port[i]->vspaceid = vspace_id; 2635 2566 2636 int vobj_id = getVobjLocId(vspace_id, cp_port_vobj_ref[i]->vobj_name, vspace[vspace_id]->vobjs); 2637 if (vobj_id >= 0) { 2567 int vobj_id = getVobjId( vspace_id, 2568 cp_port_vobj_ref[i]->vobj_name, 2569 vspace[vspace_id]->vobjs ); 2570 if (vobj_id >= 0) 2571 { 2638 2572 2639 2573 #if XML_PARSER_DEBUG … … 2643 2577 printf(" vobj_index = %d\n", vobj_id); 2644 2578 #endif 2645 cp_port[i]->mwmr_vobjid = vobj_id; 2646 2647 assert((vobj[ vspace[vspace_id]->vobj_offset + vobj_id]->type == VOBJ_TYPE_MWMR) 2648 && "coproc ports have to refer to a vobj of type MWMR"); 2649 } 2650 else { 2651 printf("[XML ERROR] illegal <vobjname> for cp_port %d,\n", i); 2579 cp_port[i]->mwmr_vobj_id = vobj_id; 2580 2581 assert((vobj[vspace[vspace_id]->vobj_offset + vobj_id]->type == VOBJ_TYPE_MWMR) 2582 && "coproc ports must refer a vobj of type MWMR"); 2583 } 2584 else 2585 { 2586 printf("[XML ERROR] <vobjname> not found for cp_port %d,\n", i); 2652 2587 exit(1); 2653 2588 } … … 2925 2860 file_write(fdout, "\n"); 2926 2861 2927 ld_write(fdout, "vseg_cluster_increment ", header->increment);2862 ld_write(fdout, "vseg_cluster_increment ", 0x00010000); 2928 2863 2929 2864 close(fdout);
Note: See TracChangeset
for help on using the changeset viewer.