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/Prediction_unit/src
Files:
6 edited

Legend:

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

    r82 r88  
    4141                          uint32_t     dir_pht_size_address_share [3],
    4242                          uint32_t *   ras_size_queue                ,//[nb_context]
    43                           uint32_t *   upt_size_queue                 //[nb_context]
     43                          uint32_t *   upt_size_queue                ,//[nb_context]
     44                          bool         is_toplevel
    4445                          )
    4546  {
     
    7273    _ras_size_queue             = ras_size_queue            ;
    7374    _upt_size_queue             = upt_size_queue            ;
    74 
    75     _size_context_id            = log2(_nb_context);
    76 //   public : uint32_t *   _size_inst_ifetch_ptr          ;//[nb_context]
    77 
    78     _size_depth                 = new uint32_t [_nb_context];
     75   
     76    _array_size_depth           = new uint32_t [_nb_context];
    7977    _size_ras_index             = new uint32_t [_nb_context];
     78
    8079    for (uint32_t i=0; i<_nb_context; i++)
    8180      {
    82         _size_depth    [i] = log2(_upt_size_queue [i]);
    83         _size_ras_index [i] = log2(_ras_size_queue [i]);
     81        _array_size_depth [i] = log2(_upt_size_queue [i]);
     82        _size_ras_index   [i] = log2(_ras_size_queue [i]);
    8483      }
    85 
    86     _max_size_depth             = max<uint32_t>(_size_depth,_nb_context);
    87     _have_port_context_id       = (_size_context_id > 0);
    88     _have_port_max_depth        = (_max_size_depth  > 0);
    89 //   public : bool     *   _have_port_inst_ifetch_ptr     ;//[nb_context]
    9084
    9185    _param_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue   ::Parameters
     
    9488       _size_address          ,
    9589       _nb_instruction        ,
    96        _size_depth            ,
     90       _array_size_depth      ,
    9791       _nb_inst_decod         ,
    9892       _nb_inst_branch_predict,
     
    10094       _nb_inst_branch_update );
    10195
    102     _size_inst_ifetch_ptr      = _param_glue->_size_inst_ifetch_ptr     ;
    103     _have_port_depth           = _param_glue->_have_port_depth;
    104     _have_port_inst_ifetch_ptr = _param_glue->_have_port_inst_ifetch_ptr;
    105     _have_port_history         = (_size_history > 0);
    106    
    10796    _param_btb  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::branch_target_buffer   ::Parameters
    10897      (_nb_context            ,
     
    116105       _nb_inst_branch_update ,
    117106       _btb_victim_scheme     );
    118 
     107   
    119108    _param_dir  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction              ::Parameters
    120109      (_dir_predictor_scheme      ,
     
    130119       _dir_pht_size_address_share);
    131120
    132     _size_history = _param_dir->_size_history;
     121    _size_history      = _param_dir->_size_history;
     122    _have_port_history = (_size_history > 0);
    133123
    134124    _param_ras  = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack   ::Parameters
     
    150140       _size_history           ,
    151141       _size_ras_index         );
     142
     143
     144    if (is_toplevel)
     145      {
     146        _size_context_id           = log2(_nb_context);
     147        _size_depth                = max<uint32_t>(_array_size_depth,_nb_context);
     148        _size_inst_ifetch_ptr      = log2(max<uint32_t>(_nb_instruction,_nb_context));
     149        _size_instruction_address  = size_address;
     150//      _size_nb_inst_decod        = ;
     151//      _size_nb_inst_commit       = ;
     152//      _size_ifetch_queue_ptr     = ;
     153   
     154        _have_port_context_id      = (_size_context_id > 0);
     155        _have_port_depth           = (_size_depth  > 0);
     156        _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0;
     157//      _have_port_ifetch_queue_ptr= _size_ifetch_queue_ptr > 0;
     158
     159        copy ();
     160      }
    152161
    153162    test();
     
    176185    delete _param_glue;
    177186
    178     delete [] _size_depth    ;
     187    delete [] _array_size_depth;
    179188    delete [] _size_ras_index;
     189
     190    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
     191  };
     192
     193#undef  FUNCTION
     194#define FUNCTION "Prediction_unit::copy"
     195  void Parameters::copy (void)
     196  {
     197    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
     198 
     199    COPY(_param_btb );
     200    COPY(_param_dir );
     201    COPY(_param_ras );
     202    COPY(_param_upt );
     203    COPY(_param_glue);
    180204
    181205    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit.cpp

    r81 r88  
    3737    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
    3838
     39#if DEBUG_Prediction_unit == true
     40    log_printf(INFO,Prediction_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
     41
     42    std::cout << *param << std::endl;
     43#endif   
     44
    3945    log_printf(INFO,Prediction_unit,FUNCTION,"Allocation");
    4046
     
    4652
    4753#ifdef STATISTICS
    48     if (_usage & USE_STATISTICS)
     54    if (usage_is_set(_usage,USE_STATISTICS))
    4955      {
    5056        log_printf(INFO,Prediction_unit,FUNCTION,"Allocation of statistics");
     
    5561
    5662#ifdef VHDL
    57     if (_usage & USE_VHDL)
     63    if (usage_is_set(_usage,USE_VHDL))
    5864      {
    5965        // generate the vhdl
     
    6571
    6672#ifdef SYSTEMC
    67     if (_usage & USE_SYSTEMC)
     73    if (usage_is_set(_usage,USE_SYSTEMC))
    6874      {
    6975        log_printf(INFO,Prediction_unit,FUNCTION,"Method - transition");
     
    8995
    9096#ifdef STATISTICS
    91     if (_usage & USE_STATISTICS)
     97    if (usage_is_set(_usage,USE_STATISTICS))
    9298      {
    9399        statistics_deallocation();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_allocation.cpp

    r82 r88  
    6565        ALLOC1_SIGNAL_OUT(out_PREDICT_PC_NEXT                    ,"pc_next"                    ,Taddress_t         ,_param->_size_address);
    6666        ALLOC1_SIGNAL_OUT(out_PREDICT_PC_NEXT_IS_DS_TAKE         ,"pc_next_is_ds_take"         ,Tcontrol_t         ,1);
    67         ALLOC1_SIGNAL_OUT(out_PREDICT_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr [alloc_signal_it1]);
     67        ALLOC1_SIGNAL_OUT(out_PREDICT_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr);
    6868        ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state);
    69         ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth [alloc_signal_it1]);
     69        ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth);
    7070      }
    7171      {
    72         ALLOC2_INTERFACE("predict",IN,SOUTH,"Interface with ifetch unit",_param->_nb_context,_param->_nb_instruction[alloc_interface_it1]);
    73         _ALLOC2_SIGNAL_OUT(out_PREDICT_INSTRUCTION_ENABLE         ,"instruction_enable"         ,Tcontrol_t         ,1,_param->_nb_context,_param->_nb_instruction[alloc_signal_it1]);
     72        ALLOC2_INTERFACE("predict",IN,SOUTH,"Interface with ifetch unit",_param->_nb_context,_param->_nb_instruction[it1]);
     73        _ALLOC2_SIGNAL_OUT(out_PREDICT_INSTRUCTION_ENABLE         ,"instruction_enable"         ,Tcontrol_t         ,1,_param->_nb_context,_param->_nb_instruction[it1]);
    7474      }
    7575    }
     
    7878    {
    7979      {
    80         ALLOC2_INTERFACE("decod",IN,SOUTH,"Interface with decod unit",_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_interface_it1]);
     80        ALLOC2_INTERFACE("decod",IN,SOUTH,"Interface with decod unit",_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
    8181       
    82         _ALLOC2_VALACK_IN ( in_DECOD_VAL                        ,VAL,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    83         _ALLOC2_VALACK_OUT(out_DECOD_ACK                        ,ACK,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    84         _ALLOC2_SIGNAL_IN ( in_DECOD_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id      ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    85         _ALLOC2_SIGNAL_IN ( in_DECOD_MATCH_INST_IFETCH_PTR      ,"match_inst_ifetch_ptr"      ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    86         _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state    ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    87         _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_max_size_depth       ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    88         _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_CONDITION           ,"branch_condition"           ,Tbranch_condition_t,_param->_size_branch_condition,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    89         _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    90         _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_SRC                ,"address_src"                ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
    91         _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_DEST               ,"address_dest"               ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
     82        _ALLOC2_VALACK_IN ( in_DECOD_VAL                        ,VAL,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     83        _ALLOC2_VALACK_OUT(out_DECOD_ACK                        ,ACK,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     84        _ALLOC2_SIGNAL_IN ( in_DECOD_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id      ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     85        _ALLOC2_SIGNAL_IN ( in_DECOD_MATCH_INST_IFETCH_PTR      ,"match_inst_ifetch_ptr"      ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     86        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state    ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     87        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth           ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     88        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_CONDITION           ,"branch_condition"           ,Tbranch_condition_t,_param->_size_branch_condition,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     89        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     90        _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_SRC                ,"address_src"                ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
     91        _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_DEST               ,"address_dest"               ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
    9292      }
    9393    }
     
    100100      ALLOC1_VALACK_OUT(out_BRANCH_COMPLETE_ACK            ,ACK);
    101101      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_CONTEXT_ID     ,"context_id"     ,Tcontext_t,_param->_size_context_id);
    102       ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_max_size_depth);
     102      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_size_depth);
    103103      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS        ,"address"        ,Taddress_t,_param->_size_address);
    104104      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_FLAG           ,"flag"           ,Tcontrol_t,1);
     
    116116      ALLOC1_VALACK_IN ( in_BRANCH_EVENT_ACK            ,ACK);
    117117//    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_CONTEXT_ID     ,"context_id"     ,Tcontext_t,_param->_size_context_id);
    118 //    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_max_size_depth);
     118//    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_size_depth);
    119119//    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1);
    120120      ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_SRC    ,"address_src"    ,Taddress_t,_param->_size_address);
     
    126126      ALLOC1_INTERFACE("depth",OUT,SOUTH,"Interface with depth",_param->_nb_context);
    127127
    128       ALLOC1_SIGNAL_OUT(out_DEPTH_NB_BRANCH    ,"nb_branch"    ,Tdepth_t,_param->_size_depth[alloc_signal_it1]+1);
    129       ALLOC1_SIGNAL_OUT(out_DEPTH_TAIL         ,"tail"         ,Tdepth_t,_param->_size_depth[alloc_signal_it1]);
     128      ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT      ,"current"      ,Tdepth_t,_param->_size_depth);
     129      ALLOC1_SIGNAL_OUT(out_DEPTH_MIN          ,"min"          ,Tdepth_t,_param->_size_depth);
     130      ALLOC1_SIGNAL_OUT(out_DEPTH_MAX          ,"max"          ,Tdepth_t,_param->_size_depth+1);
    130131    }
    131132
     
    551552          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_CONTEXT_ID"      ,
    552553                                   dest,"out_PREDICT_UPT_"+toString(i)+"_CONTEXT_ID"      );
     554          if (_param->_have_port_depth)
     555          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+       "_UPDATE_PREDICTION_ID",
     556                                   dest, "in_PREDICT_UPT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
    553557          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_ADDRESS_SRC" ,
    554558                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_ADDRESS_SRC" );
     
    593597          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_DECOD"          ,
    594598                                   dest,"out_DECOD_UPT_"+toString(i)+"_MISS_DECOD"          );
    595           if (_param->_have_port_max_depth)
     599          if (_param->_have_port_depth)
    596600          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_UPDATE_PREDICTION_ID",
    597601                                   dest,"out_DECOD_UPT_"+toString(i)+"_UPDATE_PREDICTION_ID");
     602          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_IS_ACCURATE"         ,
     603                                   dest,"out_DECOD_UPT_"+toString(i)+"_IS_ACCURATE"         );
    598604         
    599605          //out_DECOD_UPT_RAS_INDEX - component_map return_address_stack
     
    650656          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID"     ,
    651657                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID"     );
    652           if (_param->_have_port_max_depth)
     658          if (_param->_have_port_depth)
    653659          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"          ,
    654660                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"          );
     
    684690      for (uint32_t i=0; i<_param->_nb_context; i++)
    685691        {
    686           dest = _name+"_prediction_unit_glue";
    687          
     692          dest = _name;
    688693#ifdef POSITION
    689694          _component->interface_map (src ,"depth_"+toString(i),
     
    691696#endif
    692697         
    693           COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_NB_BRANCH",
    694                                    dest, "in_DEPTH_"+toString(i)+"_UPT_NB_BRANCH");
    695 
    696           if (_param->_have_port_depth[i])
    697           COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_TAIL"     ,
    698                                    dest, "in_DEPTH_"+toString(i)+"_UPT_TAIL"     );
    699         }
    700 
     698          if (_param->_have_port_depth)
     699            {
     700          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_CURRENT",
     701                              dest,"out_DEPTH_"+toString(i)+"_CURRENT");
     702          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN",
     703                              dest,"out_DEPTH_"+toString(i)+"_MIN");
     704            }
     705          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX",
     706                              dest,"out_DEPTH_"+toString(i)+"_MAX");
     707        }
     708
     709//       for (uint32_t i=0; i<_param->_nb_context; i++)
     710//      {
     711//        dest = _name+"_prediction_unit_glue";
     712         
     713// #ifdef POSITION
     714//        _component->interface_map (src ,"depth_"+toString(i),
     715//                                   dest,"depth_"+toString(i));
     716// #endif
     717         
     718//        COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_NB_BRANCH",
     719//                                 dest, "in_DEPTH_"+toString(i)+"_UPT_NB_BRANCH");
     720
     721//        if (_param->_have_port_depth)
     722//        COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_TAIL"     ,
     723//                                 dest, "in_DEPTH_"+toString(i)+"_UPT_TAIL"     );
     724//      }
    701725    }
    702726
     
    741765          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         ,
    742766                              dest,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         );
    743           if (_param->_have_port_inst_ifetch_ptr [i])
     767          if (_param->_have_port_inst_ifetch_ptr)
    744768          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            ,
    745769                              dest,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            );
    746770          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               ,
    747771                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               );
    748           if (_param->_have_port_depth [i])
     772          if (_param->_have_port_depth)
    749773          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID",
    750774                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
     
    783807            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               ,
    784808                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               );
    785             if (_param->_have_port_max_depth)
     809            if (_param->_have_port_depth)
    786810            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID",
    787811                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID");
     
    796820          }
    797821
    798       for (uint32_t i=0; i<_param->_nb_context; i++)
    799         {
    800           dest = _name;
    801 #ifdef POSITION
    802           _component->interface_map (src ,"depth_"+toString(i),
    803                                      dest,"depth_"+toString(i));
    804 #endif
    805          
    806           PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_NB_BRANCH",dest,"out_DEPTH_"+toString(i)+"_NB_BRANCH");
    807           if (_param->_have_port_depth[i])
    808           PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_TAIL"     ,dest,"out_DEPTH_"+toString(i)+"_TAIL"     );
    809         }
     822//       for (uint32_t i=0; i<_param->_nb_context; i++)
     823//      {
     824//        dest = _name;
     825// #ifdef POSITION
     826//        _component->interface_map (src ,"depth_"+toString(i),
     827//                                   dest,"depth_"+toString(i));
     828// #endif
     829         
     830//        PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_NB_BRANCH",dest,"out_DEPTH_"+toString(i)+"_NB_BRANCH");
     831//        if (_param->_have_port_depth)
     832//        PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_TAIL"     ,dest,"out_DEPTH_"+toString(i)+"_TAIL"     );
     833//      }
    810834    }
    811835
    812836    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    813     _component->test_map(false);
    814 
    815 #ifdef POSITION
    816     _component->generate_file();
     837#if DEBUG_Prediction_unit == true
     838    _component->test_map();
     839#endif
     840
     841#ifdef POSITION
     842    if (usage_is_set(_usage,USE_POSITION))
     843      _component->generate_file();
    817844#endif
    818845
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_deallocation.cpp

    r82 r88  
    2323    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
    2424
    25     if (_usage & USE_SYSTEMC)
     25    if (usage_is_set(_usage,USE_SYSTEMC))
    2626      {
    2727        delete    in_CLOCK ;
     
    3030        DELETE1_SIGNAL( in_PREDICT_VAL                        ,_param->_nb_context,1);
    3131        DELETE1_SIGNAL(out_PREDICT_ACK                        ,_param->_nb_context,1);
    32         DELETE1_SIGNAL( in_PREDICT_PC_PREVIOUS                ,_param->_nb_context,_param->_size_address);
    33         DELETE1_SIGNAL( in_PREDICT_PC_CURRENT                 ,_param->_nb_context,_param->_size_address);
     32        DELETE1_SIGNAL( in_PREDICT_PC_PREVIOUS                ,_param->_nb_context,_param->_size_instruction_address);
     33        DELETE1_SIGNAL( in_PREDICT_PC_CURRENT                 ,_param->_nb_context,_param->_size_instruction_address);
    3434        DELETE1_SIGNAL( in_PREDICT_PC_CURRENT_IS_DS_TAKE      ,_param->_nb_context,1);
    35         DELETE1_SIGNAL(out_PREDICT_PC_NEXT                    ,_param->_nb_context,_param->_size_address);
     35        DELETE1_SIGNAL(out_PREDICT_PC_NEXT                    ,_param->_nb_context,_param->_size_instruction_address);
    3636        DELETE1_SIGNAL(out_PREDICT_PC_NEXT_IS_DS_TAKE         ,_param->_nb_context,1);
    37         DELETE1_SIGNAL(out_PREDICT_INST_IFETCH_PTR            ,_param->_nb_context,_param->_size_inst_ifetch_ptr [alloc_signal_it1]);
     37        DELETE1_SIGNAL(out_PREDICT_INST_IFETCH_PTR            ,_param->_nb_context,_param->_size_inst_ifetch_ptr);
    3838        DELETE1_SIGNAL(out_PREDICT_BRANCH_STATE               ,_param->_nb_context,_param->_size_branch_state);
    39         DELETE1_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_context,_param->_size_depth [alloc_signal_it1]);
     39        DELETE1_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_context,_param->_size_depth );
    4040
    41         DELETE2_SIGNAL(out_PREDICT_INSTRUCTION_ENABLE       ,_param->_nb_context,_param->_nb_instruction[alloc_signal_it1],1);
    42         DELETE2_SIGNAL( in_DECOD_VAL                        ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],1);
    43         DELETE2_SIGNAL(out_DECOD_ACK                        ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],1);
    44         DELETE2_SIGNAL( in_DECOD_CONTEXT_ID                 ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_context_id      );
    45         DELETE2_SIGNAL( in_DECOD_MATCH_INST_IFETCH_PTR      ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],1                             );
    46         DELETE2_SIGNAL( in_DECOD_BRANCH_STATE               ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_branch_state    );
    47         DELETE2_SIGNAL( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_max_size_depth       );
    48         DELETE2_SIGNAL( in_DECOD_BRANCH_CONDITION           ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_branch_condition);
    49         DELETE2_SIGNAL( in_DECOD_BRANCH_DIRECTION           ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],1                             );
    50         DELETE2_SIGNAL( in_DECOD_ADDRESS_SRC                ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_address         );
    51         DELETE2_SIGNAL( in_DECOD_ADDRESS_DEST               ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1],_param->_size_address         );
     41        DELETE2_SIGNAL(out_PREDICT_INSTRUCTION_ENABLE       ,_param->_nb_context,_param->_nb_instruction[it1],1);
     42        DELETE2_SIGNAL( in_DECOD_VAL                        ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],1);
     43        DELETE2_SIGNAL(out_DECOD_ACK                        ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],1);
     44        DELETE2_SIGNAL( in_DECOD_CONTEXT_ID                 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_context_id      );
     45        DELETE2_SIGNAL( in_DECOD_MATCH_INST_IFETCH_PTR      ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],1                             );
     46        DELETE2_SIGNAL( in_DECOD_BRANCH_STATE               ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_branch_state    );
     47        DELETE2_SIGNAL( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_depth           );
     48        DELETE2_SIGNAL( in_DECOD_BRANCH_CONDITION           ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_branch_condition);
     49        DELETE2_SIGNAL( in_DECOD_BRANCH_DIRECTION           ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],1                             );
     50        DELETE2_SIGNAL( in_DECOD_ADDRESS_SRC                ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_instruction_address         );
     51        DELETE2_SIGNAL( in_DECOD_ADDRESS_DEST               ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1],_param->_size_instruction_address         );
    5252     
    5353        DELETE1_SIGNAL( in_BRANCH_COMPLETE_VAL            ,_param->_nb_inst_branch_complete,1);
    5454        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ACK            ,_param->_nb_inst_branch_complete,1);
    5555        DELETE1_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_ID     ,_param->_nb_inst_branch_complete,_param->_size_context_id);
    56         DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete,_param->_max_size_depth);
    57         DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete,_param->_size_address);
     56        DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete,_param->_size_depth);
     57        DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
    5858        DELETE1_SIGNAL( in_BRANCH_COMPLETE_FLAG           ,_param->_nb_inst_branch_complete,1);
    5959        DELETE1_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION,_param->_nb_inst_branch_complete,1);
    6060        DELETE1_SIGNAL(out_BRANCH_COMPLETE_TAKE           ,_param->_nb_inst_branch_complete,1);
    61         DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC    ,_param->_nb_inst_branch_complete,_param->_size_address);
    62         DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST   ,_param->_nb_inst_branch_complete,_param->_size_address);
     61        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC    ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
     62        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST   ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
    6363
    6464        DELETE1_SIGNAL(out_BRANCH_EVENT_VAL            ,_param->_nb_context,1);
    6565        DELETE1_SIGNAL( in_BRANCH_EVENT_ACK            ,_param->_nb_context,1);
    6666//      DELETE1_SIGNAL(out_BRANCH_EVENT_CONTEXT_ID     ,_param->_nb_context,_param->_size_context_id);
    67 //      DELETE1_SIGNAL(out_BRANCH_EVENT_DEPTH          ,_param->_nb_context,_param->_max_size_depth);
     67//      DELETE1_SIGNAL(out_BRANCH_EVENT_DEPTH          ,_param->_nb_context,_param->_size_depth);
    6868//      DELETE1_SIGNAL(out_BRANCH_EVENT_MISS_PREDICTION,_param->_nb_context,1);
    69         DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_SRC    ,_param->_nb_context,_param->_size_address);
    70         DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST   ,_param->_nb_context,_param->_size_address);
     69        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_SRC    ,_param->_nb_context,_param->_size_instruction_address);
     70        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST   ,_param->_nb_context,_param->_size_instruction_address);
    7171
    72         DELETE1_SIGNAL(out_DEPTH_NB_BRANCH    ,_param->_nb_context,_param->_size_depth[alloc_signal_it1]+1);
    73         DELETE1_SIGNAL(out_DEPTH_TAIL         ,_param->_nb_context,_param->_size_depth[alloc_signal_it1]);
     72        DELETE1_SIGNAL(out_DEPTH_CURRENT      ,_param->_nb_context,_param->_size_depth);
     73        DELETE1_SIGNAL(out_DEPTH_MIN          ,_param->_nb_context,_param->_size_depth);
     74        DELETE1_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context,_param->_size_depth+1);
    7475      }
    7576    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_end_cycle.cpp

    r81 r88  
    2424
    2525#ifdef STATISTICS
    26     _stat->end_cycle();
     26    if (usage_is_set(_usage,USE_STATISTICS))
     27      _stat->end_cycle();
    2728#endif   
    2829
     
    3031    // Evaluation before read the ouput signal
    3132//  sc_start(0);
    32     _interfaces->testbench();
     33    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
     34      _interfaces->testbench();
    3335#endif
    3436
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_statistics_allocation.cpp

    r81 r88  
    2626                      "Prediction_unit",
    2727                      param_statistics);
    28    
     28
     29    _stat->add_stat(_component_btb ->_stat);
     30    _stat->add_stat(_component_dir ->_stat);
     31    _stat->add_stat(_component_ras ->_stat);
     32    _stat->add_stat(_component_upt ->_stat);
     33    _stat->add_stat(_component_glue->_stat);
     34       
    2935    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
    3036  };
Note: See TracChangeset for help on using the changeset viewer.