- Timestamp:
- May 28, 2007, 10:38:18 PM (18 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo
- Files:
-
- 26 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/configuration.cfg
r29 r31 1 1 Select_Priority_Fixed 2 1616 *2 # nb_entity3 0 0+1 # encoding_one_hot2 2 16 *2 # nb_entity 3 0 1 +1 # encoding_one_hot 4 4 1 1 +1 # encoding_compact -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h
r29 r31 19 19 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h" 20 20 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h" 21 #ifdef POSITION 22 #include "Behavioural/include/Position.h" 23 #else 21 24 #include "Behavioural/include/Interfaces.h" 25 #endif 22 26 23 27 #ifdef STATISTICS … … 62 66 #endif 63 67 64 private : Interfaces * interfaces; 68 #ifdef POSITION 69 private : Position * _position; 70 #endif 71 72 private : Interfaces * _interfaces; 65 73 66 74 #ifdef SYSTEMC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp
r29 r31 9 9 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h" 10 10 11 namespace morpheo 11 namespace morpheo{ 12 12 namespace behavioural { 13 13 namespace generic { … … 21 21 log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin"); 22 22 23 interfaces = new Interfaces; 23 #ifdef POSITION 24 _position = new Position (); 25 26 Entity * entity = _position->set_entity (_name , 27 "Select_Priority_Fixed", 28 COMBINATORY ); 29 30 _interfaces = entity->set_interfaces(); 31 #else 32 _interfaces = new Interfaces(); 33 #endif 24 34 25 35 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 Interface interface_ ("", IN, WEST);27 28 in_CLOCK = interface_.set_signal_clk ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO);29 in_NRESET = interface_.set_signal_in <Tcontrol_t> ("nreset",1);30 36 37 Interface * interface_ = _interfaces->set_interface("" , 38 IN , 39 WEST, 40 "..."); 41 42 in_CLOCK = interface_->set_signal_clk ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO); 43 in_NRESET = interface_->set_signal_in <Tcontrol_t> ("nreset",1); 31 44 in_VAL = new SC_IN (Tcontrol_t) * [_param._nb_entity]; 32 45 if (_param._encoding_one_hot) … … 35 48 for (uint32_t i=0; i<_param._nb_entity; i++) 36 49 { 37 in_VAL [i] = interface_ .set_signal_in <Tcontrol_t> ("val_"+toString(i),1);50 in_VAL [i] = interface_->set_signal_in <Tcontrol_t> ("val_"+toString(i),1); 38 51 if (_param._encoding_one_hot) 39 out_ACK [i] = interface_ .set_signal_out <Tcontrol_t> ("ack_"+toString(i),1);52 out_ACK [i] = interface_->set_signal_out <Tcontrol_t> ("ack_"+toString(i),1); 40 53 } 41 54 42 55 if (_param._encoding_compact) 43 56 { 44 out_ENTITY = interface_ .set_signal_out <Tentity_t > ("entity" , _param._size_entity);45 out_ENTITY_ACK = interface_ .set_signal_out <Tcontrol_t> ("entity_ack", 1);57 out_ENTITY = interface_->set_signal_out <Tentity_t > ("entity" , _param._size_entity); 58 out_ENTITY_ACK = interface_->set_signal_out <Tcontrol_t> ("entity_ack", 1); 46 59 } 47 60 48 61 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 63 #ifdef POSITION 64 _position->generate_file(); 65 #endif 49 66 50 67 log_printf(FUNC,Select_Priority_Fixed,"allocation","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp
r29 r31 40 40 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 41 42 delete interfaces; 43 42 #ifdef POSITION 43 delete _position; 44 #else 45 delete _interfaces; 46 #endif 44 47 log_printf(FUNC,Select_Priority_Fixed,"deallocation","End"); 45 48 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_port.cpp
r29 r31 20 20 21 21 #ifdef VHDL 22 interfaces->set_port(vhdl);22 _interfaces->set_port(vhdl); 23 23 #endif 24 24 #ifdef VHDL_TESTBENCH 25 interfaces->set_port(_vhdl_testbench);25 _interfaces->set_port(_vhdl_testbench); 26 26 _vhdl_testbench->set_clock ("in_CLOCK",true); 27 27 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
r23 r31 125 125 $(DIR_CFG_USER)/*~ \ 126 126 *.vhdl \ 127 *.pos \ 127 128 *.stat \ 128 129 generated_by_systemcass \ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Direction.h
r25 r31 1 #ifdef VHDL2 3 1 #ifndef morpheo_behavioural_Direction_h 4 2 #define morpheo_behavioural_Direction_h … … 13 11 }; // end namespace behavioural 14 12 15 template<>inline std::string toString<morpheo::behavioural::direction_t>(const morpheo::behavioural::direction_t& x)16 {17 switch (x)18 {19 case morpheo::behavioural::IN : return "in" ; break;20 case morpheo::behavioural::OUT : return "out" ; break;21 case morpheo::behavioural::INOUT : return "inout" ; break;22 default : return "" ; break;23 }24 }25 13 template<> inline std::string toString<morpheo::behavioural::direction_t>(const morpheo::behavioural::direction_t& x) 14 { 15 switch (x) 16 { 17 case morpheo::behavioural::IN : return "in" ; break; 18 case morpheo::behavioural::OUT : return "out" ; break; 19 case morpheo::behavioural::INOUT : return "inout" ; break; 20 default : return "" ; break; 21 } 22 } 23 26 24 }; // end namespace morpheo 27 25 28 26 #endif 29 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
r29 r31 26 26 #endif 27 27 #include "Include/ToString.h" 28 #include "Include/ErrorMorpheo.h" 28 29 #include "Include/Debug.h" 29 30 … … 35 36 class Interface 36 37 { 38 friend class Interfaces; 39 37 40 // -----[ fields ]---------------------------------------------------- 38 41 private : const string _name ; … … 40 43 private : const localisation_t _localisation ; 41 44 private : string _comment ; 42 private : list<Signal> _list_signal ; 45 46 #ifdef POSITION 47 private : bool _is_map ; 48 private : void * _entity_map ; // Entity -> erreur cyclique 49 private : void * _interface_map; // pour être homogène avec _entity_map 50 #endif 51 private : list<Signal> * _list_signal ; 43 52 44 53 // -----[ methods ]--------------------------------------------------- … … 47 56 localisation_t localisation); 48 57 58 public : Interface (const Interface & interface); 49 59 public : ~Interface (); 50 60 51 61 public : void set_comment (string comment); 52 p ublic: string get_comment (void );62 private : string get_comment (void ); 53 63 54 p ublic : string set_signal (Signal signal);55 public : stringset_signal (string name ,64 private : string get_signal (void); 65 public : Signal * set_signal (string name , 56 66 direction_t direction, 57 67 uint32_t size , … … 63 73 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES) 64 74 { 65 string str= set_signal (name, IN , size, presence_port);66 sc_in_clk * signal = new sc_in_clk (s tr.c_str());75 Signal * sig = set_signal (name, IN , size, presence_port); 76 sc_in_clk * signal = new sc_in_clk (sig->_name.c_str()); 67 77 return signal; 68 78 }; … … 73 83 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES) 74 84 { 75 string str= set_signal (name, IN , size, presence_port);76 sc_in <T> * signal = new sc_in <T> (s tr.c_str());85 Signal * sig = set_signal (name, IN , size, presence_port); 86 sc_in <T> * signal = new sc_in <T> (sig->_name.c_str()); 77 87 return signal; 78 88 }; … … 83 93 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES) 84 94 { 85 string str= set_signal (name, OUT , size, presence_port);86 sc_out <T> * signal = new sc_out <T> (s tr.c_str());95 Signal * sig = set_signal (name, OUT , size, presence_port); 96 sc_out <T> * signal = new sc_out <T> (sig->_name.c_str()); 87 97 return signal; 88 98 }; 89 99 #endif 90 91 public : string get_signal (void);92 100 93 101 #ifdef VHDL … … 98 106 #endif 99 107 108 #ifdef POSITION 109 public : void port_map (void * entity, 110 void * interface); 111 #endif 112 100 113 public : XML toXML (void); 101 114 #ifdef POSITION 115 public : XML toXML_mapping (void); 116 #endif 102 117 public : friend ostream& operator<< (ostream& output_stream, 103 118 morpheo::behavioural::Interface & x); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
r29 r31 30 30 { 31 31 // -----[ fields ]---------------------------------------------------- 32 private : list<Interface> 32 private : list<Interface> * _list_interface; 33 33 34 34 // -----[ methods ]--------------------------------------------------- 35 35 public : Interfaces (void); 36 36 public : Interfaces (const Interfaces & interfaces); 37 37 public : ~Interfaces (); 38 38 39 public : void set_interface (Interface interface); 40 public : string get_interface (void); 39 public : Interface * set_interface (string name , 40 direction_t direction , 41 localisation_t localisation); 42 public : Interface * set_interface (string name , 43 direction_t direction , 44 localisation_t localisation, 45 string comment ); 46 private : string get_interface (void); 41 47 42 48 #ifdef VHDL … … 47 53 #endif 48 54 55 public : Interface * find_interface (string name); 56 49 57 public : XML toXML (void); 50 58 #ifdef POSITION 59 public : XML toXML_mapping (void); 60 #endif 51 61 public : friend ostream& operator<< (ostream& output_stream, 52 62 morpheo::behavioural::Interfaces & x); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Localisation.h
r29 r31 1 #ifdef VHDL2 3 1 #ifndef morpheo_behavioural_Localisation_h 4 2 #define morpheo_behavioural_Localisation_h … … 28 26 29 27 #endif 30 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r29 r31 28 28 class Signal 29 29 { 30 friend class Interface; 31 30 32 // -----[ fields ]---------------------------------------------------- 31 p ublic: const string _name ;32 p ublic: const direction_t _direction ;33 p ublic: const uint32_t _size ;34 p ublic: const presence_port_t _presence_port;33 private : const string _name ; 34 private : const direction_t _direction ; 35 private : const uint32_t _size ; 36 private : const presence_port_t _presence_port; 35 37 36 38 // -----[ methods ]--------------------------------------------------- … … 39 41 uint32_t size , 40 42 presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES); 43 public : Signal (const Signal &); 41 44 public : ~Signal (); 42 45 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h
r29 r31 24 24 { 25 25 // -----[ fields ]---------------------------------------------------- 26 private : const string _name ; 27 private : string _body ; 28 private : list<string> _list_balise_name; 26 private : const string _name ; 27 private : string _filename_extension; 28 private : string _body ; 29 private : list<string> _list_balise_name ; 29 30 30 31 // -----[ methods ]--------------------------------------------------- … … 42 43 public : bool insert_XML (XML xml ); 43 44 45 public : void filename_extension (string extension); 44 46 public : void generate_file (void); 45 47 public : void generate_file (string encoding); -
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; -
trunk/IPs/systemC/processor/Morpheo/Include/Types.h
r2 r31 35 35 #define SC_CLOCK sc_in_clk 36 36 #define SC_INTERNAL(type) type 37 #define SC_REGISTER(type) sc_signal<type > 37 38 #define SC_SIGNAL(type) sc_signal<type > 38 #define SC_REGISTER(type) sc_signal<type >39 39 #define SC_IN(type) sc_in <type > 40 40 #define SC_OUT(type) sc_out <type >
Note: See TracChangeset
for help on using the changeset viewer.