Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_allocation.cpp

    r86 r88  
    11/*
    2  * $Id$
     2 * $id: Decod_allocation.cpp 86 2008-05-14 17:08:56Z rosiere $
    33 *
    44 * [ Description ]
     
    5858    // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5959    {
    60       ALLOC2_INTERFACE("ifetch", IN, WEST, "Instruction's bundle", _param->_nb_context, _param->_nb_inst_fetch[alloc_interface_it1]);
     60      ALLOC2_INTERFACE("ifetch", IN, WEST, "Instruction's bundle", _param->_nb_context, _param->_nb_inst_fetch[it1]);
    6161
    6262     
    63       _ALLOC2_VALACK_IN ( in_IFETCH_VAL        ,VAL, _param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]);
    64       _ALLOC2_VALACK_OUT(out_IFETCH_ACK        ,ACK, _param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]);
    65       _ALLOC2_SIGNAL_IN ( in_IFETCH_INSTRUCTION,"instruction", Tinstruction_t, _param->_size_instruction,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]);
     63      _ALLOC2_VALACK_IN ( in_IFETCH_VAL        ,VAL, _param->_nb_context, _param->_nb_inst_fetch[it1]);
     64      _ALLOC2_VALACK_OUT(out_IFETCH_ACK        ,ACK, _param->_nb_context, _param->_nb_inst_fetch[it1]);
     65      _ALLOC2_SIGNAL_IN ( in_IFETCH_INSTRUCTION,"instruction", Tinstruction_t, _param->_size_instruction,_param->_nb_context, _param->_nb_inst_fetch[it1]);
    6666    }
    6767    {
    6868      ALLOC1_INTERFACE("ifetch", IN, WEST, "Instruction's bundle", _param->_nb_context);
    6969     
    70       ALLOC1_SIGNAL_IN (in_IFETCH_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id              );
    71       ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS                    ,"address"                    ,Tgeneral_address_t ,_param->_size_address_inst            );
    72 //    ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS_NEXT               ,"address_next"               ,Tgeneral_address_t ,_param->_size_address_inst            );
    73       ALLOC1_SIGNAL_IN (in_IFETCH_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr         );
    74       ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state            );
    75       ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_branch_update_prediction);
     70      ALLOC1_SIGNAL_IN (in_IFETCH_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id      );
     71      ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS                    ,"address"                    ,Tgeneral_address_t ,_param->_size_instruction_address    );
     72//    ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS_NEXT               ,"address_next"               ,Tgeneral_address_t ,_param->_size_instruction_address    );
     73      ALLOC1_SIGNAL_IN (in_IFETCH_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr );
     74      ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state    );
     75      ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth           );
     76      ALLOC1_SIGNAL_IN (in_IFETCH_EXCEPTION                  ,"exception"                  ,Texception_t       ,_param->_size_exception_ifetch);
    7677    }
    7778
     
    8687      ALLOC1_SIGNAL_OUT(out_DECOD_TYPE         ,"type"         ,Ttype_t           ,_param->_size_type                  );
    8788      ALLOC1_SIGNAL_OUT(out_DECOD_OPERATION    ,"operation"    ,Toperation_t      ,_param->_size_operation             );
     89      ALLOC1_SIGNAL_OUT(out_DECOD_NO_EXECUTE   ,"no_execute"   ,Tcontrol_t        ,1                                   );
    8890      ALLOC1_SIGNAL_OUT(out_DECOD_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t        ,1                                   );
    89       ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS      ,"address"      ,Tgeneral_data_t   ,_param->_size_address_inst          );
     91      ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS      ,"address"      ,Tgeneral_data_t   ,_param->_size_instruction_address          );
    9092      ALLOC1_SIGNAL_OUT(out_DECOD_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t        ,1                                   );
    9193      ALLOC1_SIGNAL_OUT(out_DECOD_IMMEDIAT     ,"immediat"     ,Tgeneral_data_t   ,_param->_size_general_data          );
     
    101103      ALLOC1_SIGNAL_OUT(out_DECOD_NUM_REG_RE   ,"num_reg_re"   ,Tspecial_address_t,_param->_size_special_register_logic);
    102104      ALLOC1_SIGNAL_OUT(out_DECOD_EXCEPTION_USE,"exception_use",Texception_t      ,_param->_size_exception_use         );
     105      ALLOC1_SIGNAL_OUT(out_DECOD_EXCEPTION    ,"exception"    ,Texception_t      ,_param->_size_exception_decod       );
    103106    }
    104107
     
    109112      ALLOC1_VALACK_OUT(out_PREDICT_VAL                        ,VAL);
    110113      ALLOC1_VALACK_IN ( in_PREDICT_ACK                        ,ACK);
    111       ALLOC1_SIGNAL_OUT(out_PREDICT_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id              );
    112       ALLOC1_SIGNAL_OUT(out_PREDICT_MATCH_INST_IFETCH_PTR      ,"match_inst_ifetch_ptr"      ,Tcontrol_t         ,1                                     );
    113       ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state            );
    114       ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_branch_update_prediction);
    115       ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_CONDITION           ,"branch_condition"           ,Tbranch_condition_t,_param->_size_branch_condition        );
    116 //    ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STACK_WRITE         ,"branch_stack_write"         ,Tcontrol_t         ,1                                     );
    117       ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                                     );
    118       ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_SRC                ,"address_src"                ,Tgeneral_data_t    ,_param->_size_address_inst            );
    119       ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_DEST               ,"address_dest"               ,Tgeneral_data_t    ,_param->_size_address_inst            );
    120 //    ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE               ,"can_continue"               ,Tcontrol_t         ,1                                     );
     114      ALLOC1_SIGNAL_OUT(out_PREDICT_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id      );
     115      ALLOC1_SIGNAL_OUT(out_PREDICT_MATCH_INST_IFETCH_PTR      ,"match_inst_ifetch_ptr"      ,Tcontrol_t         ,1                             );
     116      ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state    );
     117      ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth           );
     118      ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_CONDITION           ,"branch_condition"           ,Tbranch_condition_t,_param->_size_branch_condition);
     119//    ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STACK_WRITE         ,"branch_stack_write"         ,Tcontrol_t         ,1                             );
     120      ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                             );
     121      ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_SRC                ,"address_src"                ,Tgeneral_data_t    ,_param->_size_instruction_address    );
     122      ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_DEST               ,"address_dest"               ,Tgeneral_data_t    ,_param->_size_instruction_address    );
     123//    ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE               ,"can_continue"               ,Tcontrol_t         ,1                             );
    121124    }
    122125   
     
    136139      ALLOC_VALACK_IN ( in_CONTEXT_EVENT_ACK          ,ACK);
    137140      ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_CONTEXT_ID   ,"context_id"   ,Tcontext_t     ,_param->_size_context_id  );
     141      ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_DEPTH        ,"depth"        ,Tdepth_t       ,_param->_size_depth       );
    138142      ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_TYPE         ,"type"         ,Tevent_type_t  ,_param->_size_event_type  );
    139143      ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t     ,1                         );
    140       ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS      ,"address"      ,Tgeneral_data_t,_param->_size_address_inst);
    141       ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Tgeneral_data_t,_param->_size_address_inst);
    142     }
    143 
    144     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    145 
     144      ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS      ,"address"      ,Tgeneral_data_t,_param->_size_instruction_address);
     145      ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Tgeneral_data_t,_param->_size_instruction_address);
     146    }
     147
     148
     149    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     150    if (usage_is_set(_usage,USE_SYSTEMC))
     151      {
    146152    reg_CONTEXT_ADDRESS_PREVIOUS      = new Tgeneral_data_t [_param->_nb_context];
    147153    reg_CONTEXT_IS_DELAY_SLOT         = new Tcontrol_t      [_param->_nb_context];
     
    150156    internal_CONTEXT_ADDRESS_PREVIOUS = new Tgeneral_data_t [_param->_nb_context];
    151157    internal_CONTEXT_IS_DELAY_SLOT    = new Tcontrol_t      [_param->_nb_context];
     158
     159#ifdef STATISTICS
     160    internal_DECOD_VAL                = new Tcontrol_t      [_param->_nb_inst_decod];
     161#endif
     162      }
     163
     164    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     165    _priority = new generic::priority::Priority (_name+"_priority"      ,
     166                                                 _param->_priority      ,
     167                                                 _param->_load_balancing,
     168                                                 _param->_nb_context    ,
     169                                                 _param->_nb_inst_fetch ,
     170                                                 _param->_nb_context_select);
    152171
    153172    const uint32_t nb_opcod_type = 14;
     
    415434//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4   ]) _function_decod [i][ 2][OPCOD_LV_CUST4   ] = &(instruction_lv_custom);
    416435
    417         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1    ]) _function_custom[i][ 0][OPCOD_L_CUST1    ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_1   );
    418         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2    ]) _function_custom[i][ 0][OPCOD_L_CUST2    ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_2   );
    419         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3    ]) _function_custom[i][ 0][OPCOD_L_CUST3    ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_3   );
    420         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4    ]) _function_custom[i][ 0][OPCOD_L_CUST4    ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_4   );
    421         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5    ]) _function_custom[i][ 0][OPCOD_L_CUST5    ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_5   );
    422         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6    ]) _function_custom[i][ 0][OPCOD_L_CUST6    ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_6   );
    423         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7    ]) _function_custom[i][ 0][OPCOD_L_CUST7    ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_7   );
    424         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8    ]) _function_custom[i][ 0][OPCOD_L_CUST8    ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_8   );
    425 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_custom[i][ 1][OPCOD_LF_CUST1_D ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LF_1_D);
    426 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_custom[i][ 1][OPCOD_LF_CUST1_S ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LF_1_S);
    427 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1   ]) _function_custom[i][ 2][OPCOD_LV_CUST1   ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_1  );
    428 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2   ]) _function_custom[i][ 2][OPCOD_LV_CUST2   ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_2  );
    429 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3   ]) _function_custom[i][ 2][OPCOD_LV_CUST3   ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_3  );
    430 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4   ]) _function_custom[i][ 2][OPCOD_LV_CUST4   ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_4  );
     436        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1    ]) _function_custom[i][ 0][OPCOD_L_CUST1    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_1   );
     437        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2    ]) _function_custom[i][ 0][OPCOD_L_CUST2    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_2   );
     438        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3    ]) _function_custom[i][ 0][OPCOD_L_CUST3    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_3   );
     439        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4    ]) _function_custom[i][ 0][OPCOD_L_CUST4    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_4   );
     440        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5    ]) _function_custom[i][ 0][OPCOD_L_CUST5    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_5   );
     441        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6    ]) _function_custom[i][ 0][OPCOD_L_CUST6    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_6   );
     442        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7    ]) _function_custom[i][ 0][OPCOD_L_CUST7    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_7   );
     443        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8    ]) _function_custom[i][ 0][OPCOD_L_CUST8    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_8   );
     444//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_custom[i][ 1][OPCOD_LF_CUST1_D ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LF_1_D);
     445//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_custom[i][ 1][OPCOD_LF_CUST1_S ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LF_1_S);
     446//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1   ]) _function_custom[i][ 2][OPCOD_LV_CUST1   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_1  );
     447//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2   ]) _function_custom[i][ 2][OPCOD_LV_CUST2   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_2  );
     448//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3   ]) _function_custom[i][ 2][OPCOD_LV_CUST3   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_3  );
     449//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4   ]) _function_custom[i][ 2][OPCOD_LV_CUST4   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_4  );
    431450      }
    432451
     
    440459
    441460#ifdef POSITION
    442     _component->generate_file();
     461    if (usage_is_set(_usage,USE_POSITION))
     462      _component->generate_file();
    443463#endif
    444464
Note: See TracChangeset for help on using the changeset viewer.