Ignore:
Timestamp:
Feb 27, 2009, 7:37:40 PM (15 years ago)
Author:
rosiere
Message:

1) Decod_queue : multi implementation (one_fifo, multi_fifo)
2) Issue_queue : multi implementation (in_order, out_of_order)
3) Direction : Add Meta predictor
4) Context_State : re add Branch_complete, More priority to Load miss (is not speculative)
5) Return_Address_Stack : update reg_PREDICT pointer on decod miss prediction
6) UPT : Fix bug in multi event
7) Prediction_glue : in read_stack case, insert in UPT pc_next
8) Rename select : when rob have an event (need flush), read_r{a,b,c} and write_r{d,e} is set at 0

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

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/config_min.cfg

    r82 r111  
    331       1       *4      # nb_inst_decod   
    441       1       *4      # size_queue       
     50       1       +1      # queue_scheme
    5632      32      +1      # size_general_data
    671       1       +1      # nb_branch_speculated [0] [nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/config_mono_context.cfg

    r87 r111  
    331       8       *2      # nb_inst_decod   
    448       16      *2      # size_queue       
     50       1       +1      # queue_scheme
    5632      32      +1      # size_general_data
    671       2       +1      # nb_branch_speculated [0] [nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/config_multi_context.cfg

    r82 r111  
    334       4       *4      # nb_inst_decod   
    4416      16      *4      # size_queue       
     50       1       +1      # queue_scheme
    5632      32      +1      # size_general_data
    672       2       +1      # nb_branch_speculated [0] [nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/src/main.cpp

    r88 r111  
    88#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/include/test.h"
    99
    10 #define NB_PARAMS 4
     10#define NB_PARAMS 5
    1111
    1212void usage (int argc, char * argv[])
     
    1414  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
    1515  err (_("list_params is :\n"));
    16   err (_(" * nb_context                        (uint32_t)\n"));
    17   err (_(" * nb_inst_decod                     (uint32_t)\n"));
    18   err (_(" * size_queue                        (uint32_t)\n"));
    19   err (_(" * size_general_data                 (uint32_t)\n"));
    20   err (_(" * nb_branch_speculated [nb_context] (uint32_t)\n"));
     16  err (_(" * nb_context                        (uint32_t             )\n"));
     17  err (_(" * nb_inst_decod                     (uint32_t             )\n"));
     18  err (_(" * size_queue                        (uint32_t             )\n"));
     19  err (_(" * queue_scheme                      (Tdecod_queue_scheme_t)\n"));
     20  err (_(" * size_general_data                 (uint32_t             )\n"));
     21  err (_(" * nb_branch_speculated [nb_context] (uint32_t             )\n"));
    2122
    2223  exit (1);
     
    3839  uint32_t _nb_inst_decod     = fromString<uint32_t>(argv[x++]);
    3940  uint32_t _size_queue        = fromString<uint32_t>(argv[x++]);
     41  Tdecod_queue_scheme_t _queue_scheme = fromString<Tdecod_queue_scheme_t>(argv[x++]);
    4042  uint32_t _size_general_data = fromString<uint32_t>(argv[x++]);
    4143
     
    5456         _nb_inst_decod    ,
    5557         _size_queue       ,
     58         _queue_scheme     ,
    5659         _size_general_data,
    5760         _nb_branch_speculated,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/src/test.cpp

    r108 r111  
    77 */
    88
    9 #define NB_ITERATION  128
     9#define NB_ITERATION  512
    1010#define CYCLE_MAX     (128*NB_ITERATION)
    1111
     
    2020
    2121#ifdef STATISTICS
    22   morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50);
     22  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX);
    2323#endif
    2424
     
    234234          address_tmp [i] = address_src [i];
    235235
    236         uint32_t x = rand()%_param->_nb_inst_decod;
     236        uint32_t x = rand()%_param->_nb_inst_decod;
     237       
    237238        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    238239          {
     
    242243            in_DECOD_IN_CONTEXT_ID   [i]->write(context);
    243244            in_DECOD_IN_DEPTH        [i]->write(depth [context]);
     245#ifdef DEBUG
     246            in_DECOD_IN_ADDRESS      [i]->write(address_tmp [context]);
     247#endif
    244248            in_DECOD_IN_ADDRESS_NEXT [i]->write(address_tmp [context]);
    245249
     
    250254      {
    251255        uint32_t x = rand()%_param->_nb_inst_decod;
     256       
    252257        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    253258          {
     
    270275              nb_inst      [context] ++;
    271276              address_src  [context] ++;
     277
     278              LABEL("  * nb_inst  : %d",nb_inst [context]);
    272279            }
    273280        }
     
    284291              TEST(Tdepth_t  ,out_DECOD_OUT_DEPTH        [i]->read(),depth        [context]);
    285292              TEST(Taddress_t,out_DECOD_OUT_ADDRESS_NEXT [i]->read(),address_dest [context]);
    286              
     293#ifdef DEBUG
     294              TEST(Taddress_t,out_DECOD_OUT_ADDRESS      [i]->read(),address_dest [context]);
     295#endif       
    287296              nb_inst      [context] --;
    288297              address_dest [context] ++;
     298
     299              LABEL("  * nb_inst  : %d",nb_inst [context]);
    289300            }
    290301        }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h

    r110 r111  
    136136    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    137137
    138     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    139   private   : std::list<decod_queue_entry_t*>* reg_QUEUE                  ;
    140   private   : uint32_t                       * reg_NB_INST                ;//[nb_context]
    141   private   : uint32_t                         reg_LAST_SLOT              ;
     138    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     139
     140    // implementation : common
     141  private   : std::list<decod_queue_entry_t*> * reg_QUEUE                  ;
     142  private   : uint32_t                        * reg_NB_INST                ;//[nb_context]
     143    // implementation : one_fifo only
     144  private   : uint32_t                          reg_LAST_SLOT              ;
     145    // implementation : multi_fifo only
     146  private   : uint32_t                          reg_NUM_BANK_HEAD          ;
     147  private   : uint32_t                          reg_NUM_BANK_TAIL          ;
    142148
    143149    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     150    // implementation : common
    144151  private   : Tcontrol_t                     * internal_DECOD_IN_ACK      ;//[nb_inst_decod]
    145152  private   : Tcontrol_t                     * internal_DECOD_OUT_VAL     ;//[nb_inst_decod]
    146153  private   : Tcontrol_t                     * internal_DECOD_OUT_ACK     ;//[nb_inst_decod]
     154    // implementation : one_fifo only
     155    // implementation : multi_fifo only
     156
     157    // function pointer
     158  public    : void (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::*function_transition        ) (void);
     159  public    : void (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::*function_genMoore          ) (void);
     160  public    : void (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::*function_genMealy_decod_out) (void);
    147161#endif
    148162
     
    177191                                               
    178192#ifdef SYSTEMC                                 
    179   public  : void        transition                (void);
    180   public  : void        genMoore                  (void);
    181   public  : void        genMealy_decod_out        (void);
     193  public  : void        transition                             (void);
     194  public  : void        genMoore                               (void);
     195  public  : void        genMealy_decod_out                     (void);
     196
     197  public  : void        function_one_fifo_transition           (void);
     198  public  : void        function_one_fifo_genMoore             (void);
     199  public  : void        function_one_fifo_genMealy_decod_out   (void);
     200
     201  public  : void        function_multi_fifo_transition         (void);
     202  public  : void        function_multi_fifo_genMoore           (void);
     203  public  : void        function_multi_fifo_genMealy_decod_out (void);
    182204#endif                                         
    183205
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Parameters.h

    r109 r111  
    1111#include "Common/include/Debug.h"
    1212#include "Behavioural/include/Parameters.h"
     13#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Types.h"
    1314
    1415namespace morpheo {
     
    2425  {
    2526    //-----[ fields ]------------------------------------------------------------
    26   public : uint32_t            _nb_context             ;
    27   public : uint32_t            _nb_inst_decod          ;
    28   public : uint32_t            _size_queue             ;
    29 //public : uint32_t            _size_general_data      ;
    30   public : uint32_t          * _nb_branch_speculated   ; //[nb_context]
    31   public : uint32_t            _nb_instruction_in_queue;
     27  public : uint32_t              _nb_context             ;
     28  public : uint32_t              _nb_inst_decod          ;
     29  public : uint32_t              _size_queue             ;
     30  public : Tdecod_queue_scheme_t _queue_scheme           ;
     31//public : uint32_t              _size_general_data      ;
     32  public : uint32_t            * _nb_branch_speculated   ; //[nb_context]
     33  public : uint32_t              _nb_instruction_in_queue;
     34   
     35  public : uint32_t              _nb_bank;
    3236
    3337    //-----[ methods ]-----------------------------------------------------------
    34   public : Parameters  (uint32_t   nb_context          ,
    35                         uint32_t   nb_inst_decod       ,
    36                         uint32_t   size_queue          ,
    37                         uint32_t   size_general_data   ,
    38                         uint32_t * nb_branch_speculated,
    39                         bool       is_toplevel=false   );
     38  public : Parameters  (uint32_t              nb_context          ,
     39                        uint32_t              nb_inst_decod       ,
     40                        uint32_t              size_queue          ,
     41                        Tdecod_queue_scheme_t queue_scheme        ,
     42                        uint32_t              size_general_data   ,
     43                        uint32_t            * nb_branch_speculated,
     44                        bool                  is_toplevel=false   );
    4045//   public : Parameters  (Parameters & param) ;
    4146  public : ~Parameters () ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Types.h

    r108 r111  
    1818namespace decod_unit {
    1919namespace decod_queue {
     20
     21  typedef enum
     22    {
     23       DECOD_QUEUE_SCHEME_ONE_FIFO   // One fifo with a instruction bundle per slot (   internal fragmentation)
     24      ,DECOD_QUEUE_SCHEME_MULTI_FIFO // One fifo per instruction. Rename in order   (no internal fragmentation)
     25    } Tdecod_queue_scheme_t;
    2026
    2127  class decod_queue_entry_t
     
    117123}; // end namespace multi_front_end
    118124}; // end namespace core
     125}; // end namespace behavioural
    119126
    120 }; // end namespace behavioural
     127  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t>(const morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t& x)
     128  {
     129    switch (x)
     130      {
     131      case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO   : return "one_fifo"  ; break;
     132      case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO : return "multi_fifo"; break;
     133      default : return ""; break;
     134      }
     135  };
     136
     137  template<> inline morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t fromString<morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t>(const std::string& x)
     138  {
     139    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO  ))) == 0) or
     140         (x.compare("one_fifo")   == 0))
     141      return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO;
     142    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO))) == 0) or
     143         (x.compare("multi_fifo") == 0))
     144      return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO;
     145   
     146    throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));
     147  };
     148
     149
    121150}; // end namespace morpheo             
    122151
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue.cpp

    r101 r111  
    7676    if (usage_is_set(_usage,USE_SYSTEMC))
    7777      {
     78        // Function pointer
     79        switch (_param->_queue_scheme)
     80          {
     81          case DECOD_QUEUE_SCHEME_ONE_FIFO :
     82            {
     83              function_transition         = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_one_fifo_transition        ;
     84              function_genMoore           = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_one_fifo_genMoore          ;
     85              function_genMealy_decod_out = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_one_fifo_genMealy_decod_out;
     86             
     87              break;
     88            }
     89          case DECOD_QUEUE_SCHEME_MULTI_FIFO :
     90            {
     91              function_transition         = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_multi_fifo_transition        ;
     92              function_genMoore           = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_multi_fifo_genMoore          ;
     93              function_genMealy_decod_out = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_multi_fifo_genMealy_decod_out;
     94             
     95              break;
     96            }
     97          default :
     98            {
     99              break;
     100            }
     101          }
     102
    78103        log_printf(INFO,Decod_queue,FUNCTION,_("Method - transition"));
    79104
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_allocation.cpp

    r108 r111  
    138138      {
    139139    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    140     reg_QUEUE              = new std::list<decod_queue_entry_t*>;
     140    switch (_param->_queue_scheme)
     141      {
     142      case DECOD_QUEUE_SCHEME_ONE_FIFO   : reg_QUEUE = new std::list<decod_queue_entry_t*>; break;
     143      case DECOD_QUEUE_SCHEME_MULTI_FIFO : ALLOC1(reg_QUEUE,std::list<decod_queue_entry_t*>,_param->_nb_bank); break;
     144      }
    141145    reg_NB_INST            = new uint32_t   [_param->_nb_context];
    142146
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_deallocation.cpp

    r108 r111  
    9090
    9191        // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    92         delete    reg_QUEUE;
     92        switch (_param->_queue_scheme)
     93          {
     94          case DECOD_QUEUE_SCHEME_ONE_FIFO   : delete reg_QUEUE; break;
     95          case DECOD_QUEUE_SCHEME_MULTI_FIFO : DELETE1(reg_QUEUE,_param->_nb_bank); break;
     96          }
    9397        delete [] reg_NB_INST;
    9498       
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMealy_decod_out.cpp

    r108 r111  
    2525    log_function(Decod_queue,FUNCTION,_name.c_str());
    2626
    27     Tcontrol_t val [_param->_nb_inst_decod];
    28     for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    29       {
    30         val                    [i] = 0;
    31         internal_DECOD_OUT_VAL [i] = 0;
    32         internal_DECOD_OUT_ACK [i] = 0;
    33       }
    34 
    35     if (not reg_QUEUE->empty())
    36       for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    37         {
    38           uint32_t index = reg_LAST_SLOT + i;
    39 
    40           // Stop
    41           if (index >= _param->_nb_inst_decod)
    42             break;
    43 
    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]);
    53 
    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;
    78 
    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       }
    102 
    103     for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    104       {
    105         log_printf(TRACE,Decod_queue,FUNCTION,"  * DECOD_OUT_VAL : %d",val [i]);
    106        
    107         PORT_WRITE(out_DECOD_OUT_VAL [i],val [i]);
    108       }
     27    (this->*function_genMealy_decod_out) ();
    10928
    11029    log_end(Decod_queue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMoore.cpp

    r109 r111  
    2525    log_function(Decod_queue,FUNCTION,_name.c_str());
    2626
    27     //--------------------------------------------------------------------
    28     //-----[ DECOD_IN ]---------------------------------------------------
    29     //--------------------------------------------------------------------
    30     {
    31       Tcontrol_t ack = reg_QUEUE->size() < _param->_size_queue;
    32 
    33       for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    34         {
    35           internal_DECOD_IN_ACK [i] = ack;
    36           PORT_WRITE(out_DECOD_IN_ACK [i],ack);
    37         }
    38     }
    39 
    40     //--------------------------------------------------------------------
    41     //-----[ DECOD_OUT ]--------------------------------------------------
    42     //--------------------------------------------------------------------
    43     if (not reg_QUEUE->empty())
    44       for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    45         {
    46           uint32_t index = reg_LAST_SLOT + i;
    47 
    48           // Stop
    49           if (index >= _param->_nb_inst_decod)
    50             break;
    51 
    52           if (_param->_have_port_context_id)
    53           PORT_WRITE(out_DECOD_OUT_CONTEXT_ID    [i],reg_QUEUE->front()->_context_id    [index]);
    54           if (_param->_have_port_depth)
    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]);
    78         }
    79 
    80     //--------------------------------------------------------------------
    81     //-----[ NB_INST ]----------------------------------------------------
    82     //--------------------------------------------------------------------
    83     for (uint32_t i=0; i<_param->_nb_context; i++)
    84       PORT_WRITE(out_NB_INST_ALL [i], reg_NB_INST [i]);
     27    (this->*function_genMoore) ();
    8528
    8629    log_end(Decod_queue,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_transition.cpp

    r110 r111  
    2525    log_function(Decod_queue,FUNCTION,_name.c_str());
    2626
    27     if (PORT_READ(in_NRESET) == 0)
    28       {
    29         reg_QUEUE->clear();
    30 
    31         for (uint32_t i=0; i<_param->_nb_context; i++)
    32           reg_NB_INST [i]=0;
    33 
    34         reg_LAST_SLOT = 0;
    35       }
    36     else
    37       {
    38         //--------------------------------------------------------------------
    39         //-----[ DECOD_IN ]---------------------------------------------------
    40         //-------------------------------------------------------------------- 
    41         decod_queue_entry_t * entry = NULL;
    42         for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    43           {
    44             if (PORT_READ(in_DECOD_IN_VAL [i]) and internal_DECOD_IN_ACK[i])
    45               {
    46                 log_printf(TRACE,Decod_queue,FUNCTION,_("  * DECOD_IN  [%d]"),i);
    47 
    48                 if (entry == NULL)
    49                  {
    50                    // Once creation and insert in queue
    51                    entry = new decod_queue_entry_t (_param->_nb_inst_decod);
    52                    reg_QUEUE->push_back(entry);
    53 
    54 #ifdef STATISTICS
    55                    if (usage_is_set(_usage,USE_STATISTICS))
    56                      (*_stat_sum_transaction_decod_in) ++;
    57 #endif
    58                  }
    59 
    60 #ifdef STATISTICS
    61                 if (usage_is_set(_usage,USE_STATISTICS))
    62                   (*_stat_sum_inst_enable) ++;
    63 #endif
    64 
    65                 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_IN_CONTEXT_ID [i]):0;
    66 
    67                 log_printf(TRACE,Decod_queue,FUNCTION,_("    * context : %d"),context);
    68 
    69                 entry->_val           [i] = 1;
    70                 entry->_context_id    [i] = context;
    71                 entry->_depth         [i] = (_param->_have_port_depth)?PORT_READ(in_DECOD_IN_DEPTH [i]):0;
    72                 entry->_type          [i] = PORT_READ(in_DECOD_IN_TYPE          [i]);
    73                 entry->_operation     [i] = PORT_READ(in_DECOD_IN_OPERATION     [i]);
    74                 entry->_no_execute    [i] = PORT_READ(in_DECOD_IN_NO_EXECUTE    [i]);
    75                 entry->_is_delay_slot [i] = PORT_READ(in_DECOD_IN_IS_DELAY_SLOT [i]);
    76 #ifdef DEBUG
    77                 entry->_address       [i] = PORT_READ(in_DECOD_IN_ADDRESS       [i]);
    78 #endif
    79                 entry->_address_next  [i] = PORT_READ(in_DECOD_IN_ADDRESS_NEXT  [i]);
    80                 entry->_has_immediat  [i] = PORT_READ(in_DECOD_IN_HAS_IMMEDIAT  [i]);
    81                 entry->_immediat      [i] = PORT_READ(in_DECOD_IN_IMMEDIAT      [i]);
    82                 entry->_read_ra       [i] = PORT_READ(in_DECOD_IN_READ_RA       [i]);
    83                 entry->_num_reg_ra    [i] = PORT_READ(in_DECOD_IN_NUM_REG_RA    [i]);
    84                 entry->_read_rb       [i] = PORT_READ(in_DECOD_IN_READ_RB       [i]);
    85                 entry->_num_reg_rb    [i] = PORT_READ(in_DECOD_IN_NUM_REG_RB    [i]);
    86                 entry->_read_rc       [i] = PORT_READ(in_DECOD_IN_READ_RC       [i]);
    87                 entry->_num_reg_rc    [i] = PORT_READ(in_DECOD_IN_NUM_REG_RC    [i]);
    88                 entry->_write_rd      [i] = PORT_READ(in_DECOD_IN_WRITE_RD      [i]);
    89                 entry->_num_reg_rd    [i] = PORT_READ(in_DECOD_IN_NUM_REG_RD    [i]);
    90                 entry->_write_re      [i] = PORT_READ(in_DECOD_IN_WRITE_RE      [i]);
    91                 entry->_num_reg_re    [i] = PORT_READ(in_DECOD_IN_NUM_REG_RE    [i]);
    92                 entry->_exception_use [i] = PORT_READ(in_DECOD_IN_EXCEPTION_USE [i]);
    93                 entry->_exception     [i] = PORT_READ(in_DECOD_IN_EXCEPTION     [i]);
    94 
    95                 reg_NB_INST [context] ++;
    96 
    97                 log_printf(TRACE,Decod_queue,FUNCTION,_("    * nb_inst : %d"),reg_NB_INST [context]);
    98                 log_printf(TRACE,Decod_queue,FUNCTION,_("    * PUSH queue"));
    99               }
    100           }
    101 
    102         //--------------------------------------------------------------------
    103         //-----[ DECOD_OUT ]--------------------------------------------------
    104         //--------------------------------------------------------------------
    105         if (not reg_QUEUE->empty())
    106           {
    107             bool find = false;
    108            
    109             for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    110               {
    111                 // Test transaction : if ok then invalid slot
    112                 // In order by rename logic
    113                 if (internal_DECOD_OUT_VAL [i] and internal_DECOD_OUT_ACK[i])
    114                   {
    115                     log_printf(TRACE,Decod_queue,FUNCTION,_("  * DECOD_OUT [%d]"),i);
    116                
    117 #ifdef DEBUG_TEST
    118                     if (reg_LAST_SLOT != i)
    119                       throw ERRORMORPHEO(FUNCTION,toString(_("reg_LAST_SLOT (%d) is different at decod_out port (%d)."),reg_LAST_SLOT,i));
    120 #endif
    121                     reg_LAST_SLOT ++;
    122 
    123                     reg_QUEUE->front()->_val [i] = 0;
    124 
    125                     Tcontext_t context = reg_QUEUE->front()->_context_id [i];
    126                     log_printf(TRACE,Decod_queue,FUNCTION,_("    * context : %d"),context);
    127                    
    128                     reg_NB_INST [context] --;
    129                     log_printf(TRACE,Decod_queue,FUNCTION,_("    * nb_inst : %d"),reg_NB_INST [context]);
    130                   }
    131                 // Test if slot is (again) valid, if yes, then have less one instruction in the entry
    132                 find |= reg_QUEUE->front()->_val [i];
    133               }
    134            
    135             // test if can free the entry : test if have consume all entry
    136             if (not find) // no valid instruction in current slot
    137               {
    138                 log_printf(TRACE,Decod_queue,FUNCTION,_("    * POP  queue"));
    139 
    140                 // can pop the slot
    141                 delete reg_QUEUE->front();
    142                 reg_QUEUE->pop_front();
    143 
    144                 reg_LAST_SLOT = 0;
    145               }
    146           }
    147       }
    148 
    149 #if defined(DEBUG) and defined(DEBUG_Decod_queue) and (DEBUG >= DEBUG_TRACE)
    150     log_printf(TRACE,Decod_queue,FUNCTION,"  * Dump decod_queue");
    151     log_printf(TRACE,Decod_queue,FUNCTION,"    * reg_LAST_SLOT : %d",reg_LAST_SLOT);
    152     uint32_t x=0;
    153     for (std::list<decod_queue_entry_t*>::iterator it=reg_QUEUE->begin();
    154          it!=reg_QUEUE->end();
    155          it++)
    156       {
    157         for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    158           {
    159             if ((*it)->_val [i])
    160               log_printf(TRACE,Decod_queue,FUNCTION,"    * [%.4d][%.4d] %.1d, %.3d %.2d, %.2d %.3d %.1d %.1d, 0x%.8x (0x%.8x), %.1d 0x%.8x, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d"
    161                          ,x
    162                          ,i
    163                          ,(*it)->_val           [i]
    164                          ,(*it)->_context_id    [i]
    165                          ,(*it)->_depth         [i]
    166                          ,(*it)->_type          [i]
    167                          ,(*it)->_operation     [i]
    168                          ,(*it)->_no_execute    [i]
    169                          ,(*it)->_is_delay_slot [i]
    170                          ,(*it)->_address       [i]
    171                          ,(*it)->_address       [i]<<2
    172                          ,(*it)->_has_immediat  [i]
    173                          ,(*it)->_immediat      [i]
    174                          ,(*it)->_read_ra       [i]
    175                          ,(*it)->_num_reg_ra    [i]
    176                          ,(*it)->_read_rb       [i]
    177                          ,(*it)->_num_reg_rb    [i]
    178                          ,(*it)->_read_rc       [i]
    179                          ,(*it)->_num_reg_rc    [i]
    180                          ,(*it)->_write_rd      [i]
    181                          ,(*it)->_num_reg_rd    [i]
    182                          ,(*it)->_write_re      [i]
    183                          ,(*it)->_num_reg_re    [i]
    184                          ,(*it)->_exception_use [i]
    185                          ,(*it)->_exception     [i]
    186                          );
    187             else
    188               log_printf(TRACE,Decod_queue,FUNCTION,"    * [%.4d][%.4d] %d"
    189                          ,x
    190                          ,i
    191                          ,(*it)->_val           [i]
    192                          );
    193 
    194           }
    195         x++;
    196       }
    197 #endif
    198    
    199 #ifdef STATISTICS
    200     if (usage_is_set(_usage,USE_STATISTICS))
    201       {
    202         *(_stat_use_queue) += reg_QUEUE->size();
    203         for (uint32_t i=0; i<_param->_nb_context; i++)
    204           *(_stat_nb_inst [i]) += reg_NB_INST [i];
    205       }
    206 #endif
     27    (this->*function_transition) ();
    20728
    20829#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Parameters.cpp

    r109 r111  
    2020#undef  FUNCTION
    2121#define FUNCTION "Decod_queue::Parameters"
    22   Parameters::Parameters (uint32_t   nb_context          ,
    23                           uint32_t   nb_inst_decod       ,
    24                           uint32_t   size_queue          ,
    25                           uint32_t   size_general_data   ,
    26                           uint32_t * nb_branch_speculated,
    27                           bool       is_toplevel         )
     22  Parameters::Parameters (uint32_t              nb_context          ,
     23                          uint32_t              nb_inst_decod       ,
     24                          uint32_t              size_queue          ,
     25                          Tdecod_queue_scheme_t queue_scheme        ,
     26                          uint32_t              size_general_data   ,
     27                          uint32_t            * nb_branch_speculated,
     28                          bool                  is_toplevel)
    2829  {
    2930    log_begin(Decod_queue,FUNCTION);
     
    3233    _nb_inst_decod           = nb_inst_decod           ;
    3334    _size_queue              = size_queue/nb_inst_decod;
    34 //  _size_general_data       = size_general_data   ;
    35     _nb_branch_speculated    = nb_branch_speculated;
    36     _nb_instruction_in_queue = size_queue;
    37    
     35    _queue_scheme            = queue_scheme            ;
     36//  _size_general_data       = size_general_data       ;
     37    _nb_branch_speculated    = nb_branch_speculated    ;
     38    _nb_instruction_in_queue = size_queue              ;
     39
     40    _nb_bank                 = nb_inst_decod           ;
     41
    3842    test();
    3943
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Parameters_msg_error.cpp

    r109 r111  
    3030      test.error("Size of decod queue must be a multiple of nb_instruction.\n");
    3131
     32    switch (_queue_scheme)
     33      {
     34      case DECOD_QUEUE_SCHEME_ONE_FIFO :
     35      case DECOD_QUEUE_SCHEME_MULTI_FIFO :
     36        {
     37          break;
     38        }
     39      default :
     40        {
     41          test.error(toString(_("Decod queue scheme '%s' is not supported. Please wait a next revision.\n"),toString(_queue_scheme).c_str()));
     42          break;
     43        }
     44      }
     45
    3246    log_end(Decod_queue,FUNCTION);
    3347
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Parameters_print.cpp

    r82 r111  
    3030    xml.singleton_begin("nb_inst_decod       "); xml.attribut("value",toString(_nb_inst_decod    )); xml.singleton_end();
    3131    xml.singleton_begin("size_queue          "); xml.attribut("value",toString(_size_queue       )); xml.singleton_end();
     32    xml.singleton_begin("queue_scheme        "); xml.attribut("value",toString(_queue_scheme     )); xml.singleton_end();
    3233    xml.singleton_begin("size_general_data   "); xml.attribut("value",toString(_size_general_data)); xml.singleton_end();
    3334    for (uint32_t i=0;i<_nb_context; i++)
Note: See TracChangeset for help on using the changeset viewer.