- Timestamp:
- Feb 16, 2009, 9:28:31 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration/include/Parameter_affectation.h
r88 r109 25 25 // Constant 26 26 public : const std::string _name ; 27 public : conststd::string _value;27 public : std::string _value; 28 28 public : bool _use ; 29 29 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration/src/Configuration.cpp
r100 r109 42 42 debug_init (fromString<debug_verbosity_t>(_simulator->getParam("debug_level")), 43 43 fromString<double> (_simulator->getParam("debug_cycle_start")), 44 fromString<double> (_simulator->getParam("debug_cycle_stop"))); 44 fromString<double> (_simulator->getParam("debug_cycle_stop")), 45 fromString<double> (_simulator->getParam("debug_cycle_idle"))); 45 46 46 47 log_init(fromString<bool>(_simulator->getParam("debug_have_log_file")), -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration/src/Instance_fromInternalStructure.cpp
r97 r109 220 220 221 221 for (uint32_t k=0; k<MAX_OPERATION; ++k) 222 if (is_type_valid(j) and (j != TYPE_MEMORY))// A functional unit can't execute memory instruction 223 { 224 _param->_timing [i][j][k]._latence = fromString<uint32_t> (getParam("latence", 225 "functionnal_unit",toString(i).c_str(), 226 "type" ,toString(j).c_str(), 227 "operation" ,toString(k).c_str(), 228 "")); 229 _param->_timing [i][j][k]._delay = fromString<uint32_t> (getParam("delay", 230 "functionnal_unit",toString(i).c_str(), 231 "type" ,toString(j).c_str(), 232 "operation" ,toString(k).c_str(), 233 "")); 234 } 235 else 236 { 237 _param->_timing [i][j][k]._latence = 0; 238 _param->_timing [i][j][k]._delay = 0; 239 } 222 { 223 if (is_type_valid(j) and (j != TYPE_MEMORY))// A functional unit can't execute memory instruction 224 { 225 _param->_timing [i][j][k]._latence = fromString<uint32_t> (getParam("latence", 226 "functionnal_unit",toString(i).c_str(), 227 "type" ,toString(j).c_str(), 228 "operation" ,toString(k).c_str(), 229 "")); 230 _param->_timing [i][j][k]._delay = fromString<uint32_t> (getParam("delay", 231 "functionnal_unit",toString(i).c_str(), 232 "type" ,toString(j).c_str(), 233 "operation" ,toString(k).c_str(), 234 "")); 235 } 236 else 237 { 238 _param->_timing [i][j][k]._latence = 0; 239 _param->_timing [i][j][k]._delay = 0; 240 } 241 } 240 242 } 241 243 } … … 247 249 //log_printf(INFO,Configuration,FUNCTION,_("ICACHE_PORT")); 248 250 249 _param->_nb_icache_port = fromString<uint32_t>(getParam("nb_icache_port" , ""));251 _param->_nb_icache_port = fromString<uint32_t >(getParam("nb_icache_port" , "")); 250 252 _param->_icache_port_priority = fromString<Tpriority_t >(getParam("icache_port_priority" , "")); 251 253 _param->_icache_port_load_balancing = fromString<Tload_balancing_t >(getParam("icache_port_load_balancing", "")); … … 512 514 getLink_2("link_execute_unit_with_functionnal_unit",toString(i).c_str(), ""); 513 515 _param->_link_execute_unit_with_functionnal_unit [i] = pair_dual(fromString<uint32_t>(dest[0]), 514 fromString<uint32_t>(dest[1]));516 fromString<uint32_t>(dest[1])); 515 517 } 516 518 … … 519 521 getLink_2("link_execute_unit_with_load_store_unit",toString(i).c_str(), ""); 520 522 _param->_link_execute_unit_with_load_store_unit [i] = pair_dual(fromString<uint32_t>(dest[0]), 521 fromString<uint32_t>(dest[1]));523 fromString<uint32_t>(dest[1])); 522 524 523 525 for (uint32_t j=0; j<_param->_nb_cache_port[i]; ++j) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration/src/Instance_fromXMLLight.cpp
r88 r109 26 26 27 27 XMLLightVector<XML_t> vect = xml->getNodes(); 28 28 29 29 for (uint32_t i=0; i<vect.size(); ++i) 30 30 { … … 33 33 std::string child_name = child->getName(); 34 34 35 // log_printf(TRACE,Configuration,FUNCTION," * child_name : %s",child_name.c_str()); 36 35 37 //-------------------------------------------- 36 38 // Child : Parameter … … 44 46 attribute_t value_name = getAttribute(child,attributes,"name" ); 45 47 attribute_t value = getAttribute(child,attributes,"value"); 48 49 // log_printf(TRACE,Configuration,FUNCTION," * parameter \"%s\" = %s",value_name.c_str(), value.c_str()); 46 50 47 51 testAttributesEmpty(child,attributes); … … 70 74 attributes_t attributes = child->getAttributes(); 71 75 attribute_t value_name = getAttribute(child,attributes,"name"); 76 77 // log_printf(TRACE,Configuration,FUNCTION," * link \"%s\"",value_name.c_str()); 72 78 73 79 // Test, must have src or dest (or twice) … … 80 86 attribute_t value_src = (have_src )?getAttribute(child,attributes,"src" ):id; 81 87 attribute_t value_dest = (have_dest)?getAttribute(child,attributes,"dest"):id; 88 82 89 83 90 testAttributesEmpty(child,attributes); … … 111 118 if (child_name == "timing") 112 119 { 120 // log_printf(TRACE,Configuration,FUNCTION," * timing"); 121 113 122 // Notation : 114 123 // <timing type="5" operation="8" latence="2" delay="1" /> … … 183 192 } 184 193 //-------------------------------------------- 185 // Child : Other ( node)194 // Child : Other (component) 186 195 //-------------------------------------------- 187 196 else 188 197 { 198 // log_printf(TRACE,Configuration,FUNCTION," * component"); 199 189 200 testSingleton (child,false); 190 201 191 202 attributes_t attributes = child->getAttributes(); 192 attribute_t value_id 203 attribute_t value_ids = getAttribute(child,attributes,"id"); 193 204 attribute_t value_type = child->getName(); 194 195 testAttributesEmpty(child,attributes); 196 197 // Create a new component 205 206 testAttributesEmpty(child,attributes); 207 208 // Test if counter is an parameters 209 std::string name_counter = "nb_"+value_type; 210 198 211 { 199 Instance_component * param = new Instance_component(value_type, // type200 value_id);201 202 // log_printf(TRACE,Configuration,FUNCTION,"%s.%s",value_type.c_str(),value_id.c_str());203 // log_printf(TRACE,Configuration,FUNCTION," * %d",((*list_components)[value_type]).size());204 205 // Test if this id is previously used206 if (((*list_components)[value_type]).find(value_id) != ((*list_components)[value_type]).end())207 throw ERRORMORPHEO(FUNCTION,toString(_("A Component \"%s\" with id \"%s\" is previously declared.\n"),value_type.c_str(),value_id.c_str()));208 209 ((*list_components)[value_type])[value_id] = param;210 }211 212 // Test if counter is an parameters213 {214 std::string name_counter = "nb_"+value_type;215 // std::cout << name_counter << std::endl;216 217 212 if (list_parameters->find(name_counter) == list_parameters->end()) 218 213 { 219 // Scearch all occurante of this type220 uint32_t nb_counter = xml->getNodes(value_type).size();221 // std::cout << " * " << nb_counter << std::endl;222 223 214 // Insert in array 224 215 Parameter_affectation * param = new Parameter_affectation(name_counter, // type 225 toString(nb_counter)); 226 216 "0"); 227 217 // insert parameter 228 218 (*list_parameters)[name_counter] = param; … … 230 220 } 231 221 232 // Recursive function 233 fromXMLLight (child, 234 ((id=="")?value_id:(id+"."+value_id)), // construction of identificator 235 ((*list_components)[value_type])[value_id]->_list_parameters, 236 // ((*list_components)[value_type])[value_id]->_list_links, 237 list_links, 238 ((*list_components)[value_type])[value_id]->_list_components); 222 size_t index_begin = 0; 223 while (index_begin != std::string::npos) 224 { 225 size_t index_end = value_ids.find_first_of(",",index_begin+1); 226 227 size_t index_min = (index_begin==0)?index_begin:(index_begin+1); 228 size_t index_max = index_end-index_min; 229 attribute_t value_id = value_ids.substr(index_min, index_max); 230 231 // log_printf(TRACE,Configuration,FUNCTION," * component \"%s\" - %s",value_type.c_str(), value_id.c_str()); 232 233 index_begin = index_end; 234 235 // Create a new component 236 { 237 Instance_component * param = new Instance_component(value_type, // type 238 value_id); 239 240 // log_printf(TRACE,Configuration,FUNCTION,"%s.%s",value_type.c_str(),value_id.c_str()); 241 // log_printf(TRACE,Configuration,FUNCTION," * %d",((*list_components)[value_type]).size()); 242 243 // Test if this id is previously used 244 if (((*list_components)[value_type]).find(value_id) != ((*list_components)[value_type]).end()) 245 throw ERRORMORPHEO(FUNCTION,toString(_("A Component \"%s\" with id \"%s\" is previously declared.\n"),value_type.c_str(),value_id.c_str())); 246 247 ((*list_components)[value_type])[value_id] = param; 248 } 249 250 // Increase occurence counter 251 { 252 (*list_parameters)[name_counter]->_value = toString(fromString<uint32_t>((*list_parameters)[name_counter]->_value)+1); 253 } 254 255 // Recursive function 256 fromXMLLight (child, 257 ((id=="")?value_id:(id+"."+value_id)), // construction of identificator 258 ((*list_components)[value_type])[value_id]->_list_parameters, 259 // ((*list_components)[value_type])[value_id]->_list_links, 260 list_links, 261 ((*list_components)[value_type])[value_id]->_list_components); 262 } 239 263 } 240 264 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration/src/Parameter_affectation.cpp
r88 r109 17 17 Parameter_affectation::Parameter_affectation (std::string name , 18 18 std::string value ): 19 _name (name ), 20 _value (value ) 19 _name (name ) 21 20 { 22 21 log_begin(Configuration,FUNCTION); 23 22 24 _use = false; 23 _value = value; 24 _use = false; 25 25 26 26 log_end(Configuration,FUNCTION);
Note: See TracChangeset
for help on using the changeset viewer.