Changeset 38 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- May 31, 2007, 11:22:29 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 3 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity.cpp
r31 r38 19 19 _schema (schema ) 20 20 { 21 log_printf(FUNC,Behavioural,"Entity","Begin"); 21 22 _is_map = false; 23 log_printf(FUNC,Behavioural,"Entity","End"); 22 24 }; 23 25 … … 27 29 _schema (entity._schema ) 28 30 { 31 log_printf(FUNC,Behavioural,"Entity (copy)","Begin"); 29 32 _is_map = entity._is_map ; 30 33 _interfaces = entity._interfaces; 31 34 _comment = entity._comment ; 35 log_printf(FUNC,Behavioural,"Entity (copy)","End"); 32 36 }; 33 37 34 38 Entity::~Entity () 35 39 { 40 log_printf(FUNC,Behavioural,"~Entity","Begin"); 36 41 delete _interfaces; 42 log_printf(FUNC,Behavioural,"~Entity","End"); 37 43 }; 38 44 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_map.cpp
r31 r38 13 13 namespace behavioural { 14 14 15 void Entity::mapping (uint32_t size_x,16 uint32_t size_y,17 uint32_t pos_x ,18 uint32_t pos_y )15 void Entity::mapping (uint32_t pos_x, 16 uint32_t pos_y, 17 uint32_t size_x , 18 uint32_t size_y ) 19 19 { 20 20 if (_is_map != false) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r31 r38 18 18 _localisation (localisation) 19 19 { 20 _list_signal = new list<Signal>; 20 log_printf(FUNC,Behavioural,"Interface","Begin"); 21 22 _comment = ""; 23 _list_signal = new (list<Signal*>); 24 21 25 #ifdef POSITION 22 _is_map = false; 26 _is_map = false; 27 _entity_map = NULL; 28 _interface_map = NULL; 23 29 #endif 30 31 log_printf(FUNC,Behavioural,"Interface","End"); 24 32 }; 25 33 … … 29 37 _localisation (interface._localisation) 30 38 { 31 _comment = interface._comment ; 32 _list_signal = interface._list_signal; 39 log_printf(FUNC,Behavioural,"Interface (copy)","Begin"); 40 _comment = interface._comment ; 41 _list_signal = interface._list_signal; 33 42 #ifdef POSITION 34 _is_map = interface._is_map ; 43 _is_map = interface._is_map ; 44 _entity_map = interface._entity_map ; 45 _interface_map = interface._interface_map; 35 46 #endif 47 log_printf(FUNC,Behavioural,"Interface (copy)","End"); 36 48 }; 37 49 38 50 Interface::~Interface () 39 51 { 52 log_printf(FUNC,Behavioural,"~Interface","Begin"); 53 54 if (_list_signal->empty()== false) 55 { 56 list<Signal*>::iterator i = _list_signal->begin(); 57 58 while (i != _list_signal->end()) 59 { 60 delete (*i); 61 ++i; 62 } 63 } 64 40 65 delete _list_signal; 66 log_printf(FUNC,Behavioural,"~Interface","End"); 41 67 }; 42 68 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_comment.cpp
r29 r38 14 14 string Interface::get_comment (void) 15 15 { 16 return _comment; 16 log_printf(FUNC,Behavioural,"get_comment","Begin"); 17 string res = _comment; 18 log_printf(FUNC,Behavioural,"get_comment","End"); 19 return res; 17 20 }; 18 21 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp
r31 r38 14 14 string Interface::get_signal (void) 15 15 { 16 log_printf(FUNC,Behavioural,"get_signal","Begin"); 16 17 uint32_t depth = 0; 17 18 string separator = ",\n"; … … 19 20 20 21 21 list<Signal >::iterator i= _list_signal->begin();22 list<Signal*>::iterator i = _list_signal->begin(); 22 23 bool empty = _list_signal->empty(); 23 24 … … 30 31 if (i != _list_signal->end()) 31 32 { 32 text << tab << * i;33 text << tab << **i; 33 34 ++i; 34 35 } … … 37 38 { 38 39 text << separator; 39 text << tab << * i;40 text << tab << **i; 40 41 ++i; 41 42 } 42 43 43 if (last_separator) 44 44 text << separator; 45 45 } 46 47 log_printf(FUNC,Behavioural,"get_signal","End"); 46 48 47 49 return text.str(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_port_map.cpp
r31 r38 16 16 void * interface) 17 17 { 18 log_printf(FUNC,Behavioural,"port_map","Begin"); 18 19 _is_map = true ; 19 20 _entity_map = entity ; 20 21 _interface_map = interface; 21 22 log_printf(FUNC,Behavioural,"port_map","End"); 22 23 }; 23 24 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_print.cpp
r29 r38 15 15 morpheo::behavioural::Interface & x) 16 16 { 17 log_printf(FUNC,Behavioural,"operator<<","Begin"); 17 18 output_stream << x._name + "\t"+toString(x._localisation)+"\t"+toString(x._direction) << endl; 18 19 output_stream << x.get_comment() << endl; 19 20 output_stream << x.get_signal () << endl; 21 log_printf(FUNC,Behavioural,"operator<<","End"); 20 22 return output_stream; 21 23 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_comment.cpp
r29 r38 14 14 void Interface::set_comment (string comment) 15 15 { 16 log_printf(FUNC,Behavioural,"set_comment","Begin"); 16 17 _comment = _comment + comment; 18 log_printf(FUNC,Behavioural,"set_comment","End"); 17 19 }; 18 20 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp
r31 r38 15 15 void Interface::set_port (Vhdl * & vhdl) 16 16 { 17 log_printf(FUNC,Behavioural,"set_port (Vhdl)","Begin"); 17 18 if (not _list_signal->empty()) 18 19 { 19 list<Signal >::iterator i = _list_signal->begin();20 list<Signal*>::iterator i = _list_signal->begin(); 20 21 21 22 while (i != _list_signal->end()) 22 23 { 23 presence_port_t p = (*i) ._presence_port;24 presence_port_t p = (*i)->_presence_port; 24 25 if ((p == PORT_VHDL_YES_TESTBENCH_YES) or 25 26 (p == PORT_VHDL_YES_TESTBENCH_NO ) ) 26 vhdl->set_port ((*i) ._name,(*i)._direction,(*i)._size);27 vhdl->set_port ((*i)->_name,(*i)->_direction,(*i)->_size); 27 28 ++i; 28 29 } 29 30 } 31 log_printf(FUNC,Behavioural,"set_port (Vhdl)","End"); 30 32 }; 31 33 32 34 void Interface::set_port (Vhdl_Testbench * & vhdl_testbench) 33 35 { 36 log_printf(FUNC,Behavioural,"set_port (Testbench)","Begin"); 34 37 if (not _list_signal->empty()) 35 38 { 36 list<Signal >::iterator i = _list_signal->begin();39 list<Signal*>::iterator i = _list_signal->begin(); 37 40 38 41 while (i != _list_signal->end()) 39 42 { 40 presence_port_t p = (*i) ._presence_port;43 presence_port_t p = (*i)->_presence_port; 41 44 if ((p == PORT_VHDL_YES_TESTBENCH_YES) or 42 45 (p == PORT_VHDL_NO_TESTBENCH_YES ) ) 43 vhdl_testbench->set_port ((*i) ._name,(*i)._direction,(*i)._size);46 vhdl_testbench->set_port ((*i)->_name,(*i)->_direction,(*i)->_size); 44 47 ++i; 45 48 } 46 49 } 50 log_printf(FUNC,Behavioural,"set_port (Testbench)","End"); 47 51 }; 48 52 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp
r31 r38 12 12 namespace behavioural { 13 13 14 // string Interface::set_signal (Signal signal)15 // {16 // return set_signal(signal._name ,17 // signal._direction,18 // signal._size );19 // };20 21 14 Signal * Interface::set_signal (string name , 22 15 direction_t direction, … … 24 17 presence_port_t presence_port) 25 18 { 19 log_printf(FUNC,Behavioural,"set_signal","Begin"); 26 20 string str_direction = toString(direction); 27 21 string str_interface = _name; … … 37 31 if (name != "") 38 32 signame += "_"+str_signal; 39 33 40 34 Signal * sig = new Signal (signame , 41 35 direction , 42 36 size , 43 37 presence_port); 44 _list_signal->push_back (*sig); 38 39 _list_signal->push_back (sig); 40 41 log_printf(FUNC,Behavioural,"set_signal","End"); 45 42 46 43 return sig; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_toXML.cpp
r31 r38 14 14 XML Interface::toXML (void) 15 15 { 16 log_printf(FUNC,Behavioural,"toXML","Begin"); 17 16 18 XML xml ("interface"); 17 19 … … 25 27 if (_list_signal->empty()== false) 26 28 { 27 list<Signal >::iterator i = _list_signal->begin();29 list<Signal*>::iterator i = _list_signal->begin(); 28 30 29 31 while (i != _list_signal->end()) 30 32 { 31 xml. insert_XML ((*i) .toXML());33 xml. insert_XML ((*i)->toXML()); 32 34 ++i; 33 35 } … … 35 37 36 38 xml.balise_close (); 37 39 40 log_printf(FUNC,Behavioural,"toXML","End"); 41 38 42 return xml; 39 43 }; … … 42 46 XML Interface::toXML_mapping (void) 43 47 { 48 log_printf(FUNC,Behavioural,"toXML_mapping","Begin"); 49 44 50 if (_is_map != true) 45 51 throw (ErrorMorpheo ("Interface \""+_name+"\" is never mapped")); … … 52 58 xml. attribut ("port" ,(static_cast<Interface *>(_interface_map))->_name); 53 59 xml.singleton_end (); 60 61 log_printf(FUNC,Behavioural,"toXML_mapping","End"); 54 62 55 63 return xml; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r31 r38 13 13 Interfaces::Interfaces (void) 14 14 { 15 _list_interface = new list<Interface>; 15 log_printf(FUNC,Behavioural,"Interfaces","Begin"); 16 _list_interface = new list<Interface*>; 17 log_printf(FUNC,Behavioural,"Interfaces","End"); 16 18 }; 17 19 18 20 Interfaces::Interfaces (const Interfaces & interfaces) 19 21 { 22 log_printf(FUNC,Behavioural,"Interfaces (copy)","Begin"); 20 23 _list_interface = interfaces._list_interface; 24 log_printf(FUNC,Behavioural,"Interfaces (copy)","End"); 21 25 }; 22 26 23 27 Interfaces::~Interfaces () 24 28 { 29 log_printf(FUNC,Behavioural,"~Interfaces","Begin"); 30 31 if (_list_interface->empty()== false) 32 { 33 list<Interface*>::iterator i = _list_interface->begin(); 34 35 while (i != _list_interface->end()) 36 { 37 delete (*i); 38 ++i; 39 } 40 } 41 25 42 delete _list_interface; 43 log_printf(FUNC,Behavioural,"~Interfaces","End"); 26 44 }; 27 45 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_find_interface.cpp
r31 r38 15 15 if (_list_interface->empty()== false) 16 16 { 17 list<Interface >::iterator i = _list_interface->begin();17 list<Interface*>::iterator i = _list_interface->begin(); 18 18 19 19 while (i != _list_interface->end()) 20 20 { 21 if ((*i) ._name == name)22 return &(*i);21 if ((*i)->_name == name) 22 return (*i); 23 23 ++i; 24 24 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_get_interface.cpp
r31 r38 18 18 bool last_separator = false; 19 19 20 list<Interface >::iterator i = _list_interface->begin();20 list<Interface*>::iterator i = _list_interface->begin(); 21 21 bool empty = _list_interface->empty(); 22 22 … … 29 29 if (i != _list_interface->end()) 30 30 { 31 text << tab << * i;31 text << tab << **i; 32 32 ++i; 33 33 } … … 36 36 { 37 37 text << separator; 38 text << tab << * i;38 text << tab << **i; 39 39 ++i; 40 40 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp
r31 r38 17 17 Interface * interface = new Interface (name, direction, localisation); 18 18 19 _list_interface->push_back ( *interface);19 _list_interface->push_back (interface); 20 20 21 return interface;21 return interface; 22 22 }; 23 23 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp
r31 r38 17 17 if (not _list_interface->empty()) 18 18 { 19 list<Interface >::iterator i = _list_interface->begin();19 list<Interface*>::iterator i = _list_interface->begin(); 20 20 21 21 while (i != _list_interface->end()) 22 22 { 23 (*i) .set_port (vhdl);23 (*i)->set_port (vhdl); 24 24 ++i; 25 25 } … … 31 31 if (not _list_interface->empty()) 32 32 { 33 list<Interface >::iterator i = _list_interface->begin();33 list<Interface*>::iterator i = _list_interface->begin(); 34 34 35 35 while (i != _list_interface->end()) 36 36 { 37 (*i) .set_port (vhdl_testbench);37 (*i)->set_port (vhdl_testbench); 38 38 ++i; 39 39 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_toXML.cpp
r31 r38 17 17 if (_list_interface->empty()== false) 18 18 { 19 list<Interface >::iterator i = _list_interface->begin();19 list<Interface*>::iterator i = _list_interface->begin(); 20 20 21 21 while (i != _list_interface->end()) 22 22 { 23 xml. insert_XML ((*i) .toXML());23 xml. insert_XML ((*i)->toXML()); 24 24 ++i; 25 25 } … … 36 36 if (_list_interface->empty()== false) 37 37 { 38 list<Interface >::iterator i = _list_interface->begin();38 list<Interface*>::iterator i = _list_interface->begin(); 39 39 40 40 while (i != _list_interface->end()) 41 41 { 42 xml. insert_XML ((*i) .toXML_mapping());42 xml. insert_XML ((*i)->toXML_mapping()); 43 43 ++i; 44 44 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Position.cpp
r31 r38 14 14 Position::Position (void) 15 15 { 16 log_printf(FUNC,Behavioural,"Position","Begin"); 16 17 _list_component = new list<Entity *>; 18 log_printf(FUNC,Behavioural,"Position","End"); 17 19 }; 18 20 19 21 Position::Position (const Position & position) 20 22 { 23 log_printf(FUNC,Behavioural,"Position (copy)","Begin"); 21 24 _entity = position._entity ; 22 25 _list_component = position._list_component; 26 log_printf(FUNC,Behavioural,"Position (copy)","End"); 23 27 }; 24 28 25 29 Position::~Position () 26 30 { 31 log_printf(FUNC,Behavioural,"~Position","Begin"); 27 32 delete _entity; 33 34 // if (_list_component->empty()== false) 35 // { 36 // list<Entity *>::iterator i = _list_component->begin(); 37 38 // while (i != _list_component->end()) 39 // { 40 // delete (*i); 41 // ++i; 42 // } 43 // } 44 28 45 delete _list_component; 46 log_printf(FUNC,Behavioural,"~Position","End"); 29 47 }; 30 48 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Position_set_component.cpp
r31 r38 12 12 namespace behavioural { 13 13 14 void Position::set_component ( Entity * entity,15 uint32_t size_x,16 uint32_t size_y,17 uint32_t pos_x ,18 uint32_t pos_y )14 void Position::set_component (Position * position, 15 uint32_t pos_x , 16 uint32_t pos_y , 17 uint32_t size_x , 18 uint32_t size_y ) 19 19 { 20 Entity * entity = position->_entity; 21 20 22 _list_component->push_back(entity); 21 23 22 entity->mapping( size_x, size_y, pos_x, pos_y);24 entity->mapping( pos_x, pos_y, size_x, size_y); 23 25 }; 24 26 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
r31 r38 20 20 _presence_port (presence_port) 21 21 { 22 log_printf(FUNC,Behavioural,"Signal","Begin"); 23 #ifdef VHDL_TESTBENCH 24 _signal = NULL; 25 _type_info = UNKNOW; 26 #endif 27 log_printf(FUNC,Behavioural,"Signal","End"); 22 28 }; 23 29 … … 28 34 _presence_port (signal._presence_port) 29 35 { 36 log_printf(FUNC,Behavioural,"Signal (copy)","Begin"); 37 #ifdef VHDL_TESTBENCH 38 _signal = signal._signal ; 39 _type_info = signal._type_info; 40 #endif 41 log_printf(FUNC,Behavioural,"Signal (copy)","End"); 30 42 }; 31 43 32 44 Signal::~Signal () 33 45 { 46 log_printf(FUNC,Behavioural,"~Signal","Begin"); 47 log_printf(FUNC,Behavioural,"~Signal","End"); 34 48 }; 35 49 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_print.cpp
r29 r38 17 17 morpheo::behavioural::Signal & x) 18 18 { 19 output_stream << x._name + "\t{"+toString(x._size)+"}\t"+toString(x._direction) +"\t"+toString(x._presence_port); 19 log_printf(FUNC,Behavioural,"operator<<","Begin"); 20 21 output_stream << x._name ; 22 output_stream << "\t{" << x._size << "}\t" 23 << toString(x._direction) << "\t" 24 << toString(x._presence_port)<< endl; 25 26 log_printf(FUNC,Behavioural,"operator<<","End"); 20 27 21 28 return output_stream; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_toXML.cpp
r29 r38 13 13 XML Signal::toXML (void) 14 14 { 15 log_printf(FUNC,Behavioural,"toXML","Begin"); 16 15 17 XML xml ("signal"); 16 18 … … 20 22 xml.attribut ("size" ,toString(_size )); 21 23 xml.singleton_end (); 22 24 25 log_printf(FUNC,Behavioural,"toXML","End"); 26 23 27 return xml; 24 28 };
Note: See TracChangeset
for help on using the changeset viewer.