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