Changeset 139 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- Jul 30, 2010, 4:47:27 PM (14 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_test_map.cpp
r97 r139 14 14 #undef FUNCTION 15 15 #define FUNCTION "Component::test_map" 16 // bool Component::test_map (bool recursive) 17 // { 18 // log_printf(INFO,Behavioural,FUNCTION, "Test port map and interface."); 19 // return test_map (0, recursive); 20 // } 21 16 22 bool Component::test_map (bool recursive) 17 {18 log_printf(INFO,Behavioural,FUNCTION, "Test port map and interface.");19 return test_map (0, recursive);20 }21 22 bool Component::test_map (uint32_t depth, bool recursive)23 23 { 24 24 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 25 25 26 std::string tab = morpheo::tab(depth);26 // std::string tab = morpheo::tab(depth); 27 27 std::string name = _entity->get_name(); 28 28 bool test_ok = true; 29 29 30 30 bool is_behavioural = _list_component->empty (); 31 if (is_behavioural)32 {33 34 }35 else36 {37 38 }31 // if (is_behavioural) 32 // { 33 // log_printf(INFO,Interface,FUNCTION, "%s* Component \"%s\" is a behavioural description",tab.c_str(),name.c_str()); 34 // } 35 // else 36 // { 37 // log_printf(INFO,Interface,FUNCTION, "%s* Component \"%s\" is a structural description",tab.c_str(),name.c_str()); 38 // } 39 39 40 40 41 41 // log_printf(INFO,Behavioural,FUNCTION, "%s* Test port I/O",tab.c_str()); 42 42 43 test_ok &= _entity->test_map( depth+1,true,is_behavioural);43 test_ok &= _entity->test_map(true,is_behavioural); 44 44 45 45 // log_printf(INFO,Behavioural,FUNCTION, "%s* Test all internal component",tab.c_str()); … … 50 50 if (((*i)->_instance & INSTANCE_COMPONENT) != 0) 51 51 { 52 test_ok &= (*i)->_entity->test_map( depth+1,false,is_behavioural);52 test_ok &= (*i)->_entity->test_map(false,is_behavioural); 53 53 if (recursive) 54 54 try 55 55 { 56 test_ok &= (*i)->_component->test_map( depth+1,recursive);56 test_ok &= (*i)->_component->test_map(recursive); 57 57 } 58 58 catch (morpheo::ErrorMorpheo & error) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_test_map.cpp
r94 r139 15 15 #undef FUNCTION 16 16 #define FUNCTION "Entity::test_map" 17 bool Entity::test_map ( uint32_t depth,bool top_level, bool is_behavioural)17 bool Entity::test_map (bool top_level, bool is_behavioural) 18 18 { 19 19 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 20 20 21 std::string tab=morpheo::tab(depth);21 // std::string tab=morpheo::tab(depth); 22 22 23 log_printf(INFO,Interface,FUNCTION,"%s* Entity \"%s\"",tab.c_str(),_name.c_str());23 // log_printf(INFO,Interface,FUNCTION,"%s* Entity \"%s\"",tab.c_str(),_name.c_str()); 24 24 25 bool _return = _interfaces->test_map(depth+1,top_level, is_behavioural); 26 27 #ifndef DEBUG 28 if (_return == false) 29 { 30 std::cerr << "In entity \"" << _name << "\" (type : \"" << _type << "\"), a lot of port is not connected !" << std::endl; 31 } 32 #endif 25 bool _return = _interfaces->test_map(top_level, is_behavioural); 33 26 34 27 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_test_map.cpp
r94 r139 14 14 #undef FUNCTION 15 15 #define FUNCTION "Interface::test_map" 16 bool Interface::test_map ( uint32_t depth, bool top_level, bool is_behavioural)16 bool Interface::test_map (std::string name_interfaces, bool top_level, bool is_behavioural) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 std::string tab = morpheo::tab(depth);20 // std::string tab = morpheo::tab(depth); 21 21 bool _return = true; 22 22 23 log_printf(INFO,Interface,FUNCTION, "%s* Interface \"%s\"",tab.c_str(),_name.c_str());23 // log_printf(INFO,Interface,FUNCTION, "%s* Interface \"%s\"",tab.c_str(),_name.c_str()); 24 24 25 25 for (std::list<Signal*>::iterator i = _list_signal->begin(); 26 26 i != _list_signal->end(); 27 27 ++i) 28 _return &= (*i)->test_map( depth+1,top_level, is_behavioural);28 _return &= (*i)->test_map(name_interfaces+"."+_name,top_level, is_behavioural); 29 29 30 30 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_test_map.cpp
r94 r139 14 14 #undef FUNCTION 15 15 #define FUNCTION "Interfaces::test_map" 16 bool Interfaces::test_map ( uint32_t depth,bool top_level, bool is_behavioural)16 bool Interfaces::test_map (bool top_level, bool is_behavioural) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 std::string tab = morpheo::tab(depth);20 // std::string tab = morpheo::tab(depth); 21 21 22 22 bool _return = true; 23 23 24 log_printf(INFO,Interface,FUNCTION, "%s* Interfaces \"%s\"",tab.c_str(),_name.c_str());24 // log_printf(INFO,Interface,FUNCTION, "%s* Interfaces \"%s\"",tab.c_str(),_name.c_str()); 25 25 26 26 for (std::list<Interface_fifo*>::iterator i = _list_interface->begin(); 27 27 i != _list_interface->end(); 28 28 ++i) 29 _return &= (*i)->test_map( depth+1, top_level, is_behavioural);29 _return &= (*i)->test_map(_name, top_level, is_behavioural); 30 30 31 31 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_test_map.cpp
r94 r139 14 14 #undef FUNCTION 15 15 #define FUNCTION "Signal::test_map" 16 bool Signal::test_map ( uint32_t depth,bool top_level, bool is_behavioural)16 bool Signal::test_map (std::string name_interface,bool top_level, bool is_behavioural) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 std::string signame = name_interface+"."+_name; 20 21 std::string str = ""; 21 22 // std::string tab = morpheo::tab(depth); 22 23 bool _return = true; 23 24 … … 49 50 _return = false; 50 51 51 str = "Signal \""+ _name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";52 str = "Signal \""+signame+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 52 53 } 53 54 break; … … 58 59 { 59 60 _return = false; 60 str = "Signal \""+ _name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";61 str = "Signal \""+signame+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 61 62 } 62 63 break; … … 68 69 _return = false; 69 70 70 str = "Internal signal \""+ _name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";71 str = "Internal signal \""+signame+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 71 72 } 72 73 … … 78 79 _return = false; 79 80 80 str += "Internal signal \""+ _name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";81 str += "Internal signal \""+signame+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 81 82 } 82 83 … … 101 102 _return = false; 102 103 103 str = "Signal \""+ _name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";104 str = "Signal \""+signame+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 104 105 } 105 106 break; … … 111 112 _return = false; 112 113 113 str = "Signal \""+ _name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";114 str = "Signal \""+signame+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 114 115 } 115 116 break; … … 121 122 _return = false; 122 123 123 str = "Internal signal \""+ _name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";124 str = "Internal signal \""+signame+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 124 125 } 125 126 … … 131 132 _return = false; 132 133 133 str += "Internal signal \""+ _name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";134 str += "Internal signal \""+signame+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 134 135 } 135 136 … … 143 144 if (_return == false) 144 145 { 145 #ifndef DEBUG 146 std::cerr << str << std::endl; 147 #else 148 log_printf(INFO,Interface,FUNCTION, "%s* %s",tab.c_str(),str.c_str()); 149 #endif 146 msgError("%s\n",str.c_str()); 150 147 } 151 148 else 152 149 { 153 // log_printf(INFO,Interface,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(), _name.c_str());150 // log_printf(INFO,Interface,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),signame.c_str()); 154 151 } 155 152 … … 181 178 // else 182 179 // { 183 // // log_printf(INFO,Behavioural,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(), _name.c_str());180 // // log_printf(INFO,Behavioural,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),signame.c_str()); 184 181 // } 185 182 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat.cpp
r138 r139 5 5 namespace behavioural { 6 6 7 Stat::Stat (std::string name_instance,8 std::string name_component,7 Stat::Stat (std::string name_instance, 8 std::string name_component, 9 9 Parameters_Statistics * param): 10 10 _name_instance (name_instance), … … 16 16 _generate_file = true; 17 17 18 _list_operand = new std::map<std::string, var_t>; 19 _list_expr = new std::list<expr_t>; 20 _list_stat = new std::list<Stat *>; 21 _list_counters = new std::list<counters_t *>; 18 _list_operand = new std::map<std::string, var_t>; 19 _list_expr_per_cycle = new std::list<expr_t>; 20 _list_expr_per_period = new std::list<expr_t>; 21 _list_stat = new std::list<Stat *>; 22 _list_counters = new std::list<counters_t *>; 22 23 23 _cycle = create_variable("cycle");24 // _cycle = create_counter("cycle","","");25 *_cycle = 0; // for the first period24 _cycle = create_variable("cycle"); 25 // _cycle = create_counter("cycle","",""); 26 *_cycle = 0; // for the first period 26 27 } 27 28 28 29 Stat::Stat (std::string name_instance, 29 30 std::string name_component, 30 cycle_t nb_cycle_before_begin,31 cycle_t period):31 cycle_t nb_cycle_before_begin, 32 cycle_t period): 32 33 _name_instance (name_instance), 33 34 _name_component (name_component), … … 38 39 _generate_file = true; 39 40 40 _list_operand = new std::map<std::string, var_t>; 41 _list_expr = new std::list<expr_t>; 42 _list_stat = new std::list<Stat *>; 43 _list_counters = new std::list<counters_t *>; 41 _list_operand = new std::map<std::string, var_t>; 42 _list_expr_per_cycle = new std::list<expr_t>; 43 _list_expr_per_period = new std::list<expr_t>; 44 _list_stat = new std::list<Stat *>; 45 _list_counters = new std::list<counters_t *>; 44 46 45 _cycle = create_variable("cycle");46 // _cycle = create_counter("cycle","","");47 *_cycle = 0; // for the first period47 _cycle = create_variable("cycle"); 48 // _cycle = create_counter("cycle","",""); 49 *_cycle = 0; // for the first period 48 50 } 49 51 … … 63 65 64 66 // parcourir la liste et desallouer les arbres 65 for (std::list<expr_t>::iterator i=_list_expr ->begin();66 i!= _list_expr ->end();67 for (std::list<expr_t>::iterator i=_list_expr_per_cycle->begin(); 68 i!= _list_expr_per_cycle->end(); 67 69 ++i) 68 70 { 69 71 delete i->expression; 70 72 } 71 delete _list_expr; 73 delete _list_expr_per_cycle; 74 75 for (std::list<expr_t>::iterator i=_list_expr_per_period->begin(); 76 i!= _list_expr_per_period->end(); 77 ++i) 78 { 79 delete i->expression; 80 } 81 delete _list_expr_per_period; 72 82 73 83 // parcourir la liste et desallouer les arbres -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp
r110 r139 18 18 expression.variable = (*_list_operand) [varname].counter; 19 19 expression.expression = string2tree(expr); 20 20 // expression.each_cycle = each_cycle; 21 21 22 _list_expr->push_back(expression); 22 if (each_cycle) 23 _list_expr_per_cycle ->push_back(expression); 24 else 25 _list_expr_per_period->push_back(expression); 23 26 } 24 27 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_eval_exprs.cpp
r81 r139 7 7 { 8 8 // parcourir la liste et desallouer les counters 9 for (std::list<expr_t>::iterator i=_list_expr ->begin();10 i!= _list_expr ->end();9 for (std::list<expr_t>::iterator i=_list_expr_per_cycle->begin(); 10 i!= _list_expr_per_cycle->end(); 11 11 ++i) 12 { 13 if (i->each_cycle == only_each_cycle) 14 eval_expr (*i); 15 } 12 eval_expr (*i); 13 14 if (not only_each_cycle) 15 for (std::list<expr_t>::iterator i=_list_expr_per_period->begin(); 16 i!= _list_expr_per_period->end(); 17 ++i) 18 eval_expr (*i); 16 19 } 17 20 };
Note: See TracChangeset
for help on using the changeset viewer.