Changeset 57 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- Sep 28, 2007, 2:58:08 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp
r43 r57 11 11 namespace behavioural { 12 12 13 Component::Component (void) 13 Component::Component (Tusage_t usage): 14 _usage (usage) 14 15 { 15 16 log_printf(FUNC,Behavioural,"Component::Component","Begin"); 16 _list_component = new list< Entity*>;17 _list_component = new list<Tcomponent_t *>; 17 18 log_printf(FUNC,Behavioural,"Component::Component","End"); 18 19 }; 19 20 20 Component::Component (const Component & component) 21 Component::Component (const Component & component): 22 _usage (component._usage) 21 23 { 22 24 log_printf(FUNC,Behavioural,"Component::Component (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_find_entity.cpp
r43 r57 22 22 if (_list_component->empty()== false) 23 23 { 24 list< Entity*>::iterator i = _list_component->begin();24 list<Tcomponent_t *>::iterator i = _list_component->begin(); 25 25 26 26 while (i != _list_component->end()) 27 27 { 28 if ((*i)->get_name() == name) 28 Entity * entity = (*i)->_entity; 29 30 if (entity->get_name() == name) 29 31 { 30 _return = *i;32 _return = entity; 31 33 break; 32 34 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_get_component.cpp
r43 r57 22 22 bool last_separator = false; 23 23 24 list< Entity*>::iterator i = _list_component->begin();24 list<Tcomponent_t *>::iterator i = _list_component->begin(); 25 25 bool empty = _list_component->empty(); 26 26 … … 33 33 if (i != _list_component->end()) 34 34 { 35 text << tab << * *i;35 text << tab << *((*i)->_entity); 36 36 ++i; 37 37 } … … 40 40 { 41 41 text << separator; 42 text << tab << * *i;42 text << tab << *((*i)->_entity); 43 43 ++i; 44 44 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp
r43 r57 15 15 void Component::set_component (Component * component 16 16 #ifdef POSITION 17 ,uint32_t pos_x18 ,uint32_t pos_y19 ,uint32_t size_x20 ,uint32_t size_y17 ,uint32_t pos_x 18 ,uint32_t pos_y 19 ,uint32_t size_x 20 ,uint32_t size_y 21 21 #endif 22 ,Tinstance_t instance 22 23 ) 23 24 { … … 26 27 Entity * entity = component->_entity; 27 28 28 _list_component->push_back(entity); 29 Tcomponent_t * entry = new Tcomponent_t; 30 31 entry->_instance = instance; 32 entry->_entity = entity; 33 34 _list_component->push_back(entry); 29 35 30 36 #ifdef POSITION 31 entity->mapping( pos_x, pos_y, size_x, size_y); 37 if (instance & INSTANCE_POSITION) 38 entity->mapping( pos_x, pos_y, size_x, size_y); 32 39 #endif 33 40 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp
r43 r57 27 27 ,schema 28 28 #endif 29 ,_usage 29 30 ); 30 31 _entity = entity; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_toXML.cpp
r43 r57 27 27 if (_list_component->empty()== false) 28 28 { 29 list< Entity*>::iterator i = _list_component->begin();29 list<Tcomponent_t *>::iterator i = _list_component->begin(); 30 30 31 31 while (i != _list_component->end()) 32 32 { 33 xml.insert_XML ((*i)-> toXML_mapping());33 xml.insert_XML ((*i)->_entity->toXML_mapping()); 34 34 ++i; 35 35 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp
r44 r57 75 75 76 76 // for each entity 77 list< Entity*> * list_component = _list_component;78 list< Entity*>::iterator i = list_component->begin();77 list<Tcomponent_t *> * list_component = _list_component; 78 list<Tcomponent_t *>::iterator i = list_component->begin(); 79 79 if (not list_component->empty()) 80 80 { 81 81 while (i != list_component->end()) 82 82 { 83 vhdl->set_library_work ((*i)->get_name() + "_Pack"); 83 Entity * entity = (*i)->_entity; 84 Tinstance_t instance = (*i)->_instance; 85 86 if (instance & INSTANCE_LIBRARY) 87 vhdl->set_library_work (entity->get_name() + "_Pack"); 84 88 85 list<string> list_port_map; 86 87 // for each interface 88 list<Interface_fifo *> * list_interface = (*i)->get_interfaces_list()->get_interface_list(); 89 list<Interface_fifo *>::iterator j = list_interface->begin(); 90 if (not list_interface->empty()) 91 { 92 while (j != list_interface->end()) 93 { 94 // for each signal 95 list<Signal *> * list_signal = (*j)->get_signal_list(); 96 list<Signal *>::iterator k = list_signal->begin(); 97 if (not list_signal->empty()) 98 { 99 while (k != list_signal->end()) 100 { 101 // test if is connect with external interface or with an another component. 102 Signal * signal_src = (*k); 103 104 if (signal_src->presence_vhdl () == true) 105 { 106 Signal * signal_dest = signal_src->get_connect_to_signal(); 107 string name_src = signal_src->get_name(); 108 string name_dest; 109 89 if (instance & INSTANCE_COMPONENT) 90 { 91 list<string> list_port_map; 92 93 // for each interface 94 list<Interface_fifo *> * list_interface = entity->get_interfaces_list()->get_interface_list(); 95 list<Interface_fifo *>::iterator j = list_interface->begin(); 96 if (not list_interface->empty()) 97 { 98 while (j != list_interface->end()) 99 { 100 // for each signal 101 list<Signal *> * list_signal = (*j)->get_signal_list(); 102 list<Signal *>::iterator k = list_signal->begin(); 103 if (not list_signal->empty()) 104 { 105 while (k != list_signal->end()) 106 { 107 // test if is connect with external interface or with an another component. 108 Signal * signal_src = (*k); 109 110 if (signal_src->presence_vhdl () == true) 111 { 112 Signal * signal_dest = signal_src->get_connect_to_signal(); 113 string name_src = signal_src->get_name(); 114 string name_dest; 115 110 116 // // Test if destination signal is a interface port ? 111 117 // if (_entity->find_signal(signal_dest) == false) 112 118 // { 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 119 // find if signal is already link 120 map<Signal *,string>::iterator it = tab.find(signal_dest); 121 if (tab.find(signal_dest) == tab.end()) 122 { 123 // Create name 124 name_dest = "signal_"+toString(cpt++); 125 126 tab [signal_src ] = name_dest; 127 tab [signal_dest] = name_dest; 128 129 // Add a new signal 130 vhdl->set_signal (name_dest, signal_src->get_size()); 131 } 132 else 133 { 134 // find !!!! 135 name_dest = (*it).second; 136 tab [signal_src ] = name_dest; 137 } 132 138 // } 133 139 // else … … 150 156 // } 151 157 152 vhdl->set_body_component_port_map (list_port_map, name_src, name_dest); 153 } 154 ++k; 155 } 156 } 157 ++j; 158 } 159 } 160 vhdl->set_body_component ("instance_"+(*i)->get_name(),(*i)->get_name(),list_port_map); 158 vhdl->set_body_component_port_map (list_port_map, name_src, name_dest); 159 } 160 ++k; 161 } 162 } 163 ++j; 164 } 165 } 166 vhdl->set_body_component ("instance_"+entity->get_name(),entity->get_name(),list_port_map); 167 168 } 161 169 ++i; 162 170 } … … 164 172 log_printf(FUNC,Behavioural,FUNCTION,"End"); 165 173 }; 166 174 167 175 }; // end namespace behavioural 168 176 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity.cpp
r42 r57 16 16 ,schema_t schema 17 17 #endif 18 ,Tusage_t usage 18 19 ): 19 20 _name (name ) … … 22 23 ,_schema (schema ) 23 24 #endif 25 ,_usage (usage ) 24 26 { 25 27 log_printf(FUNC,Behavioural,"Entity","Begin"); 26 _interfaces = new Interfaces (name );28 _interfaces = new Interfaces (name, usage); 27 29 #ifdef POSITION 28 30 _is_map = false; … … 37 39 ,_schema (entity._schema ) 38 40 #endif 41 ,_usage (entity._usage ) 39 42 { 40 43 log_printf(FUNC,Behavioural,"Entity (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r42 r57 16 16 ,localisation_t localisation 17 17 #endif 18 ,Tusage_t usage 18 19 ): 19 20 _name (name ) … … 22 23 ,_localisation (localisation) 23 24 #endif 25 ,_usage (usage) 24 26 { 25 27 log_printf(FUNC,Behavioural,"Interface","Begin"); … … 47 49 ,_localisation (interface._localisation) 48 50 #endif 51 ,_usage (interface._usage) 49 52 { 50 53 log_printf(FUNC,Behavioural,"Interface (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo.cpp
r42 r57 16 16 ,localisation_t localisation 17 17 #endif 18 ,Tusage_t usage 18 19 ): 19 20 Interface (name … … 22 23 ,localisation 23 24 #endif 25 ,usage 24 26 ) 25 27 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r41 r57 11 11 namespace behavioural { 12 12 13 Interfaces::Interfaces (string name): 14 _name (name) 13 Interfaces::Interfaces (string name, 14 Tusage_t usage): 15 _name (name), 16 _usage (usage) 15 17 { 16 18 log_printf(FUNC,Behavioural,"Interfaces","Begin"); … … 20 22 21 23 Interfaces::Interfaces (const Interfaces & interfaces) : 22 _name (interfaces._name) 24 _name (interfaces._name), 25 _usage (interfaces._usage) 23 26 { 24 27 log_printf(FUNC,Behavioural,"Interfaces (copy)","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp
r43 r57 27 27 ,localisation 28 28 #endif 29 );29 ,_usage); 30 30 31 31 _list_interface->push_back (interface); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp
r43 r57 66 66 string type; 67 67 68 if (max == min)69 type = " ("+toString(max)+")";68 if (max == 0) 69 type = ""; 70 70 else 71 type = "("+toString(max)+" downto "+toString(min)+")"; 71 if (max == min) 72 type = "("+toString(max)+")"; 73 else 74 type = "("+toString(max)+" downto "+toString(min)+")"; 72 75 73 76 log_printf(FUNC,Behavioural,FUNCTION,"End");
Note: See TracChangeset
for help on using the changeset viewer.