[55] | 1 | /* |
---|
| 2 | * $Id: Reservation_station.cpp 136 2009-10-20 18:52:15Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Reservation_station.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_execute_loop { |
---|
| 14 | namespace execute_loop { |
---|
| 15 | namespace multi_read_unit { |
---|
| 16 | namespace read_unit { |
---|
| 17 | namespace reservation_station { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Reservation_station::Reservation_station" |
---|
[82] | 22 | |
---|
| 23 | Reservation_station::Reservation_station |
---|
| 24 | ( |
---|
[55] | 25 | #ifdef SYSTEMC |
---|
[82] | 26 | sc_module_name name, |
---|
[55] | 27 | #else |
---|
[82] | 28 | std::string name, |
---|
[55] | 29 | #endif |
---|
| 30 | #ifdef STATISTICS |
---|
[82] | 31 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[55] | 32 | #endif |
---|
[82] | 33 | morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Parameters * param, |
---|
| 34 | morpheo::behavioural::Tusage_t usage ): |
---|
| 35 | _name (name) |
---|
| 36 | ,_param (param) |
---|
| 37 | ,_usage (usage) |
---|
[55] | 38 | { |
---|
[136] | 39 | log_printf(FUNC,Reservation_station,FUNCTION,_("<%s> Begin"),_name.c_str()); |
---|
[55] | 40 | |
---|
[123] | 41 | // #if DEBUG_Reservation_station == true |
---|
| 42 | // log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
[88] | 43 | |
---|
[123] | 44 | // std::cout << *param << std::endl; |
---|
| 45 | // #endif |
---|
[88] | 46 | |
---|
[55] | 47 | #ifdef SYSTEMC |
---|
[136] | 48 | log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Allocation"),_name.c_str()); |
---|
[55] | 49 | |
---|
| 50 | allocation (); |
---|
| 51 | #endif |
---|
| 52 | |
---|
| 53 | #ifdef STATISTICS |
---|
[88] | 54 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 55 | { |
---|
[136] | 56 | log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str()); |
---|
[88] | 57 | |
---|
| 58 | statistics_declaration(param_statistics); |
---|
| 59 | } |
---|
[55] | 60 | #endif |
---|
| 61 | |
---|
| 62 | #ifdef VHDL |
---|
[88] | 63 | if (usage_is_set(_usage,USE_VHDL)) |
---|
| 64 | { |
---|
| 65 | // generate the vhdl |
---|
[136] | 66 | log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str()); |
---|
[88] | 67 | |
---|
| 68 | vhdl(); |
---|
| 69 | } |
---|
[55] | 70 | #endif |
---|
| 71 | |
---|
| 72 | #ifdef SYSTEMC |
---|
[88] | 73 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 74 | { |
---|
[55] | 75 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
[136] | 76 | log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Method - transition"),_name.c_str()); |
---|
[55] | 77 | |
---|
| 78 | SC_METHOD (transition); |
---|
| 79 | dont_initialize (); |
---|
[131] | 80 | sensitive << (*(in_CLOCK)).pos(); |
---|
[55] | 81 | //#endif |
---|
| 82 | |
---|
| 83 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 84 | // List dependency information |
---|
| 85 | #endif |
---|
| 86 | |
---|
[136] | 87 | log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Method - genMoore"),_name.c_str()); |
---|
[55] | 88 | |
---|
| 89 | SC_METHOD (genMoore); |
---|
| 90 | dont_initialize (); |
---|
[131] | 91 | sensitive << (*(in_CLOCK)).neg(); |
---|
[55] | 92 | |
---|
| 93 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 94 | // List dependency information |
---|
| 95 | #endif |
---|
[88] | 96 | } |
---|
[55] | 97 | #endif |
---|
[136] | 98 | log_printf(FUNC,Reservation_station,FUNCTION,_("<%s> End"),_name.c_str()); |
---|
[55] | 99 | }; |
---|
| 100 | |
---|
| 101 | #undef FUNCTION |
---|
| 102 | #define FUNCTION "Reservation_station::~Reservation_station" |
---|
| 103 | Reservation_station::~Reservation_station (void) |
---|
| 104 | { |
---|
[136] | 105 | log_printf(FUNC,Reservation_station,FUNCTION,_("<%s> Begin"),_name.c_str()); |
---|
[55] | 106 | |
---|
| 107 | #ifdef STATISTICS |
---|
[88] | 108 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 109 | { |
---|
[136] | 110 | log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str()); |
---|
[88] | 111 | |
---|
| 112 | delete _stat; |
---|
| 113 | } |
---|
[55] | 114 | #endif |
---|
| 115 | |
---|
| 116 | #ifdef SYSTEMC |
---|
[136] | 117 | log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Deallocation"),_name.c_str()); |
---|
[55] | 118 | |
---|
| 119 | deallocation (); |
---|
| 120 | #endif |
---|
| 121 | |
---|
[136] | 122 | log_printf(FUNC,Reservation_station,FUNCTION,_("<%s> End"),_name.c_str()); |
---|
[55] | 123 | }; |
---|
| 124 | |
---|
| 125 | }; // end namespace reservation_station |
---|
| 126 | }; // end namespace read_unit |
---|
| 127 | }; // end namespace multi_read_unit |
---|
| 128 | }; // end namespace execute_loop |
---|
| 129 | }; // end namespace multi_execute_loop |
---|
| 130 | }; // end namespace core |
---|
| 131 | |
---|
| 132 | }; // end namespace behavioural |
---|
| 133 | }; // end namespace morpheo |
---|