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

Almost complete design
with Test and test platform

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src
Files:
10 edited

Legend:

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

    r81 r88  
    3838    log_printf(FUNC,Decod,FUNCTION,"Begin");
    3939
     40#if DEBUG_Decod == true
     41    log_printf(INFO,Decod,FUNCTION,_("<%s> Parameters"),_name.c_str());
     42
     43    std::cout << *param << std::endl;
     44#endif   
     45
    4046    log_printf(INFO,Decod,FUNCTION,"Allocation");
    4147
     
    4753
    4854#ifdef STATISTICS
    49     if (_usage & USE_STATISTICS)
     55    if (usage_is_set(_usage,USE_STATISTICS))
    5056      {
    5157        log_printf(INFO,Decod,FUNCTION,"Allocation of statistics");
     
    5662
    5763#ifdef VHDL
    58     if (_usage & USE_VHDL)
     64    if (usage_is_set(_usage,USE_VHDL))
    5965      {
    6066        // generate the vhdl
     
    6672
    6773#ifdef SYSTEMC
    68     if (_usage & USE_SYSTEMC)
     74    if (usage_is_set(_usage,USE_SYSTEMC))
    6975      {
    7076        log_printf(INFO,Decod,FUNCTION,"Method - transition");
     
    95101            if (_param->_have_port_context_id)
    96102            sensitive << (*(in_IFETCH_CONTEXT_ID                  [i]));
    97             if (_param->_have_port_branch_update_prediction_id)
     103            if (_param->_have_port_depth)
    98104            sensitive << (*(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [i]));
    99105            if (_param->_have_port_depth)
     
    110116
    111117# ifdef SYSTEMCASS_SPECIFIC
     118        /*
    112119        // List dependency information
    113120
     
    162169              }
    163170
    164             if (_param->_have_port_depth)
    165               {
    166             for (uint32_t x=0; x<_param->_nb_context; x++)
    167               {
     171            for (uint32_t x=0; x<_param->_nb_context; x++)
     172              {
     173            if (_param->_have_port_depth[i])
     174              {
     175
    168176                (*(out_DECOD_DEPTH [i])) (*(in_CONTEXT_DECOD_ENABLE [x]));
    169177                (*(out_DECOD_DEPTH [i])) (*(in_CONTEXT_DEPTH        [x]));
     
    402410                if (_param->_have_port_context_id)
    403411                (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_CONTEXT_ID      [x]));
    404                 if (_param->_have_port_inst_ifetch_ptr)
     412                if (_param->_have_port_inst_ifetch_ptr[i])
    405413                (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_INST_IFETCH_PTR [x]));
    406414                for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++)
     
    601609              }
    602610          }
    603        
     611        */
    604612# endif   
    605613       
     
    617625
    618626#ifdef STATISTICS
    619     if (_usage & USE_STATISTICS)
     627    if (usage_is_set(_usage,USE_STATISTICS))
    620628      {
    621629        statistics_deallocation();
  • 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
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp

    r86 r88  
    77
    88#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h"
     9#include "Behavioural/include/Allocation.h"
    910
    1011namespace morpheo                    {
     
    2728        delete    in_CLOCK ;
    2829        delete    in_NRESET;
     30     
     31        DELETE2_SIGNAL( in_IFETCH_VAL        , _param->_nb_context, _param->_nb_inst_fetch[it1],1);
     32        DELETE2_SIGNAL(out_IFETCH_ACK        , _param->_nb_context, _param->_nb_inst_fetch[it1],1);
     33        DELETE2_SIGNAL( in_IFETCH_INSTRUCTION, _param->_nb_context, _param->_nb_inst_fetch[it1],_param->_size_instruction);
     34     
     35        DELETE1_SIGNAL(in_IFETCH_CONTEXT_ID                 , _param->_nb_context,_param->_size_context_id      );
     36        DELETE1_SIGNAL(in_IFETCH_ADDRESS                    , _param->_nb_context,_param->_size_instruction_address    );
     37//      DELETE1_SIGNAL(in_IFETCH_ADDRESS_NEXT               , _param->_nb_context,_param->_size_instruction_address    );
     38        DELETE1_SIGNAL(in_IFETCH_INST_IFETCH_PTR            , _param->_nb_context,_param->_size_inst_ifetch_ptr );
     39        DELETE1_SIGNAL(in_IFETCH_BRANCH_STATE               , _param->_nb_context,_param->_size_branch_state    );
     40        DELETE1_SIGNAL(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID, _param->_nb_context,_param->_size_depth           );
     41        DELETE1_SIGNAL(in_IFETCH_EXCEPTION                  , _param->_nb_context,_param->_size_exception_ifetch);
    2942
    30         delete []  in_IFETCH_VAL                         ;
    31         delete [] out_IFETCH_ACK                         ;
    32         delete []  in_IFETCH_INSTRUCTION                 ;
    33         if (_param->_have_port_context_id)
    34         delete []  in_IFETCH_CONTEXT_ID                  ;
    35         delete []  in_IFETCH_ADDRESS                     ;
    36 //      delete []  in_IFETCH_ADDRESS_NEXT                ;
    37         if (_param->_have_port_inst_ifetch_ptr)
    38         delete []  in_IFETCH_INST_IFETCH_PTR             ;
    39         delete []  in_IFETCH_BRANCH_STATE                ;
    40         if (_param->_have_port_branch_update_prediction_id)
    41         delete []  in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ;
     43        DELETE1_SIGNAL(out_DECOD_VAL          ,_param->_nb_inst_decod,1);
     44        DELETE1_SIGNAL( in_DECOD_ACK          ,_param->_nb_inst_decod,1);
     45        DELETE1_SIGNAL(out_DECOD_CONTEXT_ID   ,_param->_nb_inst_decod,_param->_size_context_id            );
     46        DELETE1_SIGNAL(out_DECOD_DEPTH        ,_param->_nb_inst_decod,_param->_size_depth                 );
     47        DELETE1_SIGNAL(out_DECOD_TYPE         ,_param->_nb_inst_decod,_param->_size_type                  );
     48        DELETE1_SIGNAL(out_DECOD_OPERATION    ,_param->_nb_inst_decod,_param->_size_operation             );
     49        DELETE1_SIGNAL(out_DECOD_NO_EXECUTE   ,_param->_nb_inst_decod,1                                   );
     50        DELETE1_SIGNAL(out_DECOD_IS_DELAY_SLOT,_param->_nb_inst_decod,1                                   );
     51        DELETE1_SIGNAL(out_DECOD_ADDRESS      ,_param->_nb_inst_decod,_param->_size_instruction_address          );
     52        DELETE1_SIGNAL(out_DECOD_HAS_IMMEDIAT ,_param->_nb_inst_decod,1                                   );
     53        DELETE1_SIGNAL(out_DECOD_IMMEDIAT     ,_param->_nb_inst_decod,_param->_size_general_data          );
     54        DELETE1_SIGNAL(out_DECOD_READ_RA      ,_param->_nb_inst_decod,1                                   );
     55        DELETE1_SIGNAL(out_DECOD_NUM_REG_RA   ,_param->_nb_inst_decod,_param->_size_general_register_logic);
     56        DELETE1_SIGNAL(out_DECOD_READ_RB      ,_param->_nb_inst_decod,1                                   );
     57        DELETE1_SIGNAL(out_DECOD_NUM_REG_RB   ,_param->_nb_inst_decod,_param->_size_general_register_logic);
     58        DELETE1_SIGNAL(out_DECOD_READ_RC      ,_param->_nb_inst_decod,1                                   );
     59        DELETE1_SIGNAL(out_DECOD_NUM_REG_RC   ,_param->_nb_inst_decod,_param->_size_special_register_logic);
     60        DELETE1_SIGNAL(out_DECOD_WRITE_RD     ,_param->_nb_inst_decod,1                                   );
     61        DELETE1_SIGNAL(out_DECOD_NUM_REG_RD   ,_param->_nb_inst_decod,_param->_size_general_register_logic);
     62        DELETE1_SIGNAL(out_DECOD_WRITE_RE     ,_param->_nb_inst_decod,1                                   );
     63        DELETE1_SIGNAL(out_DECOD_NUM_REG_RE   ,_param->_nb_inst_decod,_param->_size_special_register_logic);
     64        DELETE1_SIGNAL(out_DECOD_EXCEPTION_USE,_param->_nb_inst_decod,_param->_size_exception_use         );
     65        DELETE1_SIGNAL(out_DECOD_EXCEPTION    ,_param->_nb_inst_decod,_param->_size_exception_decod       );
    4266
    43         delete [] out_DECOD_VAL                          ;
    44         delete []  in_DECOD_ACK                          ;
    45         if (_param->_have_port_context_id)
    46         delete [] out_DECOD_CONTEXT_ID                   ;
    47         if (_param->_have_port_depth)
    48         delete [] out_DECOD_DEPTH                        ;
    49         delete [] out_DECOD_TYPE                         ;
    50         delete [] out_DECOD_OPERATION                    ;
    51         delete [] out_DECOD_IS_DELAY_SLOT                ;
    52         delete [] out_DECOD_ADDRESS                      ;
    53         delete [] out_DECOD_HAS_IMMEDIAT                 ;
    54         delete [] out_DECOD_IMMEDIAT                     ;
    55         delete [] out_DECOD_READ_RA                      ;
    56         delete [] out_DECOD_NUM_REG_RA                   ;
    57         delete [] out_DECOD_READ_RB                      ;
    58         delete [] out_DECOD_NUM_REG_RB                   ;
    59         delete [] out_DECOD_READ_RC                      ;
    60         delete [] out_DECOD_NUM_REG_RC                   ;
    61         delete [] out_DECOD_WRITE_RD                     ;
    62         delete [] out_DECOD_NUM_REG_RD                   ;
    63         delete [] out_DECOD_WRITE_RE                     ;
    64         delete [] out_DECOD_NUM_REG_RE                   ;
    65         delete [] out_DECOD_EXCEPTION_USE                ;
     67        DELETE1_SIGNAL(out_PREDICT_VAL                        ,_param->_nb_inst_decod,1);
     68        DELETE1_SIGNAL( in_PREDICT_ACK                        ,_param->_nb_inst_decod,1);
     69        DELETE1_SIGNAL(out_PREDICT_CONTEXT_ID                 ,_param->_nb_inst_decod,_param->_size_context_id      );
     70        DELETE1_SIGNAL(out_PREDICT_MATCH_INST_IFETCH_PTR      ,_param->_nb_inst_decod,1                             );
     71        DELETE1_SIGNAL(out_PREDICT_BRANCH_STATE               ,_param->_nb_inst_decod,_param->_size_branch_state    );
     72        DELETE1_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_inst_decod,_param->_size_depth           );
     73        DELETE1_SIGNAL(out_PREDICT_BRANCH_CONDITION           ,_param->_nb_inst_decod,_param->_size_branch_condition);
     74//      DELETE1_SIGNAL(out_PREDICT_BRANCH_STACK_WRITE         ,_param->_nb_inst_decod,1                             );
     75        DELETE1_SIGNAL(out_PREDICT_BRANCH_DIRECTION           ,_param->_nb_inst_decod,1                             );
     76        DELETE1_SIGNAL(out_PREDICT_ADDRESS_SRC                ,_param->_nb_inst_decod,_param->_size_instruction_address    );
     77        DELETE1_SIGNAL(out_PREDICT_ADDRESS_DEST               ,_param->_nb_inst_decod,_param->_size_instruction_address    );
     78//      DELETE1_SIGNAL( in_PREDICT_CAN_CONTINUE               ,_param->_nb_inst_decod,1                             );
    6679
    67         delete [] out_PREDICT_VAL                        ;
    68         delete []  in_PREDICT_ACK                        ;
    69         if (_param->_have_port_context_id)
    70         delete [] out_PREDICT_CONTEXT_ID                 ;
    71         delete [] out_PREDICT_BRANCH_STATE               ;
    72         delete [] out_PREDICT_MATCH_INST_IFETCH_PTR      ;
    73         if (_param->_have_port_branch_update_prediction_id)
    74         delete [] out_PREDICT_BRANCH_UPDATE_PREDICTION_ID;
    75         delete [] out_PREDICT_BRANCH_CONDITION           ;
    76 //      delete [] out_PREDICT_BRANCH_STACK_WRITE         ;
    77         delete [] out_PREDICT_BRANCH_DIRECTION           ;
    78         delete [] out_PREDICT_ADDRESS_SRC                ;
    79         delete [] out_PREDICT_ADDRESS_DEST               ;
    80 //      delete []  in_PREDICT_CAN_CONTINUE               ;
     80        DELETE1_SIGNAL(in_CONTEXT_DECOD_ENABLE, _param->_nb_context,1);
     81        DELETE1_SIGNAL(in_CONTEXT_DEPTH       , _param->_nb_context,_param->_size_depth);
    8182
    82         delete []  in_CONTEXT_DECOD_ENABLE               ;
    83         if (_param->_have_port_depth)
    84         delete []  in_CONTEXT_DEPTH                      ;
     83        DELETE_SIGNAL (out_CONTEXT_EVENT_VAL          ,1);
     84        DELETE_SIGNAL ( in_CONTEXT_EVENT_ACK          ,1);
     85        DELETE_SIGNAL (out_CONTEXT_EVENT_CONTEXT_ID   ,_param->_size_context_id  );
     86        DELETE_SIGNAL (out_CONTEXT_EVENT_DEPTH        ,_param->_size_depth       );
     87        DELETE_SIGNAL (out_CONTEXT_EVENT_TYPE         ,_param->_size_event_type  );
     88        DELETE_SIGNAL (out_CONTEXT_EVENT_IS_DELAY_SLOT,1                         );
     89        DELETE_SIGNAL (out_CONTEXT_EVENT_ADDRESS      ,_param->_size_instruction_address);
     90        DELETE_SIGNAL (out_CONTEXT_EVENT_ADDRESS_EPCR ,_param->_size_instruction_address);
    8591
    86         delete    out_CONTEXT_EVENT_VAL                  ;
    87         delete     in_CONTEXT_EVENT_ACK                  ;
    88         if (_param->_have_port_context_id)
    89         delete    out_CONTEXT_EVENT_CONTEXT_ID           ;
    90         delete    out_CONTEXT_EVENT_TYPE                 ;
    91         delete    out_CONTEXT_EVENT_IS_DELAY_SLOT        ;
    92         delete    out_CONTEXT_EVENT_ADDRESS              ;
    93         delete    out_CONTEXT_EVENT_ADDRESS_EPCR         ;
     92
     93   
     94        delete    reg_CONTEXT_ADDRESS_PREVIOUS      ;
     95        delete [] reg_CONTEXT_IS_DELAY_SLOT         ;
     96       
     97        delete [] internal_CONTEXT_HAVE_TRANSACTION ;
     98        delete [] internal_CONTEXT_ADDRESS_PREVIOUS ;
     99        delete [] internal_CONTEXT_IS_DELAY_SLOT    ;
     100       
     101#ifdef STATISTICS
     102        delete [] internal_DECOD_VAL;
     103#endif
    94104      }
    95105
    96106    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    97     delete    reg_CONTEXT_ADDRESS_PREVIOUS      ;
    98     delete    reg_CONTEXT_IS_DELAY_SLOT         ;
     107    delete    _priority;
    99108
    100     delete    internal_CONTEXT_HAVE_TRANSACTION ;
    101     delete    internal_CONTEXT_ADDRESS_PREVIOUS ;
    102     delete    internal_CONTEXT_IS_DELAY_SLOT    ;
    103109
    104110    const uint32_t nb_opcod_type = 14;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_end_cycle.cpp

    r81 r88  
    2525
    2626#ifdef STATISTICS
    27     _stat->end_cycle();
     27    if (usage_is_set(_usage,USE_STATISTICS))
     28      _stat->end_cycle();
    2829#endif   
    2930
     
    3132    // Evaluation before read the ouput signal
    3233//  sc_start(0);
    33     _interfaces->testbench();
     34    if (usage_is_set(_usage,VHDL_TESTBENCH))
     35      _interfaces->testbench();
    3436#endif
    3537
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp

    r87 r88  
    2222  void Decod::genMealy (void)
    2323  {
    24     log_printf(TRACE,Decod,FUNCTION,"Begin");
     24    log_begin(Decod,FUNCTION);
     25    log_function(Decod,FUNCTION,_name.c_str());
    2526
    2627    //-----------------------------------
     
    3839      {
    3940        decod_val   [i] = false;
     41        predict_val [i] = false;
    4042      }
    4143
     
    5759    //-----------------------------------
    5860    // scan all decod "slot_out"
    59     log_printf(TRACE,Decod,FUNCTION,"KANE LIVE");   
    60     std::list<select_t>::iterator it=select.begin();
     61    std::list<generic::priority::select_t> * select = _priority->select();
     62    std::list<generic::priority::select_t>::iterator it=select->begin();
    6163    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    6264      {
    63         while ((it != select.end())     and  // have a no scanned "slot_in" ?
     65        while ((it != select->end())    and  // have a no scanned "slot_in" ?
    6466               (decod_val [i] == false) and  // have not a previous selected entry?
    6567               (context_event_val == false)) // Have not a context_event (spr_access, exception, ...)
    6668          {
    67             log_printf(TRACE,Decod,FUNCTION,"loop");   
    68 
    6969            predict_val [i] = false;
    7070
    71             Tcontext_t x = it->_context ;
    72             uint32_t   y = it->_inst_fetch;
     71            Tcontext_t x = it->grp;
     72            uint32_t   y = it->elt;
    7373
    7474            // Test if this instruction is valid
     
    7676                (can_continue [x]                == 1))    // context can decod instruction (have not a previous event)
    7777              {
    78                 can_continue      [x] = can_continue_next [x];
     78                log_printf(TRACE,Decod,FUNCTION,"  * IFETCH [%d][%d]",x,y);   
     79
     80                can_continue [x] = can_continue_next [x];
    7981
    8082                decod_val  [i]    = true;                        // fetch_val and decod_enable
     
    9092                _decod_instruction->_is_delay_slot    = internal_CONTEXT_IS_DELAY_SLOT [x];
    9193
    92                 // Decod !
    93                 log_printf(TRACE,Decod,FUNCTION,"DECOD [%d]",i);
    94                 log_printf(TRACE,Decod,FUNCTION,"  * context       : %d",x);
    95                 log_printf(TRACE,Decod,FUNCTION,"  * fetch         : %d",y);
    96                 log_printf(TRACE,Decod,FUNCTION,"  * address       : %.8x",addr);
    97                 log_printf(TRACE,Decod,FUNCTION,"  * is_delay_slot : %d",internal_CONTEXT_IS_DELAY_SLOT [x]);
    98 
    99                 instruction_decod (_decod_instruction, _decod_param[x]);
    100 
    101                 Ttype_t type = _decod_instruction->_type;
     94                // Test IFetch exception
     95                Texception_t ifetch_exception = PORT_READ(in_IFETCH_EXCEPTION [x]);
     96
     97                if (ifetch_exception == EXCEPTION_IFETCH_NONE)
     98                  {
     99                    // Decod !
     100                    log_printf(TRACE,Decod,FUNCTION,"  * DECOD [%d]",i);
     101                    log_printf(TRACE,Decod,FUNCTION,"    * context       : %d",x);
     102                    log_printf(TRACE,Decod,FUNCTION,"    * fetch         : %d",y);
     103                    log_printf(TRACE,Decod,FUNCTION,"    * address       : %.8x (%.8x)",addr,(addr<<2));
     104                    log_printf(TRACE,Decod,FUNCTION,"    * is_delay_slot : %d",internal_CONTEXT_IS_DELAY_SLOT [x]);
     105                   
     106                    instruction_decod (_decod_instruction, _decod_param[x]);
     107                  }
     108                else
     109                  {
     110                    // No decod : nop
     111                    instruction_l_nop (_decod_instruction, _decod_param[x]);
     112
     113                    _decod_instruction->_exception_use = EXCEPTION_USE_NONE;
     114                    _decod_instruction->_exception     = exception_ifetch_to_exception_decod(ifetch_exception);
     115                   
     116                    // INSTRUCTION_TLB 
     117                    // INSTRUCTION_PAGE
     118                    // BUS_ERROR       
     119                    if (_decod_instruction->_is_delay_slot)
     120                      _decod_instruction->_address_next       = _decod_instruction->_address_previous;
     121                    else
     122                      _decod_instruction->_address_next       = _decod_instruction->_address;
     123                   
     124                    _decod_instruction->_event_type         = EVENT_TYPE_EXCEPTION;
     125                  }
     126
     127                Ttype_t  type  = _decod_instruction->_type;
     128                Tdepth_t depth = (_param->_have_port_depth)?PORT_READ(in_CONTEXT_DEPTH [x]):0; // DEPTH_CURRENT
    102129
    103130                if (_param->_have_port_context_id)
    104131                PORT_WRITE(out_DECOD_CONTEXT_ID    [i], x);
    105132                if (_param->_have_port_depth)
    106                 PORT_WRITE(out_DECOD_DEPTH         [i], PORT_READ(in_CONTEXT_DEPTH [x]));
     133                PORT_WRITE(out_DECOD_DEPTH         [i], depth);
    107134                PORT_WRITE(out_DECOD_TYPE          [i], type);
    108135                PORT_WRITE(out_DECOD_OPERATION     [i], _decod_instruction->_operation     );
     136                PORT_WRITE(out_DECOD_NO_EXECUTE    [i], _decod_instruction->_no_execute    );
    109137                PORT_WRITE(out_DECOD_IS_DELAY_SLOT [i], _decod_instruction->_is_delay_slot );
    110138                PORT_WRITE(out_DECOD_ADDRESS       [i], addr);
     
    122150                PORT_WRITE(out_DECOD_NUM_REG_RE    [i], _decod_instruction->_num_reg_re    );
    123151                PORT_WRITE(out_DECOD_EXCEPTION_USE [i], _decod_instruction->_exception_use );
     152//              PORT_WRITE(out_DECOD_EXCEPTION     [i], _decod_instruction->_exception     );
    124153
    125154                if (type == TYPE_BRANCH)
    126155                  {
    127                     log_printf(TRACE,Decod,FUNCTION,"  * type is branch");
     156                    log_printf(TRACE,Decod,FUNCTION,"    * type is branch");
     157                    log_printf(TRACE,Decod,FUNCTION,"      * address src  : %.8x (%.8x)",_decod_instruction->_address     ,_decod_instruction->_address     <<2);
     158                    log_printf(TRACE,Decod,FUNCTION,"      * address dest : %.8x (%.8x)",_decod_instruction->_address_next,_decod_instruction->_address_next<<2);
    128159
    129160                    predict_val [i]     = ifetch_ack  [x][y] // and decod_val [i]
     
    136167                    PORT_WRITE(out_PREDICT_MATCH_INST_IFETCH_PTR       [i],y == ((_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_IFETCH_INST_IFETCH_PTR [x]):0));
    137168                    PORT_WRITE(out_PREDICT_BRANCH_STATE                [i],PORT_READ(in_IFETCH_BRANCH_STATE                [x]));
    138                     if (_param->_have_port_branch_update_prediction_id)
    139                     PORT_WRITE(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i],PORT_READ(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x]));
     169                    if (_param->_have_port_depth)
     170                    PORT_WRITE(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i],PORT_READ(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x]));
    140171                    PORT_WRITE(out_PREDICT_BRANCH_CONDITION            [i],_decod_instruction->_branch_condition  );
    141172//                  PORT_WRITE(out_PREDICT_BRANCH_STACK_WRITE          [i],_decod_instruction->_branch_stack_write);
     
    145176               
    146177                    //can_continue_next [x] = PORT_READ(in_PREDICT_CAN_CONTINUE [i]); // can continue is set if direction is "not take" (also, continue is sequential order)
    147                     can_continue_next [x] = false; // one branch per context
     178                    can_continue_next [x] = false; // one branch per context, the DS don't execute
    148179                  }
    149180
     
    160191                    if (_param->_have_port_context_id)
    161192                    PORT_WRITE(out_CONTEXT_EVENT_CONTEXT_ID   , x);
     193                    if (_param->_have_port_depth)
     194                    PORT_WRITE(out_CONTEXT_EVENT_DEPTH        , depth);
    162195                    PORT_WRITE(out_CONTEXT_EVENT_TYPE         , _decod_instruction->_event_type    );
    163196                    PORT_WRITE(out_CONTEXT_EVENT_IS_DELAY_SLOT, _decod_instruction->_is_delay_slot );
     
    184217              }
    185218
    186             log_printf(TRACE,Decod,FUNCTION,"  - num_(decod, context, fetch) : %d %d %d",i, x, y);
    187             log_printf(TRACE,Decod,FUNCTION,"    - ifetch_ack        : %d",ifetch_ack  [x][y]);
    188             log_printf(TRACE,Decod,FUNCTION,"    - context_event_val : %d",context_event_val );
    189             log_printf(TRACE,Decod,FUNCTION,"    - predict_val       : %d",predict_val [i]   );
    190             log_printf(TRACE,Decod,FUNCTION,"    - decod_val         : %d",decod_val   [i]   );
     219            log_printf(TRACE,Decod,FUNCTION,"    - num_(decod, context, fetch) : %d %d %d",i, x, y);
     220            log_printf(TRACE,Decod,FUNCTION,"      - ifetch_ack        : %d",ifetch_ack  [x][y]);
     221            log_printf(TRACE,Decod,FUNCTION,"      - context_event_val : %d",context_event_val );
     222            log_printf(TRACE,Decod,FUNCTION,"      - predict_val       : %d",predict_val [i]   );
     223            log_printf(TRACE,Decod,FUNCTION,"      - decod_val         : %d",decod_val   [i]   );
    191224           
    192225            it ++;
     
    207240        PORT_WRITE(out_PREDICT_VAL [i], predict_val [i]);
    208241        PORT_WRITE(out_DECOD_VAL   [i], decod_val   [i]);
    209       }
    210 
    211     log_printf(FUNC,Decod,FUNCTION,"End");
     242       
     243#ifdef STATISTICS
     244        internal_DECOD_VAL [i] = decod_val [i];
     245#endif
     246      }
     247
     248    log_end(Decod,FUNCTION);
    212249  };
    213250
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_statistics_allocation.cpp

    r81 r88  
    2727                      "Decod",
    2828                      param_statistics);
    29    
    30     _stat_sum_inst_decod = _stat->create_variable ("sum_inst_decod" // ,"", "Sum of decod instruction"
    31                                                    );
    3229
     30    _stat_sum_inst_decod = _stat->create_variable("sum_inst_decod");
     31   
     32   
     33    _stat->create_expr_average_by_cycle ("average_nb_inst_decod","sum_inst_decod","","Average of decod instruction by cycle");
     34    _stat->create_expr_percent          ("percent_nb_inst_decod","average_nb_inst_decod", toString(_param->_nb_inst_decod), "Percent of decod instruction by cycle");
     35 
    3336
    34     _stat->create_expr_average_by_cycle ("average_sum_inst_decod","sum_inst_decod","","Average of decod instruction by cycle");
    35     _stat->create_expr_percent          ("percent_sum_inst_decod","average_sum_inst_decod", toString(_param->_nb_inst_decod), "Percent of decod instruction by cycle");
    3637 
    3738    log_printf(FUNC,Decod,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_transition.cpp

    r87 r88  
    2222  void Decod::transition (void)
    2323  {
    24     log_printf(FUNC,Decod,FUNCTION,"Begin");
     24    log_begin(Decod,FUNCTION);
    2525
    2626    if (PORT_READ(in_NRESET) == 0)
    2727      {
    28         reg_CONTEXT_PRIORITY = 0;
     28        _priority->reset();
    2929
    3030        for (uint32_t i=0; i<_param->_nb_context; i++)
     
    3636    else
    3737      {
    38         switch (_param->_priority)
    39           {
    40 //        case PRIORITY_STATIC :
    41 //          {
    42 //            reg_CONTEXT_PRIORITY = (reg_CONTEXT_PRIORITY+_param->_nb_context_select)%_param->_nb_context;
    43 //            break;
    44 //          }
    45           case PRIORITY_ROUND_ROBIN :
    46             {
    47               reg_CONTEXT_PRIORITY = (reg_CONTEXT_PRIORITY+1                         )%_param->_nb_context;
    48               break;
    49             }
    50           default:
    51             {
    52               break;
    53             }
    54           }
    55 
    56         // flush list
    57         select.clear();
    58        
    59         // Compute next scan order !!!
    60         switch (_param->_load_balancing)
    61           {
    62 //        case LOAD_BALANCING_BALANCE :
    63 //          {
    64 //            for (uint32_t j=0; j<_param->_max_nb_inst_fetch; j++)
    65 //              for (uint32_t i=0; i<_param->_nb_context_select; i++)
    66 //                {
    67 //                  uint32_t x=(reg_CONTEXT_PRIORITY+i)%_param->_nb_context;
    68                    
    69 //                  // Test valid inst_fetch
    70 //                  if (j < _param->_nb_inst_fetch[x])
    71 //                    select.push_back(select_t(x,j));
    72 //                }
    73                  
    74 //            break;
    75 //          }
    76           case LOAD_BALANCING_MAXIMUM_FOR_PRIORITY :
    77             {
    78 
    79               for (uint32_t i=0; i<_param->_nb_context_select; i++)
    80                 {
    81                   uint32_t x=(reg_CONTEXT_PRIORITY+i)%_param->_nb_context;
    82                  
    83                   for (uint32_t j=0; j<_param->_nb_inst_fetch[x]; j++)
    84                     select.push_back(select_t(x,j));
    85                 }
    86 
    87               break;
    88             }
    89           default :
    90             {
    91               break;
    92             }
    93           }
     38        _priority->transition();
    9439
    9540        // Compute "next previous" address
     
    9742          if (internal_CONTEXT_HAVE_TRANSACTION[i])
    9843            {
    99 #ifdef STATISTICS
    100               (*_stat_sum_inst_decod) ++;
    101 #endif
    102 
    10344              reg_CONTEXT_ADDRESS_PREVIOUS [i] = internal_CONTEXT_ADDRESS_PREVIOUS [i];
    10445              reg_CONTEXT_IS_DELAY_SLOT    [i] = internal_CONTEXT_IS_DELAY_SLOT    [i];
     
    10748//      for (uint32_t i=0; i<_param->_nb_context; i++)
    10849//        log_printf(TRACE,Decod,FUNCTION,"[%d] %.8x %d",i,reg_CONTEXT_ADDRESS_PREVIOUS [i], reg_CONTEXT_IS_DELAY_SLOT [i]);
     50
     51#ifdef STATISTICS
     52        if (usage_is_set(_usage,USE_STATISTICS))
     53          for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     54            if (internal_DECOD_VAL [i] and PORT_READ(in_DECOD_ACK[i]))
     55              (*_stat_sum_inst_decod) ++;
     56#endif
    10957      }
    11058
     
    11361#endif
    11462
    115     log_printf(FUNC,Decod,FUNCTION,"End");
     63    log_end(Decod,FUNCTION);
    11664  };
    11765
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters.cpp

    r87 r88  
    11/*
    2 
    32 * $Id$
    43 *
     
    2423                          uint32_t          * nb_inst_fetch                ,
    2524                          uint32_t            nb_inst_decod                ,
    26                           uint32_t            nb_branch_speculated         ,
    27                           uint32_t            size_branch_update_prediction,
     25                          uint32_t          * nb_branch_speculated         ,
     26//                        uint32_t          * size_branch_update_prediction,
    2827                          uint32_t            nb_context_select            ,
    2928                          uint32_t            size_general_data            ,
     
    3130                          Tload_balancing_t   load_balancing               ,
    3231                          bool             ** instruction_implemeted       ,
    33                           morpheo::behavioural::custom::custom_information_t (*get_custom_information) (uint32_t))
     32                          morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void),
     33                          bool                is_toplevel
     34                          )
    3435  {
    3536    log_printf(FUNC,Decod,FUNCTION,"Begin");
     
    4041    _nb_branch_speculated          = nb_branch_speculated         ;
    4142    _nb_context_select             = nb_context_select            ;
    42     _size_branch_update_prediction = size_branch_update_prediction;
    43     _size_general_data             = size_general_data            ;
     43//  _size_branch_update_prediction = size_branch_update_prediction;
     44//  _size_general_data             = size_general_data            ;
    4445    _priority                      = priority                     ;
    4546    _load_balancing                = load_balancing               ;
     
    5253
    5354   
    54     _max_nb_inst_fetch                     = max<uint32_t>(nb_inst_fetch,nb_context);
     55    _max_nb_inst_fetch                        = max<uint32_t>(nb_inst_fetch,nb_context);
     56                                             
     57//  _size_address_inst                        = size_general_data-2;
    5558
    56     _size_address_inst                     = size_general_data-2;
    57     _size_context_id                       = log2(nb_context          );
    58     _size_depth                            = log2(nb_branch_speculated);
    59     _size_inst_ifetch_ptr                  = log2(_max_nb_inst_fetch  );
     59    test();
    6060
    61     _have_port_context_id                  = _size_context_id > 0;
    62     _have_port_depth                       = _size_depth      > 0;
    63     _have_port_branch_update_prediction_id = _size_branch_update_prediction > 0;
    64     _have_port_inst_ifetch_ptr             = _size_inst_ifetch_ptr > 0;
    65    
    66     test();
     61    if (is_toplevel)
     62      {
     63        _size_context_id                      = log2(nb_context          );
     64        _size_depth                           = log2(max<uint32_t>(_nb_branch_speculated,_nb_context));
     65//      _size_branch_update_prediction_id     = max<uint32_t>(_size_branch_update_prediction,_nb_context);
     66        _size_inst_ifetch_ptr                 = log2(_max_nb_inst_fetch  );
     67        _size_instruction_address             = size_general_data-2;
     68        _size_general_data                    = size_general_data;
     69
     70        _have_port_context_id                 = _size_context_id > 0;
     71        _have_port_depth                      = _size_depth                       > 0;
     72//      _have_port_branch_update_prediction_id= _size_branch_update_prediction_id > 0;
     73        _have_port_inst_ifetch_ptr            = _size_inst_ifetch_ptr             > 0;
     74
     75        copy ();
     76      }
     77
    6778    log_printf(FUNC,Decod,FUNCTION,"End");
    6879  };
     
    8293  {
    8394    log_printf(FUNC,Decod,FUNCTION,"Begin");
     95
     96    log_printf(FUNC,Decod,FUNCTION,"End");
     97  };
     98
     99#undef  FUNCTION
     100#define FUNCTION "Decod::copy"
     101  void Parameters::copy (void)
     102  {
     103    log_printf(FUNC,Decod,FUNCTION,"Begin");
     104
    84105    log_printf(FUNC,Decod,FUNCTION,"End");
    85106  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters_msg_error.cpp

    r87 r88  
    3131      test.error(_("nb_inst_decod must be > 0.\n"));
    3232
    33     if ((_size_general_data != 32) and
    34         (_size_general_data != 64))
    35       test.error(_("size_general_data must be equal at 32 or 64 bits.\n"));
     33//  if ((_size_general_data != 32) and
     34//      (_size_general_data != 64))
     35//    test.error(_("size_general_data must be equal at 32 or 64 bits.\n"));
    3636
    37     if ((_nb_branch_speculated == 0) or
    38         (_nb_branch_speculated > _nb_context))
    39       test.error(_("nb_branch_speculated must be in [1:nb_context].\n"));
     37//     if ((_nb_branch_speculated == 0) or
     38//      (_nb_branch_speculated > _nb_context))
     39//       test.error(_("nb_branch_speculated must be in [1:nb_context].\n"));
    4040
    4141    if ((_nb_context_select == 0) or
     
    4848
    4949    if (sum_inst_fetch < _nb_inst_decod)
    50       test.error(_("The sum of the _nb_context_select most nb_inst_fetch must be greater that _nb_inst_decod"));
     50      test.error(_("The sum of the _nb_context_select most nb_inst_fetch must be greater that _nb_inst_decod\n"));
    5151
    5252    if ((_priority != PRIORITY_ROUND_ROBIN))
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters_print.cpp

    r81 r88  
    3030    xml.singleton_begin("nb_inst_decod                "); xml.attribut("value",toString(_nb_inst_decod                )); xml.singleton_end();
    3131    xml.singleton_begin("nb_branch_speculated         "); xml.attribut("value",toString(_nb_branch_speculated         )); xml.singleton_end();
    32     xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end();
     32//  xml.singleton_begin("size_branch_update_prediction"); xml.attribut("value",toString(_size_branch_update_prediction)); xml.singleton_end();
    3333    xml.singleton_begin("nb_context_select            "); xml.attribut("value",toString(_nb_context_select            )); xml.singleton_end();
    3434    xml.singleton_begin("size_general_data            "); xml.attribut("value",toString(_size_general_data            )); xml.singleton_end();
Note: See TracChangeset for help on using the changeset viewer.