Changeset 71 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Timestamp:
- Jan 19, 2008, 12:09:01 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Files:
-
- 2 added
- 10 deleted
- 10 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/SelfTest/src/test.cpp
r44 r71 32 32 exit (EXIT_FAILURE); 33 33 } 34 #ifdef STATISTICS 35 morpheo::behavioural::Parameters_Statistics * param_stat = new morpheo::behavioural::Parameters_Statistics (5,50); 36 #endif 37 34 38 Counter * _Counter = new Counter (name.c_str(), 35 39 #ifdef STATISTICS 36 morpheo::behavioural::Parameters_Statistics(5,50),40 param_stat, 37 41 #endif 38 42 param); … … 119 123 TEST(Tdata_t,DATA_OUT [i].read(),data_out [i]); 120 124 121 cout << dec << endl;125 cout << std::dec << endl; 122 126 } 123 127 … … 136 140 137 141 delete _Counter; 142 #ifdef STATISTICS 143 delete param_stat; 144 #endif 145 138 146 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h
r44 r71 20 20 #include "Behavioural/Generic/Counter/include/Types.h" 21 21 #ifdef STATISTICS 22 #include "Behavioural/ Generic/Counter/include/Statistics.h"22 #include "Behavioural/include/Stat.h" 23 23 #endif 24 24 #ifdef VHDL … … 44 44 45 45 protected : const Parameters _param; 46 //#ifdef STATISTICS47 // protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;48 //#endif49 46 50 47 #ifdef STATISTICS 51 private : Stat istics* _stat;48 private : Stat * _stat; 52 49 #endif 53 50 … … 81 78 #endif 82 79 #ifdef STATISTICS 83 morpheo::behavioural::Parameters_Statistics param_statistics,80 morpheo::behavioural::Parameters_Statistics * param_statistics, 84 81 #endif 85 82 Parameters param ); … … 98 95 #endif 99 96 #ifdef STATISTICS 100 public : string statistics (uint32_t depth); 97 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 98 public : string statistics_print (uint32_t depth); 101 99 #endif 102 100 … … 108 106 #endif 109 107 110 #if def VHDL_TESTBENCH111 private : void vhdl_testbench_transition(void);108 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 109 private : void end_cycle (void); 112 110 #endif 113 111 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter.cpp
r67 r71 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::counter::Parameters param ): 25 25 _name (name) 26 26 ,_param (param) 27 // #ifdef STATISTICS28 // ,_param_statistics (param_statistics)29 // #endif30 27 { 31 28 log_printf(FUNC,Counter,"Counter","Begin"); … … 37 34 #ifdef STATISTICS 38 35 // Allocation of statistics 39 _stat = new Statistics (static_cast<string>(_name), 40 param_statistics , 41 param); 36 statistics_declaration(param_statistics); 42 37 #endif 43 38 … … 82 77 83 78 #ifdef STATISTICS 84 _stat->generate_file(statistics(0));85 86 79 delete _stat; 87 80 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_end_cycle.cpp
r59 r71 1 #if def VHDL_TESTBENCH1 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 2 2 /* 3 3 * $Id$ … … 15 15 16 16 17 void Counter:: vhdl_testbench_transition()17 void Counter::end_cycle () 18 18 { 19 log_printf(FUNC,Counter," vhdl_testbench_transition","Begin");19 log_printf(FUNC,Counter,"end_cycle","Begin"); 20 20 21 // sc_start(0); 21 #ifdef STATISTICS 22 _stat->end_cycle(); 23 #endif 22 24 25 #ifdef VHDL_TESTBENCH 26 // Evaluation before read the ouput signal 27 // sc_start(0); 23 28 _interfaces->testbench(); 29 #endif 24 30 25 log_printf(FUNC,Counter," vhdl_testbench_transition","End");31 log_printf(FUNC,Counter,"end_cycle","End"); 26 32 }; 27 33 28 34 }; // end namespace counter 29 35 }; // end namespace generic 30 31 36 }; // end namespace behavioural 32 37 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_print.cpp
r59 r71 14 14 namespace counter { 15 15 16 string Counter::statistics (uint32_t depth) 16 #undef FUNCTION 17 #define FUNCTION "Counter::statistics_print" 18 string Counter::statistics_print (uint32_t depth) 17 19 { 18 log_printf(FUNC,Counter, "statistics","Begin");20 log_printf(FUNC,Counter,FUNCTION,"Begin"); 19 21 20 22 string txt = _stat->print(depth); 21 22 log_printf(FUNC,Counter, "statistics","End");23 24 log_printf(FUNC,Counter,FUNCTION,"End"); 23 25 24 26 return txt; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_transition.cpp
r2 r71 20 20 log_printf(FUNC,Counter,"transition","Begin"); 21 21 22 #ifdef STATISTICS 23 _stat->add(); 24 #endif 25 26 #ifdef VHDL_TESTBENCH 27 vhdl_testbench_transition (); 28 #endif 22 end_cycle(); 29 23 30 24 log_printf(FUNC,Counter,"transition","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/Makefile.deps
r53 r71 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 RegisterFile_Monolithic_LIBRARY = -lRegisterFile_Monolithic \ 21 $(Group_LIBRARY) \22 18 $(Behavioural_LIBRARY) 23 19 24 20 RegisterFile_Monolithic_DIR_LIBRARY = -L$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/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/RegisterFile/RegisterFile_Monolithic --makefile=Makefile; 35 29 … … 37 31 @\ 38 32 $(MAKE) Behavioural_library_clean; \ 39 $(MAKE) Group_library_clean; \40 33 $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic --makefile=Makefile clean; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp
r62 r71 34 34 35 35 #ifdef STATISTICS 36 morpheo::behavioural::Parameters_Statistics * _param_stat = new morpheo::behavioural::Parameters_Statistics (5,100 0);36 morpheo::behavioural::Parameters_Statistics * _param_stat = new morpheo::behavioural::Parameters_Statistics (5,100); 37 37 #endif 38 38 RegisterFile_Monolithic * registerfile = new RegisterFile_Monolithic (name.c_str() -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h
r57 r71 21 21 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h" 22 22 #ifdef STATISTICS 23 #include "Behavioural/ Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"23 #include "Behavioural/include/Stat.h" 24 24 #endif 25 25 #include "Behavioural/include/Component.h" … … 51 51 52 52 #ifdef STATISTICS 53 private : Stat istics* _stat;53 private : Stat * _stat; 54 54 55 private : uint32_t _stat_nb_read; 56 private : uint32_t _stat_nb_write; 55 private : counter_t * _stat_nb_read; 56 private : counter_t * _stat_nb_write; 57 private : counter_t * _stat_average_read ; 58 private : counter_t * _stat_average_write; 59 private : counter_t * _stat_percent_use_read ; 60 private : counter_t * _stat_percent_use_write; 57 61 #endif 58 62 … … 123 127 124 128 #ifdef STATISTICS 125 public : string statistics (uint32_t depth); 129 public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); 130 public : string statistics_print (uint32_t depth); 126 131 #endif 132 127 133 #if VHDL 128 134 private : void vhdl (void); … … 131 137 #endif 132 138 133 #ifdef VHDL_TESTBENCH 134 private : void vhdl_testbench_transition (void); 135 #endif 139 private : void end_cycle (void); 136 140 137 141 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp
r66 r71 37 37 38 38 #ifdef STATISTICS 39 _stat = new Statistics (static_cast<string>(_name), 40 param_statistics , 41 param); 39 statistics_declaration(param_statistics); 42 40 #endif 43 41 … … 71 69 } 72 70 73 # 71 # ifdef SYSTEMCASS_SPECIFIC 74 72 // List dependency information 75 73 for (uint32_t i=0; i<_param->_nb_port_read; i++) … … 86 84 (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i])); 87 85 } 88 # 86 # endif 89 87 90 88 for (uint32_t i=0; i<_param->_nb_port_read ; i++) … … 105 103 if (_usage & USE_STATISTICS) 106 104 { 107 _stat->generate_file(statistics(0));108 105 delete _stat; 109 106 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_end_cycle.cpp
r59 r71 1 #ifdef VHDL_TESTBENCH2 1 /* 3 2 * $Id$ … … 15 14 namespace registerfile_monolithic { 16 15 17 void RegisterFile_Monolithic:: vhdl_testbench_transition(void)16 void RegisterFile_Monolithic::end_cycle (void) 18 17 { 18 log_printf(FUNC,RegisterFile,"end_cycle","Begin"); 19 20 #ifdef STATISTICS 21 _stat->end_cycle(); 22 #endif 23 24 #ifdef VHDL_TESTBENCH 19 25 // Evaluation before read the ouput signal 20 26 21 27 // sc_start(0); 22 28 _interfaces->testbench(); 29 #endif 30 31 log_printf(FUNC,RegisterFile,"end_cycle","End"); 23 32 }; 24 33 … … 28 37 }; // end namespace behavioural 29 38 }; // end namespace morpheo 30 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_genMealy_read.cpp
r62 r71 19 19 log_printf(FUNC,RegisterFile,"genMealy_read","Begin"); 20 20 21 #ifdef STATISTICS22 _stat_nb_read = 0;23 #endif24 25 21 for (uint32_t i=0; i<_param->_nb_port_read; i++) 26 22 { … … 38 34 39 35 #ifdef STATISTICS 40 _stat_nb_read++;36 (*_stat_nb_read) ++; 41 37 #endif 42 38 // Write in registerFile … … 68 64 69 65 log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 70 71 #ifdef STATISTICS72 _stat_nb_read ++;73 #endif74 // Write in registerFile75 76 66 } 77 67 else -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_print.cpp
r59 r71 15 15 namespace registerfile_monolithic { 16 16 17 string RegisterFile_Monolithic::statistics (uint32_t depth)17 string RegisterFile_Monolithic::statistics_print (uint32_t depth) 18 18 { 19 19 return _stat->print(depth); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp
r62 r71 17 17 { 18 18 log_printf(FUNC,RegisterFile,"transition","Begin"); 19 #ifdef STATISTICS20 _stat_nb_write = 0;21 #endif22 19 23 20 for (uint32_t i=0; i<_param->_nb_port_write; i++) … … 27 24 { 28 25 #ifdef STATISTICS 29 _stat_nb_write++;26 (*_stat_nb_write) ++; 30 27 #endif 31 28 … … 47 44 { 48 45 // Have a read_write? 49 if ( (PORT_READ(in_READ_WRITE_VAL[i]) == true) and 50 (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE)) 51 { 46 if (PORT_READ(in_READ_WRITE_VAL[i]) == true) 47 { 48 if (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE) 49 { 52 50 #ifdef STATISTICS 53 _stat_nb_write++;51 (*_stat_nb_write) ++; 54 52 #endif 55 56 Taddress_t address; 57 if (_param->_have_port_address) 58 address = PORT_READ(in_READ_WRITE_ADDRESS[i]); 53 54 Taddress_t address; 55 if (_param->_have_port_address) 56 address = PORT_READ(in_READ_WRITE_ADDRESS[i]); 57 else 58 address = 0; 59 Tdata_t data = PORT_READ(in_READ_WRITE_WDATA [i]); 60 61 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 62 63 // Write in registerFile 64 REGISTER_WRITE(reg_DATA[address],data); 65 } 66 #ifdef STATISTICS 59 67 else 60 address = 0; 61 Tdata_t data = PORT_READ(in_READ_WRITE_WDATA [i]); 62 63 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 64 65 // Write in registerFile 66 REGISTER_WRITE(reg_DATA[address],data); 67 } 68 { 69 (*_stat_nb_read) ++; 70 } 71 #endif 72 } 68 73 } 69 74 70 75 #ifdef STATISTICS 71 _stat->add(_stat_nb_read,_stat_nb_write); 76 for (uint32_t i=0; i<_param->_nb_port_read; i++) 77 if ( PORT_READ(in_READ_VAL [i]) == 1) 78 (*_stat_nb_read) ++; 72 79 #endif 73 80 74 #ifdef VHDL_TESTBENCH 75 vhdl_testbench_transition (); 76 #endif 81 end_cycle(); 82 77 83 log_printf(FUNC,RegisterFile,"transition","End"); 78 84 };
Note: See TracChangeset
for help on using the changeset viewer.