Changeset 522 for soft/giet_vm/giet_xml/xml_driver.c
- Timestamp:
- Mar 10, 2015, 3:17:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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) )
Note: See TracChangeset
for help on using the changeset viewer.