- Timestamp:
- Jan 31, 2008, 6:46:41 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU
- Files:
-
- 5 deleted
- 11 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
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.