Changeset 78 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- Mar 27, 2008, 11:04:49 AM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 1 added
- 14 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp
r76 r78 20 20 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 21 21 22 // log_printf(NONE,Behavioural,FUNCTION,"Map %s.%s with %s.%s", 23 // component_src.c_str(), 24 // port_src.c_str(), 25 // component_dest.c_str(), 26 // port_dest.c_str()); 27 22 28 std::string name_entity = _entity->get_name(); 23 29 24 30 // First entity 25 31 Entity * entity_dest = find_entity(component_dest); 26 27 32 28 33 if (entity_dest == NULL) … … 53 58 54 59 // need an internal signal ? 55 bool src_is_port = entity_src == _entity;56 bool dest_is_port = entity_dest == _entity;60 bool src_is_port = (entity_src == _entity); 61 bool dest_is_port = (entity_dest == _entity); 57 62 58 63 if (src_is_port == true) … … 67 72 // 68 73 // Interface Component 69 // | |74 // | | 70 75 // ----> (IN) --X-> (IN) 71 // | |76 // | | 72 77 // <-X-- (OUT) <---- (OUT) 73 78 // | | … … 89 94 } 90 95 96 // Create internal signal 91 97 signal_dest= signal_internal (entity_productor, signal_productor); 92 98 signal_dest->set_size_max(signal_src->get_size()); 93 94 dest_is_port = false;95 99 } 96 100 … … 111 115 }; 112 116 113 void Component::port_map (std::string component_src ,114 std::string port_src )115 {116 log_printf(FUNC,Behavioural,FUNCTION,"Begin");117 118 Entity * entity_src = find_entity(component_src);119 120 if (entity_src == NULL)121 throw (ErrorMorpheo ("<Component::port_map> in component \""+_entity->get_name()+"\", port map with unknow component \""+component_src+"\"."));122 123 Signal * signal_src = entity_src->find_signal (port_src);124 125 if (signal_src == NULL)126 throw (ErrorMorpheo ("<Component::port_map> in component \""+_entity->get_name()+"\", port map with component \""+component_src+"\" and a unknow signal \""+port_src+"\"."));127 128 // need an internal signal ?129 130 if (entity_src == _entity)131 throw (ErrorMorpheo ("<Component::port_map> src can't be an interface's port of the top level."));132 133 if (signal_src->get_direction() != OUT)134 throw (ErrorMorpheo ("<Component::port_map> the direction of the signal '"+signal_src->get_name()+"' must be OUT."));135 136 Signal * signal_dest;137 138 signal_dest= signal_internal (entity_src, signal_src);139 signal_dest->set_size_max(signal_src->get_size());140 141 try142 {143 signal_src->link(signal_dest,144 false);145 }146 catch (morpheo::ErrorMorpheo & error)147 {148 throw (ErrorMorpheo ("<Component::port_map> Error in mapping "+entity_src ->get_name()+"."+signal_src ->get_name()+" :\n"+error.what ()));149 }150 //catch (...)151 // {152 // }153 154 log_printf(FUNC,Behavioural,FUNCTION,"End");155 };156 157 117 }; // end namespace behavioural 158 118 }; // end namespace morpheo 159 119 120 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp
r57 r78 29 29 Tcomponent_t * entry = new Tcomponent_t; 30 30 31 // entry->_component= component; 31 32 entry->_instance = instance; 32 33 entry->_entity = entity; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_test_map.cpp
r75 r78 13 13 #undef FUNCTION 14 14 #define FUNCTION "Component::test_map" 15 bool Component::test_map (void) 15 bool Component::test_map (bool recursive) 16 { 17 return test_map (0, recursive); 18 } 19 20 bool Component::test_map (uint32_t depth, bool recursive) 16 21 { 17 22 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 18 23 24 std::string tab = std::string(depth,'\t'); 19 25 std::string name = _entity->get_name(); 20 26 bool test_ok = true; 27 21 28 if (_list_component->empty () == true) 22 log_printf(NONE,Behavioural,FUNCTION, "Component \"%s\" is a behavioural description",name.c_str()); 29 { 30 log_printf(NONE,Behavioural,FUNCTION, "%s* Component \"%s\" is a behavioural description",tab.c_str(),name.c_str()); 31 } 23 32 else 24 33 { 25 log_printf(NONE,Behavioural,FUNCTION, " Component \"%s\" is a structural description",name.c_str());34 log_printf(NONE,Behavioural,FUNCTION, "%s* Component \"%s\" is a structural description",tab.c_str(),name.c_str()); 26 35 27 log_printf(INFO,Behavioural,FUNCTION, " Test port I/O");36 log_printf(INFO,Behavioural,FUNCTION, "%s* Test port I/O",tab.c_str()); 28 37 29 test_ok &= _entity->test_map( true);38 test_ok &= _entity->test_map(1,true); 30 39 31 log_printf(INFO,Behavioural,FUNCTION, " Test all internal component");40 log_printf(INFO,Behavioural,FUNCTION, "%s* Test all internal component",tab.c_str()); 32 41 33 42 for (std::list<Tcomponent_t *>::iterator i= _list_component->begin(); 34 43 i != _list_component->end(); 35 44 ++i) 36 test_ok &= (*i)->_entity->test_map(false); 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); 37 52 } 38 53 … … 40 55 41 56 if (test_ok == false) 42 throw (E rrorMorpheo ("<Component::test_map>A lot of port is not connected."));57 throw (ERRORMORPHEO (FUNCTION,"A lot of port is not connected.")); 43 58 44 59 return test_ok; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_test_map.cpp
r62 r78 7 7 8 8 #include "Behavioural/include/Entity.h" 9 9 #include <iostream> 10 10 11 11 namespace morpheo { … … 14 14 #undef FUNCTION 15 15 #define FUNCTION "Entity::test_map" 16 bool Entity::test_map ( bool top_level)16 bool Entity::test_map (uint32_t depth, bool top_level) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 log_printf(NONE,Behavioural,FUNCTION, " * Test mapping : Entity \"%s\"",_name.c_str()); 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 22 22 bool _return = _interfaces->test_map(top_level); 23 bool _return = _interfaces->test_map(depth+1,top_level); 24 25 #ifndef DEBUG 26 if (_return == false) 27 { 28 std::cerr << "In entity \"" << _name << "\" (type : \"" << _type << "\"), a lot of port is not connected !" << std::endl; 29 } 30 #endif 23 31 24 32 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_test_map.cpp
r75 r78 14 14 #undef FUNCTION 15 15 #define FUNCTION "Interface::test_map" 16 bool Interface::test_map ( bool top_level)16 bool Interface::test_map (uint32_t depth, bool top_level) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 std::string tab = std::string(depth,'\t'); 20 21 bool _return = true; 21 22 22 log_printf( INFO,Behavioural,FUNCTION, " * Interface \"%s\"",_name.c_str());23 log_printf(NONE,Behavioural,FUNCTION, "%s* Interface \"%s\"",tab.c_str(),_name.c_str()); 23 24 24 25 for (std::list<Signal*>::iterator i = _list_signal->begin(); 25 26 i != _list_signal->end(); 26 27 ++i) 27 _return &= (*i)->test_map( top_level);28 _return &= (*i)->test_map(depth+1,top_level); 28 29 29 30 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_test_map.cpp
r75 r78 14 14 #undef FUNCTION 15 15 #define FUNCTION "Interfaces::test_map" 16 bool Interfaces::test_map ( bool top_level)16 bool Interfaces::test_map (uint32_t depth, bool top_level) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 std::string tab = std::string(depth,'\t'); 21 20 22 bool _return = true; 21 23 22 log_printf( INFO,Behavioural,FUNCTION, " * Interfaces \"%s\"",_name.c_str());24 log_printf(NONE,Behavioural,FUNCTION, "%s* Interfaces \"%s\"",tab.c_str(),_name.c_str()); 23 25 24 26 for (std::list<Interface_fifo*>::iterator i = _list_interface->begin(); 25 27 i != _list_interface->end(); 26 28 ++i) 27 _return &= (*i)->test_map( top_level);29 _return &= (*i)->test_map(depth+1, top_level); 28 30 29 31 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp
r71 r78 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 std::string msg = msg_error(); 19 20 Parameters_test x = msg_error(); 20 21 21 if (msg.length() != 0) 22 throw (ErrorMorpheo (msg)); 22 std::cerr << x.print() << std::endl; 23 24 if (x.have_error()) 25 throw (ErrorMorpheo ("Error(s) in parameters")); 26 23 27 log_printf(FUNC,Behavioural,FUNCTION,"End"); 24 28 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
r75 r78 20 20 { 21 21 log_printf(FUNC,Behavioural,"Signal","Begin"); 22 _size = size; 23 _is_allocate = false; 24 _is_map_as_src = false; 25 _is_map_as_dest = false; 26 _connect_from_signal = NULL; 27 _connect_to_signal = NULL; 28 _sc_signal = NULL; 29 _sc_signal_map = NULL; 30 _type_info = UNKNOW; 22 _size = size; 23 _is_allocate = false; 24 _is_map_as_component_src = false; 25 _is_map_as_component_dest = false; 26 _is_map_as_toplevel_dest = false; 27 _connect_from_signal = NULL; 28 _connect_to_signal = NULL; 29 _sc_signal = NULL; 30 _sc_signal_map = NULL; 31 _type_info = UNKNOW; 31 32 #ifdef VHDL_TESTBENCH 32 33 _list_value = new std::list<std::string>; 33 34 #endif 35 36 if (_size == 0) 37 throw ERRORMORPHEO(FUNCTION,"Size of signal '"+_name+"' is nul"); 38 39 34 40 log_printf(FUNC,Behavioural,"Signal","End"); 35 41 }; … … 41 47 { 42 48 log_printf(FUNC,Behavioural,"Signal (copy)","Begin"); 43 _size = signal._size; 44 _is_allocate = signal._is_allocate; 45 _is_map_as_src = signal._is_map_as_src ; 46 _is_map_as_dest = signal._is_map_as_dest; 47 _connect_from_signal = signal._connect_from_signal; 48 _connect_to_signal = signal._connect_to_signal; 49 _sc_signal = signal._sc_signal ; 50 _sc_signal_map = signal._sc_signal_map; 51 _type_info = signal._type_info ; 49 _size = signal._size; 50 _is_allocate = signal._is_allocate; 51 _is_map_as_component_src = signal._is_map_as_component_src ; 52 _is_map_as_component_dest = signal._is_map_as_component_dest; 53 _is_map_as_toplevel_dest = signal._is_map_as_component_dest; 54 _connect_from_signal = signal._connect_from_signal; 55 _connect_to_signal = signal._connect_to_signal; 56 _sc_signal = signal._sc_signal ; 57 _sc_signal_map = signal._sc_signal_map; 58 _type_info = signal._type_info ; 52 59 #ifdef VHDL_TESTBENCH 53 _list_value = signal._list_value;60 _list_value = signal._list_value; 54 61 #endif 55 62 log_printf(FUNC,Behavioural,"Signal (copy)","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_connect.cpp
r75 r78 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 20 //std::cout << "connected : " << get_name() << "\twith " << signal_dest->get_name() << std::endl; 21 19 20 // log_printf(TRACE,Behavioural,FUNCTION,"Connection between : %s with %s",get_name().c_str(),signal_dest->get_name().c_str()); 21 // log_printf(ALL,Behavioural,FUNCTION," * source"); 22 // log_printf(ALL,Behavioural,FUNCTION," * direction : %s",toString(_direction).c_str()); 23 // log_printf(ALL,Behavioural,FUNCTION," * sc_signal : %.8x",_sc_signal); 24 // log_printf(ALL,Behavioural,FUNCTION," * type_info : %s",toString(_type_info).c_str()); 25 // log_printf(ALL,Behavioural,FUNCTION," * destination"); 26 // log_printf(ALL,Behavioural,FUNCTION," * direction : %s",toString(signal_dest->_direction).c_str()); 27 // log_printf(ALL,Behavioural,FUNCTION," * sc_signal : %.8x",signal_dest->_sc_signal); 28 // log_printf(ALL,Behavioural,FUNCTION," * type_info : %s",toString(signal_dest->_type_info).c_str()); 29 22 30 if ((_direction == IN ) and (signal_dest->_direction == IN )) 23 31 switch (_type_info) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp
r65 r78 17 17 bool signal_dest_is_port) 18 18 { 19 // signal_dest_is_port == 1 when the signal dest is in a top level interface. (else, signal_dest is type "INTERNAL") 20 19 21 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 20 22 … … 23 25 // Test 24 26 if (signal_src ->_is_allocate == false) 25 throw (E rrorMorpheo ("<Signal::link>Signal \""+_name+"\", can't map with signal \""+ get_name()+"\", because the first signal is not already allocate."));27 throw (ERRORMORPHEO (FUNCTION,"Signal \""+_name+"\", can't map with signal \""+ get_name()+"\", because the first signal is not already allocate.")); 26 28 if (signal_dest->_is_allocate == false) 27 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+signal_dest->get_name()+"\", because the second signal is not already allocate.")); 28 if (signal_src ->_is_map_as_src == true) 29 throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal_dest->get_name()+"\", because the first signal is already mapped.")); 29 throw (ERRORMORPHEO (FUNCTION,"Signal \""+_name+"\", can't map with signal \""+signal_dest->get_name()+"\", because the second signal is not already allocate.")); 30 30 31 31 // List of all case … … 43 43 not (not signal_dest_is_port and (((signal_src->_direction == IN ) and (signal_dest->_direction == INTERNAL)) or 44 44 ((signal_src->_direction == OUT) and (signal_dest->_direction == INTERNAL))))) 45 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal_dest->get_name()+"\" : illegal direction ("+toString(signal_src->_direction)+" with "+toString(signal_dest->_direction)+").")); 45 throw (ERRORMORPHEO (FUNCTION,"Signal \""+_name+"\" can't been linked with signal \""+signal_dest->get_name()+"\" : illegal direction ("+toString(signal_src->_direction)+" with "+toString(signal_dest->_direction)+").")); 46 47 48 // Multi consumer is authorized , no to multi producer! 49 bool source_have_multi_consumer = (signal_src ->_connect_to_signal != NULL); 50 // bool destination_have_multi_producer = (signal_dest->_connect_from_signal != NULL) and (signal_dest_is_port == false); 51 // if (destination_have_multi_producer) 52 // // throw (ERRORMORPHEO (FUNCTION,"Signal \""+_name+"\" can't been linked with signal \""+signal_dest->get_name()+"\" : destination have multi producer.")); 53 // log_printf(NONE,Behavioural,FUNCTION,"Signal \"%s\" can't been linked with signal \"%s\" : destination have multi producer.",_name.c_str(),signal_dest->get_name().c_str()); 46 54 47 55 // update info source 48 signal_src ->_connect_to_signal = signal_dest; 49 signal_src ->_is_map_as_src = true; 56 signal_src ->_connect_to_signal = signal_dest; 57 signal_src ->_is_map_as_component_src = true; 58 59 // update info destination 60 if (signal_dest_is_port == true) 61 signal_dest->_is_map_as_toplevel_dest = true; // because toplevel port can't be a source 62 else 63 // signal_dest is a internal signal 64 if (signal_src->_direction == OUT) 65 signal_dest->_is_map_as_component_dest = true; 66 else 67 signal_dest->_is_map_as_component_src = true; 50 68 51 // update info destination52 signal_dest->_connect_from_signal = signal_src;53 signal_dest->_is_map_as_dest = true;54 55 69 // an internal signal and port can't be a source. 56 70 // also, to fill the connect_to_signal's field 57 if ((signal_src->_direction == OUT) and 58 (signal_dest->_direction == INTERNAL)) 59 { 60 signal_dest->_connect_to_signal = signal_src; 61 } 71 if (signal_dest->_direction == INTERNAL) 72 if (signal_src->_direction == OUT) 73 signal_dest->_connect_from_signal = signal_src; 74 else 75 signal_dest->_connect_to_signal = signal_src; 76 else 77 signal_dest->_connect_from_signal = signal_src; 78 79 62 80 63 81 // vhdl_testbench : to read an output producte by a internal component … … 66 84 (signal_src ->_direction == OUT)) 67 85 signal_dest->_sc_signal_map = signal_src ->_sc_signal_map; 68 69 connect (signal_dest); 86 87 // A signal can be connect once 88 if (not source_have_multi_consumer) 89 connect (signal_dest); 70 90 71 91 log_printf(FUNC,Behavioural,FUNCTION,"End"); -
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; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp
r71 r78 4 4 namespace morpheo { 5 5 namespace behavioural { 6 void Stat::create_expr (std::string varname, std::string expr, bool each_cycle) 6 7 void Stat::create_expr (std::string varname, 8 std::string expr, 9 bool each_cycle) 7 10 { 8 11 if (is_valid_var (varname)) … … 17 20 _list_expr->push_back(expression); 18 21 } 22 23 void Stat::create_expr_average (std::string varname, 24 std::string expr_sum, 25 std::string expr_deps, 26 std::string unit, 27 std::string description) 28 { 29 create_counter(varname,unit,description); 30 create_expr (varname, "/ "+expr_sum+" "+expr_deps, false); 31 } 32 33 void Stat::create_expr_average_by_cycle (std::string varname, 34 std::string expr_sum, 35 std::string unit, 36 std::string description) 37 { 38 create_expr_average (varname, expr_sum, "cycle", unit, description); 39 } 40 41 void Stat::create_expr_percent (std::string varname, 42 std::string expr_sum, 43 std::string expr_max, 44 std::string description) 45 { 46 create_counter(varname,"%",description); 47 create_expr (varname, "/ * "+expr_sum+" 100 "+expr_max, false); 48 } 49 50 19 51 }; 20 52 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_string2tree.cpp
r71 r78 9 9 Stat_binary_tree * Stat::string2tree (std::string expr) 10 10 { 11 std::cout << "expr : " << expr << std::endl;12 13 11 const std::string delims (" "); // délimiteur : " " 14 12 const std::string numbers ("0123456789"); // délimiteur : " " -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Test.cpp
r59 r78 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ … … 12 12 namespace behavioural { 13 13 14 bool Parameters::is_natural (double val ) { return ( (val >= 0) && (floor(val) == ceil(val)));};15 bool Parameters::is_positive (double val ) { return ( (val >= 1) && (floor(val) == ceil(val)));};16 bool Parameters::is_multiple (uint32_t val1,17 uint32_t val2) { return is_positive((1.0*val1)/(1.0*val2));}; 18 bool Parameters::is_between_inclusive (uint32_t val, 19 uint32_t min,20 uint32_t max) { return ((val >= min) && (val <= max));};21 bool Parameters::is_between_exclusive (uint32_t val, 22 uint32_t min,23 uint32_t max) { return ((val > min) && (val < max));};24 14 bool is_natural (double val ) { return ( (val >= 0) && (floor(val) == ceil(val)));}; 15 bool is_positive (double val ) { return ( (val >= 1) && (floor(val) == ceil(val)));}; 16 bool is_power2 (uint32_t val) { return is_natural(::log2(static_cast<double>(val)));}; 17 bool is_multiple (uint32_t val1, 18 uint32_t val2) { return is_positive((1.0*val1)/(1.0*val2));}; 19 bool is_between_inclusive (uint32_t val, 20 uint32_t min, 21 uint32_t max) { return ((val >= min) && (val <= max));}; 22 bool is_between_exclusive (uint32_t val, 23 uint32_t min, 24 uint32_t max) { return ((val > min) && (val < max));}; 25 25 }; // end namespace behavioural 26 26 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp
r71 r78 27 27 std::string tabulation = indent(depth); 28 28 29 //body.insert(0,tabulation);29 body.insert(0,tabulation); 30 30 for (size_t pos=body.find('\n',0); pos<body.length()-1; pos=body.find('\n',++pos)) 31 31 body.insert(++pos,tabulation);
Note: See TracChangeset
for help on using the changeset viewer.