Changeset 82 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- May 1, 2008, 6:48:45 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp
r81 r82 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ … … 32 32 33 33 if (entity_dest == NULL) 34 throw (E rrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_dest+"\" is unknow."));34 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_dest+"\" is unknow.\n")); 35 35 36 36 Signal * signal_dest = entity_dest->find_signal (port_dest); 37 37 38 38 if (signal_dest == NULL) 39 throw (E rrorMorpheo ("<Component::port_map> in component \""+name_entity+"\",try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_dest+"\" have not the signal \""+port_dest+"\"."));39 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\",try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_dest+"\" have not the signal \""+port_dest+"\".\n")); 40 40 41 41 // Second entity … … 43 43 44 44 if (entity_src == NULL) 45 throw (E rrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_src+"\" is unknow."));45 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_src+"\" is unknow.\n")); 46 46 47 47 Signal * signal_src = entity_src->find_signal (port_src); 48 48 49 49 if (signal_src == NULL) 50 throw (E rrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_src+"\" have not the signal \""+port_src+"\"."));50 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_src+"\" have not the signal \""+port_src+"\".\n")); 51 51 52 52 // If all is ok, mapping 53 log_printf(TRACE,Behavioural,FUNCTION, "Signal \"%s.%s\"\tlink with \"%s.%s\""53 log_printf(TRACE,Behavioural,FUNCTION, _("Signal \"%s.%s\"\tlink with \"%s.%s\"") 54 54 ,entity_src ->get_name().c_str() 55 55 ,signal_src ->get_name().c_str() … … 62 62 63 63 if (src_is_port == true) 64 throw (E rrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_src+" is the Top_level, and we can't be use interface's port of the top level as a source."));64 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but the component \""+component_src+" is the Top_level, and we can't be use interface's port of the top level as a source.\n")); 65 65 66 66 // 2 cases : … … 106 106 catch (morpheo::ErrorMorpheo & error) 107 107 { 108 throw (ErrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but "+error.what ()));108 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", try map \""+component_src+"."+port_src+"\" with \""+component_dest+"."+port_dest+"\" but "+error.what ())); 109 109 } 110 110 //catch (...) … … 117 117 }; // end namespace behavioural 118 118 }; // end namespace morpheo 119 120 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_print.cpp
r81 r82 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp
r81 r82 29 29 Tcomponent_t * entry = new Tcomponent_t; 30 30 31 //entry->_component= component;31 entry->_component= component; 32 32 entry->_instance = instance; 33 33 entry->_entity = entity; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_test_map.cpp
r81 r82 15 15 bool Component::test_map (bool recursive) 16 16 { 17 log_printf(NONE,Behavioural,FUNCTION, "Test port map and interface."); 17 18 return test_map (0, recursive); 18 19 } … … 26 27 bool test_ok = true; 27 28 28 if (_list_component->empty () == true) 29 bool is_behavioural = _list_component->empty (); 30 if (is_behavioural) 29 31 { 30 32 log_printf(NONE,Behavioural,FUNCTION, "%s* Component \"%s\" is a behavioural description",tab.c_str(),name.c_str()); … … 33 35 { 34 36 log_printf(NONE,Behavioural,FUNCTION, "%s* Component \"%s\" is a structural description",tab.c_str(),name.c_str()); 37 } 35 38 36 log_printf(INFO,Behavioural,FUNCTION, "%s* Test port I/O",tab.c_str()); 39 40 // log_printf(NONE,Behavioural,FUNCTION, "%s* Test port I/O",tab.c_str()); 41 42 test_ok &= _entity->test_map(depth+1,true,is_behavioural); 43 44 // log_printf(NONE,Behavioural,FUNCTION, "%s* Test all internal component",tab.c_str()); 37 45 38 test_ok &= _entity->test_map(1,true);39 40 log_printf(INFO,Behavioural,FUNCTION, "%s* Test all internal component",tab.c_str());41 42 for (std::list<Tcomponent_t *>::iterator i= _list_component->begin();43 i != _list_component->end();44 ++i)45 test_ok &= (*i)->_entity->test_map(1,false);46 47 // if (recursive) 48 // for (std::list<Tcomponent_t *>::iterator i= _list_component->begin(); 49 // i != _list_component->end(); 50 // ++i) 51 // test_ok &= (*i)->_component->test_map(1,recursive); 46 for (std::list<Tcomponent_t *>::iterator i= _list_component->begin(); 47 i != _list_component->end(); 48 ++i) 49 { 50 test_ok &= (*i)->_entity->test_map(depth+1,false,is_behavioural); 51 if (recursive) 52 try 53 { 54 test_ok &= (*i)->_component->test_map(depth+1,recursive); 55 } 56 catch (morpheo::ErrorMorpheo & error) 57 { 58 // no error propagation, only top level 59 } 52 60 } 53 61 … … 55 63 56 64 if (test_ok == false) 57 throw (ERRORMORPHEO (FUNCTION, "A lot of port is not connected."));65 throw (ERRORMORPHEO (FUNCTION,_("A lot of port is not connected.\n"))); 58 66 59 67 return test_ok; 60 68 }; 61 69 70 // #undef FUNCTION 71 // #define FUNCTION "Component::test_equi" 72 // bool Component::test_equi (bool recursive) 73 // { 74 // log_printf(NONE,Behavioural,FUNCTION, "Test port equi and interface."); 75 // return test_equi (0, recursive); 76 // } 77 78 // bool Component::test_equi (uint32_t depth, bool recursive) 79 // { 80 // log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 81 82 // std::string tab = std::string(depth,'\t'); 83 // std::string name = _entity->get_name(); 84 // bool test_ok = true; 85 86 // test_ok &= _entity->test_equi(depth+1); 87 88 // for (std::list<Tcomponent_t *>::iterator i= _list_component->begin(); 89 // i != _list_component->end(); 90 // ++i) 91 // { 92 // test_ok &= (*i)->_entity->test_equi(depth+1); 93 // if (recursive) 94 // try 95 // { 96 // test_ok &= (*i)->_component->test_equi(depth+1,recursive); 97 // } 98 // catch (morpheo::ErrorMorpheo & error) 99 // { 100 // // no error propagation, only top level 101 // } 102 // } 103 104 // log_printf(FUNC,Behavioural,FUNCTION,"End"); 105 106 // if (test_ok == false) 107 // throw (ERRORMORPHEO (FUNCTION,_("A lot of port is not connected.\n"))); 108 109 // return test_ok; 110 // }; 111 62 112 63 113 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_test_map.cpp
r81 r82 14 14 #undef FUNCTION 15 15 #define FUNCTION "Entity::test_map" 16 bool Entity::test_map (uint32_t depth, bool top_level )16 bool Entity::test_map (uint32_t depth, bool top_level, bool is_behavioural) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 20 std::string tab = std::string(depth,'\t'); 21 log_printf(NONE,Behavioural,FUNCTION, "%s* Test mapping :Entity \"%s\"",tab.c_str(),_name.c_str());21 log_printf(NONE,Behavioural,FUNCTION, "%s* Entity \"%s\"",tab.c_str(),_name.c_str()); 22 22 23 bool _return = _interfaces->test_map(depth+1,top_level );23 bool _return = _interfaces->test_map(depth+1,top_level, is_behavioural); 24 24 25 25 #ifndef DEBUG … … 35 35 }; 36 36 37 // #undef FUNCTION 38 // #define FUNCTION "Entity::test_equi" 39 // bool Entity::test_equi (uint32_t depth) 40 // { 41 // log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 42 43 // std::string tab = std::string(depth,'\t'); 44 // log_printf(NONE,Behavioural,FUNCTION, "%s* Entity \"%s\"",tab.c_str(),_name.c_str()); 45 46 // bool _return = _interfaces->test_equi(depth+1); 47 48 // #ifndef DEBUG 49 // if (_return == false) 50 // { 51 // std::cerr << "In entity \"" << _name << "\" (type : \"" << _type << "\"), a lot of port is not connected !" << std::endl; 52 // } 53 // #endif 54 55 // log_printf(FUNC,Behavioural,FUNCTION,"End"); 56 57 // return _return; 58 // }; 59 37 60 }; // end namespace behavioural 38 61 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo.cpp
r81 r82 45 45 ,interface_fifo._localisation 46 46 #endif 47 ,interface_fifo._usage 47 48 ) 48 49 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_test_map.cpp
r81 r82 14 14 #undef FUNCTION 15 15 #define FUNCTION "Interface::test_map" 16 bool Interface::test_map (uint32_t depth, bool top_level )16 bool Interface::test_map (uint32_t depth, bool top_level, bool is_behavioural) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); … … 26 26 i != _list_signal->end(); 27 27 ++i) 28 _return &= (*i)->test_map(depth+1,top_level );28 _return &= (*i)->test_map(depth+1,top_level, is_behavioural); 29 29 30 30 log_printf(FUNC,Behavioural,FUNCTION,"End"); … … 33 33 }; 34 34 35 // #undef FUNCTION 36 // #define FUNCTION "Interface::test_equi" 37 // bool Interface::test_equi (uint32_t depth) 38 // { 39 // log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 40 41 // std::string tab = std::string(depth,'\t'); 42 // bool _return = true; 43 44 // log_printf(NONE,Behavioural,FUNCTION, "%s* Interface \"%s\"",tab.c_str(),_name.c_str()); 45 46 // for (std::list<Signal*>::iterator i = _list_signal->begin(); 47 // i != _list_signal->end(); 48 // ++i) 49 // _return &= (*i)->test_equi(depth+1); 50 51 // log_printf(FUNC,Behavioural,FUNCTION,"End"); 52 53 // return _return; 54 // }; 55 35 56 }; // end namespace behavioural 36 57 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_test_map.cpp
r81 r82 14 14 #undef FUNCTION 15 15 #define FUNCTION "Interfaces::test_map" 16 bool Interfaces::test_map (uint32_t depth, bool top_level )16 bool Interfaces::test_map (uint32_t depth, bool top_level, bool is_behavioural) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); … … 27 27 i != _list_interface->end(); 28 28 ++i) 29 _return &= (*i)->test_map(depth+1, top_level );29 _return &= (*i)->test_map(depth+1, top_level, is_behavioural); 30 30 31 31 log_printf(FUNC,Behavioural,FUNCTION,"End"); … … 34 34 }; 35 35 36 // #undef FUNCTION 37 // #define FUNCTION "Interfaces::test_equi" 38 // bool Interfaces::test_equi (uint32_t depth) 39 // { 40 // log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 41 42 // std::string tab = std::string(depth,'\t'); 43 44 // bool _return = true; 45 46 // log_printf(NONE,Behavioural,FUNCTION, "%s* Interfaces \"%s\"",tab.c_str(),_name.c_str()); 47 48 // for (std::list<Interface_fifo*>::iterator i = _list_interface->begin(); 49 // i != _list_interface->end(); 50 // ++i) 51 // _return &= (*i)->test_equi(depth+1); 52 53 // log_printf(FUNC,Behavioural,FUNCTION,"End"); 54 55 // return _return; 56 // }; 57 36 58 }; // end namespace behavioural 37 59 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp
r81 r82 20 20 Parameters_test x = msg_error(); 21 21 22 std::cerr << x.print() << std::endl;22 std::cerr << x.print(); 23 23 24 24 if (x.have_error()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_connect.cpp
r81 r82 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ … … 27 27 // log_printf(ALL,Behavioural,FUNCTION," * sc_signal : %.8x",signal_dest->_sc_signal); 28 28 // log_printf(ALL,Behavioural,FUNCTION," * type_info : %s",toString(signal_dest->_type_info).c_str()); 29 30 TEST_PTR(_sc_signal); 31 TEST_PTR(signal_dest->_sc_signal); 29 32 30 33 if ((_direction == IN ) and (signal_dest->_direction == IN )) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp
r81 r82 77 77 signal_dest->_connect_from_signal = signal_src; 78 78 79 80 81 79 // vhdl_testbench : to read an output producte by a internal component 82 80 // TODO : à vérifier !!!!!!!!!!!! -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_test_map.cpp
r81 r82 14 14 #undef FUNCTION 15 15 #define FUNCTION "Signal::test_map" 16 bool Signal::test_map (uint32_t depth, bool top_level )16 bool Signal::test_map (uint32_t depth, bool top_level, bool is_behavioural) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 std::string str = ""; 21 std::string tab = std::string(depth,'\t'); 20 std::string str = ""; 21 std::string tab = std::string(depth,'\t'); 22 bool _return = true; 23 22 24 // log_printf(NONE,Behavioural,FUNCTION, "%s* Signal \"%s\"",tab.c_str(),_name.c_str()); 23 25 // log_printf(NONE,Behavioural,FUNCTION, "%s%d - %d - %d",tab.c_str(), … … 25 27 // _is_map_as_component_src, 26 28 // _is_map_as_component_dest); 27 bool _return = true; 29 // log_printf(NONE,Behavioural,FUNCTION, "%stop_level %d, is_behavioural %d",tab.c_str(), 30 // top_level, 31 // is_behavioural); 28 32 29 if (top_level == true) 30 { 31 switch (_direction) 32 { 33 case morpheo::behavioural::IN : 33 // behavioural | top_level 34 //-------------+----------- 35 // 0 | 0 - 36 // 0 | 1 - 37 // 1 | 0 - 38 // 1 | 1 - 39 40 if (not (is_behavioural and top_level)) 41 if (top_level == true) 42 { 43 switch (_direction) 34 44 { 35 if (_is_map_as_toplevel_dest == false) 36 { 37 _return = false; 38 39 str = "Signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 40 } 41 break; 45 case morpheo::behavioural::IN : 46 { 47 if (_is_map_as_toplevel_dest == false) 48 { 49 _return = false; 50 51 str = "Signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 52 } 53 break; 54 } 55 case morpheo::behavioural::OUT : 56 { 57 if (_is_map_as_toplevel_dest == false) 58 { 59 _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 } 62 break; 63 } 64 case morpheo::behavioural::INTERNAL : 65 { 66 if (_is_map_as_component_src == false) 67 { 68 _return = false; 69 70 str = "Internal signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 71 } 72 73 if (_is_map_as_component_dest == false) 74 { 75 if (_return == false) 76 str+="\n"; 77 78 _return = false; 79 80 str += "Internal signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 81 } 82 83 break; 84 } 85 //case morpheo::behavioural::INOUT : 86 default : break; 42 87 } 43 case morpheo::behavioural::OUT : 88 } 89 else 90 { 91 // internal signal : 92 // Component --- I/O (as_src) 93 // Component --- Component (as_src and as_dest) 94 95 switch (_direction) 44 96 { 45 if (_is_map_as_toplevel_dest == false) 46 { 47 _return = false; 48 str = "Signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 49 } 50 break; 97 case morpheo::behavioural::IN : 98 { 99 if (_is_map_as_component_src == false) 100 { 101 _return = false; 102 103 str = "Signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 104 } 105 break; 106 } 107 case morpheo::behavioural::OUT : 108 { 109 if (_is_map_as_component_src == false) 110 { 111 _return = false; 112 113 str = "Signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 114 } 115 break; 116 } 117 case morpheo::behavioural::INTERNAL : 118 { 119 if (_is_map_as_component_src == false) 120 { 121 _return = false; 122 123 str = "Internal signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 124 } 125 126 if (_is_map_as_component_dest == false) 127 { 128 if (_return == false) 129 str+="\n"; 130 131 _return = false; 132 133 str += "Internal signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 134 } 135 136 break; 137 } 138 //case morpheo::behavioural::INOUT : 139 default : break; 51 140 } 52 //case morpheo::behavioural::INTERNAL : 53 //case morpheo::behavioural::INOUT : 54 default : break; 55 } 56 } 57 else 58 { 59 // internal signal : 60 // Component --- I/O (as_src) 61 // Component --- Component (as_src and as_dest) 62 63 switch (_direction) 64 { 65 case morpheo::behavioural::IN : 66 { 67 if (_is_map_as_component_src == false) 68 { 69 _return = false; 70 71 str = "Signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 72 } 73 break; 74 } 75 case morpheo::behavioural::OUT : 76 { 77 if (_is_map_as_component_src == false) 78 { 79 _return = false; 80 81 str = "Signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 82 } 83 break; 84 } 85 case morpheo::behavioural::INTERNAL : 86 { 87 if (_is_map_as_component_src == false) 88 { 89 _return = false; 90 91 str = "Internal signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface."; 92 } 93 94 if (_is_map_as_component_dest == false) 95 { 96 if (_return == false) 97 str+="\n"; 98 99 _return = false; 100 101 str += "Internal signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface."; 102 } 103 104 break; 105 } 106 //case morpheo::behavioural::INOUT : 107 default : break; 108 } 109 } 110 111 log_printf(FUNC,Behavioural,FUNCTION,"End"); 112 113 141 } 114 142 115 143 if (_return == false) … … 125 153 // log_printf(NONE,Behavioural,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),_name.c_str()); 126 154 } 155 156 log_printf(FUNC,Behavioural,FUNCTION,"End"); 127 157 128 158 return _return; 129 159 }; 130 160 161 // #undef FUNCTION 162 // #define FUNCTION "Signal::test_equi" 163 // bool Signal::test_equi (uint32_t depth) 164 // { 165 // log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 166 167 // std::string str = ""; 168 // std::string tab = std::string(depth,'\t'); 169 // bool _return = true; 170 171 172 173 // if (_return == false) 174 // { 175 // log_printf(NONE,Behavioural,FUNCTION, "%s* %s",tab.c_str(),str.c_str()); 176 177 // #ifndef DEBUG 178 // std::cerr << str << std::endl; 179 // #endif 180 // } 181 // else 182 // { 183 // // log_printf(NONE,Behavioural,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),_name.c_str()); 184 // } 185 186 // return _return; 187 // }; 188 131 189 }; // end namespace behavioural 132 190 }; // end namespace morpheo
Note: See TracChangeset
for help on using the changeset viewer.