Changeset 217
- Timestamp:
- Sep 19, 2012, 9:15:52 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/xml/xml_parser.c
r216 r217 5 5 // Copyright (c) UPMC-LIP6 6 6 /////////////////////////////////////////////////////////////////////////////////////// 7 // This program translate an xml file containing a MAPPING_INFO data structure 8 // to a binary file that can be directly loaded in the boot ROM and used by the GIET. 9 // The C strcutures are defined in the mapping_info.h file. 7 // This program translate a "map.xml" source file to a binary file "map.bin" that 8 // can be directly loaded in the boot ROM and used by the GIET-VM operating system. 9 // 10 // This map.xml file contains : 11 // 1) the multi-cluster/multi-processors hardware architecture description 12 // 2) the various multi-threaded software applications 13 // 3) the mapping directives bor both the tasks and the virtual segments. 14 // The corresponding C structures are defined in the "mapping_info.h" file. 15 // 16 // This program also generates the "hard_config.h" and the "giet_vsegs.ld" files, 17 // required to compile the GIET-VM code. 10 18 /////////////////////////////////////////////////////////////////////////////////////// 11 19 … … 35 43 #define MAX_PERIPHS 8192 36 44 37 #define XML_PARSER_DEBUG 45 #define XML_PARSER_DEBUG 0 38 46 39 47 /////////////////////////////////////////////////////////////////////////////////// … … 2067 2075 } 2068 2076 2069 2077 ////////////////////////////////////////// 2070 2078 void file_write(int fdout, char* towrite) 2071 2079 { … … 2078 2086 } 2079 2087 2088 ////////////////////////////////////////////////// 2080 2089 void def_int_write(int fdout, char* def, int num) 2081 2090 { … … 2083 2092 sprintf(buf, "#define\t %s %d\n", def, num); 2084 2093 file_write(fdout, buf); 2085 2086 2094 } 2087 2095 2096 ///////////////////////////////////////////////// 2088 2097 void def_hex_write(int fdout, char* def, int num) 2089 2098 { … … 2093 2102 } 2094 2103 2095 /////////////////////////// 2104 /////////////////////////////////////// 2096 2105 void genHd( const char* file_path ) 2097 /////////////////////////// 2106 /////////////////////////////////////// 2098 2107 { 2099 2108 int fdout = open_file(file_path); 2100 2109 2101 char* prol = " /* AUTO GENRATED FILE*/\n\n#ifndef _HD_CONFIG_H\n#define _HD_CONFIG_H\n\n";2110 char* prol = " /* Generated from the mapping_info file */\n\n#ifndef _HD_CONFIG_H\n#define _HD_CONFIG_H\n\n"; 2102 2111 file_write(fdout, prol); 2103 2112 2104 2113 def_int_write(fdout, "CLUSTER_X" , cluster_x); 2105 2114 def_int_write(fdout, "CLUSTER_Y" , cluster_y); 2106 def_int_write(fdout, "NB_CLUSTERS" 2115 def_int_write(fdout, "NB_CLUSTERS" , cluster_index); 2107 2116 def_hex_write(fdout, "CLUSTER_SIZE" , ( ((unsigned long)1) << 32)/cluster_index); 2108 def_int_write(fdout, "NB_PROCS_MAX" 2117 def_int_write(fdout, "NB_PROCS_MAX" , nb_proc_max); 2109 2118 def_int_write(fdout, "NB_TIMERS_MAX" , nb_timer_channel_max); 2110 2119 def_int_write(fdout, "NB_DMAS_MAX" , nb_dma_channel_max); … … 2123 2132 } 2124 2133 2134 //////////////////////////////////////////////////////// 2125 2135 void ld_write(int fdout, char* seg, unsigned int addr) 2126 2136 { … … 2131 2141 } 2132 2142 2133 /////////////////////////// 2143 /////////////////////////////////////// 2134 2144 void genLd( const char* file_path ) 2135 /////////////////////////// 2145 /////////////////////////////////////// 2136 2146 { 2137 2147 int fdout = open_file(file_path); 2138 2148 2139 char* prol = "/* AUTO GENRATED FILE*/\n\n";2149 char* prol = "/* Generated from the mapping_info file */\n\n"; 2140 2150 file_write(fdout, prol); 2141 2151
Note: See TracChangeset
for help on using the changeset viewer.