[2] | 1 | /* |
---|
| 2 | * $Id: Pattern_History_Table.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 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/Pattern_History_Table/include/Pattern_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 pattern_history_table { |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | #ifdef SYSTEMC |
---|
| 24 | Pattern_History_Table::Pattern_History_Table (sc_module_name name, |
---|
| 25 | #else |
---|
| 26 | Pattern_History_Table::Pattern_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::pattern_history_table::Parameters param ): |
---|
[2] | 32 | _name (name) |
---|
| 33 | ,_param (param) |
---|
| 34 | #ifdef STATISTICS |
---|
| 35 | ,_param_statistics (param_statistics) |
---|
| 36 | #endif |
---|
| 37 | { |
---|
| 38 | log_printf(FUNC,Pattern_History_Table,"Pattern_History_Table","Begin"); |
---|
[42] | 39 | |
---|
| 40 | #ifdef SYSTEMC |
---|
| 41 | allocation (); |
---|
| 42 | #endif |
---|
| 43 | |
---|
[2] | 44 | #ifdef STATISTICS |
---|
| 45 | // Allocation of statistics |
---|
| 46 | _stat = new Statistics (static_cast<string>(_name), |
---|
| 47 | param_statistics , |
---|
| 48 | param); |
---|
| 49 | #endif |
---|
| 50 | |
---|
| 51 | #ifdef VHDL |
---|
| 52 | // generate the vhdl |
---|
| 53 | vhdl(); |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 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 | log_printf(FUNC,Pattern_History_Table,"Pattern_History_Table","End"); |
---|
| 75 | }; |
---|
| 76 | |
---|
| 77 | Pattern_History_Table::~Pattern_History_Table (void) |
---|
| 78 | { |
---|
| 79 | log_printf(FUNC,Pattern_History_Table,"~Pattern_History_Table","Begin"); |
---|
| 80 | |
---|
| 81 | #ifdef STATISTICS |
---|
| 82 | _stat->generate_file(statistics(0)); |
---|
| 83 | |
---|
| 84 | delete _stat; |
---|
| 85 | #endif |
---|
| 86 | |
---|
| 87 | #ifdef SYSTEMC |
---|
| 88 | deallocation (); |
---|
| 89 | #endif |
---|
| 90 | |
---|
| 91 | log_printf(FUNC,Pattern_History_Table,"~Pattern_History_Table","End"); |
---|
| 92 | }; |
---|
| 93 | |
---|
| 94 | }; // end namespace pattern_history_table |
---|
| 95 | }; // end namespace two_level_branch_predictor |
---|
| 96 | }; // end namespace meta_predictor |
---|
| 97 | |
---|
[48] | 98 | }; // end namespace core |
---|
| 99 | }; // end namespace multi_front_end |
---|
| 100 | }; // end namespace front_end |
---|
| 101 | }; // end namespace prediction_unit |
---|
| 102 | }; // end namespace direction |
---|
| 103 | |
---|
| 104 | |
---|
[2] | 105 | }; // end namespace behavioural |
---|
| 106 | }; // end namespace morpheo |
---|