Ignore:
Timestamp:
Feb 12, 2009, 12:55:06 PM (15 years ago)
Author:
rosiere
Message:

1) decod_queue : add reg_LAST_SLOT.
2) Commit : insert on event -> to pop decod_queue. Head test : add information (speculative or not)
3) Context State / UPT : Branch miss and Load miss in same cycle.
4) Free List : Bank is on LSB not MSB.
5) Platforms : move data

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp

    r105 r108  
    7171  ALLOC1_SC_SIGNAL(out_DECOD_NO_EXECUTE                   ,"out_DECOD_NO_EXECUTE                   ",Tcontrol_t         ,_param->_nb_inst_decod);
    7272  ALLOC1_SC_SIGNAL(out_DECOD_IS_DELAY_SLOT                ,"out_DECOD_IS_DELAY_SLOT                ",Tcontrol_t         ,_param->_nb_inst_decod);
     73#ifdef DEBUG
     74  ALLOC1_SC_SIGNAL(out_DECOD_ADDRESS                      ,"out_DECOD_ADDRESS                      ",Tgeneral_data_t    ,_param->_nb_inst_decod);
     75#endif
    7376  ALLOC1_SC_SIGNAL(out_DECOD_ADDRESS_NEXT                 ,"out_DECOD_ADDRESS_NEXT                 ",Tgeneral_data_t    ,_param->_nb_inst_decod);
    7477  ALLOC1_SC_SIGNAL(out_DECOD_HAS_IMMEDIAT                 ,"out_DECOD_HAS_IMMEDIAT                 ",Tcontrol_t         ,_param->_nb_inst_decod);
     
    148151  INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_NO_EXECUTE                   ,_param->_nb_inst_decod);
    149152  INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_IS_DELAY_SLOT                ,_param->_nb_inst_decod);
     153#ifdef DEBUG
     154  INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_ADDRESS                      ,_param->_nb_inst_decod);
     155#endif
    150156  INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_ADDRESS_NEXT                 ,_param->_nb_inst_decod);
    151157  INSTANCE1_SC_SIGNAL(_Decod,out_DECOD_HAS_IMMEDIAT                 ,_param->_nb_inst_decod);
     
    450456  delete [] out_DECOD_NO_EXECUTE                   ;
    451457  delete [] out_DECOD_IS_DELAY_SLOT                ;
     458#ifdef DEBUG
     459  delete [] out_DECOD_ADDRESS                      ;
     460#endif
    452461  delete [] out_DECOD_ADDRESS_NEXT                 ;
    453462  delete [] out_DECOD_HAS_IMMEDIAT                 ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h

    r105 r108  
    8888  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_NO_EXECUTE                   ;//[nb_inst_decod]
    8989  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_IS_DELAY_SLOT                ;//[nb_inst_decod]
     90#ifdef DEBUG
     91  public    : SC_OUT(Tgeneral_data_t    )  ** out_DECOD_ADDRESS                      ;//[nb_inst_decod]
     92#endif
    9093  public    : SC_OUT(Tgeneral_data_t    )  ** out_DECOD_ADDRESS_NEXT                 ;//[nb_inst_decod]
    9194  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_HAS_IMMEDIAT                 ;//[nb_inst_decod]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_allocation.cpp

    r105 r108  
    8989      ALLOC1_SIGNAL_OUT(out_DECOD_NO_EXECUTE   ,"no_execute"   ,Tcontrol_t        ,1                                   );
    9090      ALLOC1_SIGNAL_OUT(out_DECOD_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t        ,1                                   );
     91#ifdef DEBUG
     92      ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS      ,"address"      ,Tgeneral_data_t   ,_param->_size_instruction_address   );
     93#endif
    9194      ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS_NEXT ,"address_next" ,Tgeneral_data_t   ,_param->_size_instruction_address   );
    9295      ALLOC1_SIGNAL_OUT(out_DECOD_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t        ,1                                   );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp

    r105 r108  
    4949        DELETE1_SIGNAL(out_DECOD_NO_EXECUTE   ,_param->_nb_inst_decod,1                                   );
    5050        DELETE1_SIGNAL(out_DECOD_IS_DELAY_SLOT,_param->_nb_inst_decod,1                                   );
     51#ifdef DEBUG
     52        DELETE1_SIGNAL(out_DECOD_ADDRESS      ,_param->_nb_inst_decod,_param->_size_instruction_address   );
     53#endif
    5154        DELETE1_SIGNAL(out_DECOD_ADDRESS_NEXT ,_param->_nb_inst_decod,_param->_size_instruction_address   );
    5255        DELETE1_SIGNAL(out_DECOD_HAS_IMMEDIAT ,_param->_nb_inst_decod,1                                   );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp

    r107 r108  
    4343
    4444    Tcontrol_t can_continue      [_param->_nb_context];
    45     Tcontrol_t can_continue_next [_param->_nb_context];   
     45//     Tcontrol_t can_continue_next [_param->_nb_context];
     46//     Tcontrol_t have_decod_branch [_param->_nb_context];
    4647
    4748    for (uint32_t i=0; i<_param->_nb_context; i++)
     
    5253       
    5354        can_continue                      [i] = PORT_READ(in_CONTEXT_DECOD_ENABLE [i]);
    54         can_continue_next                 [i] = PORT_READ(in_CONTEXT_DECOD_ENABLE [i]);
     55//      can_continue_next                 [i] = PORT_READ(in_CONTEXT_DECOD_ENABLE [i]);
     56//         have_decod_branch                 [i] = false;
    5557      }
    5658   
     
    7981                log_printf(TRACE,Decod,FUNCTION,"    * decod_ack [%d] : %d",i,PORT_READ(in_DECOD_ACK [i]));
    8082
    81                 can_continue [x] = can_continue_next [x];
     83//              can_continue [x] = can_continue_next [x];
    8284
    8385                decod_val  [i]    = true;                        // fetch_val and decod_enable
     
    139141                PORT_WRITE(out_DECOD_NO_EXECUTE    [i], _decod_instruction->_no_execute    );
    140142                PORT_WRITE(out_DECOD_IS_DELAY_SLOT [i], _decod_instruction->_is_delay_slot );
    141 //              PORT_WRITE(out_DECOD_ADDRESS       [i], addr);
     143#ifdef DEBUG
     144                PORT_WRITE(out_DECOD_ADDRESS       [i], addr);
     145#endif
    142146//                 if ((type == TYPE_BRANCH) and
    143147//                     ((_decod_instruction->_branch_condition = BRANCH_CONDITION_FLAG_SET) or
     
    193197               
    194198                    //can_continue_next [x] = PORT_READ(in_PREDICT_CAN_CONTINUE [i]); // can continue is set if direction is "not take" (also, continue is sequential order)
    195                     can_continue_next [x] = false; // one branch per context, the DS don't execute
     199                    can_continue [x] = false; // one branch per context, the DS don't execute
     200//                  can_continue_next [x] = false; // one branch per context, the DS don't execute
     201//                     have_decod_branch [x] = true;
    196202                  }
    197203
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/src/test.cpp

    r105 r108  
    6060  ALLOC1_SC_SIGNAL( in_DECOD_IN_NO_EXECUTE     ," in_DECOD_IN_NO_EXECUTE    ",Tcontrol_t         ,_param->_nb_inst_decod);
    6161  ALLOC1_SC_SIGNAL( in_DECOD_IN_IS_DELAY_SLOT  ," in_DECOD_IN_IS_DELAY_SLOT ",Tcontrol_t         ,_param->_nb_inst_decod);
     62#ifdef DEBUG
     63  ALLOC1_SC_SIGNAL( in_DECOD_IN_ADDRESS        ," in_DECOD_IN_ADDRESS       ",Tgeneral_data_t    ,_param->_nb_inst_decod);
     64#endif
    6265  ALLOC1_SC_SIGNAL( in_DECOD_IN_ADDRESS_NEXT   ," in_DECOD_IN_ADDRESS_NEXT  ",Tgeneral_data_t    ,_param->_nb_inst_decod);
    6366  ALLOC1_SC_SIGNAL( in_DECOD_IN_HAS_IMMEDIAT   ," in_DECOD_IN_HAS_IMMEDIAT  ",Tcontrol_t         ,_param->_nb_inst_decod);
     
    8487  ALLOC1_SC_SIGNAL(out_DECOD_OUT_NO_EXECUTE    ,"out_DECOD_OUT_NO_EXECUTE   ",Tcontrol_t         ,_param->_nb_inst_decod);
    8588  ALLOC1_SC_SIGNAL(out_DECOD_OUT_IS_DELAY_SLOT ,"out_DECOD_OUT_IS_DELAY_SLOT",Tcontrol_t         ,_param->_nb_inst_decod);
     89#ifdef DEBUG
     90  ALLOC1_SC_SIGNAL(out_DECOD_OUT_ADDRESS       ,"out_DECOD_OUT_ADDRESS      ",Tgeneral_data_t    ,_param->_nb_inst_decod);
     91#endif
    8692  ALLOC1_SC_SIGNAL(out_DECOD_OUT_ADDRESS_NEXT  ,"out_DECOD_OUT_ADDRESS_NEXT ",Tgeneral_data_t    ,_param->_nb_inst_decod);
    8793  ALLOC1_SC_SIGNAL(out_DECOD_OUT_HAS_IMMEDIAT  ,"out_DECOD_OUT_HAS_IMMEDIAT ",Tcontrol_t         ,_param->_nb_inst_decod);
     
    125131  INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_NO_EXECUTE     ,_param->_nb_inst_decod);
    126132  INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_IS_DELAY_SLOT  ,_param->_nb_inst_decod);
     133#ifdef DEBUG
     134  INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_ADDRESS        ,_param->_nb_inst_decod);
     135#endif
    127136  INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_ADDRESS_NEXT   ,_param->_nb_inst_decod);
    128137  INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_HAS_IMMEDIAT   ,_param->_nb_inst_decod);
     
    151160  INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_NO_EXECUTE    ,_param->_nb_inst_decod);
    152161  INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_IS_DELAY_SLOT ,_param->_nb_inst_decod);
     162#ifdef DEBUG
     163  INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_ADDRESS       ,_param->_nb_inst_decod);
     164#endif
    153165  INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_ADDRESS_NEXT  ,_param->_nb_inst_decod);
    154166  INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_HAS_IMMEDIAT  ,_param->_nb_inst_decod);
     
    304316  DELETE1_SC_SIGNAL( in_DECOD_IN_NO_EXECUTE     ,_param->_nb_inst_decod);
    305317  DELETE1_SC_SIGNAL( in_DECOD_IN_IS_DELAY_SLOT  ,_param->_nb_inst_decod);
     318#ifdef DEBUG
     319  DELETE1_SC_SIGNAL( in_DECOD_IN_ADDRESS        ,_param->_nb_inst_decod);
     320#endif
    306321  DELETE1_SC_SIGNAL( in_DECOD_IN_ADDRESS_NEXT   ,_param->_nb_inst_decod);
    307322  DELETE1_SC_SIGNAL( in_DECOD_IN_HAS_IMMEDIAT   ,_param->_nb_inst_decod);
     
    328343  DELETE1_SC_SIGNAL(out_DECOD_OUT_NO_EXECUTE    ,_param->_nb_inst_decod);
    329344  DELETE1_SC_SIGNAL(out_DECOD_OUT_IS_DELAY_SLOT ,_param->_nb_inst_decod);
     345#ifdef DEBUG
     346  DELETE1_SC_SIGNAL(out_DECOD_OUT_ADDRESS       ,_param->_nb_inst_decod);
     347#endif
    330348  DELETE1_SC_SIGNAL(out_DECOD_OUT_ADDRESS_NEXT  ,_param->_nb_inst_decod);
    331349  DELETE1_SC_SIGNAL(out_DECOD_OUT_HAS_IMMEDIAT  ,_param->_nb_inst_decod);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h

    r105 r108  
    7575  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_IN_NO_EXECUTE     ;//[nb_inst_decod]
    7676  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_IN_IS_DELAY_SLOT  ;//[nb_inst_decod]
     77#ifdef DEBUG
     78  public    : SC_IN (Tgeneral_data_t    )  **  in_DECOD_IN_ADDRESS        ;//[nb_inst_decod]
     79#endif
    7780  public    : SC_IN (Tgeneral_data_t    )  **  in_DECOD_IN_ADDRESS_NEXT   ;//[nb_inst_decod]
    7881  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_IN_HAS_IMMEDIAT   ;//[nb_inst_decod]
     
    100103  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_OUT_NO_EXECUTE    ;//[nb_inst_decod]
    101104  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_OUT_IS_DELAY_SLOT ;//[nb_inst_decod]
     105#ifdef DEBUG
     106  public    : SC_OUT(Tgeneral_data_t    )  ** out_DECOD_OUT_ADDRESS       ;//[nb_inst_decod]
     107#endif
    102108  public    : SC_OUT(Tgeneral_data_t    )  ** out_DECOD_OUT_ADDRESS_NEXT  ;//[nb_inst_decod]
    103109  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_OUT_HAS_IMMEDIAT  ;//[nb_inst_decod]
     
    129135  private   : std::list<decod_queue_entry_t*>* reg_QUEUE                  ;
    130136  private   : uint32_t                       * reg_NB_INST                ;//[nb_context]
    131    
     137  private   : uint32_t                         reg_LAST_SLOT              ;
     138
    132139    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    133140  private   : Tcontrol_t                     * internal_DECOD_IN_ACK      ;//[nb_inst_decod]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Types.h

    r105 r108  
    3030  public : Tcontrol_t         * _no_execute     ;
    3131  public : Tcontrol_t         * _is_delay_slot  ;
     32#ifdef DEBUG
     33  public : Tgeneral_data_t    * _address        ;
     34#endif
    3235  public : Tgeneral_data_t    * _address_next   ;
    3336  public : Tcontrol_t         * _has_immediat   ;
     
    5659      _no_execute     = new Tcontrol_t         [_nb_inst];
    5760      _is_delay_slot  = new Tcontrol_t         [_nb_inst];
     61#ifdef DEBUG
     62      _address        = new Tgeneral_data_t    [_nb_inst];
     63#endif
    5864      _address_next   = new Tgeneral_data_t    [_nb_inst];
    5965      _has_immediat   = new Tcontrol_t         [_nb_inst];
     
    8591      delete [] _no_execute     ;
    8692      delete [] _is_delay_slot  ;
     93#ifdef DEBUG
     94      delete [] _address        ;
     95#endif
    8796      delete [] _address_next   ;
    8897      delete [] _has_immediat   ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_allocation.cpp

    r105 r108  
    6767      ALLOC1_SIGNAL_IN ( in_DECOD_IN_NO_EXECUTE     ,"no_execute"   ,Tcontrol_t         ,1                                   );
    6868      ALLOC1_SIGNAL_IN ( in_DECOD_IN_IS_DELAY_SLOT  ,"is_delay_slot",Tcontrol_t         ,1                                   );
     69#ifdef DEBUG
     70      ALLOC1_SIGNAL_IN ( in_DECOD_IN_ADDRESS        ,"address"      ,Tgeneral_data_t    ,_param->_size_instruction_address   );
     71#endif
    6972      ALLOC1_SIGNAL_IN ( in_DECOD_IN_ADDRESS_NEXT   ,"address_next" ,Tgeneral_data_t    ,_param->_size_instruction_address   );
    7073      ALLOC1_SIGNAL_IN ( in_DECOD_IN_HAS_IMMEDIAT   ,"has_immediat" ,Tcontrol_t         ,1                                   );
     
    9699      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NO_EXECUTE     ,"no_execute"   ,Tcontrol_t         ,1                                   );
    97100      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_IS_DELAY_SLOT  ,"is_delay_slot",Tcontrol_t         ,1                                   );
     101#ifdef DEBUG
     102      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_ADDRESS        ,"address"      ,Tgeneral_data_t    ,_param->_size_instruction_address   );
     103#endif
    98104      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_ADDRESS_NEXT   ,"address_next" ,Tgeneral_data_t    ,_param->_size_instruction_address   );
    99105      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_HAS_IMMEDIAT   ,"has_immediat" ,Tcontrol_t         ,1                                   );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_deallocation.cpp

    r105 r108  
    3737        DELETE1_SIGNAL( in_DECOD_IN_NO_EXECUTE     ,_param->_nb_inst_decod,1                                   );
    3838        DELETE1_SIGNAL( in_DECOD_IN_IS_DELAY_SLOT  ,_param->_nb_inst_decod,1                                   );
     39#ifdef DEBUG
     40        DELETE1_SIGNAL( in_DECOD_IN_ADDRESS        ,_param->_nb_inst_decod,_param->_size_instruction_address   );
     41#endif
    3942        DELETE1_SIGNAL( in_DECOD_IN_ADDRESS_NEXT   ,_param->_nb_inst_decod,_param->_size_instruction_address   );
    4043        DELETE1_SIGNAL( in_DECOD_IN_HAS_IMMEDIAT   ,_param->_nb_inst_decod,1                                   );
     
    6164        DELETE1_SIGNAL(out_DECOD_OUT_NO_EXECUTE    ,_param->_nb_inst_decod,1                                   );
    6265        DELETE1_SIGNAL(out_DECOD_OUT_IS_DELAY_SLOT ,_param->_nb_inst_decod,1                                   );
     66#ifdef DEBUG
     67        DELETE1_SIGNAL(out_DECOD_OUT_ADDRESS       ,_param->_nb_inst_decod,_param->_size_instruction_address   );
     68#endif
    6369        DELETE1_SIGNAL(out_DECOD_OUT_ADDRESS_NEXT  ,_param->_nb_inst_decod,_param->_size_instruction_address   );
    6470        DELETE1_SIGNAL(out_DECOD_OUT_HAS_IMMEDIAT  ,_param->_nb_inst_decod,1                                   );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMealy_decod_out.cpp

    r106 r108  
    3535    if (not reg_QUEUE->empty())
    3636      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    37         if (reg_QUEUE->front()->_val [i])
    38           {
    39             log_printf(TRACE,Decod_queue,FUNCTION,_("  * Queue is not empty, slot [%d] is valid."),i);
     37        {
     38          uint32_t index = reg_LAST_SLOT + i;
    4039
    41             Tcontext_t context         = reg_QUEUE->front()->_context_id    [i];
    42             Tdepth_t   depth           = reg_QUEUE->front()->_depth         [i];
    43             Tdepth_t   depth_min       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [context]):0;
    44             Tdepth_t   depth_max       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX [context]):0;
    45             Tcontrol_t depth_full      = PORT_READ(in_DEPTH_FULL[context]);
     40          // Stop
     41          if (index >= _param->_nb_inst_decod)
     42            break;
    4643
    47             // is a valid instruction ?
    48             // If DEPTH_CURRENT :
    49             // equal at     DEPTH_MIN            -> not speculative
    50             // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
    51             //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
     44          if (reg_QUEUE->front()->_val [index])
     45            {
     46              log_printf(TRACE,Decod_queue,FUNCTION,_("  * Queue is not empty, slot [%d] is valid."),i);
     47             
     48              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]);
    5253
    53             // All case
    54             // ....... min ...X... max ....... OK
    55             // ....... min ....... max ...X... KO
    56             // ...X... min ....... max ....... KO
    57             // ....... max ....... min ...X... OK
    58             // ...X... max ....... min ....... OK
    59             // ....... max ...X... min ....... KO
     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      = ((depth == depth_min) or
     69                                            depth_full or
     70                                            ((depth_min <= depth_max)?
     71                                             ((depth >= depth_min) and (depth <=depth_max)):
     72                                             ((depth >= depth_min) or  (depth <=depth_max))));
     73              //Tcontrol_t is_valid        = ((depth == depth_min) or
     74              //                              ((depth_min < depth_max)?
     75              //                               (depth<=depth_max):
     76              //                               ((depth > depth_min) or (depth <= depth_max))));
     77              //Tcontrol_t is_valid        = depth <= depth_max;
    6078
    61             Tcontrol_t   is_valid      = ((depth == depth_min) or
    62                                           depth_full or
    63                                           ((depth_min <= depth_max)?
    64                                            ((depth >= depth_min) and (depth <=depth_max)):
    65                                            ((depth >= depth_min) or  (depth <=depth_max))));
    66 //          Tcontrol_t is_valid        = ((depth == depth_min) or
    67 //                                           ((depth_min < depth_max)?
    68 //                                            (depth<=depth_max):
    69 //                                            ((depth > depth_min) or (depth <= depth_max))));
    70 //          Tcontrol_t is_valid        = depth <= depth_max;
    71 
    72             log_printf(TRACE,Decod_queue,FUNCTION,"    * is_valid : %d",is_valid);
    73             log_printf(TRACE,Decod_queue,FUNCTION,"      * context      : %d",context);
    74             log_printf(TRACE,Decod_queue,FUNCTION,"      * depth        : %d",depth);
    75             log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_min    : %d",depth_min);
    76             log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_max    : %d",depth_max);
    77             log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_full   : %d",depth_full);
    78             log_printf(TRACE,Decod_queue,FUNCTION,"      * address_next : 0x%x (0x%x)",reg_QUEUE->front()->_address_next[i],reg_QUEUE->front()->_address_next[i]<<2);
    79             internal_DECOD_OUT_VAL [i] = 1; // in all case, val is set (entry is not empty, and instruction is valid)
    80             if (is_valid)
    81               {
    82                 val                    [i] = 1;
    83                 internal_DECOD_OUT_ACK [i] = PORT_READ(in_DECOD_OUT_ACK [i]);
    84               }
    85             else
    86               {
    87                 // Consume the instruction (to erase)
    88                 internal_DECOD_OUT_ACK [i] = 1;
    89               }
    90           }
     79              log_printf(TRACE,Decod_queue,FUNCTION,"    * is_valid : %d",is_valid);
     80              log_printf(TRACE,Decod_queue,FUNCTION,"      * context      : %d",context);
     81              log_printf(TRACE,Decod_queue,FUNCTION,"      * depth        : %d",depth);
     82              log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_min    : %d",depth_min);
     83              log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_max    : %d",depth_max);
     84              log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_full   : %d",depth_full);
     85#ifdef DEBUG
     86              log_printf(TRACE,Decod_queue,FUNCTION,"      * address      : 0x%x (0x%x)",reg_QUEUE->front()->_address     [index],reg_QUEUE->front()->_address     [index]<<2);
     87#endif
     88              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);
     89              internal_DECOD_OUT_VAL [index] = 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 [index] = PORT_READ(in_DECOD_OUT_ACK [i]);
     94                }
     95              else
     96                {
     97                  // Consume the instruction (to erase)
     98                  internal_DECOD_OUT_ACK [index] = 1;
     99                }
     100            }
     101      }
    91102
    92103    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    93104      {
    94105        log_printf(TRACE,Decod_queue,FUNCTION,"  * DECOD_OUT_VAL : %d",val [i]);
    95 
    96         PORT_WRITE(out_DECOD_OUT_VAL [i],val [i]);
     106       
     107        PORT_WRITE(out_DECOD_OUT_VAL [i],val [i]);
    97108      }
    98109
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMoore.cpp

    r105 r108  
    4444      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    4545        {
     46          uint32_t index = reg_LAST_SLOT + i;
     47
     48          // Stop
     49          if (index >= _param->_nb_inst_decod)
     50            break;
     51
    4652          if (_param->_have_port_context_id)
    47           PORT_WRITE(out_DECOD_OUT_CONTEXT_ID    [i],reg_QUEUE->front()->_context_id    [i]);
     53          PORT_WRITE(out_DECOD_OUT_CONTEXT_ID    [i],reg_QUEUE->front()->_context_id    [index]);
    4854          if (_param->_have_port_depth)
    49           PORT_WRITE(out_DECOD_OUT_DEPTH         [i],reg_QUEUE->front()->_depth         [i]);
    50           PORT_WRITE(out_DECOD_OUT_TYPE          [i],reg_QUEUE->front()->_type          [i]);
    51           PORT_WRITE(out_DECOD_OUT_OPERATION     [i],reg_QUEUE->front()->_operation     [i]);
    52           PORT_WRITE(out_DECOD_OUT_NO_EXECUTE    [i],reg_QUEUE->front()->_no_execute    [i]);
    53           PORT_WRITE(out_DECOD_OUT_IS_DELAY_SLOT [i],reg_QUEUE->front()->_is_delay_slot [i]);
    54           PORT_WRITE(out_DECOD_OUT_ADDRESS_NEXT  [i],reg_QUEUE->front()->_address_next  [i]);
    55           PORT_WRITE(out_DECOD_OUT_HAS_IMMEDIAT  [i],reg_QUEUE->front()->_has_immediat  [i]);
    56           PORT_WRITE(out_DECOD_OUT_IMMEDIAT      [i],reg_QUEUE->front()->_immediat      [i]);
    57           PORT_WRITE(out_DECOD_OUT_READ_RA       [i],reg_QUEUE->front()->_read_ra       [i]);
    58           PORT_WRITE(out_DECOD_OUT_NUM_REG_RA    [i],reg_QUEUE->front()->_num_reg_ra    [i]);
    59           PORT_WRITE(out_DECOD_OUT_READ_RB       [i],reg_QUEUE->front()->_read_rb       [i]);
    60           PORT_WRITE(out_DECOD_OUT_NUM_REG_RB    [i],reg_QUEUE->front()->_num_reg_rb    [i]);
    61           PORT_WRITE(out_DECOD_OUT_READ_RC       [i],reg_QUEUE->front()->_read_rc       [i]);
    62           PORT_WRITE(out_DECOD_OUT_NUM_REG_RC    [i],reg_QUEUE->front()->_num_reg_rc    [i]);
    63           PORT_WRITE(out_DECOD_OUT_WRITE_RD      [i],reg_QUEUE->front()->_write_rd      [i]);
    64           PORT_WRITE(out_DECOD_OUT_NUM_REG_RD    [i],reg_QUEUE->front()->_num_reg_rd    [i]);
    65           PORT_WRITE(out_DECOD_OUT_WRITE_RE      [i],reg_QUEUE->front()->_write_re      [i]);
    66           PORT_WRITE(out_DECOD_OUT_NUM_REG_RE    [i],reg_QUEUE->front()->_num_reg_re    [i]);
    67           PORT_WRITE(out_DECOD_OUT_EXCEPTION_USE [i],reg_QUEUE->front()->_exception_use [i]);
    68           PORT_WRITE(out_DECOD_OUT_EXCEPTION     [i],reg_QUEUE->front()->_exception     [i]);
     55          PORT_WRITE(out_DECOD_OUT_DEPTH         [i],reg_QUEUE->front()->_depth         [index]);
     56          PORT_WRITE(out_DECOD_OUT_TYPE          [i],reg_QUEUE->front()->_type          [index]);
     57          PORT_WRITE(out_DECOD_OUT_OPERATION     [i],reg_QUEUE->front()->_operation     [index]);
     58          PORT_WRITE(out_DECOD_OUT_NO_EXECUTE    [i],reg_QUEUE->front()->_no_execute    [index]);
     59          PORT_WRITE(out_DECOD_OUT_IS_DELAY_SLOT [i],reg_QUEUE->front()->_is_delay_slot [index]);
     60#ifdef DEBUG
     61          PORT_WRITE(out_DECOD_OUT_ADDRESS       [i],reg_QUEUE->front()->_address       [index]);
     62#endif
     63          PORT_WRITE(out_DECOD_OUT_ADDRESS_NEXT  [i],reg_QUEUE->front()->_address_next  [index]);
     64          PORT_WRITE(out_DECOD_OUT_HAS_IMMEDIAT  [i],reg_QUEUE->front()->_has_immediat  [index]);
     65          PORT_WRITE(out_DECOD_OUT_IMMEDIAT      [i],reg_QUEUE->front()->_immediat      [index]);
     66          PORT_WRITE(out_DECOD_OUT_READ_RA       [i],reg_QUEUE->front()->_read_ra       [index]);
     67          PORT_WRITE(out_DECOD_OUT_NUM_REG_RA    [i],reg_QUEUE->front()->_num_reg_ra    [index]);
     68          PORT_WRITE(out_DECOD_OUT_READ_RB       [i],reg_QUEUE->front()->_read_rb       [index]);
     69          PORT_WRITE(out_DECOD_OUT_NUM_REG_RB    [i],reg_QUEUE->front()->_num_reg_rb    [index]);
     70          PORT_WRITE(out_DECOD_OUT_READ_RC       [i],reg_QUEUE->front()->_read_rc       [index]);
     71          PORT_WRITE(out_DECOD_OUT_NUM_REG_RC    [i],reg_QUEUE->front()->_num_reg_rc    [index]);
     72          PORT_WRITE(out_DECOD_OUT_WRITE_RD      [i],reg_QUEUE->front()->_write_rd      [index]);
     73          PORT_WRITE(out_DECOD_OUT_NUM_REG_RD    [i],reg_QUEUE->front()->_num_reg_rd    [index]);
     74          PORT_WRITE(out_DECOD_OUT_WRITE_RE      [i],reg_QUEUE->front()->_write_re      [index]);
     75          PORT_WRITE(out_DECOD_OUT_NUM_REG_RE    [i],reg_QUEUE->front()->_num_reg_re    [index]);
     76          PORT_WRITE(out_DECOD_OUT_EXCEPTION_USE [i],reg_QUEUE->front()->_exception_use [index]);
     77          PORT_WRITE(out_DECOD_OUT_EXCEPTION     [i],reg_QUEUE->front()->_exception     [index]);
    6978        }
    7079
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_transition.cpp

    r105 r108  
    3131        for (uint32_t i=0; i<_param->_nb_context; i++)
    3232          reg_NB_INST [i]=0;
     33
     34        reg_LAST_SLOT = 0;
    3335      }
    3436    else
     
    6264                entry->_no_execute    [i] = PORT_READ(in_DECOD_IN_NO_EXECUTE    [i]);
    6365                entry->_is_delay_slot [i] = PORT_READ(in_DECOD_IN_IS_DELAY_SLOT [i]);
     66#ifdef DEBUG
     67                entry->_address       [i] = PORT_READ(in_DECOD_IN_ADDRESS       [i]);
     68#endif
    6469                entry->_address_next  [i] = PORT_READ(in_DECOD_IN_ADDRESS_NEXT  [i]);
    6570                entry->_has_immediat  [i] = PORT_READ(in_DECOD_IN_HAS_IMMEDIAT  [i]);
     
    9095        if (not reg_QUEUE->empty())
    9196          {
    92             bool find = false;
     97            bool find = false;
    9398           
    9499            for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    95100              {
    96101                // Test transaction : if ok then invalid slot
     102                // In order by rename logic
    97103                if (internal_DECOD_OUT_VAL [i] and internal_DECOD_OUT_ACK[i])
    98104                  {
    99105                    log_printf(TRACE,Decod_queue,FUNCTION,_("  * DECOD_OUT [%d]"),i);
    100106               
     107#ifdef DEBUG_TEST
     108                    if (reg_LAST_SLOT != i)
     109                      throw ERRORMORPHEO(FUNCTION,toString(_("reg_LAST_SLOT (%d) is different at decod_out port (%d)."),reg_LAST_SLOT,i));
     110#endif
     111                    reg_LAST_SLOT ++;
     112
    101113                    reg_QUEUE->front()->_val [i] = 0;
    102114
     
    108120                  }
    109121                // Test if slot is (again) valid, if yes, then have less one instruction in the entry
    110                 find |= reg_QUEUE->front()->_val [i];
     122                find |= reg_QUEUE->front()->_val [i];
    111123              }
    112124           
    113             // test if can free the entry
    114             if (not find) // no valid instruction in current slot
     125            // test if can free the entry : test if have consume all entry
     126            if (not find) // no valid instruction in current slot
    115127              {
    116128                log_printf(TRACE,Decod_queue,FUNCTION,_("    * POP  queue"));
     
    119131                delete reg_QUEUE->front();
    120132                reg_QUEUE->pop_front();
     133
     134                reg_LAST_SLOT = 0;
    121135              }
    122136          }
     
    125139#if defined(DEBUG) and defined(DEBUG_Decod_queue) and (DEBUG >= DEBUG_TRACE)
    126140    log_printf(TRACE,Decod_queue,FUNCTION,"  * Dump decod_queue");
     141    log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_LAST_SLOT : %d",reg_LAST_SLOT);
    127142    uint32_t x=0;
    128143    for (std::list<decod_queue_entry_t*>::iterator it=reg_QUEUE->begin();
     
    144159                         ,(*it)->_no_execute    [i]
    145160                         ,(*it)->_is_delay_slot [i]
    146                          ,(*it)->_address_next  [i]
    147                          ,(*it)->_address_next  [i]<<2
     161                         ,(*it)->_address       [i]
     162                         ,(*it)->_address       [i]<<2
    148163                         ,(*it)->_has_immediat  [i]
    149164                         ,(*it)->_immediat      [i]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/src/test.cpp

    r105 r108  
    7373  ALLOC1_SC_SIGNAL(out_DECOD_NO_EXECUTE                   ,"out_DECOD_NO_EXECUTE                   ",Tcontrol_t         ,_param->_nb_inst_decod);
    7474  ALLOC1_SC_SIGNAL(out_DECOD_IS_DELAY_SLOT                ,"out_DECOD_IS_DELAY_SLOT                ",Tcontrol_t         ,_param->_nb_inst_decod);
     75#ifdef DEBUG
     76  ALLOC1_SC_SIGNAL(out_DECOD_ADDRESS                      ,"out_DECOD_ADDRESS                      ",Tgeneral_data_t    ,_param->_nb_inst_decod);
     77#endif
    7578  ALLOC1_SC_SIGNAL(out_DECOD_ADDRESS_NEXT                 ,"out_DECOD_ADDRESS_NEXT                 ",Tgeneral_data_t    ,_param->_nb_inst_decod);
    7679  ALLOC1_SC_SIGNAL(out_DECOD_HAS_IMMEDIAT                 ,"out_DECOD_HAS_IMMEDIAT                 ",Tcontrol_t         ,_param->_nb_inst_decod);
     
    159162  INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_NO_EXECUTE                   ,_param->_nb_inst_decod);
    160163  INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_IS_DELAY_SLOT                ,_param->_nb_inst_decod);
     164#ifdef DEBUG
     165  INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_ADDRESS                      ,_param->_nb_inst_decod);
     166#endif
    161167  INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_ADDRESS_NEXT                 ,_param->_nb_inst_decod);
    162168  INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_HAS_IMMEDIAT                 ,_param->_nb_inst_decod);
     
    490496  DELETE1_SC_SIGNAL(out_DECOD_NO_EXECUTE                   ,_param->_nb_inst_decod);
    491497  DELETE1_SC_SIGNAL(out_DECOD_IS_DELAY_SLOT                ,_param->_nb_inst_decod);
     498#ifdef DEBUG
     499  DELETE1_SC_SIGNAL(out_DECOD_ADDRESS                      ,_param->_nb_inst_decod);
     500#endif
    492501  DELETE1_SC_SIGNAL(out_DECOD_ADDRESS_NEXT                 ,_param->_nb_inst_decod);
    493502  DELETE1_SC_SIGNAL(out_DECOD_HAS_IMMEDIAT                 ,_param->_nb_inst_decod);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/include/Decod_unit.h

    r105 r108  
    8787  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_NO_EXECUTE                   ;//[nb_inst_decod]
    8888  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_IS_DELAY_SLOT                ;//[nb_inst_decod]
     89#ifdef DEBUG
     90  public    : SC_OUT(Tgeneral_data_t    )  ** out_DECOD_ADDRESS                      ;//[nb_inst_decod]
     91#endif
    8992  public    : SC_OUT(Tgeneral_data_t    )  ** out_DECOD_ADDRESS_NEXT                 ;//[nb_inst_decod]
    9093  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_HAS_IMMEDIAT                 ;//[nb_inst_decod]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit_allocation.cpp

    r105 r108  
    8989      ALLOC1_SIGNAL_OUT(out_DECOD_NO_EXECUTE   ,"no_execute"   ,Tcontrol_t        ,1                                   );
    9090      ALLOC1_SIGNAL_OUT(out_DECOD_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t        ,1                                   );
     91#ifdef DEBUG
     92      ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS      ,"address"      ,Tgeneral_data_t   ,_param->_size_instruction_address   );
     93#endif
    9194      ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS_NEXT ,"address_next" ,Tgeneral_data_t   ,_param->_size_instruction_address   );
    9295      ALLOC1_SIGNAL_OUT(out_DECOD_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t        ,1                                   );
     
    293296          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_IS_DELAY_SLOT",
    294297                                   dest, "in_DECOD_IN_"+toString(i)+"_IS_DELAY_SLOT");
     298#ifdef DEBUG
     299          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_ADDRESS"      ,
     300                                   dest, "in_DECOD_IN_"+toString(i)+"_ADDRESS"      );
     301#endif
    295302          COMPONENT_MAP(_component,src ,"out_DECOD_"   +toString(i)+"_ADDRESS_NEXT" ,
    296303                                   dest, "in_DECOD_IN_"+toString(i)+"_ADDRESS_NEXT" );
     
    435442      // in_DECOD_IN_NO_EXECUTE     - component decod
    436443      // in_DECOD_IN_IS_DELAY_SLOT  - component decod
     444      // in_DECOD_IN_ADDRESS        - component decod
    437445      // in_DECOD_IN_ADDRESS_NEXT   - component decod
    438446      // in_DECOD_IN_HAS_IMMEDIAT   - component decod
     
    478486          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_IS_DELAY_SLOT",
    479487                              dest,"out_DECOD_"    +toString(i)+"_IS_DELAY_SLOT");
     488#ifdef DEBUG
     489          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_ADDRESS"      ,
     490                              dest,"out_DECOD_"    +toString(i)+"_ADDRESS"      );
     491#endif
    480492          PORT_MAP(_component,src ,"out_DECOD_OUT_"+toString(i)+"_ADDRESS_NEXT" ,
    481493                              dest,"out_DECOD_"    +toString(i)+"_ADDRESS_NEXT" );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit_deallocation.cpp

    r105 r108  
    4848        DELETE1_SIGNAL(out_DECOD_NO_EXECUTE                   ,_param->_nb_inst_decod,1                                   );
    4949        DELETE1_SIGNAL(out_DECOD_IS_DELAY_SLOT                ,_param->_nb_inst_decod,1                                   );
     50#ifdef DEBUG
     51        DELETE1_SIGNAL(out_DECOD_ADDRESS                      ,_param->_nb_inst_decod,_param->_size_instruction_address   );
     52#endif
    5053        DELETE1_SIGNAL(out_DECOD_ADDRESS_NEXT                 ,_param->_nb_inst_decod,_param->_size_instruction_address   );
    5154        DELETE1_SIGNAL(out_DECOD_HAS_IMMEDIAT                 ,_param->_nb_inst_decod,1                                   );
Note: See TracChangeset for help on using the changeset viewer.