[82] | 1 | /* |
---|
| 2 | * $Id: Decod_queue_allocation.cpp 123 2009-06-08 20:43:30Z 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 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Decod_queue::allocation" |
---|
| 21 | void Decod_queue::allocation |
---|
| 22 | ( |
---|
| 23 | #ifdef STATISTICS |
---|
| 24 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 25 | #else |
---|
| 26 | void |
---|
| 27 | #endif |
---|
| 28 | ) |
---|
| 29 | { |
---|
| 30 | log_begin(Decod_queue,FUNCTION); |
---|
| 31 | |
---|
| 32 | _component = new Component (_usage); |
---|
| 33 | |
---|
| 34 | Entity * entity = _component->set_entity (_name |
---|
| 35 | ,"Decod_queue" |
---|
| 36 | #ifdef POSITION |
---|
| 37 | ,COMBINATORY |
---|
| 38 | #endif |
---|
| 39 | ); |
---|
| 40 | |
---|
| 41 | _interfaces = entity->set_interfaces(); |
---|
| 42 | |
---|
| 43 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 44 | { |
---|
| 45 | Interface * interface = _interfaces->set_interface("" |
---|
| 46 | #ifdef POSITION |
---|
| 47 | ,IN |
---|
| 48 | ,SOUTH, |
---|
| 49 | _("Generalist interface") |
---|
| 50 | #endif |
---|
| 51 | ); |
---|
| 52 | |
---|
| 53 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
| 54 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | // ~~~~~[ Interface : "decod_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 58 | { |
---|
[112] | 59 | ALLOC1_INTERFACE_BEGIN("decod_in",IN ,WEST,_("Input of decod_queue"), _param->_nb_inst_decod); |
---|
[82] | 60 | |
---|
| 61 | ALLOC1_VALACK_IN ( in_DECOD_IN_VAL ,VAL); |
---|
| 62 | ALLOC1_VALACK_OUT(out_DECOD_IN_ACK ,ACK); |
---|
| 63 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
| 64 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth ); |
---|
| 65 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
| 66 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ); |
---|
[88] | 67 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_NO_EXECUTE ,"no_execute" ,Tcontrol_t ,1 ); |
---|
[82] | 68 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_IS_DELAY_SLOT ,"is_delay_slot",Tcontrol_t ,1 ); |
---|
[108] | 69 | #ifdef DEBUG |
---|
| 70 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_ADDRESS ,"address" ,Tgeneral_data_t ,_param->_size_instruction_address ); |
---|
| 71 | #endif |
---|
[105] | 72 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_ADDRESS_NEXT ,"address_next" ,Tgeneral_data_t ,_param->_size_instruction_address ); |
---|
[82] | 73 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); |
---|
| 74 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_IMMEDIAT ,"immediat" ,Tgeneral_data_t ,_param->_size_general_data ); |
---|
| 75 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_READ_RA ,"read_ra" ,Tcontrol_t ,1 ); |
---|
| 76 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RA ,"num_reg_ra" ,Tgeneral_address_t ,_param->_size_general_register_logic); |
---|
| 77 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_READ_RB ,"read_rb" ,Tcontrol_t ,1 ); |
---|
| 78 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RB ,"num_reg_rb" ,Tgeneral_address_t ,_param->_size_general_register_logic); |
---|
| 79 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_READ_RC ,"read_rc" ,Tcontrol_t ,1 ); |
---|
| 80 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RC ,"num_reg_rc" ,Tspecial_address_t ,_param->_size_special_register_logic); |
---|
| 81 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_WRITE_RD ,"write_rd" ,Tcontrol_t ,1 ); |
---|
| 82 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RD ,"num_reg_rd" ,Tgeneral_address_t ,_param->_size_general_register_logic); |
---|
| 83 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_WRITE_RE ,"write_re" ,Tcontrol_t ,1 ); |
---|
| 84 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RE ,"num_reg_re" ,Tspecial_address_t ,_param->_size_special_register_logic); |
---|
| 85 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_EXCEPTION_USE ,"exception_use",Texception_t ,_param->_size_exception_use ); |
---|
[88] | 86 | ALLOC1_SIGNAL_IN ( in_DECOD_IN_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_decod ); |
---|
[112] | 87 | |
---|
| 88 | ALLOC1_INTERFACE_END(_param->_nb_inst_decod); |
---|
[82] | 89 | } |
---|
| 90 | |
---|
| 91 | // ~~~~~[ Interface : "decod_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 92 | { |
---|
[112] | 93 | ALLOC1_INTERFACE_BEGIN("decod_out",OUT,EAST,_("Output of decod_queue"), _param->_nb_inst_decod); |
---|
[82] | 94 | |
---|
| 95 | ALLOC1_VALACK_OUT(out_DECOD_OUT_VAL ,VAL); |
---|
| 96 | ALLOC1_VALACK_IN ( in_DECOD_OUT_ACK ,ACK); |
---|
| 97 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
| 98 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth ); |
---|
| 99 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
| 100 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ); |
---|
[88] | 101 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NO_EXECUTE ,"no_execute" ,Tcontrol_t ,1 ); |
---|
[123] | 102 | // ALLOC1_SIGNAL_OUT(out_DECOD_OUT_HAVE_EVENT ,"have_event" ,Tcontrol_t ,1 ); |
---|
| 103 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_LAST_EVENT ,"last_event" ,Tcontrol_t ,1 ); |
---|
[82] | 104 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_IS_DELAY_SLOT ,"is_delay_slot",Tcontrol_t ,1 ); |
---|
[108] | 105 | #ifdef DEBUG |
---|
| 106 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_ADDRESS ,"address" ,Tgeneral_data_t ,_param->_size_instruction_address ); |
---|
| 107 | #endif |
---|
[105] | 108 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_ADDRESS_NEXT ,"address_next" ,Tgeneral_data_t ,_param->_size_instruction_address ); |
---|
[82] | 109 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); |
---|
| 110 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_IMMEDIAT ,"immediat" ,Tgeneral_data_t ,_param->_size_general_data ); |
---|
| 111 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_READ_RA ,"read_ra" ,Tcontrol_t ,1 ); |
---|
| 112 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RA ,"num_reg_ra" ,Tgeneral_address_t ,_param->_size_general_register_logic); |
---|
| 113 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_READ_RB ,"read_rb" ,Tcontrol_t ,1 ); |
---|
| 114 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RB ,"num_reg_rb" ,Tgeneral_address_t ,_param->_size_general_register_logic); |
---|
| 115 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_READ_RC ,"read_rc" ,Tcontrol_t ,1 ); |
---|
| 116 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RC ,"num_reg_rc" ,Tspecial_address_t ,_param->_size_special_register_logic); |
---|
| 117 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_WRITE_RD ,"write_rd" ,Tcontrol_t ,1 ); |
---|
| 118 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RD ,"num_reg_rd" ,Tgeneral_address_t ,_param->_size_general_register_logic); |
---|
| 119 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_WRITE_RE ,"write_re" ,Tcontrol_t ,1 ); |
---|
| 120 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RE ,"num_reg_re" ,Tspecial_address_t ,_param->_size_special_register_logic); |
---|
| 121 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_EXCEPTION_USE ,"exception_use",Texception_t ,_param->_size_exception_use ); |
---|
[88] | 122 | ALLOC1_SIGNAL_OUT(out_DECOD_OUT_EXCEPTION ,"exception" ,Texception_t ,_param->_size_exception_decod ); |
---|
[112] | 123 | |
---|
| 124 | ALLOC1_INTERFACE_END(_param->_nb_inst_decod); |
---|
[82] | 125 | } |
---|
| 126 | |
---|
| 127 | // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 128 | { |
---|
[112] | 129 | ALLOC1_INTERFACE_BEGIN("depth",IN ,NORTH,_("Depth"), _param->_nb_context); |
---|
[82] | 130 | |
---|
[101] | 131 | ALLOC1_SIGNAL_IN ( in_DEPTH_MIN ,"min" ,Tdepth_t ,_param->_size_depth); |
---|
| 132 | ALLOC1_SIGNAL_IN ( in_DEPTH_MAX ,"max" ,Tdepth_t ,_param->_size_depth); |
---|
| 133 | ALLOC1_SIGNAL_IN ( in_DEPTH_FULL ,"full" ,Tcontrol_t ,1); |
---|
[112] | 134 | |
---|
| 135 | ALLOC1_INTERFACE_END(_param->_nb_context); |
---|
[82] | 136 | } |
---|
| 137 | |
---|
[88] | 138 | // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[82] | 139 | { |
---|
[112] | 140 | ALLOC1_INTERFACE_BEGIN("nb_inst",OUT,NORTH,_("Instruction's number"), _param->_nb_context); |
---|
[82] | 141 | |
---|
[118] | 142 | ALLOC1_SIGNAL_OUT(out_NB_INST_ALL ,"all" ,Tcounter_t ,_param->_size_nb_inst_decod); |
---|
[112] | 143 | |
---|
| 144 | ALLOC1_INTERFACE_END(_param->_nb_context); |
---|
[82] | 145 | } |
---|
| 146 | |
---|
[123] | 147 | // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 148 | { |
---|
| 149 | ALLOC1_INTERFACE_BEGIN("context",IN ,NORTH,_("Context"), _param->_nb_context); |
---|
| 150 | |
---|
| 151 | ALLOC1_SIGNAL_IN ( in_CONTEXT_EVENT ,"event" ,Tcontrol_t ,1); |
---|
| 152 | |
---|
| 153 | ALLOC1_INTERFACE_END(_param->_nb_context); |
---|
| 154 | } |
---|
| 155 | |
---|
[88] | 156 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 157 | { |
---|
[82] | 158 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[111] | 159 | switch (_param->_queue_scheme) |
---|
| 160 | { |
---|
[112] | 161 | case DECOD_QUEUE_SCHEME_ONE_FIFO : ALLOC0(reg_QUEUE,std::list<decod_queue_entry_t*>); break; |
---|
[111] | 162 | case DECOD_QUEUE_SCHEME_MULTI_FIFO : ALLOC1(reg_QUEUE,std::list<decod_queue_entry_t*>,_param->_nb_bank); break; |
---|
| 163 | } |
---|
[82] | 164 | |
---|
[123] | 165 | ALLOC1(reg_NB_INST ,uint32_t,_param->_nb_context); |
---|
| 166 | ALLOC1(reg_NB_INST_EVENT ,uint32_t,_param->_nb_context); |
---|
[112] | 167 | |
---|
[82] | 168 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[112] | 169 | ALLOC1(internal_DECOD_IN_ACK ,Tcontrol_t,_param->_nb_inst_decod); |
---|
| 170 | ALLOC1(internal_DECOD_OUT_VAL,Tcontrol_t,_param->_nb_inst_decod); |
---|
| 171 | ALLOC1(internal_DECOD_OUT_ACK,Tcontrol_t,_param->_nb_inst_decod); |
---|
[88] | 172 | } |
---|
[82] | 173 | |
---|
| 174 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 175 | |
---|
| 176 | #ifdef POSITION |
---|
| 177 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 178 | _component->generate_file(); |
---|
| 179 | #endif |
---|
| 180 | |
---|
| 181 | log_end(Decod_queue,FUNCTION); |
---|
| 182 | }; |
---|
| 183 | |
---|
| 184 | }; // end namespace decod_queue |
---|
| 185 | }; // end namespace decod_unit |
---|
| 186 | }; // end namespace front_end |
---|
| 187 | }; // end namespace multi_front_end |
---|
| 188 | }; // end namespace core |
---|
| 189 | |
---|
| 190 | }; // end namespace behavioural |
---|
| 191 | }; // end namespace morpheo |
---|