- Timestamp:
- Mar 27, 2008, 11:04:49 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_test_map.cpp
r75 r78 14 14 #undef FUNCTION 15 15 #define FUNCTION "Signal::test_map" 16 bool Signal::test_map ( bool top_level)16 bool Signal::test_map (uint32_t depth, bool top_level) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 log_printf(INFO,Behavioural,FUNCTION, " * Signal \"%s\"",_name.c_str()); 21 22 bool _return = false; 20 std::string str = ""; 21 std::string tab = std::string(depth,'\t'); 22 // log_printf(NONE,Behavioural,FUNCTION, "%s* Signal \"%s\"",tab.c_str(),_name.c_str()); 23 // log_printf(NONE,Behavioural,FUNCTION, "%s%d - %d - %d",tab.c_str(), 24 // _is_map_as_toplevel_dest, 25 // _is_map_as_component_src, 26 // _is_map_as_component_dest); 27 bool _return = true; 23 28 24 29 if (top_level == true) 25 30 { 26 _return = _is_map_as_dest;27 28 31 switch (_direction) 29 32 { 30 33 case morpheo::behavioural::IN : 31 34 { 32 if (_return == false) 33 std::cerr << "Signal \"" << _name << "\" is not mapped with an outpout port or a component." << std::endl; 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 } 34 41 break; 35 42 } 36 43 case morpheo::behavioural::OUT : 37 44 { 38 if (_return == false) 39 std::cerr << "Signal \"" << _name << "\" is not mapped with an input port or a component." << std::endl; 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 } 40 50 break; 41 51 } 42 //case morpheo::behavioural::INTERNAL : return "internal" ; break;43 //case morpheo::behavioural::INOUT : return "inout" ; break;52 //case morpheo::behavioural::INTERNAL : 53 //case morpheo::behavioural::INOUT : 44 54 default : break; 45 55 } … … 47 57 else 48 58 { 49 _return = _is_map_as_src and _is_map_as_dest; 59 // internal signal : 60 // Component --- I/O (as_src) 61 // Component --- Component (as_src and as_dest) 50 62 51 if (_return == false)63 switch (_direction) 52 64 { 53 if (_is_map_as_src == false) 54 std::cerr << "Signal \"" << _name << "\" is not mapped as source" << std::endl; 55 if (_is_map_as_dest == false) 56 std::cerr << "Signal \"" << _name << "\" is not mapped as destination" << std::endl; 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; 57 108 } 58 109 } 59 110 60 111 log_printf(FUNC,Behavioural,FUNCTION,"End"); 112 113 114 115 if (_return == false) 116 { 117 log_printf(NONE,Behavioural,FUNCTION, "%s* %s",tab.c_str(),str.c_str()); 118 119 #ifndef DEBUG 120 std::cerr << str << std::endl; 121 #endif 122 } 123 else 124 { 125 // log_printf(NONE,Behavioural,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),_name.c_str()); 126 } 61 127 62 128 return _return;
Note: See TracChangeset
for help on using the changeset viewer.