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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.