[2] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace stage_1_ifetch { |
---|
| 13 | namespace predictor { |
---|
| 14 | namespace meta_predictor { |
---|
| 15 | namespace two_level_branch_predictor { |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | #ifdef SYSTEMC |
---|
| 19 | Two_Level_Branch_Predictor::Two_Level_Branch_Predictor (sc_module_name name, |
---|
| 20 | #else |
---|
| 21 | Two_Level_Branch_Predictor::Two_Level_Branch_Predictor (string name, |
---|
| 22 | #endif |
---|
| 23 | #ifdef STATISTICS |
---|
| 24 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 25 | #endif |
---|
| 26 | morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param ): |
---|
| 27 | _name (name) |
---|
| 28 | ,_param (param) |
---|
| 29 | #ifdef STATISTICS |
---|
| 30 | ,_param_statistics (param_statistics) |
---|
| 31 | #endif |
---|
| 32 | { |
---|
| 33 | log_printf(FUNC,Two_Level_Branch_Predictor,"Two_Level_Branch_Predictor","Begin"); |
---|
| 34 | |
---|
| 35 | #ifdef STATISTICS |
---|
| 36 | // Allocation of statistics |
---|
| 37 | _stat = new Statistics (static_cast<string>(_name), |
---|
| 38 | param_statistics , |
---|
| 39 | param); |
---|
| 40 | #endif |
---|
| 41 | |
---|
| 42 | #ifdef VHDL_TESTBENCH |
---|
| 43 | // Creation of a testbench |
---|
| 44 | // -> port |
---|
| 45 | // -> clock's signals |
---|
| 46 | _vhdl_testbench = new Vhdl_Testbench (_name); |
---|
| 47 | vhdl_testbench_port (); |
---|
| 48 | _vhdl_testbench->set_clock ("in_CLOCK",true); |
---|
| 49 | #endif |
---|
| 50 | |
---|
| 51 | #ifdef VHDL |
---|
| 52 | // generate the vhdl |
---|
| 53 | vhdl(); |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 56 | #ifdef SYSTEMC |
---|
| 57 | allocation (); |
---|
| 58 | |
---|
| 59 | SC_METHOD (transition); |
---|
| 60 | dont_initialize (); |
---|
| 61 | sensitive_pos << *(in_CLOCK); |
---|
| 62 | |
---|
| 63 | // SC_METHOD (genMoore); |
---|
| 64 | // dont_initialize (); |
---|
| 65 | // sensitive_neg << *(in_CLOCK); |
---|
| 66 | |
---|
| 67 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 68 | // List dependency information |
---|
| 69 | #endif |
---|
| 70 | |
---|
| 71 | #endif |
---|
| 72 | log_printf(FUNC,Two_Level_Branch_Predictor,"Two_Level_Branch_Predictor","End"); |
---|
| 73 | }; |
---|
| 74 | |
---|
| 75 | Two_Level_Branch_Predictor::~Two_Level_Branch_Predictor (void) |
---|
| 76 | { |
---|
| 77 | log_printf(FUNC,Two_Level_Branch_Predictor,"~Two_Level_Branch_Predictor","Begin"); |
---|
| 78 | |
---|
| 79 | #ifdef VHDL_TESTBENCH |
---|
| 80 | // generate the test bench |
---|
| 81 | _vhdl_testbench->generate_file(); |
---|
| 82 | delete _vhdl_testbench; |
---|
| 83 | #endif |
---|
| 84 | |
---|
| 85 | #ifdef STATISTICS |
---|
| 86 | _stat->generate_file(statistics(0)); |
---|
| 87 | |
---|
| 88 | delete _stat; |
---|
| 89 | #endif |
---|
| 90 | |
---|
| 91 | #ifdef SYSTEMC |
---|
| 92 | deallocation (); |
---|
| 93 | #endif |
---|
| 94 | |
---|
| 95 | log_printf(FUNC,Two_Level_Branch_Predictor,"~Two_Level_Branch_Predictor","End"); |
---|
| 96 | }; |
---|
| 97 | |
---|
| 98 | }; // end namespace two_level_branch_predictor |
---|
| 99 | }; // end namespace meta_predictor |
---|
| 100 | }; // end namespace predictor |
---|
| 101 | }; // end namespace stage_1_ifetch |
---|
| 102 | }; // end namespace behavioural |
---|
| 103 | }; // end namespace morpheo |
---|