Changeset 160 for soft/giet_vm/xml/xml_driver.c
- Timestamp:
- Jun 12, 2012, 4:21:27 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/xml/xml_driver.c
r158 r160 20 20 void buildXml( mapping_header_t* header, FILE* fpout) 21 21 { 22 23 const char* 24 vobj_type[] = 25 { 26 "ELF", 27 "PTAB", //page table 28 "PERI", //hardware component 29 "MWMR", //MWMR channel 30 "LOCK", //Lock 31 "BUFFER", //Any "no intialiasation needed" objects (stacks...) 32 "BARRIER" //Barrier 33 }; 22 34 const char* mode_str[] = { "____", 23 35 "___U", … … 41 53 unsigned int pseg_id; 42 54 unsigned int vseg_id; 55 unsigned int vobj_id; 43 56 unsigned int task_id; 44 57 … … 47 60 mapping_vspace_t* vspace; 48 61 mapping_vseg_t* vseg; 62 mapping_vobj_t* vobj; 49 63 mapping_task_t* task; 50 64 … … 71 85 MAPPING_VSPACE_SIZE*header->vspaces ); 72 86 87 // computes the base adresss for vobjs array, 88 vobj = (mapping_vobj_t*) ((char*)header + 89 MAPPING_HEADER_SIZE + 90 MAPPING_CLUSTER_SIZE*header->clusters + 91 MAPPING_PSEG_SIZE*header->psegs + 92 MAPPING_VSPACE_SIZE*header->vspaces + 93 MAPPING_VSEG_SIZE*header->vsegs ); 94 73 95 // computes the base address for tasks array 74 96 task = (mapping_task_t*) ((char*)header + … … 77 99 MAPPING_PSEG_SIZE*header->psegs + 78 100 MAPPING_VSPACE_SIZE*header->vspaces + 101 MAPPING_VOBJ_SIZE*header->vobjs + 79 102 MAPPING_VSEG_SIZE*header->vsegs ); 80 103 … … 89 112 fprintf( fpout, " ttys = \"%d\"\n", header->ttys); 90 113 fprintf( fpout, " vspaces = \"%d\"\n", header->vspaces); 91 fprintf( fpout, " globals = \"%d\"\n", header->globals); 92 fprintf( fpout, " syspath = \"%s\" >\n", header->syspath); 114 fprintf( fpout, " globals = \"%d\" />\n\n", header->globals); 93 115 94 116 ///////////////////// clusters /////////////////////////////////////////////// … … 124 146 fprintf( fpout, " <vseg name = \"%s\"\n", vseg[vseg_id].name); 125 147 fprintf( fpout, " vbase = \"0x%x\"\n", vseg[vseg_id].vbase); 126 fprintf( fpout, " length = \"0x%x\"\n", vseg[vseg_id].length);127 148 fprintf( fpout, " mode = \"%s\"\n", mode_str[vseg[vseg_id].mode]); 128 149 fprintf( fpout, " psegname = \"%s\"\n", pseg[pseg_id].name); 129 fprintf( fpout, " ident = \"%d\" />\n\n", vseg[vseg_id].ident); 150 fprintf( fpout, " ident = \"%d\" >\n", vseg[vseg_id].ident); 151 for ( vobj_id = vseg[vseg_id].vobj_offset ; 152 vobj_id < (vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs) ; vobj_id++ ) 153 { 154 fprintf( fpout, " <vobj name = \"%s\"\n", vobj[vobj_id].name); 155 fprintf( fpout, " type = \"%s\" \n", vobj_type[vobj[vobj_id].type]); 156 if(vobj[vobj_id].length) 157 fprintf( fpout, " length = \"0x%x\" \n", vobj[vobj_id].length); 158 if(vobj[vobj_id].align) 159 fprintf( fpout, " align = \"%d\" \n", vobj[vobj_id].align); 160 if(vobj[vobj_id].binpath[0]!='\0') 161 fprintf( fpout, " binpath = \"%s\" \n", vobj[vobj_id].binpath); 162 fprintf( fpout, " />\n"); 163 } 164 fprintf( fpout, " </vseg>\n\n"); 130 165 } 131 166 fprintf( fpout, " </globalset>\n" ); … … 136 171 for ( vspace_id = 0 ; vspace_id < header->vspaces ; vspace_id++ ) 137 172 { 173 unsigned int func_id = vspace[vspace_id].vobj_offset + vspace[vspace_id].funcs_offset; 138 174 fprintf( fpout, " <vspace name = \"%s\"\n", vspace[vspace_id].name); 139 fprintf( fpout, " binpath = \"%s\"\n", vspace[vspace_id].binpath); 140 fprintf( fpout, " vsegs = \"%d\"\n", vspace[vspace_id].vsegs); 141 fprintf( fpout, " tasks = \"%d\"\n", vspace[vspace_id].tasks); 142 fprintf( fpout, " mwmrs = \"%d\"\n", vspace[vspace_id].mwmrs); 175 fprintf( fpout, " funcs = \"%s\"\n", vobj[func_id].name); 143 176 fprintf( fpout, " ttys = \"%d\" >\n\n", vspace[vspace_id].ttys); 144 177 … … 150 183 fprintf( fpout, " <vseg name = \"%s\"\n", vseg[vseg_id].name); 151 184 fprintf( fpout, " vbase = \"0x%x\"\n", vseg[vseg_id].vbase); 152 fprintf( fpout, " length = \"0x%x\"\n", vseg[vseg_id].length);153 185 fprintf( fpout, " mode = \"%s\"\n", mode_str[vseg[vseg_id].mode]); 154 186 fprintf( fpout, " psegname = \"%s\"\n", pseg[pseg_id].name); 155 fprintf( fpout, " mwmr = \"%d\"\n", vseg[vseg_id].mwmr); 156 fprintf( fpout, " ident = \"%d\" />\n\n", vseg[vseg_id].ident); 187 fprintf( fpout, " ident = \"%d\" >\n", vseg[vseg_id].ident); 188 189 for ( vobj_id = vseg[vseg_id].vobj_offset ; 190 vobj_id < (vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs) ; vobj_id++ ) 191 { 192 fprintf( fpout, "\t <vobj name = \"%s\"\n", vobj[vobj_id].name); 193 fprintf( fpout, "\t type = \"%s\" \n", vobj_type[vobj[vobj_id].type]); 194 if(vobj[vobj_id].length) 195 fprintf( fpout, "\t length = \"0x%x\" \n", vobj[vobj_id].length); 196 if(vobj[vobj_id].align) 197 fprintf( fpout, "\t align = \"%d\" \n", vobj[vobj_id].align); 198 if(vobj[vobj_id].binpath[0]!='\0') 199 fprintf( fpout, "\t binpath = \"%s\" \n", vobj[vobj_id].binpath); 200 fprintf( fpout, "\t />\n"); 201 } 202 fprintf( fpout, "\t\t </vseg>\n\n"); 157 203 } 158 204 for ( task_id = vspace[vspace_id].task_offset ; 159 205 task_id < (vspace[vspace_id].task_offset + vspace[vspace_id].tasks) ; task_id++ ) 160 206 { 161 unsigned int v seg_id = task[task_id].vseglocid + vspace[vspace_id].vseg_offset;207 unsigned int vobj_id = task[task_id].vobjlocid + vspace[vspace_id].vobj_offset; 162 208 163 209 fprintf( fpout, " <task name = \"%s\"\n", task[task_id].name); 164 210 fprintf( fpout, " clusterid = \"%d\"\n", task[task_id].clusterid); 165 211 fprintf( fpout, " proclocid = \"%d\"\n", task[task_id].proclocid); 166 fprintf( fpout, " stackname = \"%s\"\n", v seg[vseg_id].name);212 fprintf( fpout, " stackname = \"%s\"\n", vobj[vobj_id].name); 167 213 fprintf( fpout, " startid = \"%d\"\n", task[task_id].startid); 168 214 fprintf( fpout, " ttylocid = \"%d\" />\n\n", task[task_id].ttylocid);
Note: See TracChangeset
for help on using the changeset viewer.