- Timestamp:
- May 1, 2008, 6:48:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.