[82] | 1 | /* |
---|
| 2 | * $Id: Decod_queue_deallocation.cpp 112 2009-03-18 22:36:26Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h" |
---|
| 9 | #include "Behavioural/include/Allocation.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_front_end { |
---|
| 15 | namespace front_end { |
---|
| 16 | namespace decod_unit { |
---|
| 17 | namespace decod_queue { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Decod_queue::deallocation" |
---|
| 22 | void Decod_queue::deallocation (void) |
---|
| 23 | { |
---|
| 24 | log_begin(Decod_queue,FUNCTION); |
---|
| 25 | |
---|
| 26 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 27 | { |
---|
| 28 | delete in_CLOCK ; |
---|
| 29 | delete in_NRESET; |
---|
| 30 | |
---|
| 31 | DELETE1_SIGNAL( in_DECOD_IN_VAL ,_param->_nb_inst_decod,1); |
---|
| 32 | DELETE1_SIGNAL(out_DECOD_IN_ACK ,_param->_nb_inst_decod,1); |
---|
| 33 | DELETE1_SIGNAL( in_DECOD_IN_CONTEXT_ID ,_param->_nb_inst_decod,_param->_size_context_id ); |
---|
| 34 | DELETE1_SIGNAL( in_DECOD_IN_DEPTH ,_param->_nb_inst_decod,_param->_size_depth ); |
---|
| 35 | DELETE1_SIGNAL( in_DECOD_IN_TYPE ,_param->_nb_inst_decod,_param->_size_type ); |
---|
| 36 | DELETE1_SIGNAL( in_DECOD_IN_OPERATION ,_param->_nb_inst_decod,_param->_size_operation ); |
---|
[88] | 37 | DELETE1_SIGNAL( in_DECOD_IN_NO_EXECUTE ,_param->_nb_inst_decod,1 ); |
---|
[82] | 38 | DELETE1_SIGNAL( in_DECOD_IN_IS_DELAY_SLOT ,_param->_nb_inst_decod,1 ); |
---|
[108] | 39 | #ifdef DEBUG |
---|
| 40 | DELETE1_SIGNAL( in_DECOD_IN_ADDRESS ,_param->_nb_inst_decod,_param->_size_instruction_address ); |
---|
| 41 | #endif |
---|
[105] | 42 | DELETE1_SIGNAL( in_DECOD_IN_ADDRESS_NEXT ,_param->_nb_inst_decod,_param->_size_instruction_address ); |
---|
[82] | 43 | DELETE1_SIGNAL( in_DECOD_IN_HAS_IMMEDIAT ,_param->_nb_inst_decod,1 ); |
---|
| 44 | DELETE1_SIGNAL( in_DECOD_IN_IMMEDIAT ,_param->_nb_inst_decod,_param->_size_general_data ); |
---|
| 45 | DELETE1_SIGNAL( in_DECOD_IN_READ_RA ,_param->_nb_inst_decod,1 ); |
---|
| 46 | DELETE1_SIGNAL( in_DECOD_IN_NUM_REG_RA ,_param->_nb_inst_decod,_param->_size_general_register_logic); |
---|
| 47 | DELETE1_SIGNAL( in_DECOD_IN_READ_RB ,_param->_nb_inst_decod,1 ); |
---|
| 48 | DELETE1_SIGNAL( in_DECOD_IN_NUM_REG_RB ,_param->_nb_inst_decod,_param->_size_general_register_logic); |
---|
| 49 | DELETE1_SIGNAL( in_DECOD_IN_READ_RC ,_param->_nb_inst_decod,1 ); |
---|
| 50 | DELETE1_SIGNAL( in_DECOD_IN_NUM_REG_RC ,_param->_nb_inst_decod,_param->_size_special_register_logic); |
---|
| 51 | DELETE1_SIGNAL( in_DECOD_IN_WRITE_RD ,_param->_nb_inst_decod,1 ); |
---|
| 52 | DELETE1_SIGNAL( in_DECOD_IN_NUM_REG_RD ,_param->_nb_inst_decod,_param->_size_general_register_logic); |
---|
| 53 | DELETE1_SIGNAL( in_DECOD_IN_WRITE_RE ,_param->_nb_inst_decod,1 ); |
---|
| 54 | DELETE1_SIGNAL( in_DECOD_IN_NUM_REG_RE ,_param->_nb_inst_decod,_param->_size_special_register_logic); |
---|
| 55 | DELETE1_SIGNAL( in_DECOD_IN_EXCEPTION_USE ,_param->_nb_inst_decod,_param->_size_exception_use ); |
---|
[88] | 56 | DELETE1_SIGNAL( in_DECOD_IN_EXCEPTION ,_param->_nb_inst_decod,_param->_size_exception ); |
---|
[82] | 57 | |
---|
| 58 | DELETE1_SIGNAL(out_DECOD_OUT_VAL ,_param->_nb_inst_decod,1); |
---|
| 59 | DELETE1_SIGNAL( in_DECOD_OUT_ACK ,_param->_nb_inst_decod,1); |
---|
| 60 | DELETE1_SIGNAL(out_DECOD_OUT_CONTEXT_ID ,_param->_nb_inst_decod,_param->_size_context_id ); |
---|
| 61 | DELETE1_SIGNAL(out_DECOD_OUT_DEPTH ,_param->_nb_inst_decod,_param->_size_depth ); |
---|
| 62 | DELETE1_SIGNAL(out_DECOD_OUT_TYPE ,_param->_nb_inst_decod,_param->_size_type ); |
---|
| 63 | DELETE1_SIGNAL(out_DECOD_OUT_OPERATION ,_param->_nb_inst_decod,_param->_size_operation ); |
---|
[88] | 64 | DELETE1_SIGNAL(out_DECOD_OUT_NO_EXECUTE ,_param->_nb_inst_decod,1 ); |
---|
[82] | 65 | DELETE1_SIGNAL(out_DECOD_OUT_IS_DELAY_SLOT ,_param->_nb_inst_decod,1 ); |
---|
[108] | 66 | #ifdef DEBUG |
---|
| 67 | DELETE1_SIGNAL(out_DECOD_OUT_ADDRESS ,_param->_nb_inst_decod,_param->_size_instruction_address ); |
---|
| 68 | #endif |
---|
[105] | 69 | DELETE1_SIGNAL(out_DECOD_OUT_ADDRESS_NEXT ,_param->_nb_inst_decod,_param->_size_instruction_address ); |
---|
[82] | 70 | DELETE1_SIGNAL(out_DECOD_OUT_HAS_IMMEDIAT ,_param->_nb_inst_decod,1 ); |
---|
| 71 | DELETE1_SIGNAL(out_DECOD_OUT_IMMEDIAT ,_param->_nb_inst_decod,_param->_size_general_data ); |
---|
| 72 | DELETE1_SIGNAL(out_DECOD_OUT_READ_RA ,_param->_nb_inst_decod,1 ); |
---|
| 73 | DELETE1_SIGNAL(out_DECOD_OUT_NUM_REG_RA ,_param->_nb_inst_decod,_param->_size_general_register_logic); |
---|
| 74 | DELETE1_SIGNAL(out_DECOD_OUT_READ_RB ,_param->_nb_inst_decod,1 ); |
---|
| 75 | DELETE1_SIGNAL(out_DECOD_OUT_NUM_REG_RB ,_param->_nb_inst_decod,_param->_size_general_register_logic); |
---|
| 76 | DELETE1_SIGNAL(out_DECOD_OUT_READ_RC ,_param->_nb_inst_decod,1 ); |
---|
| 77 | DELETE1_SIGNAL(out_DECOD_OUT_NUM_REG_RC ,_param->_nb_inst_decod,_param->_size_special_register_logic); |
---|
| 78 | DELETE1_SIGNAL(out_DECOD_OUT_WRITE_RD ,_param->_nb_inst_decod,1 ); |
---|
| 79 | DELETE1_SIGNAL(out_DECOD_OUT_NUM_REG_RD ,_param->_nb_inst_decod,_param->_size_general_register_logic); |
---|
| 80 | DELETE1_SIGNAL(out_DECOD_OUT_WRITE_RE ,_param->_nb_inst_decod,1 ); |
---|
| 81 | DELETE1_SIGNAL(out_DECOD_OUT_NUM_REG_RE ,_param->_nb_inst_decod,_param->_size_special_register_logic); |
---|
| 82 | DELETE1_SIGNAL(out_DECOD_OUT_EXCEPTION_USE ,_param->_nb_inst_decod,_param->_size_exception_use ); |
---|
[88] | 83 | DELETE1_SIGNAL(out_DECOD_OUT_EXCEPTION ,_param->_nb_inst_decod,_param->_size_exception ); |
---|
[82] | 84 | |
---|
[101] | 85 | DELETE1_SIGNAL( in_DEPTH_MIN ,_param->_nb_context,_param->_size_depth); |
---|
| 86 | DELETE1_SIGNAL( in_DEPTH_MAX ,_param->_nb_context,_param->_size_depth); |
---|
| 87 | DELETE1_SIGNAL( in_DEPTH_FULL ,_param->_nb_context,1); |
---|
[82] | 88 | |
---|
[88] | 89 | DELETE1_SIGNAL(out_NB_INST_ALL ,_param->_nb_context,_param->_size_nb_inst_decod); |
---|
| 90 | |
---|
| 91 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[111] | 92 | switch (_param->_queue_scheme) |
---|
| 93 | { |
---|
[112] | 94 | case DECOD_QUEUE_SCHEME_ONE_FIFO : |
---|
| 95 | { |
---|
| 96 | while (not reg_QUEUE->empty()) |
---|
| 97 | { |
---|
| 98 | delete reg_QUEUE->front(); |
---|
| 99 | reg_QUEUE->pop_front(); |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | DELETE0(reg_QUEUE); |
---|
| 103 | break; |
---|
| 104 | } |
---|
| 105 | case DECOD_QUEUE_SCHEME_MULTI_FIFO : |
---|
| 106 | { |
---|
| 107 | for (uint32_t i=0; i<_param->_nb_bank; ++i) |
---|
| 108 | while (not reg_QUEUE[i].empty()) |
---|
| 109 | { |
---|
| 110 | delete reg_QUEUE[i].front(); |
---|
| 111 | reg_QUEUE[i].pop_front(); |
---|
| 112 | } |
---|
| 113 | |
---|
| 114 | DELETE1(reg_QUEUE,_param->_nb_bank); break; |
---|
| 115 | } |
---|
| 116 | } |
---|
| 117 | |
---|
| 118 | DELETE1(reg_NB_INST ,_param->_nb_context); |
---|
[88] | 119 | |
---|
| 120 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[112] | 121 | DELETE1(internal_DECOD_IN_ACK ,_param->_nb_inst_decod); |
---|
| 122 | DELETE1(internal_DECOD_OUT_VAL,_param->_nb_inst_decod); |
---|
| 123 | DELETE1(internal_DECOD_OUT_ACK,_param->_nb_inst_decod); |
---|
[82] | 124 | } |
---|
| 125 | |
---|
| 126 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 127 | |
---|
| 128 | delete _component; |
---|
| 129 | |
---|
| 130 | log_end(Decod_queue,FUNCTION); |
---|
| 131 | }; |
---|
| 132 | |
---|
| 133 | }; // end namespace decod_queue |
---|
| 134 | }; // end namespace decod_unit |
---|
| 135 | }; // end namespace front_end |
---|
| 136 | }; // end namespace multi_front_end |
---|
| 137 | }; // end namespace core |
---|
| 138 | |
---|
| 139 | }; // end namespace behavioural |
---|
| 140 | }; // end namespace morpheo |
---|