Ignore:
Timestamp:
Jun 8, 2009, 10:43:30 PM (15 years ago)
Author:
rosiere
Message:

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end
Files:
1 added
78 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Context_State.h

    r120 r123  
    143143    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    144144  public    : SC_OUT(Tcontrol_t         )  ** out_CONTEXT_DECOD_ENABLE               ;//[nb_context]
     145  public    : SC_OUT(Tcontrol_t         )  ** out_CONTEXT_EVENT                      ;//[nb_context]
    145146
    146147    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    211212  public  : void        genMoore                  (void);
    212213  public  : void        genMealy_decod_event      (void);
     214  public  : void        genMealy_context_event    (void);
    213215#endif                                         
    214216
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State.cpp

    r101 r123  
    3939    usage_environment(_usage);
    4040
    41 #if DEBUG_Context_State == true
    42     log_printf(INFO,Context_State,FUNCTION,_("<%s> Parameters"),_name.c_str());
     41// #if DEBUG_Context_State == true
     42//     log_printf(INFO,Context_State,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4343
    44     std::cout << *param << std::endl;
    45 #endif   
     44//     std::cout << *param << std::endl;
     45// #endif   
    4646
    4747    log_printf(INFO,Context_State,FUNCTION,_("Allocation"));
     
    139139        // List dependency information
    140140# endif   
     141
     142        log_printf(INFO,Context_State,FUNCTION,_("Method - genMealy_context_event"));
     143
     144        SC_METHOD (genMealy_context_event);
     145        dont_initialize ();
     146//      sensitive << (*(in_CLOCK)).neg(); // use internal register
     147        sensitive << (*(in_COMMIT_EVENT_VAL             ));
     148        if (_param->_have_port_context_id)                                     
     149        sensitive << (*(in_COMMIT_EVENT_CONTEXT_ID      ));
     150        for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
     151          {
     152            sensitive << (*(in_BRANCH_COMPLETE_VAL             [i]))
     153                      << (*(in_BRANCH_COMPLETE_MISS_PREDICTION [i]));
     154            if (_param->_have_port_context_id)                                 
     155            sensitive << (*(in_BRANCH_COMPLETE_CONTEXT_ID      [i]));
     156          }
     157       
     158# ifdef SYSTEMCASS_SPECIFIC
     159        // List dependency information
     160# endif   
    141161       
    142162#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_allocation.cpp

    r119 r123  
    172172     
    173173      ALLOC1_SIGNAL_OUT(out_CONTEXT_DECOD_ENABLE               ,"decod_enable",Tcontrol_t,1);
     174      ALLOC1_SIGNAL_OUT(out_CONTEXT_EVENT                      ,"event"       ,Tcontrol_t,1);
    174175
    175176      ALLOC1_INTERFACE_END(_param->_nb_context);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_deallocation.cpp

    r119 r123  
    9191       
    9292        DELETE1_SIGNAL(out_CONTEXT_DECOD_ENABLE               ,_param->_nb_context,1);
     93        DELETE1_SIGNAL(out_CONTEXT_EVENT                      ,_param->_nb_context,1);
    9394
    9495        DELETE1_SIGNAL( in_DEPTH_MIN                          ,_param->_nb_context,_param->_size_depth);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_genMealy_decod_event.cpp

    r102 r123  
    2424    log_function(Context_State,FUNCTION,_name.c_str());
    2525
     26    if (PORT_READ(in_NRESET))
     27      {
    2628    for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
    2729      {
     
    4951
    5052        internal_DECOD_EVENT_ACK [i] = ack;
    51         PORT_WRITE(out_DECOD_EVENT_ACK [i], internal_DECOD_EVENT_ACK [i]);
    5253      }
     54      }
     55    else
     56      {
     57        for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
     58          internal_DECOD_EVENT_ACK [i] = 0;
     59      }
     60
     61    for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
     62      PORT_WRITE(out_DECOD_EVENT_ACK [i], internal_DECOD_EVENT_ACK [i]);
    5363
    5464    log_end(Context_State,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_genMoore.cpp

    r119 r123  
    2424    log_function(Context_State,FUNCTION,_name.c_str());
    2525
     26    if (PORT_READ(in_NRESET))
     27      {
    2628    // -------------------------------------------------------------------
    2729    // -----[ EVENT ]-----------------------------------------------------
     
    6769
    6870        internal_EVENT_VAL [i] = val;
    69         PORT_WRITE(out_EVENT_VAL              [i], val);
    7071        PORT_WRITE(out_EVENT_ADDRESS          [i], address);
    7172        PORT_WRITE(out_EVENT_ADDRESS_NEXT     [i], address_next);
     
    9798        internal_SPR_EVENT_VAL [i] = (state == CONTEXT_STATE_KO_EXCEP_SPR  );
    9899
    99         PORT_WRITE(out_SPR_EVENT_VAL       [i], internal_SPR_EVENT_VAL     [i]);
    100100        PORT_WRITE(out_SPR_EVENT_EPCR      [i], reg_EVENT_ADDRESS_EPCR     [i]);
    101101        PORT_WRITE(out_SPR_EVENT_EEAR      [i], reg_EVENT_ADDRESS_EEAR     [i]);
     
    117117        PORT_WRITE(out_CONTEXT_DECOD_ENABLE [i], (state==CONTEXT_STATE_OK));
    118118      }
     119      }
     120    else
     121      {
     122        for (uint32_t i=0; i<_param->_nb_context; i++)
     123          {
     124            internal_EVENT_VAL     [i] = 0;
     125            internal_SPR_EVENT_VAL [i] = 0;
     126
     127            PORT_WRITE(out_CONTEXT_DECOD_ENABLE [i], 0);
     128          }
     129      }
     130
     131    // Write output
     132    for (uint32_t i=0; i<_param->_nb_context; i++)
     133      {
     134        PORT_WRITE(out_EVENT_VAL     [i], internal_EVENT_VAL     [i]);
     135        PORT_WRITE(out_SPR_EVENT_VAL [i], internal_SPR_EVENT_VAL [i]);
     136      }
    119137
    120138    log_end(Context_State,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp

    r122 r123  
    1616namespace context_state {
    1717
    18 #define MISS_FAST
     18// #define MANAGE_EVENT MANAGE_EVENT_WAIT_ALL
     19// #define MANAGE_EVENT MANAGE_EVENT_WAIT_DECODE
     20#define MANAGE_EVENT MANAGE_EVENT_NO_WAIT
    1921
    2022#define get_priority(x) \
    2123  (((state == CONTEXT_STATE_KO_MISS_LOAD_ADDR                  ) or  \
     24    (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND               ) or  \
    2225    (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_ADDR       ) or  \
    23     (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND               ) or  \
    2426    (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAITEND    ) or  \
    2527    (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAIT_UPDATE))?3: \
     
    4345            reg_STATE            [i] = CONTEXT_STATE_OK;
    4446            reg_INTERRUPT_ENABLE [i] = 0;
     47            reg_EVENT_DEPTH      [i] = 0; // unacessary
    4548          }
    4649      }
     
    5962            Tcounter_t inst_all        = inst_commit_all + inst_decod_all;
    6063//          Tcounter_t inst_mem        = inst_commit_mem + inst_decod_all;
     64            bool       condition       = ( (MANAGE_EVENT == MANAGE_EVENT_WAIT_ALL   )?(inst_all       == 0):
     65                                          ((MANAGE_EVENT == MANAGE_EVENT_WAIT_DECODE)?(inst_decod_all == 0):
     66                                            true));
    6167
    6268            context_state_t state = reg_STATE [i];
     
    8995              case CONTEXT_STATE_KO_MISS_BRANCH_WAITEND :
    9096                {
    91                   // Wait end of all instruction
    92 //                if (inst_all == 0)
    93                   if (
    94 #ifdef  MISS_FAST
    95                       inst_decod_all ==
    96 #else
    97                       inst_all ==
    98 #endif
    99                       0)
    100                    
     97                  if (condition)
    10198//                  state = CONTEXT_STATE_OK;
    10299                    state = CONTEXT_STATE_KO_MISS_BRANCH_ADDR;
     
    106103                {
    107104                  // Wait end of all instruction
    108 //                if (inst_all == 0)
    109                   if (
    110 #ifdef  MISS_FAST
    111                       inst_decod_all ==
    112 #else
    113                       inst_all ==
    114 #endif
    115                       0)
     105                  if (condition)
    116106                    state = CONTEXT_STATE_KO_MISS_LOAD_ADDR;
    117107
     
    146136                {
    147137                  // Wait end of all instruction
    148 //                if (inst_all == 0)
    149                   if (
    150 #ifdef  MISS_FAST
    151                       inst_decod_all ==
    152 #else
    153                       inst_all ==
    154 #endif
    155                       0)
     138                  if (condition)
    156139//                  state = CONTEXT_STATE_OK; // @@@ TODO : make MISS fast (miss decod)
    157140                    state = CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_ADDR;
     
    333316#endif
    334317
     318              log_printf(TRACE,Context_State,FUNCTION,"    * state     : %s",toString(state).c_str());
    335319              log_printf(TRACE,Context_State,FUNCTION,"    * depth     : %d",depth     );
    336320              log_printf(TRACE,Context_State,FUNCTION,"    * depth_cur : %d",depth_cur );
     
    648632                          }
    649633                        }
     634
     635                      depth = (depth+1)%_param->_nb_inst_branch_speculated[context];
     636
    650637                      break;
    651638                    }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod.cpp

    r101 r123  
    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   
     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   
    4545
    4646    log_printf(INFO,Decod,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp

    r120 r123  
    2525    log_function(Decod,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    //-----------------------------------
    2830    // Initialization
     
    280282#endif
    281283      }
     284      }
     285    else
     286      {
     287    for (uint32_t i=0; i<_param->_nb_context; i++)
     288      {
     289        internal_CONTEXT_HAVE_TRANSACTION [i] = false;
     290//      internal_CONTEXT_ADDRESS_PREVIOUS [i] = reg_CONTEXT_ADDRESS_PREVIOUS [i];
     291//      internal_CONTEXT_IS_DELAY_SLOT    [i] = reg_CONTEXT_IS_DELAY_SLOT    [i];
     292      for (uint32_t j=0; j<_param->_nb_inst_fetch[i]; j++)
     293        PORT_WRITE(out_IFETCH_ACK [i][j], 0);
     294      }
     295
     296    PORT_WRITE(out_CONTEXT_EVENT_VAL, 0);
     297
     298    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     299      {
     300        PORT_WRITE(out_PREDICT_VAL [i], 0);
     301        PORT_WRITE(out_DECOD_VAL   [i], 0);
     302
     303#ifdef STATISTICS
     304        internal_DECOD_VAL [i] = 0;
     305#endif
     306      }
     307      }
    282308
    283309    log_end(Decod,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h

    r111 r123  
    106106  public    : SC_OUT(Toperation_t       )  ** out_DECOD_OUT_OPERATION     ;//[nb_inst_decod]
    107107  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_OUT_NO_EXECUTE    ;//[nb_inst_decod]
     108//public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_OUT_HAVE_EVENT    ;//[nb_inst_decod]
     109  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_OUT_LAST_EVENT    ;//[nb_inst_decod]
    108110  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_OUT_IS_DELAY_SLOT ;//[nb_inst_decod]
    109111#ifdef DEBUG
     
    134136  public    : SC_OUT(Tcounter_t         )  ** out_NB_INST_ALL             ;//[nb_context]
    135137
     138    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     139  public    : SC_IN (Tcontrol_t         )  **  in_CONTEXT_EVENT           ;//[nb_context]
     140
    136141    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    137142
     
    141146  private   : std::list<decod_queue_entry_t*> * reg_QUEUE                  ;
    142147  private   : uint32_t                        * reg_NB_INST                ;//[nb_context]
     148  private   : uint32_t                        * reg_NB_INST_EVENT          ;//[nb_context]
     149
    143150    // implementation : one_fifo only
    144151  private   : uint32_t                          reg_LAST_SLOT              ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue.cpp

    r111 r123  
    4040    usage_environment(_usage);
    4141
    42 #if DEBUG_Decod_queue == true
    43     log_printf(INFO,Decod_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     42// #if DEBUG_Decod_queue == true
     43//     log_printf(INFO,Decod_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4444
    45     std::cout << *param << std::endl;
    46 #endif   
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    log_printf(INFO,Decod_queue,FUNCTION,_("Allocation"));
     
    129129        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    130130          sensitive << (*(in_DECOD_OUT_ACK [i]));
    131           for (uint32_t i=0; i<_param->_nb_context; i++)
    132             {
    133               if (_param->_have_port_depth)
    134                 {
    135               sensitive << (*(in_DEPTH_MIN [i]));
    136               sensitive << (*(in_DEPTH_MAX [i]));
    137                 }
    138               sensitive << (*(in_DEPTH_FULL[i]));
    139             }
     131//         for (uint32_t i=0; i<_param->_nb_context; i++)
     132//           {
     133//             if (_param->_have_port_depth)
     134//               {
     135//                 sensitive << (*(in_DEPTH_MIN [i]));
     136//                 sensitive << (*(in_DEPTH_MAX [i]));
     137//               }
     138//             sensitive << (*(in_DEPTH_FULL[i]));
     139//           }
    140140
    141141# ifdef SYSTEMCASS_SPECIFIC
    142         // List dependency information
    143         for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    144           {
    145             (*(out_DECOD_OUT_VAL [i])) (*(in_DECOD_OUT_ACK [i]));
    146             for (uint32_t j=0; j<_param->_nb_context; j++)
    147               {
    148                 if (_param->_have_port_depth)
    149                   {
    150                 (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MIN [j]));
    151                 (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MAX [j]));
    152                   }
    153               }
    154           }
     142//      // List dependency information
     143//      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     144//        {
     145//          (*(out_DECOD_OUT_VAL [i])) (*(in_DECOD_OUT_ACK [i]));
     146//             for (uint32_t j=0; j<_param->_nb_context; j++)
     147//               {
     148//                 if (_param->_have_port_depth)
     149//                   {
     150//                 (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MIN [j]));
     151//                 (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MAX [j]));
     152//                   }
     153//               }
     154//        }
    155155# endif   
    156156       
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_allocation.cpp

    r118 r123  
    100100      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_OPERATION      ,"operation"    ,Toperation_t       ,_param->_size_operation             );
    101101      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NO_EXECUTE     ,"no_execute"   ,Tcontrol_t         ,1                                   );
     102//    ALLOC1_SIGNAL_OUT(out_DECOD_OUT_HAVE_EVENT     ,"have_event"   ,Tcontrol_t         ,1                                   );
     103      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_LAST_EVENT     ,"last_event"   ,Tcontrol_t         ,1                                   );
    102104      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_IS_DELAY_SLOT  ,"is_delay_slot",Tcontrol_t         ,1                                   );
    103105#ifdef DEBUG
     
    143145    }
    144146
     147    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
     148    {
     149      ALLOC1_INTERFACE_BEGIN("context",IN ,NORTH,_("Context"), _param->_nb_context);
     150
     151      ALLOC1_SIGNAL_IN ( in_CONTEXT_EVENT  ,"event"    ,Tcontrol_t         ,1);
     152
     153      ALLOC1_INTERFACE_END(_param->_nb_context);
     154    }
     155
    145156    if (usage_is_set(_usage,USE_SYSTEMC))
    146157      {
     
    152163      }
    153164
    154     ALLOC1(reg_NB_INST,uint32_t,_param->_nb_context);
     165    ALLOC1(reg_NB_INST           ,uint32_t,_param->_nb_context);
     166    ALLOC1(reg_NB_INST_EVENT     ,uint32_t,_param->_nb_context);
    155167
    156168    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_deallocation.cpp

    r115 r123  
    6262        DELETE1_SIGNAL(out_DECOD_OUT_TYPE          ,_param->_nb_inst_decod,_param->_size_type                  );
    6363        DELETE1_SIGNAL(out_DECOD_OUT_OPERATION     ,_param->_nb_inst_decod,_param->_size_operation             );
    64         DELETE1_SIGNAL(out_DECOD_OUT_NO_EXECUTE    ,_param->_nb_inst_decod,1                                   );
     64        DELETE1_SIGNAL(out_DECOD_OUT_NO_EXECUTE    ,_param->_nb_inst_decod,1                                   );
     65//      DELETE1_SIGNAL(out_DECOD_OUT_HAVE_EVENT    ,_param->_nb_inst_decod,1                                   );
     66        DELETE1_SIGNAL(out_DECOD_OUT_LAST_EVENT    ,_param->_nb_inst_decod,1                                   );
    6567        DELETE1_SIGNAL(out_DECOD_OUT_IS_DELAY_SLOT ,_param->_nb_inst_decod,1                                   );
    6668#ifdef DEBUG
     
    8890
    8991        DELETE1_SIGNAL(out_NB_INST_ALL             ,_param->_nb_context,_param->_size_nb_inst_decod);
     92
     93        DELETE1_SIGNAL( in_CONTEXT_EVENT           ,_param->_nb_context,1);
    9094
    9195        // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     
    117121          }
    118122
    119         DELETE1(reg_NB_INST ,_param->_nb_context);
     123        DELETE1(reg_NB_INST           ,_param->_nb_context);
     124        DELETE1(reg_NB_INST_EVENT     ,_param->_nb_context);
    120125       
    121126        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_multi_fifo_genMealy_decod_out.cpp

    r115 r123  
    2424    log_begin(Decod_queue,FUNCTION);
    2525    log_function(Decod_queue,FUNCTION,_name.c_str());
    26    
    27     Tcontrol_t val [_param->_nb_inst_decod];
     26
     27    if (PORT_READ(in_NRESET))
     28      {
     29    bool       context_val   [_param->_nb_context];
     30    uint32_t   nb_inst_event [_param->_nb_context];
     31    for (uint32_t i=0; i<_param->_nb_context; i++)
     32      {
     33        context_val   [i] = true;
     34        nb_inst_event [i] = reg_NB_INST_EVENT [i];
     35      }
     36
     37    Tcontrol_t val         [_param->_nb_inst_decod];
    2838    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    2939      {
     
    4454           
    4555            Tcontext_t context         = reg_QUEUE[num_bank].front()->_context_id    [0];
    46             Tdepth_t   depth           = reg_QUEUE[num_bank].front()->_depth         [0];
    47             Tdepth_t   depth_min       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [context]):0;
    48             Tdepth_t   depth_max       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX [context]):0;
    49             Tcontrol_t depth_full      = PORT_READ(in_DEPTH_FULL[context]);
    5056
    51             // is a valid instruction ?
    52             // If DEPTH_CURRENT :
    53             // equal at     DEPTH_MIN            -> not speculative
    54             // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
    55             //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
    56            
    57             // All case
    58             // ....... min ...X... max ....... OK
    59             // ....... min ....... max ...X... KO
    60             // ...X... min ....... max ....... KO
    61             // ....... max ....... min ...X... OK
    62             // ...X... max ....... min ....... OK
    63             // ....... max ...X... min ....... KO
    64            
    65             Tcontrol_t is_valid = true;
     57            log_printf(TRACE,Decod_queue,FUNCTION,"      * context      : %d",context);
    6658
    67 //             Tcontrol_t   is_valid      = ((depth == depth_min) or
    68 //                                           depth_full or
    69 //                                           ((depth_min <= depth_max)?
    70 //                                            ((depth >= depth_min) and (depth <=depth_max)):
    71 //                                            ((depth >= depth_min) or  (depth <=depth_max))));
    72             //Tcontrol_t is_valid        = ((depth == depth_min) or
    73             //                              ((depth_min < depth_max)?
    74             //                               (depth<=depth_max):
    75             //                               ((depth > depth_min) or (depth <= depth_max))));
    76             //Tcontrol_t is_valid        = depth <= depth_max;
    77            
    78             log_printf(TRACE,Decod_queue,FUNCTION,"    * is_valid : %d",is_valid);
    79             log_printf(TRACE,Decod_queue,FUNCTION,"      * context      : %d",context);
    80             log_printf(TRACE,Decod_queue,FUNCTION,"      * depth        : %d",depth);
    81             log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_min    : %d",depth_min);
    82             log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_max    : %d",depth_max);
    83             log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_full   : %d",depth_full);
    84 #ifdef DEBUG
    85             log_printf(TRACE,Decod_queue,FUNCTION,"      * address      : 0x%x (0x%x)",reg_QUEUE[num_bank].front()->_address     [0],reg_QUEUE[num_bank].front()->_address     [0]<<2);
    86 #endif
    87             log_printf(TRACE,Decod_queue,FUNCTION,"      * address_next : 0x%x (0x%x)",reg_QUEUE[num_bank].front()->_address_next[0],reg_QUEUE[num_bank].front()->_address_next[0]<<2);
     59            if (context_val [context])
     60              {
    8861
    89             internal_DECOD_OUT_VAL [i] = 1; // in all case, val is set (entry is not empty, and instruction is valid)
    90             if (is_valid)
    91               {
    92                 val                    [i] = 1;
    93                 internal_DECOD_OUT_ACK [i] = PORT_READ(in_DECOD_OUT_ACK [i]);
    94               }
    95             else
    96               {
    97                 // Consume the instruction (to erase)
    98                 internal_DECOD_OUT_ACK [i] = 1;
     62//                 Tdepth_t   depth           = reg_QUEUE[num_bank].front()->_depth         [0];
     63//                 Tdepth_t   depth_min       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [context]):0;
     64//                 Tdepth_t   depth_max       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX [context]):0;
     65//                 Tcontrol_t depth_full      = PORT_READ(in_DEPTH_FULL[context]);
     66               
     67                    // is a valid instruction ?
     68                // If DEPTH_CURRENT :
     69                // equal at     DEPTH_MIN            -> not speculative
     70                // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
     71                //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
     72               
     73                // All case
     74                // ....... min ...X... max ....... OK
     75                // ....... min ....... max ...X... KO
     76                // ...X... min ....... max ....... KO
     77                // ....... max ....... min ...X... OK
     78                // ...X... max ....... min ....... OK
     79                // ....... max ...X... min ....... KO
     80               
     81                Tcontrol_t is_valid = (nb_inst_event [context] == 0);
     82               
     83//                 Tcontrol_t   is_valid      = ((depth == depth_min) or
     84//                                               depth_full or
     85//                                               ((depth_min <= depth_max)?
     86//                                                ((depth >= depth_min) and (depth <=depth_max)):
     87//                                                ((depth >= depth_min) or  (depth <=depth_max))));
     88               
     89                log_printf(TRACE,Decod_queue,FUNCTION,"    * is_valid : %d",is_valid);
     90                log_printf(TRACE,Decod_queue,FUNCTION,"      * context_val  : %d",context_val   [context]);
     91                log_printf(TRACE,Decod_queue,FUNCTION,"      * nb_inst_event: %d",nb_inst_event [context]);
     92//              log_printf(TRACE,Decod_queue,FUNCTION,"      * depth        : %d",depth);
     93//              log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_min    : %d",depth_min);
     94//              log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_max    : %d",depth_max);
     95//              log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_full   : %d",depth_full);
     96#ifdef DEBUG   
     97                log_printf(TRACE,Decod_queue,FUNCTION,"      * address      : 0x%x (0x%x)",reg_QUEUE[num_bank].front()->_address     [0],reg_QUEUE[num_bank].front()->_address     [0]<<2);
     98#endif         
     99                log_printf(TRACE,Decod_queue,FUNCTION,"      * address_next : 0x%x (0x%x)",reg_QUEUE[num_bank].front()->_address_next[0],reg_QUEUE[num_bank].front()->_address_next[0]<<2);
     100               
     101                internal_DECOD_OUT_VAL [i] = 1; // in all case, val is set (entry is not empty, and instruction is valid)
     102               
     103                if (is_valid)
     104                  {
     105                    val                    [i] = 1;
     106                    internal_DECOD_OUT_ACK [i] = PORT_READ(in_DECOD_OUT_ACK [i]);
     107               
     108                  }
     109                else
     110                  {
     111                    // Consume the instruction (to erase)
     112                    internal_DECOD_OUT_ACK [i] = 1;
     113
     114                    // Have event ?
     115                    if (nb_inst_event [context] > 0)
     116                      {
     117                        nb_inst_event [context] --;
     118                       
     119                        // Last event ?
     120                        if (nb_inst_event [context] == 0)
     121                          {
     122                            context_val [context] = false;
     123                          }
     124                      }
     125                  }
    99126              }
    100127          }
     
    107134       
    108135        PORT_WRITE(out_DECOD_OUT_VAL [i],val [i]);
     136      }
     137      }
     138    else
     139      {
     140        // Reset
     141        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     142          {
     143            internal_DECOD_OUT_VAL [i] = 0;
     144            internal_DECOD_OUT_ACK [i] = 0;
     145            PORT_WRITE(out_DECOD_OUT_VAL [i],0);
     146          }
    109147      }
    110148
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_multi_fifo_genMoore.cpp

    r111 r123  
    2525    log_function(Decod_queue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    //--------------------------------------------------------------------
    2830    //-----[ DECOD_IN ]---------------------------------------------------
     
    3436        {
    3537          internal_DECOD_IN_ACK [i] = (reg_QUEUE[num_bank].size() < _param->_size_queue);
    36           PORT_WRITE(out_DECOD_IN_ACK [i],internal_DECOD_IN_ACK [i]);
    3738
    3839          num_bank = (num_bank+1)%_param->_nb_bank;
     
    5758                PORT_WRITE(out_DECOD_OUT_OPERATION     [i],reg_QUEUE[num_bank].front()->_operation     [0]);
    5859                PORT_WRITE(out_DECOD_OUT_NO_EXECUTE    [i],reg_QUEUE[num_bank].front()->_no_execute    [0]);
     60//              PORT_WRITE(out_DECOD_OUT_HAVE_EVENT    [i],0);
     61                PORT_WRITE(out_DECOD_OUT_LAST_EVENT    [i],0);
    5962                PORT_WRITE(out_DECOD_OUT_IS_DELAY_SLOT [i],reg_QUEUE[num_bank].front()->_is_delay_slot [0]);
    6063#ifdef DEBUG
     
    8689    for (uint32_t i=0; i<_param->_nb_context; i++)
    8790      PORT_WRITE(out_NB_INST_ALL [i], reg_NB_INST [i]);
     91      }
     92    else
     93      {
     94        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     95          {
     96            internal_DECOD_IN_ACK [i] = 0;
     97          }
     98        for (uint32_t i=0; i<_param->_nb_context; i++)
     99          PORT_WRITE(out_NB_INST_ALL [i], 0);
     100      }
     101
     102
     103    // Write output
     104    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     105      {
     106        PORT_WRITE(out_DECOD_IN_ACK [i],internal_DECOD_IN_ACK [i]);
     107      }
     108
    88109
    89110    log_end(Decod_queue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_multi_fifo_transition.cpp

    r112 r123  
    3535
    3636        for (uint32_t i=0; i<_param->_nb_context; i++)
    37           reg_NB_INST [i]=0;
     37          {
     38            reg_NB_INST       [i]=0;
     39            reg_NB_INST_EVENT [i]=0;
     40          }
    3841
    3942        reg_NUM_BANK_HEAD = 0;
     
    131134                // Update pointer
    132135                reg_NUM_BANK_HEAD = (reg_NUM_BANK_HEAD+1)%_param->_nb_bank;
    133                 reg_NB_INST [context] --;
     136               
     137                reg_NB_INST       [context] --;
     138                if (reg_NB_INST_EVENT [context] > 0)
     139                reg_NB_INST_EVENT [context] --;
    134140              }
    135141        }
    136142
    137143        //--------------------------------------------------------------------
     144        //-----[ CONTEXT_EVENT ]----------------------------------------------
     145        //--------------------------------------------------------------------
     146        for (uint32_t i=0; i<_param->_nb_context; i++)
     147          if (PORT_READ(in_CONTEXT_EVENT [i]))
     148            reg_NB_INST_EVENT [i] = reg_NB_INST [i];
     149
     150        //--------------------------------------------------------------------
    138151        //-----[ OTHERS ]-----------------------------------------------------
    139152        //--------------------------------------------------------------------
     
    141154#if defined(DEBUG) and defined(DEBUG_Decod_queue) and (DEBUG >= DEBUG_TRACE)
    142155    log_printf(TRACE,Decod_queue,FUNCTION,"  * Dump decod_queue");
    143     log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_NUM_BANK_HEAD : %d",reg_NUM_BANK_HEAD);
    144     log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_NUM_BANK_TAIL : %d",reg_NUM_BANK_TAIL);
     156    log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_NUM_BANK_HEAD     : %d",reg_NUM_BANK_HEAD);
     157    log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_NUM_BANK_TAIL     : %d",reg_NUM_BANK_TAIL);
    145158    for (uint32_t i=0; i<_param->_nb_context; i++)
    146       log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_NB_INST [%d] : %d",i,reg_NB_INST [i]);
    147 
     159      {
     160    log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_NB_INST       [%d] : %d",i,reg_NB_INST [i]);
     161    log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_NB_INST_EVENT [%d] : %d",i,reg_NB_INST_EVENT [i]);
     162      }
    148163    for (uint32_t i=0; i<_param->_nb_bank; ++i)
    149164      {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_one_fifo_genMealy_decod_out.cpp

    r115 r123  
    2525    log_function(Decod_queue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
     29    bool       context_val   [_param->_nb_context];
     30    uint32_t   nb_inst_event [_param->_nb_context];
     31    for (uint32_t i=0; i<_param->_nb_context; i++)
     32      {
     33        context_val   [i] = true;
     34        nb_inst_event [i] = reg_NB_INST_EVENT [i];
     35      }
     36
    2737    Tcontrol_t val [_param->_nb_inst_decod];
    2838    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     
    4757             
    4858              Tcontext_t context         = reg_QUEUE->front()->_context_id    [index];
    49               Tdepth_t   depth           = reg_QUEUE->front()->_depth         [index];
    50               Tdepth_t   depth_min       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [context]):0;
    51               Tdepth_t   depth_max       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX [context]):0;
    52               Tcontrol_t depth_full      = PORT_READ(in_DEPTH_FULL[context]);
    5359
    54               // is a valid instruction ?
    55               // If DEPTH_CURRENT :
    56               // equal at     DEPTH_MIN            -> not speculative
    57               // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
    58               //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
    59              
    60               // All case
    61               // ....... min ...X... max ....... OK
    62               // ....... min ....... max ...X... KO
    63               // ...X... min ....... max ....... KO
    64               // ....... max ....... min ...X... OK
    65               // ...X... max ....... min ....... OK
    66               // ....... max ...X... min ....... KO
    67              
    68               Tcontrol_t is_valid = true;
    69 //               Tcontrol_t   is_valid      = ((depth == depth_min) or
    70 //                                             depth_full or
    71 //                                             ((depth_min <= depth_max)?
    72 //                                              ((depth >= depth_min) and (depth <=depth_max)):
    73 //                                              ((depth >= depth_min) or  (depth <=depth_max))));
    74               //Tcontrol_t is_valid        = ((depth == depth_min) or
    75               //                              ((depth_min < depth_max)?
    76               //                               (depth<=depth_max):
    77               //                               ((depth > depth_min) or (depth <= depth_max))));
    78               //Tcontrol_t is_valid        = depth <= depth_max;
     60              log_printf(TRACE,Decod_queue,FUNCTION,"      * context      : %d",context);
    7961
    80               log_printf(TRACE,Decod_queue,FUNCTION,"    * is_valid : %d",is_valid);
    81               log_printf(TRACE,Decod_queue,FUNCTION,"      * context      : %d",context);
    82               log_printf(TRACE,Decod_queue,FUNCTION,"      * depth        : %d",depth);
    83               log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_min    : %d",depth_min);
    84               log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_max    : %d",depth_max);
    85               log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_full   : %d",depth_full);
    86 #ifdef DEBUG
    87               log_printf(TRACE,Decod_queue,FUNCTION,"      * address      : 0x%x (0x%x)",reg_QUEUE->front()->_address     [index],reg_QUEUE->front()->_address     [index]<<2);
    88 #endif
    89               log_printf(TRACE,Decod_queue,FUNCTION,"      * address_next : 0x%x (0x%x)",reg_QUEUE->front()->_address_next[index],reg_QUEUE->front()->_address_next[index]<<2);
    90               internal_DECOD_OUT_VAL [index] = 1; // in all case, val is set (entry is not empty, and instruction is valid)
    91               if (is_valid)
     62              if (context_val [context])
    9263                {
    93                   val                    [i]     = 1;
    94                   internal_DECOD_OUT_ACK [index] = PORT_READ(in_DECOD_OUT_ACK [i]);
    95                 }
    96               else
    97                 {
    98                   // Consume the instruction (to erase)
    99                   internal_DECOD_OUT_ACK [index] = 1;
     64
     65//               Tdepth_t   depth           = reg_QUEUE->front()->_depth         [index];
     66//               Tdepth_t   depth_min       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [context]):0;
     67//               Tdepth_t   depth_max       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX [context]):0;
     68//               Tcontrol_t depth_full      = PORT_READ(in_DEPTH_FULL[context]);
     69
     70                  // is a valid instruction ?
     71                  // If DEPTH_CURRENT :
     72                  // equal at     DEPTH_MIN            -> not speculative
     73                  // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
     74                  //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
     75                 
     76                  // All case
     77                  // ....... min ...X... max ....... OK
     78                  // ....... min ....... max ...X... KO
     79                  // ...X... min ....... max ....... KO
     80                  // ....... max ....... min ...X... OK
     81                  // ...X... max ....... min ....... OK
     82                  // ....... max ...X... min ....... KO
     83                 
     84                  Tcontrol_t is_valid = (nb_inst_event [context] == 0);
     85
     86//                   Tcontrol_t   is_valid      = ((depth == depth_min) or
     87//                                                 depth_full or
     88//                                                 ((depth_min <= depth_max)?
     89//                                                  ((depth >= depth_min) and (depth <=depth_max)):
     90//                                                  ((depth >= depth_min) or  (depth <=depth_max))));
     91                 
     92                  log_printf(TRACE,Decod_queue,FUNCTION,"    * is_valid : %d",is_valid);
     93                  log_printf(TRACE,Decod_queue,FUNCTION,"      * context_val  : %d",context_val   [context]);
     94                  log_printf(TRACE,Decod_queue,FUNCTION,"      * nb_inst_event: %d",nb_inst_event [context]);
     95//                   log_printf(TRACE,Decod_queue,FUNCTION,"      * depth        : %d",depth);
     96//                   log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_min    : %d",depth_min);
     97//                   log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_max    : %d",depth_max);
     98//                   log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_full   : %d",depth_full);
     99#ifdef DEBUG     
     100                  log_printf(TRACE,Decod_queue,FUNCTION,"      * address      : 0x%x (0x%x)",reg_QUEUE->front()->_address     [index],reg_QUEUE->front()->_address     [index]<<2);
     101#endif           
     102                  log_printf(TRACE,Decod_queue,FUNCTION,"      * address_next : 0x%x (0x%x)",reg_QUEUE->front()->_address_next[index],reg_QUEUE->front()->_address_next[index]<<2);
     103                  internal_DECOD_OUT_VAL [index] = 1; // in all case, val is set (entry is not empty, and instruction is valid)
     104                 
     105                  if (is_valid)
     106                    {
     107                      val                    [i]     = 1;
     108                      internal_DECOD_OUT_ACK [index] = PORT_READ(in_DECOD_OUT_ACK [i]);
     109                    }
     110                  else
     111                    {
     112                      // Consume the instruction (to erase)
     113                      internal_DECOD_OUT_ACK [index] = 1;
     114
     115                      // Have event ?
     116                      if (nb_inst_event [context] > 0)
     117                        {
     118                          nb_inst_event [context] --;
     119                         
     120                          // Last event ?
     121                          if (nb_inst_event [context] == 0)
     122                            {
     123                              context_val [context] = false;
     124                            }
     125                        }
     126                    }
    100127                }
    101128            }
     
    107134       
    108135        PORT_WRITE(out_DECOD_OUT_VAL [i],val [i]);
     136      }
     137      }
     138    else
     139      {
     140        // Reset
     141        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     142          {
     143            internal_DECOD_OUT_VAL [i] = 0;
     144            internal_DECOD_OUT_ACK [i] = 0;
     145            PORT_WRITE(out_DECOD_OUT_VAL [i],0);
     146          }
    109147      }
    110148
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_one_fifo_genMoore.cpp

    r111 r123  
    2525    log_function(Decod_queue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    //--------------------------------------------------------------------
    2830    //-----[ DECOD_IN ]---------------------------------------------------
     
    3436        {
    3537          internal_DECOD_IN_ACK [i] = ack;
    36           PORT_WRITE(out_DECOD_IN_ACK [i],ack);
    3738        }
    3839    }
     
    5758          PORT_WRITE(out_DECOD_OUT_OPERATION     [i],reg_QUEUE->front()->_operation     [index]);
    5859          PORT_WRITE(out_DECOD_OUT_NO_EXECUTE    [i],reg_QUEUE->front()->_no_execute    [index]);
     60//        PORT_WRITE(out_DECOD_OUT_HAVE_EVENT    [i],0);
     61          PORT_WRITE(out_DECOD_OUT_LAST_EVENT    [i],0);
    5962          PORT_WRITE(out_DECOD_OUT_IS_DELAY_SLOT [i],reg_QUEUE->front()->_is_delay_slot [index]);
    6063#ifdef DEBUG
     
    8386    for (uint32_t i=0; i<_param->_nb_context; i++)
    8487      PORT_WRITE(out_NB_INST_ALL [i], reg_NB_INST [i]);
     88      }
     89    else
     90      {
     91        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     92          {
     93            internal_DECOD_IN_ACK [i] = 0;
     94          }
     95        for (uint32_t i=0; i<_param->_nb_context; i++)
     96          PORT_WRITE(out_NB_INST_ALL [i], 0);
     97      }
     98     
     99    // Write output
     100    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     101      {
     102        PORT_WRITE(out_DECOD_IN_ACK [i],internal_DECOD_IN_ACK [i]);
     103      }
     104
    85105
    86106    log_end(Decod_queue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_one_fifo_transition.cpp

    r112 r123  
    3434
    3535        for (uint32_t i=0; i<_param->_nb_context; i++)
    36           reg_NB_INST [i]=0;
     36          {
     37            reg_NB_INST       [i]=0;
     38            reg_NB_INST_EVENT [i]=0;
     39          }
    3740
    3841        reg_LAST_SLOT = 0;
     
    130133                    log_printf(TRACE,Decod_queue,FUNCTION,_("    * context : %d"),context);
    131134                   
    132                     reg_NB_INST [context] --;
     135                    reg_NB_INST       [context] --;
     136                    if (reg_NB_INST_EVENT [context] > 0)
     137                    reg_NB_INST_EVENT [context] --;
     138
    133139                    log_printf(TRACE,Decod_queue,FUNCTION,_("    * nb_inst : %d"),reg_NB_INST [context]);
    134140                  }
     
    149155              }
    150156          }
     157
     158        //--------------------------------------------------------------------
     159        //-----[ CONTEXT_EVENT ]----------------------------------------------
     160        //--------------------------------------------------------------------
     161        for (uint32_t i=0; i<_param->_nb_context; i++)
     162          if (PORT_READ(in_CONTEXT_EVENT [i]))
     163            reg_NB_INST_EVENT [i] = reg_NB_INST [i];
    151164      }
    152165
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMealy_decod_out.cpp

    r111 r123  
    2525    log_function(Decod_queue,FUNCTION,_name.c_str());
    2626
     27//     if (PORT_READ(in_NRESET))
    2728    (this->*function_genMealy_decod_out) ();
    2829
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/include/Decod_unit.h

    r118 r123  
    8686  public    : SC_OUT(Toperation_t       )  ** out_DECOD_OPERATION                    ;//[nb_inst_decod]
    8787  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_NO_EXECUTE                   ;//[nb_inst_decod]
     88//public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_HAVE_EVENT                   ;//[nb_inst_decod]
     89  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_LAST_EVENT                   ;//[nb_inst_decod]
    8890  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_IS_DELAY_SLOT                ;//[nb_inst_decod]
    8991#ifdef DEBUG
     
    130132    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    131133  public    : SC_IN (Tcontrol_t         )  **  in_CONTEXT_DECOD_ENABLE               ;//[nb_context]
     134  public    : SC_IN (Tcontrol_t         )  **  in_CONTEXT_EVENT                      ;//[nb_context]
    132135  public    : SC_IN (Tcontrol_t         )  **  in_CONTEXT_DEPTH_VAL                  ;//[nb_context]
    133136  public    : SC_IN (Tdepth_t           )  **  in_CONTEXT_DEPTH                      ;//[nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit.cpp

    r88 r123  
    3939    usage_environment(_usage);
    4040
    41 #if DEBUG_Decod_unit == true
    42     log_printf(INFO,Decod_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
     41// #if DEBUG_Decod_unit == true
     42//     log_printf(INFO,Decod_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4343
    44     std::cout << *param << std::endl;
    45 #endif   
     44//     std::cout << *param << std::endl;
     45// #endif   
    4646
    4747    log_printf(INFO,Decod_unit,FUNCTION,_("Allocation"));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit_allocation.cpp

    r118 r123  
    9191      ALLOC1_SIGNAL_OUT(out_DECOD_OPERATION    ,"operation"    ,Toperation_t      ,_param->_size_operation             );
    9292      ALLOC1_SIGNAL_OUT(out_DECOD_NO_EXECUTE   ,"no_execute"   ,Tcontrol_t        ,1                                   );
     93//    ALLOC1_SIGNAL_OUT(out_DECOD_HAVE_EVENT   ,"have_event"   ,Tcontrol_t        ,1                                   );
     94      ALLOC1_SIGNAL_OUT(out_DECOD_LAST_EVENT   ,"last_event"   ,Tcontrol_t        ,1                                   );
    9395      ALLOC1_SIGNAL_OUT(out_DECOD_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t        ,1                                   );
    9496#ifdef DEBUG
     
    159161
    160162      ALLOC1_SIGNAL_IN (in_CONTEXT_DECOD_ENABLE,"decod_enable",Tcontrol_t,1);
     163      ALLOC1_SIGNAL_IN (in_CONTEXT_EVENT       ,"event"       ,Tcontrol_t,1);
    161164      ALLOC1_SIGNAL_IN (in_CONTEXT_DEPTH_VAL   ,"depth_val"   ,Tcontrol_t,1);
    162165      ALLOC1_SIGNAL_IN (in_CONTEXT_DEPTH       ,"depth"       ,Tdepth_t  ,_param->_size_depth);
     
    499502          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_NO_EXECUTE"   ,
    500503                              dest,"out_DECOD_"    +toString(i)+"_NO_EXECUTE"   );
     504//        PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_HAVE_EVENT"   ,
     505//                            dest,"out_DECOD_"    +toString(i)+"_HAVE_EVENT"   );
     506          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_LAST_EVENT"   ,
     507                              dest,"out_DECOD_"    +toString(i)+"_LAST_EVENT"   );
    501508          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_IS_DELAY_SLOT",
    502509                              dest,"out_DECOD_"    +toString(i)+"_IS_DELAY_SLOT");
     
    569576                              dest,"out_NB_INST_"+toString(i)+"_DECOD_ALL");
    570577        }
     578
     579
     580
     581      for (uint32_t i=0; i<_param->_nb_context; i++)
     582        {
     583          dest = _name;
     584
     585#ifdef POSITION
     586          _component->interface_map (src ,"context_"+toString(i),
     587                                     dest,"context_"+toString(i));
     588#endif
     589         
     590          PORT_MAP(_component,src , "in_CONTEXT_"+toString(i)+"_EVENT"       ,
     591                              dest, "in_CONTEXT_"+toString(i)+"_EVENT"       );
     592
     593        }
    571594    }
    572595    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit_deallocation.cpp

    r112 r123  
    4747        DELETE1_SIGNAL(out_DECOD_OPERATION                    ,_param->_nb_inst_decod,_param->_size_operation             );
    4848        DELETE1_SIGNAL(out_DECOD_NO_EXECUTE                   ,_param->_nb_inst_decod,1                                   );
     49//      DELETE1_SIGNAL(out_DECOD_HAVE_EVENT                   ,_param->_nb_inst_decod,1                                   );
     50        DELETE1_SIGNAL(out_DECOD_LAST_EVENT                   ,_param->_nb_inst_decod,1                                   );
    4951        DELETE1_SIGNAL(out_DECOD_IS_DELAY_SLOT                ,_param->_nb_inst_decod,1                                   );
    5052#ifdef DEBUG
     
    8789       
    8890        DELETE1_SIGNAL(in_CONTEXT_DECOD_ENABLE                ,_param->_nb_context,1);
     91        DELETE1_SIGNAL(in_CONTEXT_EVENT                       ,_param->_nb_context,1);
    8992        DELETE1_SIGNAL(in_CONTEXT_DEPTH                       ,_param->_nb_context,_param->_size_depth);
    9093       
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue.cpp

    r119 r123  
    3939    usage_environment(_usage);
    4040
    41 #if DEBUG_Front_end_Glue == true
    42     log_printf(INFO,Front_end_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    43 
    44     std::cout << *param << std::endl;
    45 #endif   
     41// #if DEBUG_Front_end_Glue == true
     42//     log_printf(INFO,Front_end_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     43
     44//     std::cout << *param << std::endl;
     45// #endif   
    4646
    4747    log_printf(INFO,Front_end_Glue,FUNCTION,_("<%s> : Allocation"),_name.c_str());
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue_genMealy_branch_complete.cpp

    r88 r123  
    2222    log_begin(Front_end_Glue,FUNCTION);
    2323
     24    if (PORT_READ(in_NRESET))
     25      {
    2426    for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
    2527      {
     
    3638        PORT_WRITE(out_BRANCH_COMPLETE_ACK [i],ack);     
    3739      }
     40      }
     41    else
     42      {
     43        // RESET
     44        for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i)
     45          {
     46            PORT_WRITE(out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL [i],0);
     47            PORT_WRITE(out_BRANCH_COMPLETE_CONTEXT_STATE_VAL   [i],0);
     48            PORT_WRITE(out_BRANCH_COMPLETE_ACK                 [i],0);     
     49          }
     50      }
    3851
    3952    log_end(Front_end_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue_genMealy_decod.cpp

    r88 r123  
    2424    // Warning : this function is an sc_method if _have_port_context_id
    2525
     26    if (PORT_READ(in_NRESET))
     27      {
    2628    for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
    2729      for (uint32_t j=0; j<_param->_nb_inst_decod[i]; ++j)
    2830        PORT_WRITE(out_DECOD_CONTEXT_ID [i][j],_param->_translate_context_id_from_decod_unit[i][PORT_READ(in_DECOD_DECOD_UNIT_CONTEXT_ID [i][j])]);
     31      }
    2932
    3033    log_end(Front_end_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue_genMealy_depth.cpp

    r101 r123  
    2222    log_begin(Front_end_Glue,FUNCTION);
    2323
     24    if (PORT_READ(in_NRESET))
     25      {
    2426    for (uint32_t i=0; i<_param->_nb_context; ++i)
    2527      {
     
    4850          PORT_WRITE(out_DEPTH_DECOD_UNIT_FULL        [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_FULL    [num_context]));
    4951        }
     52      }
    5053
    5154    log_end(Front_end_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue_genMealy_event.cpp

    r119 r123  
    2323    log_function(Front_end_Glue,FUNCTION,_name.c_str());
    2424
     25    if (PORT_READ(in_NRESET))
     26      {
    2527    for (uint32_t i=0; i<_param->_nb_context; ++i)
    2628      {
     
    124126#endif
    125127      }
     128      }
     129    else
     130      {
     131        // Reset
     132        for (uint32_t i=0; i<_param->_nb_context; ++i)
     133          {
     134            PORT_WRITE(out_EVENT_VAL                 [i], 0);
     135            PORT_WRITE(out_EVENT_IFETCH_UNIT_VAL     [i], 0);
     136            PORT_WRITE(out_EVENT_PREDICTION_UNIT_VAL [i], 0);
     137            PORT_WRITE(out_EVENT_CONTEXT_STATE_ACK   [i], 0);
     138          }
     139      }
    126140
    127141    log_end(Front_end_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue_genMealy_nb_inst.cpp

    r108 r123  
    2222    log_begin(Front_end_Glue,FUNCTION);
    2323
     24    if (PORT_READ(in_NRESET))
     25      {
    2426    for (uint32_t i=0; i<_param->_nb_context; ++i)
    2527      {
     
    2830        PORT_WRITE(out_NB_INST_DECOD_ALL               [i], nb_inst);
    2931        PORT_WRITE(out_NB_INST_CONTEXT_STATE_DECOD_ALL [i], nb_inst);
     32      }
    3033      }
    3134
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management.cpp

    r88 r123  
    3838    log_printf(FUNC,Address_management,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Address_management == true
    41     log_printf(INFO,Address_management,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40// #if DEBUG_Address_management == true
     41//     log_printf(INFO,Address_management,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4242
    43     std::cout << *param << std::endl;
    44 #endif   
     43//     std::cout << *param << std::endl;
     44// #endif   
    4545
    4646    log_printf(INFO,Address_management,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_genMoore.cpp

    r107 r123  
    2424    log_printf(FUNC,Address_management,FUNCTION,"Begin");
    2525
     26    if (PORT_READ(in_NRESET))
     27      {
    2628    // =========================================
    2729    // ===== ADDRESS ===========================
     
    3032    internal_ADDRESS_VAL = reg_PC_ACCESS_VAL;
    3133
    32     PORT_WRITE(out_ADDRESS_VAL                        ,internal_ADDRESS_VAL                     );
    3334    // Align pc on instruction packet address.
    3435    PORT_WRITE(out_ADDRESS_INSTRUCTION_ADDRESS        ,reg_PC_ACCESS - (reg_PC_ACCESS%_param->_nb_instruction));
     
    4849    internal_PREDICT_VAL = not reg_PC_NEXT_NEXT_VAL;
    4950
    50     PORT_WRITE(out_PREDICT_VAL                  ,internal_PREDICT_VAL);
    5151    PORT_WRITE(out_PREDICT_PC_PREVIOUS          ,reg_PC_CURRENT        );
    5252    PORT_WRITE(out_PREDICT_PC_CURRENT           ,reg_PC_NEXT           );
    5353    PORT_WRITE(out_PREDICT_PC_CURRENT_IS_DS_TAKE,reg_PC_NEXT_IS_DS_TAKE);
    54    
     54      }
     55    else
     56      {
     57    internal_ADDRESS_VAL = 0;
     58    internal_PREDICT_VAL = 0;
     59      }
     60
     61    PORT_WRITE(out_ADDRESS_VAL,internal_ADDRESS_VAL);
     62    PORT_WRITE(out_PREDICT_VAL,internal_PREDICT_VAL);
     63
    5564    log_printf(FUNC,Address_management,FUNCTION,"End");
    5665  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_transition.cpp

    r119 r123  
    222222      std::string instruction_enable;
    223223      for (uint32_t i=0; i<_param->_nb_instruction; ++i)
    224         instruction_enable += toString(reg_PC_ACCESS_INSTRUCTION_ENABLE [i])+ " ";
     224        instruction_enable += ((reg_PC_ACCESS_VAL)?(toString(reg_PC_ACCESS_INSTRUCTION_ENABLE [i])):"X") + " ";
    225225
    226226      log_printf(TRACE,Address_management,FUNCTION,"    * Access    : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s",
     
    238238      std::string instruction_enable;
    239239      for (uint32_t i=0; i<_param->_nb_instruction; ++i)
    240         instruction_enable += toString(reg_PC_CURRENT_INSTRUCTION_ENABLE [i])+ " ";
     240        instruction_enable += ((reg_PC_CURRENT_VAL)?(toString(reg_PC_CURRENT_INSTRUCTION_ENABLE [i])):"X") + " ";
    241241
    242242      log_printf(TRACE,Address_management,FUNCTION,"    * Current   : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s",
     
    254254      std::string instruction_enable;
    255255      for (uint32_t i=0; i<_param->_nb_instruction; ++i)
    256         instruction_enable += toString(reg_PC_NEXT_INSTRUCTION_ENABLE [i])+ " ";
     256        instruction_enable += ((reg_PC_NEXT_VAL)?(toString(reg_PC_NEXT_INSTRUCTION_ENABLE [i])):"X") + " ";
    257257
    258258      log_printf(TRACE,Address_management,FUNCTION,"    * Next      : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s",
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue.cpp

    r88 r123  
    3838    log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Ifetch_queue == true
    41     log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40// #if DEBUG_Ifetch_queue == true
     41//     log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4242
    43     std::cout << *param << std::endl;
    44 #endif   
     43//     std::cout << *param << std::endl;
     44// #endif   
    4545
    4646    log_printf(INFO,Ifetch_queue,FUNCTION,_("<%s> Allocation"),_name.c_str());
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_deallocation.cpp

    r112 r123  
    3636        DELETE0_SIGNAL( in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,_param->_size_depth          );
    3737        DELETE0_SIGNAL(out_ADDRESS_IFETCH_QUEUE_ID            ,_param->_size_ifetch_queue_ptr);
    38         DELETE1_SIGNAL( in_ADDRESS_INSTRUCTION_ENABLE         ,1,_param->_nb_instruction);
     38        DELETE1_SIGNAL( in_ADDRESS_INSTRUCTION_ENABLE         ,_param->_nb_instruction,1);
    3939     
    40         DELETE1_SIGNAL(out_DECOD_VAL                        ,1,_param->_nb_instruction);
    41         DELETE1_SIGNAL( in_DECOD_ACK                        ,1,_param->_nb_instruction);
    42         DELETE1_SIGNAL(out_DECOD_INSTRUCTION                ,_param->_size_instruction,_param->_nb_instruction);
     40        DELETE1_SIGNAL(out_DECOD_VAL                        ,_param->_nb_instruction,1);
     41        DELETE1_SIGNAL( in_DECOD_ACK                        ,_param->_nb_instruction,1);
     42        DELETE1_SIGNAL(out_DECOD_INSTRUCTION                ,_param->_nb_instruction,_param->_size_instruction);
    4343        DELETE0_SIGNAL(out_DECOD_ADDRESS                    ,_param->_size_instruction_address);
    4444        DELETE0_SIGNAL(out_DECOD_INST_IFETCH_PTR            ,_param->_size_inst_ifetch_ptr );
     
    5151        DELETE0_SIGNAL( in_ICACHE_RSP_PACKET_ID  ,_param->_size_ifetch_queue_ptr);
    5252        DELETE0_SIGNAL( in_ICACHE_RSP_ERROR      ,_param->_size_icache_error);
    53         DELETE1_SIGNAL( in_ICACHE_RSP_INSTRUCTION,_param->_size_instruction,_param->_nb_instruction);
     53        DELETE1_SIGNAL( in_ICACHE_RSP_INSTRUCTION,_param->_nb_instruction,_param->_size_instruction);
    5454
    5555        DELETE0_SIGNAL( in_EVENT_RESET_VAL,1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_genMoore.cpp

    r119 r123  
    2323    log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin");
    2424
     25    if (PORT_READ(in_NRESET))
     26      {
    2527    // ==========================================================
    2628    // =====[ ADDRESS ]==========================================
     
    2931      internal_ADDRESS_ACK = (_queue[reg_PTR_WRITE]->_state == IFETCH_QUEUE_STATE_EMPTY);
    3032     
    31       PORT_WRITE(out_ADDRESS_ACK            , internal_ADDRESS_ACK);
    3233      if (_param->_have_port_ifetch_queue_ptr)
    3334      PORT_WRITE(out_ADDRESS_IFETCH_QUEUE_ID, reg_PTR_WRITE);
     
    4344        {
    4445          internal_DECOD_VAL [i] = ack and _queue[reg_PTR_READ]->_instruction_enable [i];
    45           PORT_WRITE(out_DECOD_VAL         [i], internal_DECOD_VAL [i]);
    4646          PORT_WRITE(out_DECOD_INSTRUCTION [i],         _queue[reg_PTR_READ]->_instruction        [i]);
    4747        }
     
    5555      PORT_WRITE(out_DECOD_EXCEPTION                  , _queue[reg_PTR_READ]->_exception                  );
    5656    }
     57      }
     58    else
     59      {
     60        // Reset
     61        internal_ADDRESS_ACK = 0;
     62        for (uint32_t i=0; i<_param->_nb_instruction; i++)
     63          internal_DECOD_VAL [i] = 0;
     64       
     65      }
     66
     67    // Write Output
     68    PORT_WRITE(out_ADDRESS_ACK  , internal_ADDRESS_ACK);
     69    for (uint32_t i=0; i<_param->_nb_instruction; i++)
     70    PORT_WRITE(out_DECOD_VAL [i], internal_DECOD_VAL [i]);
    5771
    5872    log_printf(FUNC,Ifetch_queue,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Ifetch_unit_Glue.cpp

    r88 r123  
    3838    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Ifetch_unit_Glue == true
    41     log_printf(INFO,Ifetch_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40// #if DEBUG_Ifetch_unit_Glue == true
     41//     log_printf(INFO,Ifetch_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4242
    43     std::cout << *param << std::endl;
    44 #endif   
     43//     std::cout << *param << std::endl;
     44// #endif   
    4545
    4646    log_printf(INFO,Ifetch_unit_Glue,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Ifetch_unit_Glue_genMealy_event.cpp

    r81 r123  
    2424    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin");
    2525
     26    if (PORT_READ(in_NRESET))
     27      {
    2628    Tcontrol_t address_ack = PORT_READ(in_EVENT_ADDRESS_ACK);
    2729    Tcontrol_t queue_ack   = PORT_READ(in_EVENT_QUEUE_ACK  );
     
    3133    PORT_WRITE(out_EVENT_ADDRESS_VAL, val         and queue_ack);
    3234    PORT_WRITE(out_EVENT_QUEUE_VAL  , address_ack and val);
    33    
     35      }
     36    else
     37      {
     38    PORT_WRITE(out_EVENT_ACK        , 0);
     39    PORT_WRITE(out_EVENT_ADDRESS_VAL, 0);
     40    PORT_WRITE(out_EVENT_QUEUE_VAL  , 0);
     41      }
     42
    3443    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End");
    3544  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue/src/Ifetch_unit_Glue_genMealy_icache_req.cpp

    r85 r123  
    2424    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"Begin");
    2525
     26    if (PORT_READ(in_NRESET))
     27      {
    2628    Tcontrol_t address_val = PORT_READ(in_ICACHE_REQ_ADDRESS_VAL);
    2729    Tcontrol_t queue_ack   = PORT_READ(in_ICACHE_REQ_QUEUE_ACK  );
     
    3537    PORT_WRITE(out_ICACHE_REQ_ADDRESS      ,address);
    3638    PORT_WRITE(out_ICACHE_REQ_QUEUE_ADDRESS,address);
     39      }
     40    else
     41      {
     42        // RESET
     43        PORT_WRITE(out_ICACHE_REQ_VAL        , 0);
     44        PORT_WRITE(out_ICACHE_REQ_ADDRESS_ACK, 0);
     45        PORT_WRITE(out_ICACHE_REQ_QUEUE_VAL  , 0);
     46      }
    3747   
    3848    log_printf(FUNC,Ifetch_unit_Glue,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/src/Ifetch_unit.cpp

    r88 r123  
    3737    log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin");
    3838
    39 #if DEBUG_Ifetch_unit == true
    40     log_printf(INFO,Ifetch_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
     39// #if DEBUG_Ifetch_unit == true
     40//     log_printf(INFO,Ifetch_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4141
    42     std::cout << *param << std::endl;
    43 #endif   
     42//     std::cout << *param << std::endl;
     43// #endif   
    4444
    4545    log_printf(INFO,Ifetch_unit,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/src/Ifetch_unit_deallocation.cpp

    r112 r123  
    4040        DELETE0_SIGNAL( in_ICACHE_RSP_PACKET_ID  ,_param->_size_ifetch_queue_ptr   );
    4141        DELETE0_SIGNAL( in_ICACHE_RSP_ERROR      ,_param->_size_icache_error);
    42         DELETE1_SIGNAL( in_ICACHE_RSP_INSTRUCTION,_param->_size_instruction,_param->_nb_instruction);
     42        DELETE1_SIGNAL( in_ICACHE_RSP_INSTRUCTION,_param->_nb_instruction, _param->_size_instruction);
    4343
    4444        DELETE0_SIGNAL(out_PREDICT_VAL                        ,1);
     
    5252        DELETE0_SIGNAL( in_PREDICT_BRANCH_STATE               ,_param->_size_branch_state);
    5353        DELETE0_SIGNAL( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_size_depth);
    54         DELETE1_SIGNAL( in_PREDICT_INSTRUCTION_ENABLE         ,1,_param->_nb_instruction);
     54        DELETE1_SIGNAL( in_PREDICT_INSTRUCTION_ENABLE         ,_param->_nb_instruction,1);
    5555
    5656    //  DELETE0_SIGNAL(out_DECOD_CONTEXT_ID                 ,_param->_size_context_id);
     
    6262        DELETE1_SIGNAL(out_DECOD_VAL                        ,1,_param->_nb_instruction);
    6363        DELETE1_SIGNAL( in_DECOD_ACK                        ,1,_param->_nb_instruction);
    64         DELETE1_SIGNAL(out_DECOD_INSTRUCTION                ,_param->_size_instruction,_param->_nb_instruction);
     64        DELETE1_SIGNAL(out_DECOD_INSTRUCTION                ,_param->_nb_instruction,_param->_size_instruction);
    6565
    6666        DELETE0_SIGNAL( in_EVENT_VAL              ,1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/src/Branch_Target_Buffer_Glue.cpp

    r88 r123  
    3939    log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin");
    4040
    41 #if DEBUG_Branch_Target_Buffer_Glue == true
    42     log_printf(INFO,Branch_Target_Buffer_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    43 
    44     std::cout << *param << std::endl;
    45 #endif   
     41// #if DEBUG_Branch_Target_Buffer_Glue == true
     42//     log_printf(INFO,Branch_Target_Buffer_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     43
     44//     std::cout << *param << std::endl;
     45// #endif   
    4646
    4747    log_printf(INFO,Branch_Target_Buffer_Glue,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/src/Branch_Target_Buffer_Glue_genMealy_decod.cpp

    r98 r123  
    2525    log_function(Branch_Target_Buffer_Glue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    2830      {
     
    6264          }
    6365      }
     66      }
     67    else
     68      {
     69        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     70          {
     71            PORT_WRITE(out_DECOD_ACK            [i], 0);
     72            PORT_WRITE(out_DECOD_REGISTER_VAL   [i], 0);
     73            if (_param->_have_port_victim)
     74            PORT_WRITE(out_DECOD_VICTIM_VAL     [i], 0);
     75          }
     76      }
    6477
    6578    log_end(Branch_Target_Buffer_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/src/Branch_Target_Buffer_Glue_genMealy_predict.cpp

    r108 r123  
    2525    log_function(Branch_Target_Buffer_Glue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
    2830      {
     
    8385          }
    8486      }
     87      }
     88    else
     89      {
     90        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     91          {
     92            PORT_WRITE(out_PREDICT_ACK            [i], 0);
     93            PORT_WRITE(out_PREDICT_REGISTER_VAL   [i], 0);
     94            if (_param->_have_port_victim)
     95            PORT_WRITE(out_PREDICT_VICTIM_VAL     [i], 0);
     96          }
     97      }
    8598
    8699    log_end(Branch_Target_Buffer_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/src/Branch_Target_Buffer_Glue_genMealy_update.cpp

    r98 r123  
    2525    log_function(Branch_Target_Buffer_Glue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    2830      {
     
    5254          }
    5355      }
     56      }
     57    else
     58      {
     59        for (uint32_t i=0; i<_param->_nb_inst_update; i++)
     60          {
     61            PORT_WRITE(out_UPDATE_ACK            [i], 0);
     62            PORT_WRITE(out_UPDATE_REGISTER_VAL   [i], 0);
     63            if (_param->_have_port_victim)
     64            PORT_WRITE(out_UPDATE_VICTIM_VAL     [i], 0);
     65          }
     66      }
    5467
    5568    log_end(Branch_Target_Buffer_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register.cpp

    r113 r123  
    3838    log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Branch_Target_Buffer_Register == true
    41     log_printf(INFO,Branch_Target_Buffer_Register,FUNCTION,_("<%s> Parameters"),_name.c_str());
    42 
    43     std::cout << *param << std::endl;
    44 #endif   
     40// #if DEBUG_Branch_Target_Buffer_Register == true
     41//     log_printf(INFO,Branch_Target_Buffer_Register,FUNCTION,_("<%s> Parameters"),_name.c_str());
     42
     43//     std::cout << *param << std::endl;
     44// #endif   
    4545
    4646    log_printf(INFO,Branch_Target_Buffer_Register,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register_genMealy_decod.cpp

    r88 r123  
    2525    log_function(Branch_Target_Buffer_Register,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    2830      {
     
    5557          }
    5658      }
    57 
     59      }
     60    else
     61      {
     62//      internal_DECOD_HIT       [i] = hit      ;
     63//      internal_DECOD_NUM_BANK  [i] = num_bank ;
     64//      internal_DECOD_NUM_ENTRY [i] = num_entry;
     65      }
     66   
    5867    log_end(Branch_Target_Buffer_Register,FUNCTION);
    5968  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register_genMealy_predict.cpp

    r108 r123  
    2525    log_function(Branch_Target_Buffer_Register,FUNCTION,_name.c_str());
    2626   
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
    2830      {
     
    6466          }
    6567      }
     68      }
     69//     else
     70//       {
     71//       }
    6672
    6773    log_end(Branch_Target_Buffer_Register,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register_genMealy_update.cpp

    r88 r123  
    2525    log_function(Branch_Target_Buffer_Register,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    2830      {
     
    5557          }
    5658      }
     59      }
     60//     else
     61//       {
     62//      internal_UPDATE_HIT       [i] = hit      ;
     63//      internal_UPDATE_NUM_BANK  [i] = num_bank ;
     64//      internal_UPDATE_NUM_ENTRY [i] = num_entry;
     65//       }
    5766
    5867    log_end(Branch_Target_Buffer_Register,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/src/Branch_Target_Buffer.cpp

    r88 r123  
    4040    log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Allocation");
    4141
    42 #if DEBUG_Branch_Target_Buffer == true
    43     log_printf(INFO,Branch_Target_Buffer,FUNCTION,_("<%s> Parameters"),_name.c_str());
     42// #if DEBUG_Branch_Target_Buffer == true
     43//     log_printf(INFO,Branch_Target_Buffer,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4444
    45     std::cout << *param << std::endl;
    46 #endif   
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    allocation (
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/src/Direction_Glue.cpp

    r112 r123  
    4040
    4141
    42 #if DEBUG_Direction_Glue == true
    43     log_printf(INFO,Direction_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    44 
    45     std::cout << *param << std::endl;
    46 #endif   
     42// #if DEBUG_Direction_Glue == true
     43//     log_printf(INFO,Direction_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     44
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    log_printf(INFO,Direction_Glue,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/src/Direction_Glue_genMealy_predict.cpp

    r107 r123  
    2626    log_function(Direction_Glue,FUNCTION,_name.c_str());
    2727
     28    if (PORT_READ(in_NRESET))
     29      {
     30//         std::cout << "Kane (before) " << std::endl;
     31//         std::cout << _param << std::endl;
     32//         std::cout << _param->_nb_inst_update << std::endl;
     33//         std::cout << _param->_nb_inst_predict<< std::endl;
     34//         std::cout << "Kane (end) " << std::endl;
     35
     36
    2837    // constant direction : never / always
    2938    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     
    3140        log_printf(TRACE,Direction_Glue,FUNCTION,"  * PREDICT [%d]",i);
    3241
    33         Tcontrol_t direction;
     42        Tcontrol_t direction = false;
    3443
    3544        switch (_param->_predictor_scheme)
     
    8695        PORT_WRITE(out_PREDICT_DIRECTION   [i], direction);
    8796      }
     97      }
     98    else
     99      {
     100        //RESET
     101        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     102          {
     103            if (_param->_have_component_meta_predictor)
     104              {
     105            PORT_WRITE(out_PREDICT_PREDICTOR_VAL [i], 0);
     106            PORT_WRITE(out_PREDICT_ACK           [i], 0);
     107              }
     108          }
     109      }
    88110
    89111    log_end(Direction_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/src/Direction_Glue_genMealy_update.cpp

    r112 r123  
    2626    log_function(Direction_Glue,FUNCTION,_name.c_str());
    2727
     28    if (PORT_READ(in_NRESET))
     29      {
    2830    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    2931      {
     
    3537        PORT_WRITE(out_UPDATE_PREDICTOR_PREDICTION_IFETCH [i], PORT_READ(in_UPDATE_PREDICTION_IFETCH [i]));
    3638      }
    37    
     39      }
     40    else
     41      {
     42        // RESET
     43        for (uint32_t i=0; i<_param->_nb_inst_update; i++)
     44          {
     45            PORT_WRITE(out_UPDATE_PREDICTOR_VAL [i], 0);
     46            PORT_WRITE(out_UPDATE_ACK           [i], 0);
     47          }
     48      }
     49
    3850    log_end(Direction_Glue,FUNCTION);
    3951  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict.cpp

    r111 r123  
    2727    log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str());
    2828
     29    if (PORT_READ(in_NRESET))
     30      {
    2931    for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
    3032      {
     
    8991        PORT_WRITE(out_PREDICT_DIRECTION [i],direction);
    9092      }
     93      }
     94//     else
     95//       {
     96//       }
    9197
    9298    log_end(Meta_Predictor_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict_valack.cpp

    r111 r123  
    2727    log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str());
    2828
     29    if (PORT_READ(in_NRESET))
     30      {
    2931    for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
    3032      {
     
    4042
    4143        PORT_WRITE(out_PREDICT_ACK [i],ack);
     44      }
     45      }
     46    else
     47      {
     48        // Reset
     49        for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
     50          {
     51            for (uint32_t j=0; j<_param->_nb_predictor; ++j)
     52              PORT_WRITE(out_PREDICT_PREDICTOR_VAL [j][i],0);
     53            PORT_WRITE(out_PREDICT_ACK [i],0);
     54          }
    4255      }
    4356
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_update.cpp

    r112 r123  
    2727    log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str());
    2828
     29    if (PORT_READ(in_NRESET))
     30      {
    2931    for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
    3032      {
     
    112114          }
    113115      }
     116      }
     117//     else
     118//       {
     119//         // RESET
     120//       }
    114121
    115122    log_end(Meta_Predictor_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_update_valack.cpp

    r111 r123  
    2727    log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str());
    2828
     29    if (PORT_READ(in_NRESET))
     30      {
    2931    for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
    3032      {
     
    4042
    4143        PORT_WRITE(out_UPDATE_ACK [i],ack);
     44      }
     45      }
     46    else
     47      {
     48        // RESET
     49        for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
     50          {
     51            for (uint32_t j=0; j<_param->_nb_predictor; ++j)
     52              PORT_WRITE(out_UPDATE_PREDICTOR_VAL [j][i],0);
     53            PORT_WRITE(out_UPDATE_ACK [i],0);
     54          }
    4255      }
    4356
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_genMealy_predict.cpp

    r119 r123  
    2929    log_function(Two_Level_Branch_Predictor,FUNCTION,_name.c_str());
    3030
     31    if (PORT_READ(in_NRESET))
     32      {
    3133    // ===================================================================
    3234    // =====[ PREDICT ]===================================================
     
    9597          PORT_WRITE(out_PREDICT_HISTORY   [i],history  );
    9698        }
     99      }
    97100
    98101    log_end(Two_Level_Branch_Predictor,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/src/Direction.cpp

    r88 r123  
    3838    log_printf(FUNC,Direction,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Direction == true
    41     log_printf(INFO,Direction,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40// #if DEBUG_Direction == true
     41//     log_printf(INFO,Direction,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4242
    43     std::cout << *param << std::endl;
    44 #endif
     43//     std::cout << *param << std::endl;
     44// #endif
    4545
    4646    log_printf(INFO,Direction,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue.cpp

    r110 r123  
    4040    usage_environment(_usage);
    4141
    42 #if DEBUG_Prediction_unit_Glue == true
    43     log_printf(INFO,Prediction_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
    44 
    45     std::cout << *param << std::endl;
    46 #endif   
     42// #if DEBUG_Prediction_unit_Glue == true
     43//     log_printf(INFO,Prediction_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     44
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    log_printf(INFO,Prediction_unit_Glue,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_decod.cpp

    r110 r123  
    290290          PORT_WRITE(out_DECOD_ACK [i][j], ack[j]);
    291291      }
     292    else
     293      {
     294        // Reset
     295        for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++)
     296          {
     297            PORT_WRITE(out_DECOD_BTB_VAL [i], 0);
     298            PORT_WRITE(out_DECOD_RAS_VAL [i], 0);
     299            PORT_WRITE(out_DECOD_UPT_VAL [i], 0);
     300          }
     301       
     302        for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
     303          for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
     304            PORT_WRITE(out_DECOD_ACK [i][j], 0);
     305      }
    292306    log_end(Prediction_unit_Glue,FUNCTION);
    293307  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp

    r111 r123  
    420420      PORT_WRITE(out_PREDICT_ACK[i],ack[i]);
    421421      }
     422    else
     423      {
     424        // RESET
     425        for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
     426          {
     427            PORT_WRITE(out_PREDICT_BTB_VAL [i], 0);
     428            PORT_WRITE(out_PREDICT_DIR_VAL [i], 0);
     429            PORT_WRITE(out_PREDICT_RAS_VAL [i], 0);
     430            PORT_WRITE(out_PREDICT_UPT_VAL [i], 0);
     431          }
     432        for (uint32_t i=0; i<_param->_nb_context; i++)
     433          PORT_WRITE(out_PREDICT_ACK[i],0);
     434      }
    422435
    423436    log_end(Prediction_unit_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_update.cpp

    r98 r123  
    2525    log_function(Prediction_unit_Glue,FUNCTION,_name.c_str());
    2626
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
    2830      {
     
    8890        PORT_WRITE(out_UPDATE_UPT_ACK [i], upt_ack);
    8991      }
     92      }
     93    else
     94      {
     95        // RESET
     96        for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
     97          {
     98            PORT_WRITE(out_UPDATE_BTB_VAL [i], 0);
     99            PORT_WRITE(out_UPDATE_DIR_VAL [i], 0);
     100            PORT_WRITE(out_UPDATE_RAS_VAL [i], 0);
     101            PORT_WRITE(out_UPDATE_UPT_ACK [i], 0);
     102          }
     103      }
    90104
    91105    log_end(Prediction_unit_Glue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack.cpp

    r88 r123  
    3838    log_printf(FUNC,Return_Address_Stack,FUNCTION,"Begin");
    3939
    40 #if DEBUG_Return_Address_Stac == true
    41     log_printf(INFO,Return_Address_Stac,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40// #if DEBUG_Return_Address_Stac == true
     41//     log_printf(INFO,Return_Address_Stac,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4242
    43     std::cout << *param << std::endl;
    44 #endif   
     43//     std::cout << *param << std::endl;
     44// #endif   
    4545
    4646    log_printf(INFO,Return_Address_Stack,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_decod.cpp

    r118 r123  
    6666      }
    6767      }
     68    else
     69      {
     70//      internal_DECOD_HIT [i] = (push or (reg_NB_ELT[context]>0));
     71      }
     72
    6873    log_end(Return_Address_Stack,FUNCTION);
    6974  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_genMealy_predict.cpp

    r118 r123  
    2525    log_function(Return_Address_Stack,FUNCTION,_name.c_str());
    2626
    27     if (PORT_READ(in_NRESET) == 1)
     27    if (PORT_READ(in_NRESET))
    2828      {
    2929#ifdef DEBUG_TEST
     
    6969      }
    7070      }
     71    else
     72      {
     73//     for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     74//      internal_PREDICT_HIT [i] = (push or (reg_PREDICT_NB_ELT[context]>0));
     75
     76      }
    7177
    7278    log_end(Return_Address_Stack,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h

    r122 r123  
    5454      UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT        , // prediction unit is ok, wait the end of event (send by Context State)
    5555      UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT        , // prediction unit is update, send signal to context manager
    56       UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT          // prediction unit is ok, wait the end of event (send by Context State)
     56      UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT        , // prediction unit is ok, wait the end of event (send by Context State)
     57      UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE         // prediction unit is ok, wait the end of event (send by Context State)
    5758    } upt_event_state_t;
    5859
     
    226227      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT  : return "UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT"  ; break;
    227228      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT  : return "UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT"  ; break;
     229      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE : return "UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE" ; break;
    228230      default    : return ""; break;
    229231      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table.cpp

    r111 r123  
    4040    usage_environment(_usage);
    4141
    42 #if DEBUG_Update_Prediction_Table == true
    43     log_printf(INFO,Update_Prediction_Table,FUNCTION,_("<%s> Parameters"),_name.c_str());
    44 
    45     std::cout << *param << std::endl;
    46 #endif   
     42// #if DEBUG_Update_Prediction_Table == true
     43//     log_printf(INFO,Update_Prediction_Table,FUNCTION,_("<%s> Parameters"),_name.c_str());
     44
     45//     std::cout << *param << std::endl;
     46// #endif   
    4747
    4848    log_printf(INFO,Update_Prediction_Table,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_branch_complete.cpp

    r122 r123  
    2424    log_begin(Update_Prediction_Table,FUNCTION);
    2525    log_function(Update_Prediction_Table,FUNCTION,_name.c_str());
    26    
     26
     27    if (PORT_READ(in_NRESET))
     28      {
    2729    for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
    2830#ifdef DEBUG_TEST
     
    129131//      PORT_WRITE(out_BRANCH_COMPLETE_ADDRESS_DEST    [i], internal_BRANCH_COMPLETE_ADDRESS_DEST    [i]);
    130132      }
    131 
     133      }
    132134    log_end(Update_Prediction_Table,FUNCTION);
    133135  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp

    r122 r123  
    6868      }
    6969      }
     70    else
     71      {
     72        // RESET
     73        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     74          PORT_WRITE(out_DECOD_ACK          [i], 0);
     75      }
     76
    7077    log_end(Update_Prediction_Table,FUNCTION);
    7178  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_predict.cpp

    r122 r123  
    5757        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ACK         : %d",internal_PREDICT_ACK [i]);
    5858
    59         PORT_WRITE(out_PREDICT_ACK                  [i], internal_PREDICT_ACK                  [i]);
    6059        if (_param->_have_port_depth)
    6160        PORT_WRITE(out_PREDICT_UPDATE_PREDICTION_ID [i], internal_PREDICT_UPDATE_PREDICTION_ID [i]);
     
    6362
    6463      }//don't reset
     64    else
     65      {
     66        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     67          {
     68            internal_PREDICT_ACK [i] = 0;
     69//          internal_PREDICT_UPDATE_PREDICTION_ID [i] = top;
     70          }
     71      }
     72
     73    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     74      PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]);
    6575
    6676    log_end(Update_Prediction_Table,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp

    r122 r123  
    248248        internal_UPDATE_CONTEXT_ID      [i] = context;
    249249
    250         PORT_WRITE(out_UPDATE_VAL                   [i],internal_UPDATE_VAL [i]);
    251250        if (val)
    252251          {
     
    282281        Tcontrol_t val = ((reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT) or
    283282                          (reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT));
    284         PORT_WRITE(out_BRANCH_EVENT_VAL              [i],val);
    285283        if (_param->_have_port_depth)
    286284        PORT_WRITE(out_BRANCH_EVENT_DEPTH            [i],reg_EVENT_DEPTH            [i]);
     
    301299            internal_UPDATE_VAL             [i] = 0;
    302300            internal_UPDATE_VAL_WITHOUT_ACK [i] = 0;
     301            internal_UPDATE_CONTEXT_ID      [i] = 0;
     302       
    303303          }
    304304        for (uint32_t i=0; i<_param->_nb_context; i++)
     
    308308      }
    309309
     310    // Write output
     311    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
     312      PORT_WRITE(out_UPDATE_VAL       [i],internal_UPDATE_VAL [i]);
     313    for (uint32_t i=0; i<_param->_nb_context; i++)
     314      PORT_WRITE(out_BRANCH_EVENT_VAL [i],internal_BRANCH_EVENT_VAL [i]);
    310315
    311316    log_end(Update_Prediction_Table,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r122 r123  
    545545                        }
    546546                     
     547                      // Test if freeing the branch with no accurate ?
     548                      if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
     549                        reg_IS_ACCURATE [context] = true;
     550
    547551                      // Update pointer
    548552                      //  * if update RAS : update pointer is decreaste until it equal at top pointer
     
    577581                                }
    578582                             
    579                               reg_UPT_EVENT_STATE [context] = upt_event_state;
    580583                            }
    581584                          else
     
    593596                        }
    594597                     
    595                       // Test if freeing the branch with no accurate ?
    596                       if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
    597                         reg_IS_ACCURATE [context] = true;
     598                      // special case :
     599                      if ((upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE) and
     600                          (reg_UPT_UPDATE [context] == reg_EVENT_UPT_PTR [context]))
     601                        {
     602                          reg_UPT_TOP     [context] = reg_UPT_TOP_EVENT [context];
     603                          reg_UPT_UPDATE  [context] = reg_UPT_TOP_EVENT [context];
     604                          reg_IS_ACCURATE [context] = true;
     605
     606                          upt_event_state = UPT_EVENT_STATE_OK;
     607                        }
     608
     609                      reg_UPT_EVENT_STATE [context] = upt_event_state;
    598610
    599611                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE (after ) : %d",reg_UPT_UPDATE[context]);
     
    654666                       
    655667                        Taddress_t        address_src         = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src;
    656                         upt_state_t       event_top           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
     668                        upt_state_t       top_state           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
    657669                       
    658670                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * upt_event_state     : %s",toString(upt_event_state).c_str());
    659                         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * event_top           : %s",toString(event_top).c_str());
     671                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top_state           : %s",toString(top_state).c_str());
    660672                       
    661673                        bool              previous_ufpt_event = (reg_UFPT_EVENT_STATE [i] == UFPT_EVENT_STATE_KO_FLUSH);
     
    667679                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT)
    668680                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT)
    669                                                                  or (event_top       == UPDATE_PREDICTION_STATE_END_KO    )
    670                                                                  or (event_top       == UPDATE_PREDICTION_STATE_KO        )
     681                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE)
     682                                                                 or (top_state       == UPDATE_PREDICTION_STATE_END_KO    )
     683                                                                 or (top_state       == UPDATE_PREDICTION_STATE_KO        )
    671684                                                                 );
    672685                       
     
    706719                                reg_UPDATE_PREDICTION_TABLE [context][top]._retire_ok = false;
    707720                               
    708                                 switch (event_top)
     721                                switch (top_state)
    709722                                  {
    710723                                  case UPDATE_PREDICTION_STATE_END_KO :
     724                                  case UPDATE_PREDICTION_STATE_END    :
    711725                                    {
    712726                                      // Have already update predictor
     
    867881                      case UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT :
    868882                        {
    869                           Tdepth_t depth = reg_EVENT_UPT_PTR [i];
     883                          Tdepth_t depth  = reg_EVENT_UPT_PTR [i];
     884                          Tdepth_t update = reg_UPT_UPDATE    [i];
    870885                         
    871886                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth : %d",depth);
     
    878893                            }
    879894
    880                             reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
    881                             reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
    882 
    883                           // break; continue
     895                          // Special case : branch_complete a speculative branch and the context_state signal the end of this event before the complete of previous branch
     896                          if (depth != update)
     897                            {
     898                              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_COMMIT_WAIT_END_UPDATE (event)",i);
     899                              upt_event_state = UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE;
     900
     901                              break; // stop here
     902                             }
     903
     904                          reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
     905                          reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
     906
     907//                             break; continue
    884908                        }
    885909                      case UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT :
     
    906930                    // Flush UPFT
    907931                    flush_UFPT [i] = true;
     932
     933                    if (upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE)
     934                      {
     935                        reg_UPT_TOP     [i] = reg_UPT_TOP_EVENT [i];
     936                        reg_UPT_UPDATE  [i] = reg_UPT_TOP_EVENT [i];
     937                        reg_IS_ACCURATE [i] = true;
     938                       
     939                        upt_event_state = UPT_EVENT_STATE_OK;
     940                      }
    908941                   
    909942                    // Flush UPT
     
    9781011                    reg_EVENT_UPT_PTR         [i] = top;
    9791012                    reg_EVENT_UPT_FULL        [i] = (not empty and (bottom == reg_UPT_TOP [i]));
     1013//                  reg_EVENT_DEPTH           [i] = PORT_READ(in_EVENT_DEPTH [i]);//(top+1)%_param->_size_upt_queue[i];
    9801014                    reg_EVENT_DEPTH           [i] = top;
     1015
    9811016//                  reg_EVENT_ADDRESS_SRC     [i] = address_src; // delay_slot is compute in I_State
    9821017//                  reg_EVENT_ADDRESS_DEST_VAL[i] = good_take;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit.cpp

    r88 r123  
    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());
     39// #if DEBUG_Prediction_unit == true
     40//     log_printf(INFO,Prediction_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4141
    42     std::cout << *param << std::endl;
    43 #endif   
     42//     std::cout << *param << std::endl;
     43// #endif   
    4444
    4545    log_printf(INFO,Prediction_unit,FUNCTION,"Allocation");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/include/Front_end.h

    r108 r123  
    9393  public    : SC_OUT(Toperation_t         ) ** out_DECOD_OPERATION                 ;//[sum_inst_decod]
    9494  public    : SC_OUT(Tcontrol_t           ) ** out_DECOD_NO_EXECUTE                ;//[sum_inst_decod]
     95//public    : SC_OUT(Tcontrol_t           ) ** out_DECOD_HAVE_EVENT                ;//[sum_inst_decod]
     96  public    : SC_OUT(Tcontrol_t           ) ** out_DECOD_LAST_EVENT                ;//[sum_inst_decod]
    9597  public    : SC_OUT(Tcontrol_t           ) ** out_DECOD_IS_DELAY_SLOT             ;//[sum_inst_decod]
    9698#ifdef DEBUG
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Front_end.cpp

    r88 r123  
    3838    usage_environment(_usage);
    3939
    40 #if DEBUG_Core == true
    41     log_printf(INFO,Core,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40// #if DEBUG_Core == true
     41//     log_printf(INFO,Core,FUNCTION,_("<%s> Parameters"),_name.c_str());
    4242
    43     std::cout << *param << std::endl;
    44 #endif   
     43//     std::cout << *param << std::endl;
     44// #endif   
    4545
    4646    log_printf(INFO,Front_end,FUNCTION,_("<%s> : Allocation"),_name.c_str());
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Front_end_allocation.cpp

    r119 r123  
    101101      ALLOC1_SIGNAL_OUT (out_DECOD_OPERATION                  ,"OPERATION"        ,Toperation_t         ,_param->_size_operation             );
    102102      ALLOC1_SIGNAL_OUT (out_DECOD_NO_EXECUTE                 ,"NO_EXECUTE"       ,Tcontrol_t           ,1                                   );
     103//    ALLOC1_SIGNAL_OUT (out_DECOD_HAVE_EVENT                 ,"HAVE_EVENT"       ,Tcontrol_t           ,1                                   );
     104      ALLOC1_SIGNAL_OUT (out_DECOD_LAST_EVENT                 ,"LAST_EVENT"       ,Tcontrol_t           ,1                                   );
    103105      ALLOC1_SIGNAL_OUT (out_DECOD_IS_DELAY_SLOT              ,"IS_DELAY_SLOT"    ,Tcontrol_t           ,1                                   );
    104106#ifdef DEBUG
     
    726728          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_NO_EXECUTE"   ,
    727729                              dest,"out_DECOD_"+toString(x)+"_NO_EXECUTE"   );
     730//           PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_HAVE_EVENT"   ,
     731//                               dest,"out_DECOD_"+toString(x)+"_HAVE_EVENT"   );
     732          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_LAST_EVENT"   ,
     733                              dest,"out_DECOD_"+toString(x)+"_LAST_EVENT"   );
    728734          PORT_MAP(_component,src ,"out_DECOD_"+toString(j)+"_IS_DELAY_SLOT",
    729735                              dest,"out_DECOD_"+toString(x)+"_IS_DELAY_SLOT");
     
    865871          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+"_DECOD_ENABLE",
    866872                                   dest,"out_CONTEXT_"+toString(y)+"_DECOD_ENABLE");
     873          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+"_EVENT",
     874                                   dest,"out_CONTEXT_"+toString(y)+"_EVENT");
    867875
    868876          dest = _name+"_glue";
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Front_end_deallocation.cpp

    r122 r123  
    4747        DELETE1_SIGNAL(out_DECOD_TYPE                       ,_param->_sum_inst_decod,_param->_size_type                  );
    4848        DELETE1_SIGNAL(out_DECOD_OPERATION                  ,_param->_sum_inst_decod,_param->_size_operation             );
    49         DELETE1_SIGNAL(out_DECOD_NO_EXECUTE                 ,_param->_sum_inst_decod,1                                   );
     49        DELETE1_SIGNAL(out_DECOD_NO_EXECUTE                 ,_param->_sum_inst_decod,1                                   );
     50//      DELETE1_SIGNAL(out_DECOD_HAVE_EVENT                 ,_param->_sum_inst_decod,1                                   );
     51        DELETE1_SIGNAL(out_DECOD_LAST_EVENT                 ,_param->_sum_inst_decod,1                                   );
    5052        DELETE1_SIGNAL(out_DECOD_IS_DELAY_SLOT              ,_param->_sum_inst_decod,1                                   );
    5153#ifdef DEBUG
Note: See TracChangeset for help on using the changeset viewer.