Changeset 31 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- May 28, 2007, 10:38:18 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 23 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r29 r31 18 18 _localisation (localisation) 19 19 { 20 _list_signal = new list<Signal>; 21 #ifdef POSITION 22 _is_map = false; 23 #endif 24 }; 25 26 Interface::Interface (const Interface & interface): 27 _name (interface._name ), 28 _direction (interface._direction ), 29 _localisation (interface._localisation) 30 { 31 _comment = interface._comment ; 32 _list_signal = interface._list_signal; 33 #ifdef POSITION 34 _is_map = interface._is_map ; 35 #endif 20 36 }; 21 37 22 38 Interface::~Interface () 23 39 { 40 delete _list_signal; 24 41 }; 25 42 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp
r29 r31 19 19 20 20 21 list<Signal>::iterator i = _list_signal .begin();22 bool empty = _list_signal .empty();21 list<Signal>::iterator i = _list_signal->begin(); 22 bool empty = _list_signal->empty(); 23 23 24 24 string tab = string(depth,'\t'); … … 28 28 { 29 29 // First 30 if (i != _list_signal .end())30 if (i != _list_signal->end()) 31 31 { 32 32 text << tab << *i; … … 34 34 } 35 35 36 while (i != _list_signal .end())36 while (i != _list_signal->end()) 37 37 { 38 38 text << separator; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp
r29 r31 15 15 void Interface::set_port (Vhdl * & vhdl) 16 16 { 17 if (not _list_signal .empty())17 if (not _list_signal->empty()) 18 18 { 19 list<Signal>::iterator i = _list_signal .begin();19 list<Signal>::iterator i = _list_signal->begin(); 20 20 21 while (i != _list_signal .end())21 while (i != _list_signal->end()) 22 22 { 23 23 presence_port_t p = (*i)._presence_port; … … 32 32 void Interface::set_port (Vhdl_Testbench * & vhdl_testbench) 33 33 { 34 if (not _list_signal .empty())34 if (not _list_signal->empty()) 35 35 { 36 list<Signal>::iterator i = _list_signal .begin();36 list<Signal>::iterator i = _list_signal->begin(); 37 37 38 while (i != _list_signal .end())38 while (i != _list_signal->end()) 39 39 { 40 40 presence_port_t p = (*i)._presence_port; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp
r29 r31 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 }; 14 // string Interface::set_signal (Signal signal) 15 // { 16 // return set_signal(signal._name , 17 // signal._direction, 18 // signal._size ); 19 // }; 21 20 22 stringInterface::set_signal (string name ,23 direction_t direction,24 uint32_t size ,25 presence_port_t presence_port)21 Signal * Interface::set_signal (string name , 22 direction_t direction, 23 uint32_t size , 24 presence_port_t presence_port) 26 25 { 27 26 string str_direction = toString(direction); … … 39 38 signame += "_"+str_signal; 40 39 41 _list_signal.push_back (Signal (signame , 42 direction , 43 size , 44 presence_port)); 40 Signal * sig = new Signal (signame , 41 direction , 42 size , 43 presence_port); 44 _list_signal->push_back (*sig); 45 45 46 return sig name;46 return sig; 47 47 }; 48 48 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_toXML.cpp
r29 r31 7 7 8 8 #include "Behavioural/include/Interface.h" 9 #include "Behavioural/include/Entity.h" 9 10 10 11 namespace morpheo { … … 15 16 XML xml ("interface"); 16 17 17 xml.balise_open_begin (" interface");18 xml.balise_open_begin ("port"); 18 19 xml. attribut ("name" ,_name ); 19 20 xml. attribut ("direction" ,toString(_direction )); … … 22 23 xml. text (get_comment()); 23 24 24 if (_list_signal .empty()== false)25 if (_list_signal->empty()== false) 25 26 { 26 list<Signal>::iterator i = _list_signal .begin();27 list<Signal>::iterator i = _list_signal->begin(); 27 28 28 while (i != _list_signal .end())29 while (i != _list_signal->end()) 29 30 { 30 31 xml. insert_XML ((*i).toXML()); … … 38 39 }; 39 40 41 #ifdef POSITION 42 XML Interface::toXML_mapping (void) 43 { 44 if (_is_map != true) 45 throw (ErrorMorpheo ("Interface \""+_name+"\" is never mapped")); 46 47 XML xml ("interface"); 48 49 xml.singleton_begin ("port_map"); 50 xml. attribut ("name" ,_name ); 51 xml. attribut ("component",(static_cast<Entity *>(_entity_map ))->_name); 52 xml. attribut ("port" ,(static_cast<Interface *>(_interface_map))->_name); 53 xml.singleton_end (); 54 55 return xml; 56 }; 57 #endif 40 58 }; // end namespace behavioural 41 59 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r29 r31 13 13 Interfaces::Interfaces (void) 14 14 { 15 _list_interface = new list<Interface>; 16 }; 17 18 Interfaces::Interfaces (const Interfaces & interfaces) 19 { 20 _list_interface = interfaces._list_interface; 15 21 }; 16 22 17 23 Interfaces::~Interfaces () 18 24 { 25 delete _list_interface; 19 26 }; 20 27 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_get_interface.cpp
r29 r31 15 15 { 16 16 uint32_t depth = 0; 17 string separator = " ,\n";17 string separator = "\n"; 18 18 bool last_separator = false; 19 19 20 21 list<Interface>::iterator i = _list_interface.begin(); 22 bool empty = _list_interface.empty(); 20 list<Interface>::iterator i = _list_interface->begin(); 21 bool empty = _list_interface->empty(); 23 22 24 23 string tab = string(depth,'\t'); … … 28 27 { 29 28 // First 30 if (i != _list_interface .end())29 if (i != _list_interface->end()) 31 30 { 32 31 text << tab << *i; … … 34 33 } 35 34 36 while (i != _list_interface .end())35 while (i != _list_interface->end()) 37 36 { 38 37 text << separator; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_print.cpp
r29 r31 12 12 namespace behavioural { 13 13 14 ostream& operator<< (ostream& output_stream ,14 ostream& operator<< (ostream& output_stream , 15 15 morpheo::behavioural::Interfaces & x) 16 16 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp
r29 r31 11 11 namespace behavioural { 12 12 13 void Interfaces::set_interface (Interface interface) 13 Interface * Interfaces::set_interface (string name , 14 direction_t direction , 15 localisation_t localisation) 14 16 { 15 _list_interface.push_back (interface); 17 Interface * interface = new Interface (name, direction, localisation); 18 19 _list_interface->push_back (*interface); 20 21 return interface; 22 }; 23 24 Interface * Interfaces::set_interface (string name , 25 direction_t direction , 26 localisation_t localisation, 27 string comment ) 28 { 29 Interface * interface = set_interface(name, direction, localisation); 30 31 interface->set_comment (comment); 32 33 return interface; 16 34 }; 17 35 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp
r29 r31 15 15 void Interfaces::set_port (Vhdl * & vhdl) 16 16 { 17 if (not _list_interface .empty())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 while (i != _list_interface .end())21 while (i != _list_interface->end()) 22 22 { 23 23 (*i).set_port (vhdl); … … 29 29 void Interfaces::set_port (Vhdl_Testbench * & vhdl_testbench) 30 30 { 31 if (not _list_interface .empty())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 while (i != _list_interface .end())35 while (i != _list_interface->end()) 36 36 { 37 37 (*i).set_port (vhdl_testbench); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_toXML.cpp
r29 r31 15 15 XML xml ("interfaces"); 16 16 17 // xml.balise_open ("interfaces"); 17 if (_list_interface->empty()== false) 18 { 19 list<Interface>::iterator i = _list_interface->begin(); 18 20 19 if (_list_interface.empty()== false) 20 { 21 list<Interface>::iterator i = _list_interface.begin(); 22 23 while (i != _list_interface.end()) 21 while (i != _list_interface->end()) 24 22 { 25 23 xml. insert_XML ((*i).toXML()); … … 27 25 } 28 26 } 29 30 // xml.balise_close ();31 27 32 28 return xml; 33 29 }; 34 30 31 #ifdef POSITION 32 XML Interfaces::toXML_mapping (void) 33 { 34 XML xml ("interfaces"); 35 36 if (_list_interface->empty()== false) 37 { 38 list<Interface>::iterator i = _list_interface->begin(); 39 40 while (i != _list_interface->end()) 41 { 42 xml. insert_XML ((*i).toXML_mapping()); 43 ++i; 44 } 45 } 46 47 return xml; 48 }; 49 #endif 35 50 }; // end namespace behavioural 36 51 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
r29 r31 21 21 { 22 22 }; 23 23 24 Signal::Signal (const Signal & signal): 25 _name (signal._name ), 26 _direction (signal._direction ), 27 _size (signal._size ), 28 _presence_port (signal._presence_port) 29 { 30 }; 31 24 32 Signal::~Signal () 25 33 { 26 34 }; 27 28 35 29 36 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp
r3 r31 14 14 _name (name) 15 15 { 16 _filename_extension="xml"; 16 17 }; 17 18 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp
r3 r31 18 18 19 19 string name = _name; 20 string filename = name + ". xml";20 string filename = name + "." + _filename_extension; 21 21 22 22 cout << "Generate file \""<< filename << "\"" << endl;
Note: See TracChangeset
for help on using the changeset viewer.