[78] | 1 | /* |
---|
| 2 | * $Id: Branch_Target_Buffer.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/include/Branch_Target_Buffer.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_front_end { |
---|
| 14 | namespace front_end { |
---|
| 15 | namespace prediction_unit { |
---|
| 16 | namespace branch_target_buffer { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Branch_Target_Buffer::Branch_Target_Buffer" |
---|
| 21 | Branch_Target_Buffer::Branch_Target_Buffer |
---|
| 22 | ( |
---|
| 23 | #ifdef SYSTEMC |
---|
| 24 | sc_module_name name, |
---|
| 25 | #else |
---|
| 26 | string name, |
---|
| 27 | #endif |
---|
| 28 | #ifdef STATISTICS |
---|
| 29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 30 | #endif |
---|
| 31 | morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::branch_target_buffer::Parameters * param, |
---|
| 32 | morpheo::behavioural::Tusage_t usage |
---|
| 33 | ): |
---|
| 34 | _name (name) |
---|
| 35 | ,_param (param) |
---|
| 36 | ,_usage (usage) |
---|
| 37 | { |
---|
| 38 | log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"Begin"); |
---|
| 39 | |
---|
| 40 | log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Allocation"); |
---|
| 41 | |
---|
| 42 | allocation ( |
---|
| 43 | #ifdef STATISTICS |
---|
| 44 | param_statistics |
---|
| 45 | #endif |
---|
| 46 | ); |
---|
| 47 | |
---|
| 48 | #ifdef STATISTICS |
---|
| 49 | if (_usage & USE_STATISTICS) |
---|
| 50 | { |
---|
| 51 | log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Allocation of statistics"); |
---|
| 52 | |
---|
| 53 | statistics_allocation(param_statistics); |
---|
| 54 | } |
---|
| 55 | #endif |
---|
| 56 | |
---|
| 57 | #ifdef VHDL |
---|
| 58 | if (_usage & USE_VHDL) |
---|
| 59 | { |
---|
| 60 | // generate the vhdl |
---|
| 61 | log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Generate the vhdl"); |
---|
| 62 | |
---|
| 63 | vhdl(); |
---|
| 64 | } |
---|
| 65 | #endif |
---|
| 66 | |
---|
| 67 | #ifdef SYSTEMC |
---|
| 68 | if (_usage & USE_SYSTEMC) |
---|
| 69 | { |
---|
| 70 | log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Method - transition"); |
---|
| 71 | |
---|
| 72 | SC_METHOD (transition); |
---|
| 73 | dont_initialize (); |
---|
| 74 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 75 | |
---|
| 76 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 77 | // List dependency information |
---|
| 78 | # endif |
---|
| 79 | |
---|
| 80 | #endif |
---|
| 81 | } |
---|
| 82 | log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"End"); |
---|
| 83 | }; |
---|
| 84 | |
---|
| 85 | #undef FUNCTION |
---|
| 86 | #define FUNCTION "Branch_Target_Buffer::~Branch_Target_Buffer" |
---|
| 87 | Branch_Target_Buffer::~Branch_Target_Buffer (void) |
---|
| 88 | { |
---|
| 89 | log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"Begin"); |
---|
| 90 | |
---|
| 91 | #ifdef STATISTICS |
---|
| 92 | if (_usage & USE_STATISTICS) |
---|
| 93 | { |
---|
| 94 | statistics_deallocation(); |
---|
| 95 | } |
---|
| 96 | #endif |
---|
| 97 | |
---|
| 98 | log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Deallocation"); |
---|
| 99 | deallocation (); |
---|
| 100 | |
---|
| 101 | log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"End"); |
---|
| 102 | }; |
---|
| 103 | |
---|
| 104 | }; // end namespace branch_target_buffer |
---|
| 105 | }; // end namespace prediction_unit |
---|
| 106 | }; // end namespace front_end |
---|
| 107 | }; // end namespace multi_front_end |
---|
| 108 | }; // end namespace core |
---|
| 109 | |
---|
| 110 | }; // end namespace behavioural |
---|
| 111 | }; // end namespace morpheo |
---|