Changeset 189 for soft/giet_vm/xml/xml_driver.c
- Timestamp:
- Aug 7, 2012, 6:37:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/xml/xml_driver.c
r181 r189 17 17 #include <mapping_info.h> 18 18 19 ///////////////////////////////////////////////////// 20 void buildXml( mapping_header_t* header, FILE* fpout )19 ////////////////////////////////////////////////////// 20 void buildXml( mapping_header_t* header, FILE* fpout ) 21 21 { 22 23 22 const char* vobj_type[] = 24 23 { … … 30 29 "LOCK", // Spin-Lock 31 30 "BUFFER", // Any "no intialiasation needed" objects (stacks...) 32 "BARRIER" // Barrier31 "BARRIER", // Barrier 33 32 }; 34 33 … … 37 36 "RAM", 38 37 "ROM", 39 "PERI" 38 "PERI", 40 39 }; 41 40 … … 43 42 { 44 43 "HARD", 45 "SOFT" 44 "SOFT", 46 45 }; 47 46 48 47 const char* isr_type[] = 49 48 { 49 "ISR_DEFAULT", 50 "ISR_SWITCH", 51 "ISR_TTY", 52 "ISR_DMA", 50 53 "ISR_IOC", 51 "ISR_FBDMA", 52 "ISR_TTY" 53 }; 54 55 const char* reg_type[] = 56 { 57 "STATUS", 58 "CONFIG" 54 "ISR_TIMER", 55 }; 56 57 const char* periph_type[] = 58 { 59 "IOC", 60 "TTY", 61 "TIM", 62 "DMA", 63 "FBF", 64 "NIC", 65 "IOB", 59 66 }; 60 67 … … 62 69 { 63 70 "TO_COPROC", 64 "FROM_COPROC" 71 "FROM_COPROC", 65 72 }; 66 73 … … 81 88 "CX_U", 82 89 "CXW_", 83 "CXWU" 90 "CXWU", 84 91 }; 85 92 … … 94 101 unsigned int coproc_id; 95 102 unsigned int port_id; 96 unsigned int reg_id;97 98 mapping_cluster_t* 99 mapping_pseg_t* 100 mapping_vspace_t* 101 mapping_vseg_t* 102 mapping_vobj_t* 103 mapping_task_t* 104 mapping_proc_t* 105 mapping_irq_t* 106 mapping_coproc_t* 107 mapping_c oproc_port_t* cp_port;108 mapping_ coproc_reg_t* cp_reg;103 unsigned int periph_id; 104 105 mapping_cluster_t* cluster; 106 mapping_pseg_t* pseg; 107 mapping_vspace_t* vspace; 108 mapping_vseg_t* vseg; 109 mapping_vobj_t* vobj; 110 mapping_task_t* task; 111 mapping_proc_t* proc; 112 mapping_irq_t* irq; 113 mapping_coproc_t* coproc; 114 mapping_cp_port_t* cp_port; 115 mapping_periph_t* periph; 109 116 110 117 // computes the base adresss for clusters array, … … 147 154 MAPPING_VSEG_SIZE*header->vsegs ); 148 155 149 // computes the base address thearray156 // computes the base address for procs array 150 157 proc = (mapping_proc_t*) ((char*)header + 151 158 MAPPING_HEADER_SIZE + … … 157 164 MAPPING_TASK_SIZE*header->tasks); 158 165 159 // computes the base address the array 160 irq = (mapping_irq_t*) ((char*)header + 161 MAPPING_HEADER_SIZE + 162 MAPPING_CLUSTER_SIZE*header->clusters + 163 MAPPING_PSEG_SIZE*header->psegs + 164 MAPPING_VSPACE_SIZE*header->vspaces + 165 MAPPING_VOBJ_SIZE*header->vobjs + 166 MAPPING_VSEG_SIZE*header->vsegs+ 167 MAPPING_TASK_SIZE*header->tasks+ 168 MAPPING_PROC_SIZE*header->procs 169 ); 170 171 // computes the base address the array 172 coproc = (mapping_coproc_t*) ((char*)header + 173 MAPPING_HEADER_SIZE + 174 MAPPING_CLUSTER_SIZE*header->clusters + 175 MAPPING_PSEG_SIZE*header->psegs + 176 MAPPING_VSPACE_SIZE*header->vspaces + 177 MAPPING_VOBJ_SIZE*header->vobjs + 178 MAPPING_VSEG_SIZE*header->vsegs+ 179 MAPPING_TASK_SIZE*header->tasks+ 180 MAPPING_PROC_SIZE*header->procs+ 181 MAPPING_IRQ_SIZE*header->irqs 182 ); 183 184 // computes the base address the array 185 cp_port = (mapping_coproc_port_t*) ((char*)header + 186 MAPPING_HEADER_SIZE + 187 MAPPING_CLUSTER_SIZE*header->clusters + 188 MAPPING_PSEG_SIZE*header->psegs + 189 MAPPING_VSPACE_SIZE*header->vspaces + 190 MAPPING_VOBJ_SIZE*header->vobjs + 191 MAPPING_VSEG_SIZE*header->vsegs+ 192 MAPPING_TASK_SIZE*header->tasks+ 193 MAPPING_PROC_SIZE*header->procs+ 194 MAPPING_IRQ_SIZE*header->irqs+ 195 MAPPING_COPROC_SIZE*header->coprocs 196 ); 197 198 // computes the base address the array 199 cp_reg = (mapping_coproc_reg_t*) ((char*)header + 200 MAPPING_HEADER_SIZE + 201 MAPPING_CLUSTER_SIZE*header->clusters + 202 MAPPING_PSEG_SIZE*header->psegs + 203 MAPPING_VSPACE_SIZE*header->vspaces + 204 MAPPING_VOBJ_SIZE*header->vobjs + 205 MAPPING_VSEG_SIZE*header->vsegs+ 206 MAPPING_TASK_SIZE*header->tasks+ 207 MAPPING_PROC_SIZE*header->procs+ 208 MAPPING_IRQ_SIZE*header->irqs+ 209 MAPPING_COPROC_SIZE*header->coprocs+ 210 MAPPING_CP_PORT_SIZE*header->cp_ports 211 ); 166 // computes the base address for irqs array 167 irq = (mapping_irq_t*) ((char*)header + 168 MAPPING_HEADER_SIZE + 169 MAPPING_CLUSTER_SIZE*header->clusters + 170 MAPPING_PSEG_SIZE*header->psegs + 171 MAPPING_VSPACE_SIZE*header->vspaces + 172 MAPPING_VOBJ_SIZE*header->vobjs + 173 MAPPING_VSEG_SIZE*header->vsegs + 174 MAPPING_TASK_SIZE*header->tasks + 175 MAPPING_PROC_SIZE*header->procs); 176 177 // computes the base address for coprocs array 178 coproc = (mapping_coproc_t*) ((char*)header + 179 MAPPING_HEADER_SIZE + 180 MAPPING_CLUSTER_SIZE*header->clusters + 181 MAPPING_PSEG_SIZE*header->psegs + 182 MAPPING_VSPACE_SIZE*header->vspaces + 183 MAPPING_VOBJ_SIZE*header->vobjs + 184 MAPPING_VSEG_SIZE*header->vsegs + 185 MAPPING_TASK_SIZE*header->tasks + 186 MAPPING_PROC_SIZE*header->procs + 187 MAPPING_IRQ_SIZE*header->irqs); 188 189 // computes the base address for cp_ports array 190 cp_port = (mapping_cp_port_t*)((char*)header + 191 MAPPING_HEADER_SIZE + 192 MAPPING_CLUSTER_SIZE*header->clusters + 193 MAPPING_PSEG_SIZE*header->psegs + 194 MAPPING_VSPACE_SIZE*header->vspaces + 195 MAPPING_VOBJ_SIZE*header->vobjs + 196 MAPPING_VSEG_SIZE*header->vsegs + 197 MAPPING_TASK_SIZE*header->tasks + 198 MAPPING_PROC_SIZE*header->procs + 199 MAPPING_IRQ_SIZE*header->irqs + 200 MAPPING_COPROC_SIZE*header->coprocs); 201 202 // computes the base address for periphs array 203 periph = (mapping_periph_t*) ((char*)header + 204 MAPPING_HEADER_SIZE + 205 MAPPING_CLUSTER_SIZE*header->clusters + 206 MAPPING_PSEG_SIZE*header->psegs + 207 MAPPING_VSPACE_SIZE*header->vspaces + 208 MAPPING_VOBJ_SIZE*header->vobjs + 209 MAPPING_VSEG_SIZE*header->vsegs + 210 MAPPING_TASK_SIZE*header->tasks + 211 MAPPING_PROC_SIZE*header->procs + 212 MAPPING_IRQ_SIZE*header->irqs + 213 MAPPING_COPROC_SIZE*header->coprocs + 214 MAPPING_CP_PORT_SIZE*header->cp_ports); 215 216 ///////////////////////// header ///////////////////////////////////////////// 212 217 213 218 fprintf( fpout, "<?xml version = \"1.0\"?>\n\n"); 214 215 ///////////////////////// header /////////////////////////////////////////////216 219 217 220 fprintf( fpout, "<mapping_info signature = \"0x%x\"\n", header->signature); 218 221 fprintf( fpout, " name = \"%s\"\n", header->name); 219 222 fprintf( fpout, " clusters = \"%d\"\n", header->clusters); 220 fprintf( fpout, " ttys = \"%d\"\n", header->ttys);221 fprintf( fpout, " fbs = \"%d\"\n", header->fbs);222 223 fprintf( fpout, " vspaces = \"%d\"\n", header->vspaces); 223 224 fprintf( fpout, " globals = \"%d\" >\n\n", header->globals); … … 238 239 fprintf( fpout, " length = \"0x%x\" />\n", pseg[pseg_id].length); 239 240 } 241 242 ///////////////////// processors ///////////////////////////////////////////// 243 240 244 for ( proc_id = cluster[cluster_id].proc_offset ; 241 245 proc_id < cluster[cluster_id].proc_offset + cluster[cluster_id].procs ; … … 253 257 } 254 258 259 260 ///////////////////// coprocessors /////////////////////////////////////////// 261 255 262 for ( coproc_id = cluster[cluster_id].coproc_offset ; 256 263 coproc_id < cluster[cluster_id].coproc_offset + cluster[cluster_id].coprocs ; … … 266 273 fprintf( fpout, " vobjname = \"%s\" />\n", vobj[vobj_id].name); 267 274 } 268 for ( reg_id = coproc[coproc_id].reg_offset ;269 reg_id < coproc[coproc_id].reg_offset+coproc[coproc_id].regs ;270 reg_id++ )271 {272 fprintf( fpout, " <reg name = \"%s\"\n", cp_reg[reg_id].name);273 fprintf( fpout, " type = \"%s\"\n", reg_type[cp_reg[reg_id].type]);274 fprintf( fpout, " value = \"0x%x\"\n", cp_reg[reg_id].value);275 fprintf( fpout, " channel = \"0x%x\"\n", cp_reg[reg_id].channel_id);276 fprintf( fpout, " index = \"0x%x\" />\n", cp_reg[reg_id].loc_id);277 }278 275 fprintf( fpout, " </coproc>\n" ); 276 } 277 278 ///////////////////// periphs /////////////////////////////////////////////// 279 280 for ( periph_id = cluster[cluster_id].periph_offset ; 281 periph_id < cluster[cluster_id].periph_offset + cluster[cluster_id].periphs ; 282 periph_id++ ) 283 { 284 fprintf( fpout, " <periph type = \"%s\"\n", periph_type[periph[periph_id].type]); 285 fprintf( fpout, " psegname = \"%s\"\n", pseg[periph[periph_id].psegid].name); 286 fprintf( fpout, " channels = \"%d\" />\n", periph[periph_id].channels); 279 287 } 280 288 fprintf( fpout, " </cluster>\n" ); … … 356 364 fprintf( fpout, " startid = \"%d\"\n", task[task_id].startid); 357 365 fprintf( fpout, " usetty = \"%d\"\n", task[task_id].use_tty); 358 fprintf( fpout, " usefb = \"%d\" />\n\n", task[task_id].use_fb); 366 fprintf( fpout, " usenic = \"%d\"\n", task[task_id].use_nic); 367 fprintf( fpout, " usetimer = \"%d\"\n", task[task_id].use_timer); 368 fprintf( fpout, " usefbma = \"%d\" />\n\n", task[task_id].use_fbdma); 359 369 } 360 370 fprintf( fpout, " </vspace>\n\n");
Note: See TracChangeset
for help on using the changeset viewer.