Changeset 75 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked
- Timestamp:
- Jan 31, 2008, 6:46:41 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked
- Files:
-
- 6 deleted
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.