Changeset 75 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Timestamp:
- Jan 31, 2008, 6:46:41 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Files:
-
- 1 added
- 36 deleted
- 72 edited
- 9 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h
r71 r75 27 27 #include "Behavioural/include/Component.h" 28 28 29 using namespace std;30 31 29 namespace morpheo { 32 30 namespace behavioural { … … 41 39 // -----[ fields ]---------------------------------------------------- 42 40 // Parameters 43 protected : const st ring _name;41 protected : const std::string _name; 44 42 45 43 protected : const Parameters _param; 46 44 47 45 #ifdef STATISTICS 48 p rivate: Stat * _stat;46 public : Stat * _stat; 49 47 #endif 50 48 … … 75 73 public : Counter (sc_module_name name, 76 74 #else 77 public : Counter (st ringname,75 public : Counter (std::string name, 78 76 #endif 79 77 #ifdef STATISTICS … … 96 94 #ifdef STATISTICS 97 95 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 98 public : string statistics_print (uint32_t depth);99 96 #endif 100 97 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Parameters.h
r44 r75 32 32 public : ~Parameters () ; 33 33 34 public : string msg_error (void); 35 36 public : string print (uint32_t depth); 37 public : friend ostream& operator<< (ostream& output_stream, 38 morpheo::behavioural::generic::counter::Parameters & x); 34 public : std::string msg_error (void); 35 public : std::string print (uint32_t depth); 36 public : friend std::ostream& operator<< (std::ostream& output_stream, 37 morpheo::behavioural::generic::counter::Parameters & x); 39 38 }; 40 39 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_allocation.cpp
r42 r75 17 17 void Counter::allocation (void) 18 18 { 19 string rename;20 21 19 log_printf(FUNC,Counter,"allocation","Begin"); 22 20 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_declaration.cpp
r71 r75 20 20 log_printf(FUNC,Counter,FUNCTION,"Begin"); 21 21 22 _stat = new Stat (static_cast<st ring>(_name),22 _stat = new Stat (static_cast<std::string>(_name), 23 23 "Counter", 24 24 param_statistics); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_vhdl_body.cpp
r42 r75 21 21 for (uint32_t i=0; i<_param._nb_port; i++) 22 22 { 23 st ring counter_inc, counter_dec;23 std::string counter_inc, counter_dec; 24 24 25 25 if (_param._size_data > 1) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_msg_error.cpp
r2 r75 9 9 #include "Behavioural/Generic/Counter/include/Types.h" 10 10 #include <sstream> 11 using namespace std;12 11 13 12 namespace morpheo { … … 17 16 18 17 19 st ring Parameters::msg_error(void)18 std::string Parameters::msg_error(void) 20 19 { 21 20 log_printf(FUNC,Counter,"msg_error","Begin"); 22 21 23 st ring msg = "";22 std::string msg = ""; 24 23 25 24 if (_size_data < 1) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_print.cpp
r3 r75 8 8 #include "Behavioural/Generic/Counter/include/Parameters.h" 9 9 #include "Behavioural/include/XML.h" 10 using namespace std;11 10 12 11 namespace morpheo { … … 16 15 17 16 18 st ring Parameters::print (uint32_t depth)17 std::string Parameters::print (uint32_t depth) 19 18 { 20 19 log_printf(FUNC,Counter,"print","Begin"); … … 36 35 }; 37 36 38 ostream& operator<< (ostream& output_stream ,39 37 std::ostream& operator<< (std::ostream& output_stream , 38 morpheo::behavioural::generic::counter::Parameters & x) 40 39 { 41 40 output_stream << x.print(0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Parameters.h
r67 r75 32 32 public : ~Parameters () ; 33 33 34 public : string msg_error(void);34 public : std::string msg_error (void); 35 35 36 public : st ring print (uint32_t depth);37 public : friend ostream& operator<< (ostream& output_stream,38 36 public : std::string print (uint32_t depth); 37 public : friend std::ostream& operator<< (std::ostream& output_stream, 38 morpheo::behavioural::generic::queue::Parameters & x); 39 39 }; 40 40 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Queue.h
r67 r75 22 22 #include "Behavioural/Generic/Queue/include/Parameters.h" 23 23 #ifdef STATISTICS 24 #include "Behavioural/ Generic/Queue/include/Statistics.h"24 #include "Behavioural/include/Stat.h" 25 25 #endif 26 26 #include "Behavioural/include/Component.h" … … 29 29 #endif 30 30 #include "Behavioural/include/Usage.h" 31 32 using namespace std;33 using namespace morpheo::behavioural::generic::queue_control;34 31 35 32 namespace morpheo { … … 46 43 // -----[ fields ]---------------------------------------------------- 47 44 // Parameters 48 protected : const st ring _name;45 protected : const std::string _name; 49 46 protected : const Parameters * _param; 50 47 private : const Tusage_t _usage; … … 55 52 56 53 #ifdef STATISTICS 57 p rivate : Statistics* _stat;54 public : Stat * _stat; 58 55 #endif 59 56 … … 99 96 sc_module_name name, 100 97 #else 101 st ringname,98 std::string name, 102 99 #endif 103 100 #ifdef STATISTICS … … 116 113 public : void genMoore (void); 117 114 #endif 115 118 116 #ifdef STATISTICS 119 public : string statistics (uint32_t depth);117 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 120 118 #endif 121 119 … … 125 123 private : void vhdl_body (Vhdl * & vhdl); 126 124 #endif 127 128 #if def VHDL_TESTBENCH129 private : void vhdl_testbench_transition(void);125 126 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 127 private : void end_cycle (void); 130 128 #endif 131 129 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Parameters_msg_error.cpp
r67 r75 9 9 #include "Behavioural/Generic/Queue/include/Parameters.h" 10 10 #include <sstream> 11 using namespace std;12 13 11 namespace morpheo { 14 12 namespace behavioural { … … 19 17 #undef FUNCTION 20 18 #define FUNCTION "Queue::msg_error" 21 st ring Parameters::msg_error(void)19 std::string Parameters::msg_error(void) 22 20 { 23 21 log_printf(FUNC,Queue,FUNCTION,"Begin"); 24 22 25 st ring msg = "";23 std::string msg = ""; 26 24 27 25 return msg; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Parameters_print.cpp
r67 r75 8 8 #include "Behavioural/Generic/Queue/include/Parameters.h" 9 9 #include "Behavioural/include/XML.h" 10 using namespace std;11 10 12 11 namespace morpheo { … … 18 17 #undef FUNCTION 19 18 #define FUNCTION "Queue::print" 20 st ring Parameters::print (uint32_t depth)19 std::string Parameters::print (uint32_t depth) 21 20 { 22 21 log_printf(FUNC,Queue,FUNCTION,"Begin"); … … 36 35 #undef FUNCTION 37 36 #define FUNCTION "Queue::operator<<" 38 ostream& operator<< (ostream& output_stream ,39 37 std::ostream& operator<< (std::ostream& output_stream , 38 morpheo::behavioural::generic::queue::Parameters & x) 40 39 { 41 40 log_printf(FUNC,Queue,FUNCTION,"Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue.cpp
r68 r75 32 32 ,_param (param) 33 33 ,_usage (usage) 34 // #ifdef STATISTICS35 // ,_param_statistics (param_statistics)36 // #endif37 34 { 38 35 log_printf(FUNC,Queue,FUNCTION,"Begin"); … … 46 43 log_printf(INFO,Queue,FUNCTION,"Allocation of statistics"); 47 44 48 // Allocation of statistics 49 _stat = new Statistics (static_cast<string>(_name), 50 param_statistics , 51 param); 45 statistics_declaration(param_statistics); 52 46 } 53 47 #endif … … 102 96 log_printf(INFO,Queue,FUNCTION,"Generate Statistics file"); 103 97 104 _stat->generate_file(statistics(0));105 98 delete _stat; 106 99 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_allocation.cpp
r68 r75 19 19 void Queue::allocation (void) 20 20 { 21 string rename;22 23 21 log_printf(FUNC,Queue,FUNCTION,"Begin"); 24 22 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_statistics_declaration.cpp
r67 r75 14 14 namespace queue { 15 15 16 17 16 #undef FUNCTION 18 #define FUNCTION "Queue::statistics "19 string Queue::statistics (uint32_t depth)17 #define FUNCTION "Queue::statistics_declaration" 18 void Queue::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics) 20 19 { 21 20 log_printf(FUNC,Queue,FUNCTION,"Begin"); 22 21 23 string txt = _stat->print(depth); 22 _stat = new Stat (static_cast<std::string>(_name), 23 "Queue", 24 param_statistics); 24 25 25 26 log_printf(FUNC,Queue,FUNCTION,"End"); 26 27 return txt;28 27 }; 29 28 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_transition.cpp
r67 r75 53 53 } 54 54 55 #ifdef STATISTICS 56 _stat->add(); 57 #endif 58 59 #ifdef VHDL_TESTBENCH 60 vhdl_testbench_transition (); 55 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 56 end_cycle (); 61 57 #endif 62 58 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/include/Queue_Control.h
r56 r75 16 16 #include "Common/include/Debug.h" 17 17 18 using namespace std;19 20 18 namespace morpheo { 21 19 namespace behavioural { … … 27 25 private : const uint32_t _nb_elt_max; 28 26 private : uint32_t _nb_elt; 29 private : vector<uint32_t> * _tab;27 private : std::vector<uint32_t> * _tab; 30 28 31 29 public : Queue_Control (uint32_t nb_elt_max); … … 45 43 46 44 public : uint32_t operator[] (uint32_t); 47 public : ostream& operator<< (ostream& output_stream);45 public : std::ostream& operator<< (std::ostream& output_stream); 48 46 }; 49 47 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/src/Queue_Control.cpp
r56 r75 13 13 log_printf(FUNC,Queue_Control,FUNCTION,"Begin"); 14 14 15 _tab = new vector<uint32_t>;15 _tab = new std::vector<uint32_t>; 16 16 17 17 log_printf(FUNC,Queue_Control,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/src/Queue_Control_operator.cpp
r56 r75 8 8 #undef FUNCTION 9 9 #define FUNCTION "Queue_Control::operator<<" 10 ostream& Queue_Control::operator<< (ostream& output_stream)10 std::ostream& Queue_Control::operator<< (std::ostream& output_stream) 11 11 { 12 12 log_printf(FUNC,Queue_Control,FUNCTION,"Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h
r62 r75 37 37 public : ~Parameters () ; 38 38 39 public : string msg_error (void); 40 41 public : string print (uint32_t depth); 42 public : friend ostream& operator<< (ostream& output_stream, 43 morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters & x); 39 public : std::string msg_error (void); 40 public : std::string print (uint32_t depth); 41 public : friend std::ostream& operator<< (std::ostream& output_stream, 42 morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters & x); 44 43 }; 45 44 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h
r71 r75 16 16 #include "Common/include/ToString.h" 17 17 #include <iostream> 18 using namespace std;19 18 20 19 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h" … … 28 27 #endif 29 28 #include "Behavioural/include/Usage.h" 30 31 using namespace std;32 29 33 30 namespace morpheo { … … 46 43 // -----[ fields ]---------------------------------------------------- 47 44 // Parameters 48 protected : const st ring _name;45 protected : const std::string _name; 49 46 protected : const Parameters * _param; 50 47 private : const Tusage_t _usage; 51 48 52 49 #ifdef STATISTICS 53 p rivate: Stat * _stat;50 public : Stat * _stat; 54 51 55 52 private : counter_t * _stat_nb_read; … … 106 103 sc_module_name name 107 104 #else 108 st ring name105 std::string name 109 106 #endif 110 107 #ifdef STATISTICS … … 128 125 #ifdef STATISTICS 129 126 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 130 public : string statistics_print (uint32_t depth);131 127 #endif 132 128 … … 137 133 #endif 138 134 135 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 139 136 private : void end_cycle (void); 140 137 #endif 141 138 }; 142 139 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_msg_error.cpp
r62 r75 10 10 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h" 11 11 #include <sstream> 12 using namespace std;13 12 14 13 namespace morpheo { … … 18 17 namespace registerfile_monolithic { 19 18 20 st ring Parameters::msg_error(void)19 std::string Parameters::msg_error(void) 21 20 { 22 st ring msg = "";21 std::string msg = ""; 23 22 24 23 if ((8*sizeof(Tdata_t)) < _size_word) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_print.cpp
r55 r75 8 8 #include <stdint.h> 9 9 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h" 10 #include <sstream> 11 using namespace std; 10 #include "Behavioural/include/XML.h" 12 11 13 12 namespace morpheo { … … 17 16 namespace registerfile_monolithic { 18 17 19 st ring Parameters::print (uint32_t depth)18 std::string Parameters::print (uint32_t depth) 20 19 { 21 string tab = string(depth,'\t');22 ostringstream msg; 23 msg << tab << "<registerfile_monolithic>" << endl24 << tab << "\t<nb_port_read value=\"" << _nb_port_read << "\" />" << endl 25 << tab << "\t<nb_port_write value=\"" << _nb_port_write << "\" />" << endl 26 << tab << "\t<nb_port_read_write value=\"" << _nb_port_read_write << "\" />" << endl 27 << tab << "\t<nb_word value=\"" << _nb_word << "\" />" << endl 28 << tab << "\t<size_word value=\"" << _size_word << "\" />" << endl 29 << tab << "</registerfile_monolithic>" << endl;30 31 return msg.str();20 XML xml ("registerfile_monolithic"); 21 22 xml.balise_open("registerfile_monolithic"); 23 xml.singleton_begin("nb_port_read "); xml.attribut("value",toString(_nb_port_read )); xml.singleton_end(); 24 xml.singleton_begin("nb_port_write "); xml.attribut("value",toString(_nb_port_write )); xml.singleton_end(); 25 xml.singleton_begin("nb_port_read_write"); xml.attribut("value",toString(_nb_port_read_write)); xml.singleton_end(); 26 xml.singleton_begin("nb_word "); xml.attribut("value",toString(_nb_word )); xml.singleton_end(); 27 xml.singleton_begin("size_word "); xml.attribut("value",toString(_size_word )); xml.singleton_end(); 28 xml.balise_close(); 29 30 return xml.get_body(depth); 32 31 }; 33 32 34 ostream& operator<< (ostream& output_stream ,35 33 std::ostream& operator<< (std::ostream& output_stream , 34 morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters & x) 36 35 { 37 36 output_stream << x.print(0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp
r71 r75 19 19 sc_module_name name, 20 20 #else 21 st ring name ,21 std::string name , 22 22 #endif 23 23 #ifdef STATISTICS … … 37 37 38 38 #ifdef STATISTICS 39 statistics_declaration(param_statistics); 39 if (_usage & USE_STATISTICS) 40 statistics_declaration(param_statistics); 40 41 #endif 41 42 … … 102 103 #ifdef STATISTICS 103 104 if (_usage & USE_STATISTICS) 104 { 105 delete _stat; 106 } 105 delete _stat; 107 106 #endif 108 107 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp
r62 r75 124 124 for (uint32_t i=0; i<_param->_nb_word; i++) 125 125 { 126 st ring rename = "reg_DATA[" + toString(i) + "]";126 std::string rename = "reg_DATA[" + toString(i) + "]"; 127 127 reg_DATA [i] = new SC_REGISTER (Tdata_t) (rename.c_str()); 128 128 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_end_cycle.cpp
r71 r75 1 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 1 2 /* 2 3 * $Id$ … … 37 38 }; // end namespace behavioural 38 39 }; // end namespace morpheo 40 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_declaration.cpp
r71 r75 17 17 void RegisterFile_Monolithic::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics) 18 18 { 19 _stat = new Stat (static_cast<st ring>(_name),19 _stat = new Stat (static_cast<std::string>(_name), 20 20 "RegisterFile_Monolithic", 21 21 param_statistics); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp
r71 r75 79 79 #endif 80 80 81 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 81 82 end_cycle(); 82 83 #endif 83 84 log_printf(FUNC,RegisterFile,"transition","End"); 84 85 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp
r62 r75 38 38 for (uint32_t i = 0; i < _param->_nb_port_read; i++) 39 39 { 40 st ring str_address;40 std::string str_address; 41 41 if (_param->_have_port_address) 42 42 str_address = "conv_integer(in_READ_"+toString(i)+"_ADDRESS)"; … … 48 48 for (uint32_t i = 0; i < _param->_nb_port_read_write; i++) 49 49 { 50 st ring str_address;50 std::string str_address; 51 51 if (_param->_have_port_address) 52 52 str_address = "conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)"; … … 68 68 for (uint32_t i = 0; i < _param->_nb_port_write; i++) 69 69 { 70 st ring str_address;70 std::string str_address; 71 71 if (_param->_have_port_address) 72 72 str_address = "conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)"; … … 80 80 for (uint32_t i = 0; i < _param->_nb_port_read_write; i++) 81 81 { 82 st ring str_address;82 std::string str_address; 83 83 if (_param->_have_port_address) 84 84 str_address = "conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)"; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h
r62 r75 10 10 11 11 #include "Common/include/Debug.h" 12 #include "Common/include/FromString.h"13 12 #include "Behavioural/include/Parameters.h" 14 13 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h" … … 16 15 17 16 namespace morpheo { 18 typedef enum {PARTIAL_CROSSBAR,19 FULL_CROSSBAR } Tcrossbar_t;20 21 template<> inline Tcrossbar_t fromString<Tcrossbar_t> (const std::string& x)22 {23 if ( (x.compare("0") == 0) or24 (x.compare("PARTIAL_CROSSBAR") == 0))25 return PARTIAL_CROSSBAR;26 if ( (x.compare("1") == 0) or27 (x.compare("FULL_CROSSBAR" ) == 0))28 return FULL_CROSSBAR;29 30 throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));31 };32 33 template<> inline std::string toString<Tcrossbar_t> (const Tcrossbar_t& x)34 {35 ostringstream out;36 37 if (x == PARTIAL_CROSSBAR)38 out << "PARTIAL_CROSSBAR";39 if (x == FULL_CROSSBAR)40 out << "FULL_CROSSBAR";41 42 return out.str();43 };44 45 17 namespace behavioural { 46 18 namespace generic { … … 92 64 public : ~Parameters () ; 93 65 94 public : string msg_error (void); 95 96 public : string print (uint32_t depth); 97 public : friend ostream& operator<< (ostream& output_stream, 98 morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x); 66 public : std::string msg_error (void); 67 public : std::string print (uint32_t depth); 68 public : friend std::ostream& operator<< (std::ostream& output_stream, 69 morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x); 99 70 }; 100 71 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h
r57 r75 20 20 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h" 21 21 #ifdef STATISTICS 22 #include "Behavioural/ Generic/RegisterFile/RegisterFile_Multi_Banked/include/Statistics.h"22 #include "Behavioural/include/Stat.h" 23 23 #endif 24 24 #include "Behavioural/include/Component.h" … … 26 26 #include "Behavioural/include/Vhdl.h" 27 27 #endif 28 29 using namespace std;30 28 31 29 namespace morpheo { … … 43 41 // -----[ fields ]---------------------------------------------------- 44 42 // Parameters 45 protected : const st ring _name;43 protected : const std::string _name; 46 44 47 45 protected : const Parameters * _param; 48 //#ifdef STATISTICS49 // protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;50 //#endif51 46 52 47 #ifdef STATISTICS 53 p rivate : Statistics* _stat;48 public : Stat * _stat; 54 49 #endif 55 50 … … 100 95 sc_module_name name, 101 96 #else 102 st ringname,97 std::string name, 103 98 #endif 104 99 #ifdef STATISTICS … … 113 108 private : void deallocation (void); 114 109 115 //#if defined(STATISTICS) or defined(VHDL_TESTBENCH)116 117 110 private : Taddress_t address_bank (Taddress_t address); 118 111 private : Taddress_t address_num_reg (Taddress_t address); … … 129 122 public : void partial_crossbar_genMealy_read (void); 130 123 public : void partial_crossbar_genMealy_write(void); 131 132 //#endif133 124 #endif 134 #ifdef STATISTICS135 public : string statistics (uint32_t depth);136 #endif137 125 138 126 #if VHDL … … 142 130 #endif 143 131 144 #ifdef VHDL_TESTBENCH 145 private : void vhdl_testbench_transition (void); 132 #ifdef STATISTICS 133 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 134 #endif 135 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 136 private : void end_cycle (void); 146 137 #endif 147 138 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h
r57 r75 10 10 11 11 #include "Behavioural/include/Types.h" 12 12 #include "Common/include/ToString.h" 13 #include "Common/include/FromString.h" 13 14 namespace morpheo { 14 15 namespace behavioural { … … 23 24 }; // end namespace registerfile 24 25 }; // end namespace generic 26 }; // end namespace behavioural 25 27 26 }; // end namespace behavioural 28 typedef enum {PARTIAL_CROSSBAR, 29 FULL_CROSSBAR } Tcrossbar_t; 30 31 template<> inline Tcrossbar_t fromString<Tcrossbar_t> (const std::string& x) 32 { 33 if ( (x.compare("0") == 0) or 34 (x.compare("PARTIAL_CROSSBAR") == 0)) 35 return PARTIAL_CROSSBAR; 36 if ( (x.compare("1") == 0) or 37 (x.compare("FULL_CROSSBAR" ) == 0)) 38 return FULL_CROSSBAR; 39 40 throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\"")); 41 }; 42 43 template<> inline std::string toString<Tcrossbar_t> (const Tcrossbar_t& x) 44 { 45 std::ostringstream out; 46 47 if (x == PARTIAL_CROSSBAR) 48 out << "PARTIAL_CROSSBAR"; 49 if (x == FULL_CROSSBAR) 50 out << "FULL_CROSSBAR"; 51 52 return out.str(); 53 }; 54 55 27 56 }; // end namespace morpheo 28 57 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/Parameters_msg_error.cpp
r53 r75 7 7 8 8 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h" 9 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h"10 #include <sstream>11 using namespace std;12 9 13 10 namespace morpheo { … … 18 15 19 16 20 st ring Parameters::msg_error(void)17 std::string Parameters::msg_error(void) 21 18 { 22 19 log_printf(FUNC,RegisterFile_Multi_Banked,"msg_error","Begin"); 23 20 24 st ring msg = "";21 std::string msg = ""; 25 22 26 23 if (_nb_port_read < _nb_port_read_by_bank) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/Parameters_print.cpp
r53 r75 8 8 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h" 9 9 #include "Behavioural/include/XML.h" 10 using namespace std;11 10 12 11 namespace morpheo { … … 17 16 18 17 19 st ring Parameters::print (uint32_t depth)18 std::string Parameters::print (uint32_t depth) 20 19 { 21 20 log_printf(FUNC,RegisterFile_Multi_Banked,"print","Begin"); … … 46 45 }; 47 46 48 ostream& operator<< (ostream& output_stream ,49 47 std::ostream& operator<< (std::ostream& output_stream , 48 morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x) 50 49 { 51 50 output_stream << x.print(0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked.cpp
r67 r75 26 26 _name (name) 27 27 ,_param (param) 28 // #ifdef STATISTICS29 // ,_param_statistics (param_statistics)30 // #endif31 28 { 32 29 log_printf(FUNC,RegisterFile_Multi_Banked,"RegisterFile_Multi_Banked","Begin"); … … 42 39 43 40 // Allocation of statistics 44 _stat = new Statistics (static_cast<string>(_name), 45 param_statistics , 46 param); 41 statistics_declaration(param_statistics); 47 42 #endif 48 43 … … 142 137 #ifdef STATISTICS 143 138 log_printf(INFO,RegisterFile_Multi_Banked,"~RegisterFile_Multi_Banked","Generate Statistics file"); 144 145 _stat->generate_file(statistics(0));146 139 147 140 delete _stat; … … 160 153 }; // end namespace registerfile 161 154 }; // end namespace generic 162 163 155 }; // end namespace behavioural 164 156 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_allocation.cpp
r62 r75 18 18 void RegisterFile_Multi_Banked::allocation (void) 19 19 { 20 string rename;21 22 20 log_printf(FUNC,RegisterFile_Multi_Banked,"allocation","Begin"); 23 21 … … 27 25 ,"RegisterFile_Multi_Banked" 28 26 #ifdef POSITION 29 ,R egister27 ,REGISTER 30 28 #endif 31 29 ); … … 106 104 for (uint32_t j=0; j<_param->_nb_word; j++) 107 105 { 108 st ring rename = "reg_DATA_" + toString(i) + "_" + toString(j);106 std::string rename = "reg_DATA_" + toString(i) + "_" + toString(j); 109 107 reg_DATA [i][j] = new SC_REGISTER (Tdata_t) (rename.c_str()); 110 108 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_end_cycle.cpp
r59 r75 1 #ifdef VHDL_TESTBENCH 1 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 2 2 3 /* 3 4 * $Id$ … … 15 16 namespace registerfile_multi_banked { 16 17 18 #undef FUNCTION 19 #define FUNCTION "RegisterFile_Multi_Banked::end_cycle" 20 void RegisterFile_Multi_Banked::end_cycle () 21 { 22 log_printf(FUNC,RegisterFile_Multi_Banked,FUNCTION,"Begin"); 17 23 18 void RegisterFile_Multi_Banked::vhdl_testbench_transition () 19 {20 log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_testbench_transition","Begin"); 24 #ifdef STATISTICS 25 _stat->end_cycle(); 26 #endif 21 27 28 #ifdef VHDL_TESTBENCH 22 29 // Evaluation before read the ouput signal 23 // sc_start(0); 30 // sc_start(0); 31 _interfaces->testbench(); 32 #endif 24 33 25 _interfaces->testbench(); 26 27 log_printf(FUNC,RegisterFile_Multi_Banked,"vhdl_testbench_transition","End"); 34 log_printf(FUNC,RegisterFile_Multi_Banked,FUNCTION,"End"); 28 35 }; 29 36 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_statistics_declaration.cpp
r59 r75 15 15 namespace registerfile_multi_banked { 16 16 17 #undef FUNCTION 18 #define FUNCTION "RegisterFile_Multi_Banked::statistics_declaration" 19 void RegisterFile_Multi_Banked::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics) 20 { 21 log_printf(FUNC,RegisterFile_Multi_Banked,FUNCTION,"Begin"); 17 22 18 string RegisterFile_Multi_Banked::statistics (uint32_t depth) 19 { 20 log_printf(FUNC,RegisterFile_Multi_Banked,"statistics","Begin"); 21 22 string txt = _stat->print(depth); 23 _stat = new Stat (static_cast<std::string>(_name), 24 "RegisterFile_Multi_Banked", 25 param_statistics); 23 26 24 log_printf(FUNC,RegisterFile_Multi_Banked,"statistics","End"); 25 26 return txt; 27 log_printf(FUNC,RegisterFile_Multi_Banked,FUNCTION,"End"); 27 28 }; 28 29 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_transition.cpp
r57 r75 35 35 } 36 36 37 #ifdef STATISTICS 38 _stat->add(); 39 #endif 40 41 #ifdef VHDL_TESTBENCH 42 vhdl_testbench_transition (); 37 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 38 end_cycle(); 43 39 #endif 44 40 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl.cpp
r57 r75 39 39 ,_param->_size_word); 40 40 41 st ring bank_name = _name + "_bank";41 std::string bank_name = _name + "_bank"; 42 42 bank = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic 43 43 (bank_name.c_str() … … 106 106 (nb_select_port_4 != nb_select_port_1) ); 107 107 108 st ring select_name1;109 st ring select_name2;110 st ring select_name3;111 st ring select_name4;108 std::string select_name1; 109 std::string select_name2; 110 std::string select_name3; 111 std::string select_name4; 112 112 113 113 if (have_select1) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_body.cpp
r62 r75 85 85 { 86 86 uint32_t num_port = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_read_by_bank*k+j); 87 st ring separator = ((k==0)?" ":",");88 st ring index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";87 std::string separator = ((k==0)?" ":","); 88 std::string index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):""; 89 89 90 90 vhdl->set_body("\t"+separator+" in_VAL_"+toString(k)+" \t=>\tinternal_READ_"+toString(i)+"_"+toString(num_port)+index+"_VAL"); … … 104 104 { 105 105 uint32_t num_port = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_write_by_bank*k+j); 106 st ring separator = ((k==0)?" ":",");107 st ring index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";106 std::string separator = ((k==0)?" ":","); 107 std::string index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):""; 108 108 109 109 vhdl->set_body("\t"+separator+" in_VAL_"+toString(k)+" \t=>\tinternal_WRITE_"+toString(i)+"_"+toString(num_port)+index+"_VAL"); … … 130 130 { 131 131 uint32_t num_port = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_read_by_bank*k+j); 132 st ring index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";132 std::string index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):""; 133 133 vhdl->set_body("\tor internal_SELECT_READ_"+toString(i)+"_"+toString(num_port)+index+"_VAL"); 134 134 } … … 143 143 { 144 144 uint32_t num_port = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_write_by_bank*k+j); 145 st ring index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";145 std::string index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):""; 146 146 147 147 vhdl->set_body("\tor internal_SELECT_WRITE_"+toString(i)+"_"+toString(num_port)+index+"_VAL"); … … 168 168 { 169 169 uint32_t num_port = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_read_by_bank*k+j); 170 st ring index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";170 std::string index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):""; 171 171 172 172 vhdl->set_body("\tin_READ_"+toString(num_port)+"_ADDRESS"+std_logic_range(_param->_size_address_by_bank)+" when internal_SELECT_READ_"+toString(i)+"_"+toString(num_port)+index+"_VAL ='1' else"); … … 183 183 { 184 184 uint32_t num_port = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_write_by_bank*k+j); 185 st ring index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";185 std::string index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):""; 186 186 187 187 vhdl->set_body("\tin_WRITE_"+toString(num_port)+"_ADDRESS"+std_logic_range(_param->_size_address_by_bank)+" when internal_SELECT_WRITE_"+toString(i)+"_"+toString(num_port)+index+"_VAL='1' else"); … … 207 207 { 208 208 uint32_t num_port = (_param->_crossbar == FULL_CROSSBAR)?k:(_param->_nb_port_write_by_bank*k+j); 209 st ring index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):"";209 std::string index = (_param->_crossbar == FULL_CROSSBAR)?("_"+toString(j)):""; 210 210 vhdl->set_body("\tin_WRITE_"+toString(num_port)+"_DATA when internal_SELECT_WRITE_"+toString(i)+"_"+toString(num_port)+index+"_VAL='1' else"); 211 211 } … … 225 225 for (uint32_t j=0; j<_param->_nb_port_read; j ++) 226 226 { 227 st ring str_address;227 std::string str_address; 228 228 229 229 if (_param->_have_bank_port_address == true) … … 236 236 for (uint32_t j=0; j<_param->_nb_port_write; j ++) 237 237 { 238 st ring str_address;238 std::string str_address; 239 239 240 240 if (_param->_have_port_address == true) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/include/Parameters.h
r62 r75 43 43 public : ~Parameters () ; 44 44 45 public : string msg_error (void); 46 47 public : string print (uint32_t depth); 48 public : friend ostream& operator<< (ostream& output_stream, 45 public : std::string msg_error (void); 46 public : std::string print (uint32_t depth); 47 public : friend std::ostream& operator<< (std::ostream& output_stream, 49 48 morpheo::behavioural::generic::registerfile::Parameters & x); 50 49 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/include/RegisterFile.h
r62 r75 23 23 #include "Behavioural/Generic/RegisterFile/include/Types.h" 24 24 #ifdef STATISTICS 25 #include "Behavioural/ Generic/RegisterFile/include/Statistics.h"25 #include "Behavioural/include/Stat.h" 26 26 #endif 27 27 #include "Behavioural/include/Component.h" … … 29 29 #include "Behavioural/include/Vhdl.h" 30 30 #endif 31 32 using namespace std;33 31 34 32 namespace morpheo { … … 45 43 // -----[ fields ]---------------------------------------------------- 46 44 // Parameters 47 protected : const st ring _name;45 protected : const std::string _name; 48 46 49 47 protected : const Parameters * _param; 48 50 49 #ifdef STATISTICS 51 p rotected : morpheo::behavioural::Parameters_Statistics * _param_statistics;50 public : Stat * _stat; 52 51 #endif 53 52 … … 89 88 public : RegisterFile ( 90 89 #ifdef SYSTEMC 91 90 sc_module_name name, 92 91 #else 93 92 std::string name, 94 93 #endif 95 94 #ifdef STATISTICS 96 95 morpheo::behavioural::Parameters_Statistics * param_statistics, 97 96 #endif 98 99 97 Parameters * param ); 98 100 99 public : ~RegisterFile (void); 101 100 102 101 #ifdef SYSTEMC 103 private : void allocation (void); 102 private : void allocation ( 103 #ifdef STATISTICS 104 morpheo::behavioural::Parameters_Statistics * param_statistics 105 #else 106 void 107 #endif 108 ); 104 109 private : void deallocation (void); 105 110 #endif 106 107 #ifdef STATISTICS108 public : string statistics (uint32_t depth);109 #endif110 111 }; 111 112 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/Parameters_msg_error.cpp
r53 r75 9 9 #include "Behavioural/Generic/RegisterFile/include/Types.h" 10 10 #include <sstream> 11 using namespace std;12 11 13 12 namespace morpheo { … … 17 16 18 17 19 st ring Parameters::msg_error(void)18 std::string Parameters::msg_error(void) 20 19 { 21 20 log_printf(FUNC,RegisterFile,"msg_error","Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/Parameters_print.cpp
r53 r75 8 8 #include "Behavioural/Generic/RegisterFile/include/Parameters.h" 9 9 #include "Behavioural/include/XML.h" 10 using namespace std;11 10 12 11 namespace morpheo { … … 16 15 17 16 18 st ring Parameters::print (uint32_t depth)17 std::string Parameters::print (uint32_t depth) 19 18 { 20 19 log_printf(FUNC,RegisterFile,"print","Begin"); 21 20 22 st ring _return;21 std::string _return; 23 22 24 23 if (_instance == instance_RegisterFile_Monolithic) … … 32 31 }; 33 32 34 ostream& operator<< (ostream& output_stream ,35 33 std::ostream& operator<< (std::ostream& output_stream , 34 morpheo::behavioural::generic::registerfile::Parameters & x) 36 35 { 37 if (x._instance == instance_RegisterFile_Monolithic) 38 output_stream << x._param_registerfile_monolithic ->print(0); 39 else 40 output_stream << x._param_registerfile_multi_banked->print(0); 36 output_stream << x.print(0); 41 37 42 38 return output_stream; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile.cpp
r62 r75 25 25 _name (name) 26 26 ,_param (param) 27 #ifdef STATISTICS28 ,_param_statistics (param_statistics)29 #endif30 27 { 31 28 log_printf(FUNC,RegisterFile,"RegisterFile","Begin"); … … 34 31 log_printf(INFO,RegisterFile,"RegisterFile","Allocation"); 35 32 36 allocation (); 33 allocation ( 34 # ifdef STATISTICS 35 param_statistics 36 # endif 37 ); 38 #endif 39 40 #ifdef STATISTICS 41 if (_param->_instance == instance_RegisterFile_Monolithic) 42 _stat = component_RegisterFile_Monolithic ->_stat; 43 else 44 _stat = component_RegisterFile_Multi_Banked->_stat; 37 45 #endif 38 46 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_allocation.cpp
r62 r75 15 15 16 16 17 void RegisterFile::allocation (void) 17 void RegisterFile::allocation ( 18 #ifdef STATISTICS 19 morpheo::behavioural::Parameters_Statistics * param_statistics 20 #else 21 void 22 #endif 23 ) 18 24 { 19 st ring rename;25 std::string rename; 20 26 21 27 log_printf(FUNC,RegisterFile,"allocation","Begin"); … … 78 84 component_RegisterFile_Monolithic = new morpheo::behavioural::generic::registerfile::registerfile_monolithic ::RegisterFile_Monolithic ::RegisterFile_Monolithic (_name.c_str() 79 85 #ifdef STATISTICS 80 , _param_statistics86 ,param_statistics 81 87 #endif 82 88 ,_param->_param_registerfile_monolithic … … 89 95 component_RegisterFile_Multi_Banked = new morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::RegisterFile_Multi_Banked (_name.c_str() 90 96 #ifdef STATISTICS 91 , _param_statistics97 ,param_statistics 92 98 #endif 93 99 ,_param->_param_registerfile_multi_banked -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h
r44 r75 34 34 public : ~Parameters () ; 35 35 36 public : string msg_error (void); 37 38 public : string print (uint32_t depth); 39 public : friend ostream& operator<< (ostream& output_stream, 40 morpheo::behavioural::generic::select::select_priority_fixed::Parameters & x); 36 public : std::string msg_error (void); 37 public : std::string print (uint32_t depth); 38 public : friend std::ostream& operator<< (std::ostream& output_stream, 39 morpheo::behavioural::generic::select::select_priority_fixed::Parameters & x); 41 40 }; 42 41 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h
r57 r75 20 20 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h" 21 21 #ifdef STATISTICS 22 #include "Behavioural/ Generic/Select/Select_Priority_Fixed/include/Statistics.h"22 #include "Behavioural/include/Stat.h" 23 23 #endif 24 24 #include "Behavioural/include/Component.h" … … 27 27 #endif 28 28 #include "Behavioural/include/Usage.h" 29 30 using namespace std;31 29 32 30 namespace morpheo { … … 44 42 // -----[ fields ]---------------------------------------------------- 45 43 // Parameters 46 protected : const st ring _name;44 protected : const std::string _name; 47 45 protected : const Parameters * _param; 48 46 private : const Tusage_t _usage; … … 52 50 53 51 #ifdef STATISTICS 54 p rivate : Statistics* _stat;52 public : Stat * _stat; 55 53 #endif 56 54 … … 87 85 sc_module_name name, 88 86 #else 89 st ringname,87 std::string name, 90 88 #endif 91 89 #ifdef STATISTICS … … 101 99 private : void deallocation (void); 102 100 103 # if defined(STATISTICS) or defined(VHDL_TESTBENCH)101 # if defined(STATISTICS) or defined(VHDL_TESTBENCH) 104 102 public : void transition (void); 105 # endif103 # endif 106 104 public : void genMealy_entity (void); 107 105 #endif 108 #ifdef STATISTICS109 public : string statistics (uint32_t depth);110 #endif111 106 112 107 #if VHDL … … 116 111 #endif 117 112 118 #ifdef VHDL_TESTBENCH 119 private : void vhdl_testbench_transition (void); 113 #ifdef STATISTICS 114 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 115 #endif 116 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 117 private : void end_cycle (void); 120 118 #endif 121 119 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Parameters_msg_error.cpp
r40 r75 9 9 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h" 10 10 #include <sstream> 11 using namespace std;12 11 13 12 namespace morpheo { … … 18 17 19 18 20 st ring Parameters::msg_error(void)19 std::string Parameters::msg_error(void) 21 20 { 22 21 log_printf(FUNC,Select_Priority_Fixed,"msg_error","Begin"); 23 22 24 st ring msg = "";23 std::string msg = ""; 25 24 26 25 if ((_encoding_one_hot or _encoding_compact) == false) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Parameters_print.cpp
r15 r75 8 8 #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h" 9 9 #include "Behavioural/include/XML.h" 10 using namespace std;11 10 12 11 namespace morpheo { … … 16 15 namespace select_priority_fixed { 17 16 18 st ring Parameters::print (uint32_t depth)17 std::string Parameters::print (uint32_t depth) 19 18 { 20 19 log_printf(FUNC,Select_Priority_Fixed,"print","Begin"); … … 33 32 }; 34 33 35 ostream& operator<< (ostream& output_stream ,36 34 std::ostream& operator<< (std::ostream& output_stream , 35 morpheo::behavioural::generic::select::select_priority_fixed::Parameters & x) 37 36 { 38 37 output_stream << x.print(0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp
r68 r75 30 30 _param (param), 31 31 _usage (usage) 32 // #ifdef STATISTICS33 // ,_param_statistics (param_statistics)34 // #endif35 32 { 36 33 log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin"); … … 44 41 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics"); 45 42 46 // Allocation of statistics 47 _stat = new Statistics (static_cast<string>(_name), 48 param_statistics , 49 param); 43 statistics_declaration(param_statistics); 50 44 } 51 45 #endif … … 106 100 log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file"); 107 101 108 _stat->generate_file(statistics(0));109 102 delete _stat; 110 103 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_end_cycle.cpp
r59 r75 1 #if def VHDL_TESTBENCH1 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 2 2 /* 3 3 * $Id$ … … 15 15 namespace select_priority_fixed { 16 16 17 #undef FUNCTION 18 #define FUNCTION "Select_Priority_Fixed::end_cycle" 19 void Select_Priority_Fixed::end_cycle () 20 { 21 log_printf(FUNC,Select_Priority_Fixed,FUNCTION,"Begin"); 17 22 18 void Select_Priority_Fixed::vhdl_testbench_transition () 19 {20 log_printf(FUNC,Select_Priority_Fixed,"vhdl_testbench_transition","Begin"); 23 #ifdef STATISTICS 24 _stat->end_cycle(); 25 #endif 21 26 27 #ifdef VHDL_TESTBENCH 22 28 // Evaluation before read the ouput signal 23 // sc_start(0); 29 // sc_start(0); 30 _interfaces->testbench(); 31 #endif 24 32 25 _interfaces->testbench(); 26 27 log_printf(FUNC,Select_Priority_Fixed,"vhdl_testbench_transition","End"); 33 log_printf(FUNC,Select_Priority_Fixed,FUNCTION,"End"); 28 34 }; 29 35 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_statistics_declaration.cpp
r59 r75 15 15 namespace select_priority_fixed { 16 16 17 #undef FUNCTION 18 #define FUNCTION "Select_Priority_Fixed::statistics_declaration" 19 void Select_Priority_Fixed::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics) 20 { 21 log_printf(FUNC,Select_Priority_Fixed,FUNCTION,"Begin"); 17 22 18 string Select_Priority_Fixed::statistics (uint32_t depth) 19 { 20 log_printf(FUNC,Select_Priority_Fixed,"statistics","Begin"); 21 22 string txt = _stat->print(depth); 23 _stat = new Stat (static_cast<std::string>(_name), 24 "Select_Priority_Fixed", 25 param_statistics); 23 26 24 log_printf(FUNC,Select_Priority_Fixed,"statistics","End"); 25 26 return txt; 27 log_printf(FUNC,Select_Priority_Fixed,FUNCTION,"End"); 27 28 }; 28 29 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_transition.cpp
r15 r75 21 21 log_printf(FUNC,Select_Priority_Fixed,"transition","Begin"); 22 22 23 #ifdef STATISTICS 24 _stat->add(); 25 #endif 26 27 #ifdef VHDL_TESTBENCH 28 vhdl_testbench_transition (); 23 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 24 end_cycle(); 29 25 #endif 30 26 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_body.cpp
r59 r75 38 38 if (_param->_encoding_compact) 39 39 { 40 st ring range = ((_param->_size_entity-1)==0)?"(0)":std_logic_range(_param->_size_entity-1,0);40 std::string range = ((_param->_size_entity-1)==0)?"(0)":std_logic_range(_param->_size_entity-1,0); 41 41 42 42 vhdl->set_body ("out_ENTITY <= internal_entity"+range+";"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/SelfTest/include/test.h
r2 r75 20 20 using namespace morpheo::behavioural; 21 21 using namespace morpheo::behavioural::generic; 22 23 22 using namespace morpheo::behavioural::generic::shifter; 24 23 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/SelfTest/src/test.cpp
r44 r75 33 33 exit (EXIT_FAILURE); 34 34 } 35 36 #ifdef STATISTICS 37 morpheo::behavioural::Parameters_Statistics * param_stat = new morpheo::behavioural::Parameters_Statistics(5,50); 38 #endif 35 39 Shifter * _Shifter = new Shifter (name.c_str(), 36 40 #ifdef STATISTICS 37 morpheo::behavioural::Parameters_Statistics(5,50),38 #endif 39 41 param_stat, 42 #endif 43 param); 40 44 41 45 #ifdef SYSTEMC … … 48 52 sc_signal <Tshift_t > SHIFTER_SHIFT [param._nb_port]; 49 53 sc_signal <Tdirection_t> SHIFTER_DIRECTION [param._nb_port]; 50 sc_signal < Ttype_t > SHIFTER_TYPE [param._nb_port];54 sc_signal <morpheo::behavioural::generic::shifter::Ttype_t > SHIFTER_TYPE [param._nb_port]; 51 55 sc_signal <Tcarry_t > SHIFTER_CARRY [param._nb_port]; 52 56 sc_signal <Tcontrol_t > SHIFTER_CARRY_IN [param._nb_port]; … … 96 100 97 101 Tdirection_t direction ; 98 Ttype_t type ;102 morpheo::behavioural::generic::shifter::Ttype_t type ; 99 103 Tcarry_t carry ; 100 104 const Tdata_t data_max = (1<<param._size_data); … … 271 275 << hex 272 276 << data_in[i] << op 273 << dec277 << std::dec 274 278 << shift << " = " 275 << hex279 << std::hex 276 280 << SHIFTER_DATA_OUT [i].read() 277 281 << " - completion : " 278 282 << data_completion [i] 279 << dec ;283 << std::dec ; 280 284 281 285 TEST(Tdata_t,SHIFTER_DATA_OUT [i].read(),data_out[i]); … … 298 302 299 303 delete _Shifter; 304 305 #ifdef STATISTICS 306 delete param_stat; 307 #endif 300 308 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Parameters.h
r2 r75 48 48 public : const bool _have_direction_right ; 49 49 50 string toString_rotate (rotate_t x)51 {52 switch (x)53 {54 case without_rotate : return "without_rotate" ;55 case internal_rotate : return "internal_rotate";56 case external_rotate : return "external_rotate";57 default : return "";58 }59 };60 61 string toString_direction (direction_t x)62 {63 switch (x)64 {65 case internal_right_shift : return "internal_right_shift";66 case internal_left_shift : return "internal_left_shift" ;67 case external_direction : return "external_direction" ;68 default : return "";69 }70 };71 72 string toString_carry (carry_t x)73 {74 switch (x)75 {76 case internal_logic : return "internal_logic" ;77 case internal_arithmetic : return "internal_arithmetic" ;78 case external_carry : return "external_carry" ;79 case external_completion : return "external_completion" ;80 default : return "";81 }82 };83 84 50 //-----[ methods ]----------------------------------------------------------- 85 51 public : Parameters (uint32_t size_data , … … 93 59 public : ~Parameters () ; 94 60 95 public : string msg_error (void); 96 97 public : string print (uint32_t depth); 98 public : friend ostream& operator<< (ostream& output_stream, 99 morpheo::behavioural::generic::shifter::Parameters & x); 61 public : std::string msg_error (void); 62 public : std::string print (uint32_t depth); 63 public : friend std::ostream& operator<< (std::ostream& output_stream, 64 morpheo::behavioural::generic::shifter::Parameters & x); 100 65 }; 101 66 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Shifter.h
r44 r75 19 19 #include "Behavioural/Generic/Shifter/include/Types.h" 20 20 #ifdef STATISTICS 21 #include "Behavioural/ Generic/Shifter/include/Statistics.h"21 #include "Behavioural/include/Stat.h" 22 22 #endif 23 23 #ifdef VHDL … … 25 25 #endif 26 26 #include "Behavioural/include/Component.h" 27 28 using namespace std;29 27 30 28 namespace morpheo { … … 41 39 // -----[ fields ]---------------------------------------------------- 42 40 // Parameters 43 protected : const st ring _name;41 protected : const std::string _name; 44 42 45 43 protected : const Parameters _param; 46 44 #ifdef STATISTICS 47 p rivate : Statistics* _stat;45 public : Stat * _stat; 48 46 #endif 49 47 … … 79 77 public : Shifter ( 80 78 #ifdef SYSTEMC 81 sc_module_name name,79 sc_module_name name, 82 80 #else 83 st ringname,81 std::string name, 84 82 #endif 85 83 #ifdef STATISTICS 86 morpheo::behavioural::Parameters_Statistics param_statistics,84 morpheo::behavioural::Parameters_Statistics * param_statistics, 87 85 #endif 88 Parameters param );86 Parameters param ); 89 87 90 88 public : Shifter (Parameters param ); … … 106 104 private : void vhdl_body (Vhdl * & vhdl); 107 105 #endif 106 108 107 #ifdef STATISTICS 109 public : string statistics (uint32_t depth);108 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 110 109 #endif 111 112 #ifdef VHDL_TESTBENCH 113 private : void vhdl_testbench_transition (void); 110 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 111 private : void end_cycle (void); 114 112 #endif 115 116 113 }; 117 114 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Types.h
r44 r75 1 #ifdef SYSTEMC2 1 #ifndef morpheo_behavioural_generic_shifter_Type_h 3 2 #define morpheo_behavioural_generic_shifter_Type_h … … 10 9 */ 11 10 12 #include "Common/include/Types.h" 11 #include "Behavioural/include/Types.h" 12 #include "Common/include/ToString.h" 13 13 14 14 namespace morpheo { … … 49 49 }; // end namespace generic 50 50 }; // end namespace behavioural 51 52 template<> inline std::string toString<morpheo::behavioural::generic::shifter::rotate_t>(const morpheo::behavioural::generic::shifter::rotate_t& x) 53 { 54 switch (x) 55 { 56 case morpheo::behavioural::generic::shifter::without_rotate : return "without_rotate" ; 57 case morpheo::behavioural::generic::shifter::internal_rotate : return "internal_rotate"; 58 case morpheo::behavioural::generic::shifter::external_rotate : return "external_rotate"; 59 default : return ""; 60 } 61 }; 62 63 template<> inline std::string toString<morpheo::behavioural::generic::shifter::direction_t>(const morpheo::behavioural::generic::shifter::direction_t& x) 64 { 65 switch (x) 66 { 67 case morpheo::behavioural::generic::shifter::internal_right_shift : return "internal_right_shift"; 68 case morpheo::behavioural::generic::shifter::internal_left_shift : return "internal_left_shift" ; 69 case morpheo::behavioural::generic::shifter::external_direction : return "external_direction" ; 70 default : return ""; 71 } 72 }; 73 74 template<> inline std::string toString<morpheo::behavioural::generic::shifter::carry_t>(const morpheo::behavioural::generic::shifter::carry_t& x) 75 { 76 switch (x) 77 { 78 case morpheo::behavioural::generic::shifter::internal_logic : return "internal_logic" ; 79 case morpheo::behavioural::generic::shifter::internal_arithmetic : return "internal_arithmetic" ; 80 case morpheo::behavioural::generic::shifter::external_carry : return "external_carry" ; 81 case morpheo::behavioural::generic::shifter::external_completion : return "external_completion" ; 82 default : return ""; 83 } 84 }; 85 86 51 87 }; // end namespace morpheo 52 88 53 89 #endif 54 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Parameters_msg_error.cpp
r2 r75 9 9 #include "Behavioural/Generic/Shifter/include/Types.h" 10 10 #include <sstream> 11 using namespace std;12 11 13 12 namespace morpheo { … … 16 15 namespace shifter { 17 16 18 st ring Parameters::msg_error(void)17 std::string Parameters::msg_error(void) 19 18 { 20 st ring msg = "";19 std::string msg = ""; 21 20 22 21 if (_size_data < 2) … … 42 41 { 43 42 msg += " - Incompatible parameters : internal_rotate have never carry (must be set at \"internal_logic\"\n"; 44 msg += " * rotate : " + toString _rotate(_rotate) + "\n";45 msg += " * carry : " + toString _carry(_carry ) + "\n";43 msg += " * rotate : " + toString(_rotate) + "\n"; 44 msg += " * carry : " + toString(_carry ) + "\n"; 46 45 } 47 46 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Parameters_print.cpp
r2 r75 7 7 8 8 #include "Behavioural/Generic/Shifter/include/Parameters.h" 9 #include <sstream> 10 using namespace std; 9 #include "Behavioural/include/XML.h" 11 10 12 11 namespace morpheo { … … 16 15 17 16 18 st ring Parameters::print (uint32_t depth)17 std::string Parameters::print (uint32_t depth) 19 18 { 20 string tab = string(depth,'\t'); 21 ostringstream msg; 22 msg << tab << "<shifter>" << endl 23 << tab << "\t<size_data value=\"" << _size_data << "\" />" << endl 24 << tab << "\t<nb_port value=\"" << _nb_port << "\" />" << endl 25 << tab << "\t<shift_value value=\"" << _shift_value << "\" />" << endl 26 << tab << "\t<rotate value=\"" << toString_rotate (_rotate ) << "\" />" << endl 27 << tab << "\t<direction value=\"" << toString_direction (_direction) << "\" />" << endl 28 << tab << "\t<carry value=\"" << toString_carry (_carry ) << "\" />" << endl 29 << tab << "\t<!-- port_completion is type bool : " << toString(_type_completion_bool) << " -->" << endl 30 << tab << "</shifter>" << endl; 19 XML xml ("shifter"); 20 21 xml.balise_open("shifter"); 22 xml.singleton_begin("size_data "); xml.attribut("value",toString(_size_data )); xml.singleton_end(); 23 xml.singleton_begin("nb_port "); xml.attribut("value",toString(_nb_port )); xml.singleton_end(); 24 xml.singleton_begin("shift_value"); xml.attribut("value",toString(_shift_value)); xml.singleton_end(); 25 xml.singleton_begin("rotate "); xml.attribut("value",toString(_rotate )); xml.singleton_end(); 26 xml.singleton_begin("direction "); xml.attribut("value",toString(_direction )); xml.singleton_end(); 27 xml.singleton_begin("carry "); xml.attribut("value",toString(_carry )); xml.singleton_end(); 31 28 32 return msg.str();29 return xml.get_body(depth); 33 30 }; 34 31 35 ostream& operator<< (ostream& output_stream ,36 32 std::ostream& operator<< (std::ostream& output_stream , 33 morpheo::behavioural::generic::shifter::Parameters & x) 37 34 { 38 35 output_stream << x.print(0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter.cpp
r66 r75 20 20 #endif 21 21 #ifdef STATISTICS 22 ,morpheo::behavioural::Parameters_Statistics 22 ,morpheo::behavioural::Parameters_Statistics * param_statistics 23 23 #endif 24 24 ,morpheo::behavioural::generic::shifter::Parameters param ): … … 32 32 #ifdef STATISTICS 33 33 // Allocation of statistics 34 _stat = new Statistics (static_cast<string>(_name), 35 param_statistics , 36 param); 34 statistics_declaration(param_statistics); 37 35 #endif 38 36 … … 101 99 102 100 #ifdef STATISTICS 103 _stat->generate_file(statistics(0));104 105 101 delete _stat; 106 102 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_end_cycle.cpp
r59 r75 1 #if def VHDL_TESTBENCH1 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 2 2 /* 3 3 * $Id$ … … 14 14 namespace shifter { 15 15 16 #undef FUNCTION 17 #define FUNCTION "Shifter::end_cycle" 18 void Shifter::end_cycle () 19 { 20 log_printf(FUNC,Shifter,FUNCTION,"Begin"); 16 21 17 void Shifter::vhdl_testbench_transition (void) 18 {19 // sc_start(0); 22 #ifdef STATISTICS 23 _stat->end_cycle(); 24 #endif 20 25 26 #ifdef VHDL_TESTBENCH 27 // Evaluation before read the ouput signal 28 // sc_start(0); 21 29 _interfaces->testbench(); 30 #endif 31 32 log_printf(FUNC,Shifter,FUNCTION,"End"); 22 33 }; 34 23 35 24 36 }; // end namespace shifter -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_genMealy_shift.cpp
r44 r75 11 11 #include <bitset> 12 12 13 using namespace std;14 13 namespace morpheo { 15 14 namespace behavioural { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_statistics_declaration.cpp
r59 r75 14 14 namespace shifter { 15 15 16 #undef FUNCTION 17 #define FUNCTION "Shifter::statistics_declaration" 18 void Shifter::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics) 19 { 20 log_printf(FUNC,Shifter,FUNCTION,"Begin"); 16 21 17 string Shifter::statistics (uint32_t depth) 18 { 19 return _stat->print(depth); 22 _stat = new Stat (static_cast<std::string>(_name), 23 "Shifter", 24 param_statistics); 25 26 log_printf(FUNC,Shifter,FUNCTION,"End"); 20 27 }; 21 28 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_transition.cpp
r42 r75 18 18 void Shifter::transition (void) 19 19 { 20 #ifdef STATISTICS 21 _stat->add(); 22 #endif 23 24 #ifdef VHDL_TESTBENCH 25 vhdl_testbench_transition (); 20 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 21 end_cycle (); 26 22 #endif 27 23 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_vhdl_body.cpp
r42 r75 50 50 for (uint32_t i=0; i<_param._nb_port; i++) 51 51 { 52 st ring print_shifter_completion;52 std::string print_shifter_completion; 53 53 54 54 if (_param._type_completion_bool == true) … … 83 83 { 84 84 vhdl->set_body ("out_SHIFTER_"+toString(i)+"_DATA <="); 85 st ring print_else = " ";85 std::string print_else = " "; 86 86 87 87 //-----[ Shift arithmetic Left ]--------------------------------------- … … 89 89 { 90 90 bool have_when = false; 91 st ring print_when = "";92 st ring print_and = "";91 std::string print_when = ""; 92 std::string print_and = ""; 93 93 94 94 if (_param._direction == external_direction) … … 120 120 { 121 121 bool have_when = false; 122 st ring print_when = "";123 st ring print_and = "";122 std::string print_when = ""; 123 std::string print_and = ""; 124 124 125 125 if (_param._direction == external_direction) … … 151 151 { 152 152 bool have_when = false; 153 st ring print_when = "";154 st ring print_and = "";153 std::string print_when = ""; 154 std::string print_and = ""; 155 155 156 156 if (_param._direction == external_direction) … … 175 175 print_when = "when " + print_when; 176 176 177 st ring print_expr_completion;177 std::string print_expr_completion; 178 178 179 179 if (_param._size_data_completion == 0) … … 189 189 { 190 190 bool have_when = false; 191 st ring print_when = "";192 st ring print_and = "";191 std::string print_when = ""; 192 std::string print_and = ""; 193 193 194 194 if (_param._direction == external_direction) … … 213 213 print_when = "when " + print_when; 214 214 215 st ring print_expr_completion;215 std::string print_expr_completion; 216 216 217 217 if (_param._size_data_completion == 0) … … 227 227 { 228 228 bool have_when = false; 229 st ring print_when = "";230 st ring print_and = "";229 std::string print_when = ""; 230 std::string print_and = ""; 231 231 232 232 if (_param._direction == external_direction) … … 253 253 { 254 254 bool have_when = false; 255 st ring print_when = "";256 st ring print_and = "";255 std::string print_when = ""; 256 std::string print_and = ""; 257 257 258 258 if (_param._direction == external_direction) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/Makefile.deps
r53 r75 13 13 include $(DIR_MORPHEO)/Behavioural/Makefile.deps 14 14 endif 15 ifndef Group16 include $(DIR_MORPHEO)/Behavioural/Generic/Group/Makefile.deps17 endif18 15 19 16 #-----[ Library ]------------------------------------------ 20 17 Victim_Pseudo_LRU_LIBRARY = -lVictim_Pseudo_LRU \ 21 $(Group_LIBRARY) \22 18 $(Behavioural_LIBRARY) 23 19 24 20 Victim_Pseudo_LRU_DIR_LIBRARY = -L$(DIR_MORPHEO)/Behavioural/Generic/Victim/Victim_Pseudo_LRU/lib \ 25 $(Group_DIR_LIBRARY) \26 21 $(Behavioural_DIR_LIBRARY) 27 22 … … 31 26 @\ 32 27 $(MAKE) Behavioural_library; \ 33 $(MAKE) Group_library; \34 28 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/Victim/Victim_Pseudo_LRU --makefile=Makefile; 35 29 36 30 Victim_Pseudo_LRU_library_clean : 37 31 @\ 38 32 $(MAKE) Behavioural_library_clean; \ 39 $(MAKE) Group_library_clean; \40 33 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/Victim/Victim_Pseudo_LRU --makefile=Makefile clean; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/src/test.cpp
r44 r75 36 36 exit (EXIT_FAILURE); 37 37 } 38 39 #ifdef STATISTICS 40 morpheo::behavioural::Parameters_Statistics * param_stat = new morpheo::behavioural::Parameters_Statistics(5,50); 41 #endif 42 38 43 Victim_Pseudo_LRU * _Victim_Pseudo_LRU = new Victim_Pseudo_LRU (name.c_str(), 39 44 #ifdef STATISTICS 40 morpheo::behavioural::Parameters_Statistics(5,50),41 #endif 42 45 param_stat, 46 #endif 47 param); 43 48 44 49 #ifdef SYSTEMC … … 207 212 208 213 delete _Victim_Pseudo_LRU; 214 215 #ifdef STATISTICS 216 delete param_stat; 217 #endif 218 209 219 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h
r15 r75 35 35 public : ~Parameters () ; 36 36 37 public : string msg_error (void); 38 39 public : string print (uint32_t depth); 40 public : friend ostream& operator<< (ostream& output_stream, 41 morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters & x); 37 public : std::string msg_error (void); 38 public : std::string print (uint32_t depth); 39 public : friend std::ostream& operator<< (std::ostream& output_stream, 40 morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters & x); 42 41 }; 43 42 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h
r44 r75 9 9 */ 10 10 11 #include " Common/include/Types.h"11 #include "Behavioural/include/Types.h" 12 12 13 13 namespace morpheo { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h
r44 r75 35 35 #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h" 36 36 #ifdef STATISTICS 37 #include "Behavioural/ Generic/Victim/Victim_Pseudo_LRU/include/Statistics.h"37 #include "Behavioural/include/Stat.h" 38 38 #endif 39 39 #ifdef VHDL 40 40 #include "Behavioural/include/Vhdl.h" 41 41 #endif 42 #ifdef POSITION43 42 #include "Behavioural/include/Component.h" 44 #else45 #include "Behavioural/include/Interfaces.h"46 #endif47 48 using namespace std;49 43 50 44 namespace morpheo { … … 157 151 } 158 152 159 public : st ring print ()160 { 161 st ring res = "";153 public : std::string print () 154 { 155 std::string res = ""; 162 156 163 157 for (int32_t i=static_cast<int32_t>(_size)-1; i>=0; i--) … … 170 164 // -----[ fields ]---------------------------------------------------- 171 165 // Parameters 172 protected : const st ring _name;166 protected : const std::string _name; 173 167 174 168 protected : const Parameters _param; 175 169 #ifdef STATISTICS 176 private : Statistics * _stat; 177 #endif 178 179 #ifdef POSITION 180 private : Component * _component; 181 #endif 170 public : Stat * _stat; 171 #endif 172 173 public : Component * _component; 182 174 private : Interfaces * _interfaces; 183 175 … … 215 207 public : Victim_Pseudo_LRU ( 216 208 #ifdef SYSTEMC 217 sc_module_name name,209 sc_module_name name, 218 210 #else 219 st ringname,211 std::string name, 220 212 #endif 221 213 #ifdef STATISTICS 222 morpheo::behavioural::Parameters_Statistics param_statistics,223 #endif 224 Parameters param );214 morpheo::behavioural::Parameters_Statistics * param_statistics, 215 #endif 216 Parameters param ); 225 217 226 218 public : Victim_Pseudo_LRU (Parameters param ); … … 233 225 public : void transition (void); 234 226 public : void genMealy_access (void); 235 #endif236 #ifdef STATISTICS237 public : string statistics (uint32_t depth);238 227 #endif 239 228 … … 244 233 #endif 245 234 246 #ifdef VHDL_TESTBENCH 247 private : void vhdl_testbench_transition (void); 248 #endif 249 235 #ifdef STATISTICS 236 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 237 #endif 238 239 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 240 private : void end_cycle (void); 241 #endif 250 242 }; 251 243 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Parameters_msg_error.cpp
r15 r75 9 9 #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h" 10 10 #include <sstream> 11 using namespace std;12 11 13 12 namespace morpheo { … … 17 16 namespace victim_pseudo_lru { 18 17 19 st ring Parameters::msg_error(void)18 std::string Parameters::msg_error(void) 20 19 { 21 st ring msg = "";20 std::string msg = ""; 22 21 23 22 if (_nb_entity < 2) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Parameters_print.cpp
r15 r75 2 2 * $Id$ 3 3 * 4 * [ 4 * [ Description ] 5 5 * 6 6 */ 7 7 8 8 #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h" 9 #include "Behavioural/include/XML.h" 9 10 #include <sstream> 10 using namespace std;11 11 12 12 namespace morpheo { … … 16 16 namespace victim_pseudo_lru { 17 17 18 st ring Parameters::print (uint32_t depth)18 std::string Parameters::print (uint32_t depth) 19 19 { 20 string tab = string(depth,'\t');21 ostringstream msg; 22 msg << tab << "<victim_pseudo_lru>" << endl23 << tab << "\t<nb_entity value=\"" << _nb_entity << "\" />" << endl 24 << tab << "\t<nb_access value=\"" << _nb_access << "\" />" << endl 25 << tab << "\t<nb_update value=\"" << _nb_update << "\" />" << endl 26 << tab << "\t<size_table value=\"" << _size_table << "\" />" << endl 27 << tab << "</victim_pseudo_lru>" << endl;28 29 return msg.str();20 XML xml ("victim_pseudo_lru"); 21 22 xml.balise_open("victim_pseudo_lru"); 23 xml.singleton_begin("nb_entity "); xml.attribut("value",toString(_nb_entity )); xml.singleton_end(); 24 xml.singleton_begin("nb_access "); xml.attribut("value",toString(_nb_access )); xml.singleton_end(); 25 xml.singleton_begin("nb_update "); xml.attribut("value",toString(_nb_update )); xml.singleton_end(); 26 xml.singleton_begin("size_table"); xml.attribut("value",toString(_size_table)); xml.singleton_end(); 27 xml.balise_close(); 28 29 return xml.get_body(depth); 30 30 }; 31 31 32 ostream& operator<< (ostream& output_stream ,33 32 std::ostream& operator<< (std::ostream& output_stream , 33 morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters & x) 34 34 { 35 35 output_stream << x.print(0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU.cpp
r66 r75 17 17 Victim_Pseudo_LRU::Victim_Pseudo_LRU (sc_module_name name, 18 18 #else 19 Victim_Pseudo_LRU::Victim_Pseudo_LRU (st ring name,19 Victim_Pseudo_LRU::Victim_Pseudo_LRU (std::string name, 20 20 #endif 21 21 #ifdef STATISTICS 22 morpheo::behavioural::Parameters_Statistics 22 morpheo::behavioural::Parameters_Statistics * param_statistics, 23 23 #endif 24 24 morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters param ): … … 37 37 38 38 // Allocation of statistics 39 _stat = new Statistics (static_cast<string>(_name), 40 param_statistics , 41 param); 39 statistics_declaration(param_statistics); 42 40 #endif 43 41 … … 93 91 94 92 #ifdef STATISTICS 95 _stat->generate_file(statistics(0));96 97 93 delete _stat; 98 94 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_allocation.cpp
r42 r75 17 17 void Victim_Pseudo_LRU::allocation (void) 18 18 { 19 #ifdef POSITION20 19 _component = new Component (); 21 20 22 Entity * entity = _component->set_entity (_name , 23 "Select_Priority_Fixed", 24 COMBINATORY ); 21 Entity * entity = _component->set_entity (_name 22 ,"Select_Priority_Fixed" 23 #ifdef POSITION 24 ,COMBINATORY 25 #endif 26 ); 25 27 26 28 _interfaces = entity->set_interfaces(); 27 #else28 _interfaces = new Interfaces();29 #endif30 29 31 30 // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 31 { 33 Interface_fifo * interface = _interfaces->set_interface("", IN ,WEST, "Generalist interface"); 32 Interface_fifo * interface = _interfaces->set_interface("" 33 #ifdef POSITION 34 , IN ,WEST, "Generalist interface" 35 #endif 36 ); 34 37 35 38 in_CLOCK = interface->set_signal_clk ("clock" ,1); … … 47 50 for (uint32_t i=0; i<_param._nb_access; i++) 48 51 { 49 Interface_fifo * interface = _interfaces->set_interface("access_"+toString(i), IN ,WEST, "Access"); 52 Interface_fifo * interface = _interfaces->set_interface("access_"+toString(i) 53 #ifdef POSITION 54 , IN ,WEST, "Access" 55 #endif 56 ); 50 57 51 58 in_ACCESS_VAL [i] = interface->set_signal_valack_in ("val" , VAL); … … 69 76 for (uint32_t i=0; i<_param._nb_update; i++) 70 77 { 71 Interface_fifo * interface = _interfaces->set_interface("update_"+toString(i), IN ,EAST, "Update"); 78 Interface_fifo * interface = _interfaces->set_interface("update_"+toString(i) 79 #ifdef POSITION 80 , IN ,EAST, "Update" 81 #endif 82 ); 72 83 73 84 in_UPDATE_VAL [i] = interface->set_signal_valack_in ("val" , VAL); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_end_cycle.cpp
r59 r75 1 #if def VHDL_TESTBENCH1 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 2 2 /* 3 3 * $Id$ … … 15 15 namespace victim_pseudo_lru { 16 16 17 #undef FUNCTION 18 #define FUNCTION "Victim_Pseudo_LRU::end_cycle" 19 void Victim_Pseudo_LRU::end_cycle () 20 { 21 log_printf(FUNC,Victim_Pseudo_LRU,FUNCTION,"Begin"); 17 22 18 void Victim_Pseudo_LRU::vhdl_testbench_transition (void) 19 { 23 #ifdef STATISTICS 24 _stat->end_cycle(); 25 #endif 26 27 #ifdef VHDL_TESTBENCH 20 28 // Evaluation before read the ouput signal 21 // sc_start(0); 29 // sc_start(0); 30 _interfaces->testbench(); 31 #endif 22 32 23 _interfaces->testbench();33 log_printf(FUNC,Victim_Pseudo_LRU,FUNCTION,"End"); 24 34 }; 25 35 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_statistics_declaration.cpp
r59 r75 15 15 namespace victim_pseudo_lru { 16 16 17 18 string Victim_Pseudo_LRU::statistics (uint32_t depth) 17 #undef FUNCTION 18 #define FUNCTION "Victim_Pseudo_LRU::statistics_declaration" 19 void Victim_Pseudo_LRU::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics) 19 20 { 20 return _stat->print(depth); 21 log_printf(FUNC,Victim_Pseudo_LRU,FUNCTION,"Begin"); 22 23 _stat = new Stat (static_cast<std::string>(_name), 24 "Victim_Pseudo_LRU", 25 param_statistics); 26 27 log_printf(FUNC,Victim_Pseudo_LRU,FUNCTION,"End"); 21 28 }; 22 29 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_transition.cpp
r42 r75 61 61 }//end for i 62 62 63 #ifdef STATISTICS 64 _stat->add(_stat_nb_access, 65 _stat_nb_update); 66 #endif 67 68 #ifdef VHDL_TESTBENCH 69 vhdl_testbench_transition (); 63 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 64 end_cycle (); 70 65 #endif 71 66 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_vhdl_body.cpp
r42 r75 40 40 // Read the table 41 41 42 st ring access_address;42 std::string access_address; 43 43 44 44 if (_param._size_table>1) … … 58 58 for (int32_t k=(1<<j)-1; k<static_cast<int32_t>(_param._nb_entity-1); k+=(1<<(j+1))) 59 59 { 60 st ring cond = "";60 std::string cond = ""; 61 61 62 62 // Create the condition … … 70 70 } 71 71 72 st ring print_else = (k==(1<<j)-1)?" ":"else ";72 std::string print_else = (k==(1<<j)-1)?" ":"else "; 73 73 74 74 vhdl->set_body ("\t"+print_else+"access_entry_"+toString(i)+"("+toString(k)+") "+cond); … … 93 93 { 94 94 bool have_cond = false; 95 st ring cond = "";95 std::string cond = ""; 96 96 97 97 // condition to change the bit … … 126 126 { 127 127 bool have_cond = false; 128 st ring cond = "";128 std::string cond = ""; 129 129 130 130 // condition to change the bit … … 144 144 if (have_cond == true) 145 145 { 146 st ring update_address;146 std::string update_address; 147 147 148 148 if (_param._size_table>1) … … 170 170 for (uint32_t i=0; i<_param._nb_access; i++) 171 171 { 172 st ring access_address;172 std::string access_address; 173 173 174 174 if (_param._size_table>1) … … 185 185 for (uint32_t i=0; i<_param._nb_update; i++) 186 186 { 187 st ring update_address;187 std::string update_address; 188 188 189 189 if (_param._size_table>1)
Note: See TracChangeset
for help on using the changeset viewer.