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/Decod_unit/Decod_queue/src
Files:
10 edited

Legend:

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