[71] | 1 | #ifdef STATISTICS |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace registerfile { |
---|
| 15 | namespace registerfile_monolithic { |
---|
| 16 | |
---|
| 17 | void RegisterFile_Monolithic::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics) |
---|
| 18 | { |
---|
| 19 | _stat = new Stat (static_cast<string>(_name), |
---|
| 20 | "RegisterFile_Monolithic", |
---|
| 21 | param_statistics); |
---|
| 22 | |
---|
| 23 | _stat_nb_read = _stat->create_variable("nb_read" ); |
---|
| 24 | _stat_nb_write = _stat->create_variable("nb_write"); |
---|
| 25 | |
---|
| 26 | _stat_average_read = _stat->create_counter("average_read" , "", "Average read by cycle"); |
---|
| 27 | _stat_average_write = _stat->create_counter("average_write", "", "Average write by cycle"); |
---|
| 28 | |
---|
| 29 | _stat_percent_use_read = _stat->create_counter("percent_use_read" , "%", "Read port usage"); |
---|
| 30 | _stat_percent_use_write = _stat->create_counter("percent_use_write", "%", "Write port usage"); |
---|
| 31 | |
---|
| 32 | _stat->create_expr("average_read" , "/ nb_read cycle", false); |
---|
| 33 | _stat->create_expr("average_write", "/ nb_write cycle", false); |
---|
| 34 | |
---|
| 35 | _stat->create_expr("percent_use_read" , "/ * average_read 100 " + toString(_param->_nb_port_read +_param->_nb_port_read_write), false); |
---|
| 36 | _stat->create_expr("percent_use_write", "/ * average_write 100 " + toString(_param->_nb_port_write+_param->_nb_port_read_write), false); |
---|
| 37 | |
---|
| 38 | }; |
---|
| 39 | |
---|
| 40 | }; // end namespace registerfile_monolithic |
---|
| 41 | }; // end namespace registerfile |
---|
| 42 | }; // end namespace generic |
---|
| 43 | }; // end namespace behavioural |
---|
| 44 | }; // end namespace morpheo |
---|
| 45 | #endif |
---|