- Timestamp:
- Sep 28, 2007, 2:58:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.