[2] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[48] | 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h" |
---|
[2] | 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
[48] | 12 | namespace core { |
---|
| 13 | namespace multi_front_end { |
---|
| 14 | namespace front_end { |
---|
| 15 | namespace prediction_unit { |
---|
| 16 | namespace direction { |
---|
| 17 | |
---|
[2] | 18 | namespace meta_predictor { |
---|
| 19 | namespace two_level_branch_predictor { |
---|
| 20 | namespace branch_history_table { |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | #ifdef SYSTEMC |
---|
| 24 | Branch_History_Table::Branch_History_Table (sc_module_name name, |
---|
| 25 | #else |
---|
| 26 | Branch_History_Table::Branch_History_Table (string name, |
---|
| 27 | #endif |
---|
| 28 | #ifdef STATISTICS |
---|
| 29 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 30 | #endif |
---|
[48] | 31 | morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::branch_history_table::Parameters param ): |
---|
[2] | 32 | _name (name) |
---|
| 33 | ,_param (param) |
---|
| 34 | #ifdef STATISTICS |
---|
| 35 | ,_param_statistics (param_statistics) |
---|
| 36 | #endif |
---|
| 37 | { |
---|
[42] | 38 | |
---|
| 39 | #ifdef SYSTEMC |
---|
| 40 | allocation (); |
---|
| 41 | #endif |
---|
| 42 | |
---|
[2] | 43 | #ifdef STATISTICS |
---|
| 44 | // Allocation of statistics |
---|
| 45 | _stat = new Statistics (static_cast<string>(_name), |
---|
| 46 | param_statistics , |
---|
| 47 | param); |
---|
| 48 | #endif |
---|
| 49 | |
---|
| 50 | #ifdef VHDL |
---|
| 51 | // generate the vhdl |
---|
| 52 | vhdl(); |
---|
| 53 | #endif |
---|
| 54 | |
---|
[42] | 55 | |
---|
[2] | 56 | #ifdef SYSTEMC |
---|
[15] | 57 | // // Constant |
---|
| 58 | // for (uint32_t i=0; i<_param._nb_prediction ; i++) |
---|
| 59 | // PORT_WRITE(out_PREDICT_ACK [i],1); |
---|
| 60 | // for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
| 61 | // PORT_WRITE(out_BRANCH_COMPLETE_ACK [i],1); |
---|
[2] | 62 | |
---|
| 63 | #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) |
---|
| 64 | SC_METHOD (transition); |
---|
| 65 | dont_initialize (); |
---|
| 66 | sensitive_pos << *(in_CLOCK); |
---|
| 67 | #endif |
---|
| 68 | |
---|
| 69 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 70 | // List dependency information |
---|
| 71 | #endif |
---|
| 72 | |
---|
| 73 | #endif |
---|
| 74 | }; |
---|
| 75 | |
---|
| 76 | Branch_History_Table::~Branch_History_Table (void) |
---|
| 77 | { |
---|
| 78 | #ifdef STATISTICS |
---|
| 79 | |
---|
| 80 | _stat->generate_file(statistics(0)); |
---|
| 81 | |
---|
| 82 | delete _stat; |
---|
| 83 | #endif |
---|
| 84 | |
---|
| 85 | #ifdef SYSTEMC |
---|
| 86 | deallocation (); |
---|
| 87 | #endif |
---|
| 88 | }; |
---|
| 89 | |
---|
| 90 | }; // end namespace branch_history_table |
---|
| 91 | }; // end namespace two_level_branch_predictor |
---|
| 92 | }; // end namespace meta_predictor |
---|
| 93 | |
---|
[48] | 94 | }; // end namespace core |
---|
| 95 | }; // end namespace multi_front_end |
---|
| 96 | }; // end namespace front_end |
---|
| 97 | }; // end namespace prediction_unit |
---|
| 98 | }; // end namespace direction |
---|
| 99 | |
---|
| 100 | |
---|
[2] | 101 | }; // end namespace behavioural |
---|
| 102 | }; // end namespace morpheo |
---|