[88] | 1 | /* |
---|
| 2 | * $Id: Issue_queue.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/include/Issue_queue.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_ooo_engine { |
---|
| 14 | namespace ooo_engine { |
---|
| 15 | namespace issue_queue { |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | #undef FUNCTION |
---|
| 19 | #define FUNCTION "Issue_queue::Issue_queue" |
---|
| 20 | Issue_queue::Issue_queue |
---|
| 21 | ( |
---|
| 22 | #ifdef SYSTEMC |
---|
| 23 | sc_module_name name, |
---|
| 24 | #else |
---|
| 25 | string name, |
---|
| 26 | #endif |
---|
| 27 | #ifdef STATISTICS |
---|
| 28 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 29 | #endif |
---|
| 30 | morpheo::behavioural::core::multi_ooo_engine::ooo_engine::issue_queue::Parameters * param, |
---|
| 31 | morpheo::behavioural::Tusage_t usage |
---|
| 32 | ): |
---|
| 33 | _name (name) |
---|
| 34 | ,_param (param) |
---|
| 35 | ,_usage (usage) |
---|
| 36 | { |
---|
| 37 | log_begin(Issue_queue,FUNCTION); |
---|
| 38 | |
---|
| 39 | usage_environment(_usage); |
---|
| 40 | |
---|
| 41 | #if DEBUG_Issue_queue == true |
---|
| 42 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
| 43 | |
---|
| 44 | std::cout << *param << std::endl; |
---|
| 45 | #endif |
---|
| 46 | |
---|
| 47 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Allocation"),_name.c_str()); |
---|
| 48 | |
---|
| 49 | allocation ( |
---|
| 50 | #ifdef STATISTICS |
---|
| 51 | param_statistics |
---|
| 52 | #endif |
---|
| 53 | ); |
---|
| 54 | |
---|
| 55 | #ifdef STATISTICS |
---|
| 56 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 57 | { |
---|
| 58 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str()); |
---|
| 59 | |
---|
| 60 | statistics_allocation(param_statistics); |
---|
| 61 | } |
---|
| 62 | #endif |
---|
| 63 | |
---|
| 64 | #ifdef VHDL |
---|
| 65 | if (usage_is_set(_usage,USE_VHDL)) |
---|
| 66 | { |
---|
| 67 | // generate the vhdl |
---|
| 68 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str()); |
---|
| 69 | |
---|
| 70 | vhdl(); |
---|
| 71 | } |
---|
| 72 | #endif |
---|
| 73 | |
---|
| 74 | #ifdef SYSTEMC |
---|
| 75 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 76 | { |
---|
| 77 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Method - transition"),_name.c_str()); |
---|
| 78 | |
---|
| 79 | SC_METHOD (transition); |
---|
| 80 | dont_initialize (); |
---|
| 81 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 82 | |
---|
| 83 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 84 | // List dependency information |
---|
| 85 | # endif |
---|
| 86 | |
---|
| 87 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str()); |
---|
| 88 | |
---|
| 89 | SC_METHOD (genMoore); |
---|
| 90 | dont_initialize (); |
---|
| 91 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
| 92 | |
---|
| 93 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 94 | // List dependency information |
---|
| 95 | # endif |
---|
| 96 | |
---|
| 97 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Method - genMealy"),_name.c_str()); |
---|
| 98 | |
---|
| 99 | SC_METHOD (genMealy); |
---|
| 100 | dont_initialize (); |
---|
| 101 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
| 102 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++) |
---|
| 103 | sensitive << (*(in_REEXECUTE_VAL [i])) |
---|
| 104 | << (*(in_REEXECUTE_TYPE [i])); |
---|
| 105 | for (uint32_t i=0; i<_param->_nb_rename_unit; i++) |
---|
| 106 | for (uint32_t j=0; j<_param->_nb_inst_rename[i]; j++) |
---|
| 107 | sensitive // << (*(in_ISSUE_IN_VAL [i][j])) |
---|
| 108 | << (*(in_ISSUE_IN_TYPE [i][j])); |
---|
| 109 | |
---|
| 110 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 111 | // List dependency information |
---|
| 112 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++) |
---|
| 113 | for (uint32_t x=0; x<_param->_nb_inst_reexecute; x++) |
---|
| 114 | { |
---|
| 115 | (*(out_REEXECUTE_ACK [i])) (*(in_REEXECUTE_VAL [x])); |
---|
| 116 | (*(out_REEXECUTE_ACK [i])) (*(in_REEXECUTE_TYPE [x])); |
---|
| 117 | } |
---|
| 118 | |
---|
| 119 | for (uint32_t i=0; i<_param->_nb_rename_unit; i++) |
---|
| 120 | for (uint32_t j=0; j<_param->_nb_inst_rename[i]; j++) |
---|
| 121 | { |
---|
| 122 | for (uint32_t x=0; x<_param->_nb_inst_reexecute; x++) |
---|
| 123 | { |
---|
| 124 | (*(out_ISSUE_IN_ACK [i][j])) (*(in_REEXECUTE_VAL [x])); |
---|
| 125 | (*(out_ISSUE_IN_ACK [i][j])) (*(in_REEXECUTE_TYPE [x])); |
---|
| 126 | } |
---|
| 127 | |
---|
| 128 | for (uint32_t x=0; x<_param->_nb_rename_unit; x++) |
---|
| 129 | for (uint32_t y=0; y<_param->_nb_inst_rename[x]; y++) |
---|
| 130 | { |
---|
| 131 | (*(out_ISSUE_IN_ACK [i][j])) (*(in_ISSUE_IN_VAL [x][y])); |
---|
| 132 | (*(out_ISSUE_IN_ACK [i][j])) (*(in_ISSUE_IN_TYPE [x][y])); |
---|
| 133 | } |
---|
| 134 | } |
---|
| 135 | # endif |
---|
| 136 | |
---|
| 137 | #endif |
---|
| 138 | } |
---|
| 139 | log_end(Issue_queue,FUNCTION); |
---|
| 140 | }; |
---|
| 141 | |
---|
| 142 | #undef FUNCTION |
---|
| 143 | #define FUNCTION "Issue_queue::~Issue_queue" |
---|
| 144 | Issue_queue::~Issue_queue (void) |
---|
| 145 | { |
---|
| 146 | log_begin(Issue_queue,FUNCTION); |
---|
| 147 | |
---|
| 148 | #ifdef STATISTICS |
---|
| 149 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 150 | { |
---|
| 151 | statistics_deallocation(); |
---|
| 152 | } |
---|
| 153 | #endif |
---|
| 154 | |
---|
| 155 | log_printf(INFO,Issue_queue,FUNCTION,_("<%s> : Deallocation"),_name.c_str()); |
---|
| 156 | |
---|
| 157 | deallocation (); |
---|
| 158 | |
---|
| 159 | log_end(Issue_queue,FUNCTION); |
---|
| 160 | }; |
---|
| 161 | |
---|
| 162 | }; // end namespace issue_queue |
---|
| 163 | }; // end namespace ooo_engine |
---|
| 164 | }; // end namespace multi_ooo_engine |
---|
| 165 | }; // end namespace core |
---|
| 166 | |
---|
| 167 | }; // end namespace behavioural |
---|
| 168 | }; // end namespace morpheo |
---|