Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/SelfTest/Makefile

    r81 r88  
    2424library_clean                   : Read_queue_library_clean
    2525
     26local_clean                     :
     27
    2628include                         ../Makefile.deps
    2729include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/SelfTest/include/test.h

    r81 r88  
    1616
    1717#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Read_queue.h"
     18#include "Common/include/Time.h"
    1819
    1920using namespace std;
     
    3031              morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::read_queue::Parameters * param);
    3132
    32 class Time
    33 {
    34 private : timeval time_begin;
    35 // private : timeval time_end;
    36  
    37 public  : Time ()
    38   {
    39     gettimeofday(&time_begin     ,NULL);
    40   };
    41 
    42 public  : ~Time ()
    43   {
    44     cout << *this;
    45   };
    46 
    47 public  : friend ostream& operator<< (ostream& output_stream,
    48                                       const Time & x)
    49   {
    50     timeval time_end;
    51    
    52     gettimeofday(&time_end       ,NULL);
    53    
    54     uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
    55 
    56     double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
    57    
    58     output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl;
    59 
    60     return output_stream;
    61   }
    62 };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/SelfTest/src/main.cpp

    r81 r88  
    7777         ,size_store_queue
    7878         ,size_load_queue
     79         ,true //is_toplevel
    7980          );
    8081     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/SelfTest/src/test.cpp

    r82 r88  
    2323#endif
    2424
     25  Tusage_t _usage = USE_ALL;
     26
     27//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     28//   _usage = usage_unset(_usage,USE_VHDL                 );
     29//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     30//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     31//   _usage = usage_unset(_usage,USE_POSITION             );
     32//   _usage = usage_unset(_usage,USE_STATISTICS           );
     33//   _usage = usage_unset(_usage,USE_INFORMATION          );
     34
    2535  Read_queue * _Read_queue = new Read_queue (name.c_str(),
    2636#ifdef STATISTICS
     
    2838#endif
    2939                                             _param,
    30                                              USE_ALL);
     40                                             _usage);
    3141 
    3242#ifdef SYSTEMC
     
    200210  if(_param->_have_port_ooo_engine_id)
    201211    (*(_Read_queue-> in_READ_QUEUE_IN_OOO_ENGINE_ID  )) (*(READ_QUEUE_IN_OOO_ENGINE_ID  ));
    202   if(_param->_have_port_rob_id       )
     212  if(_param->_have_port_rob_ptr       )
    203213    (*(_Read_queue-> in_READ_QUEUE_IN_ROB_ID         )) (*(READ_QUEUE_IN_ROB_ID         ));
    204214  (*(_Read_queue-> in_READ_QUEUE_IN_OPERATION      )) (*(READ_QUEUE_IN_OPERATION      ));
     
    228238  if(_param->_have_port_ooo_engine_id)
    229239    (*(_Read_queue->out_READ_QUEUE_OUT_OOO_ENGINE_ID )) (*(READ_QUEUE_OUT_OOO_ENGINE_ID ));
    230   if(_param->_have_port_rob_id       )
     240  if(_param->_have_port_rob_ptr       )
    231241    (*(_Read_queue->out_READ_QUEUE_OUT_ROB_ID        )) (*(READ_QUEUE_OUT_ROB_ID        ));
    232242  (*(_Read_queue->out_READ_QUEUE_OUT_OPERATION     )) (*(READ_QUEUE_OUT_OPERATION     ));
     
    388398              if(_param->_have_port_front_end_id )
    389399                READ_QUEUE_IN_FRONT_END_ID   ->write((3*_ooo_engine_id [request_in])%_param->_nb_front_end);
    390               if(_param->_have_port_rob_id       )
     400              if(_param->_have_port_rob_ptr       )
    391401                READ_QUEUE_IN_ROB_ID      ->write(request_in);
    392402              READ_QUEUE_IN_OPERATION   ->write(0);
     
    504514            {
    505515              Tpacket_t  rob_id;
    506               if(_param->_have_port_rob_id       )
     516              if(_param->_have_port_rob_ptr       )
    507517                rob_id = READ_QUEUE_OUT_ROB_ID->read();
    508518              else
     
    551561  TEST_OK ("End of Simulation");
    552562  delete _time;
     563
    553564  cout << "<" << name << "> ............ Stop Simulation" << endl;
    554565
     
    564575   if(_param->_have_port_ooo_engine_id )
    565576     delete    READ_QUEUE_IN_OOO_ENGINE_ID;
    566    if(_param->_have_port_rob_id       )
     577   if(_param->_have_port_rob_ptr       )
    567578     delete    READ_QUEUE_IN_ROB_ID    ;
    568579   delete    READ_QUEUE_IN_OPERATION    ;
     
    592603   if(_param->_have_port_ooo_engine_id )
    593604     delete    READ_QUEUE_OUT_OOO_ENGINE_ID;
    594    if(_param->_have_port_rob_id       )
     605   if(_param->_have_port_rob_ptr       )
    595606     delete    READ_QUEUE_OUT_ROB_ID      ;
    596607   delete    READ_QUEUE_OUT_OPERATION   ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Parameters.h

    r81 r88  
    2828  {
    2929    //-----[ fields ]------------------------------------------------------------
    30   public : const uint32_t    _size_queue           ;
    31   public : const uint32_t    _nb_context           ;
    32   public : const uint32_t    _nb_front_end         ;
    33   public : const uint32_t    _nb_ooo_engine        ;
    34   public : const uint32_t    _nb_packet            ;
    35   public : const uint32_t    _size_general_data    ;
    36   public : const uint32_t    _size_special_data    ;
    37   public : const uint32_t    _nb_general_register  ;
    38   public : const uint32_t    _nb_special_register  ;
    39   public : const uint32_t    _nb_gpr_write         ;
    40   public : const uint32_t    _nb_spr_write         ;
    41   public : const uint32_t    _size_store_queue     ;
    42   public : const uint32_t    _size_load_queue      ;
     30  public : uint32_t    _size_queue           ;
     31  public : uint32_t    _nb_context           ;
     32  public : uint32_t    _nb_front_end         ;
     33  public : uint32_t    _nb_ooo_engine        ;
     34  public : uint32_t    _nb_packet            ;
     35//public : uint32_t    _size_general_data    ;
     36//public : uint32_t    _size_special_data    ;
     37  public : uint32_t    _nb_general_register  ;
     38  public : uint32_t    _nb_special_register  ;
     39  public : uint32_t    _nb_gpr_write         ;
     40  public : uint32_t    _nb_spr_write         ;
     41//public : uint32_t    _size_store_queue     ;
     42//public : uint32_t    _size_load_queue      ;
    4343
    44   public : const uint32_t    _nb_gpr_read          ;
    45   public : const uint32_t    _nb_spr_read          ;   
    46   public : const uint32_t    _size_context_id      ;
    47   public : const uint32_t    _size_front_end_id    ;
    48   public : const uint32_t    _size_ooo_engine_id   ;
    49   public : const uint32_t    _size_rob_id          ;
    50   public : const uint32_t    _size_general_register;
    51   public : const uint32_t    _size_special_register;
     44  public : uint32_t    _nb_gpr_read          ;
     45  public : uint32_t    _nb_spr_read          ;   
     46//public : uint32_t    _size_context_id      ;
     47//public : uint32_t    _size_front_end_id    ;
     48//public : uint32_t    _size_ooo_engine_id   ;
     49//public : uint32_t    _size_rob_id          ;
     50//public : uint32_t    _size_general_register;
     51//public : uint32_t    _size_special_register;
    5252
    53   public : const bool        _have_port_context_id   ;
    54   public : const bool        _have_port_front_end_id ;
    55   public : const bool        _have_port_ooo_engine_id;
    56   public : const bool        _have_port_rob_id       ;
    57   public : const bool        _have_port_load_queue_ptr;
     53//public : bool        _have_port_context_id   ;
     54//public : bool        _have_port_front_end_id ;
     55//public : bool        _have_port_ooo_engine_id;
     56//public : bool        _have_port_rob_id       ;
     57//public : bool        _have_port_load_queue_ptr;
    5858
    59   public : const uint32_t    _size_internal_queue;
     59  public : uint32_t    _size_internal_queue;
    6060
    6161    //-----[ methods ]-----------------------------------------------------------
     
    7272                        uint32_t nb_spr_write       ,
    7373                        uint32_t size_store_queue   ,
    74                         uint32_t size_load_queue    );
     74                        uint32_t size_load_queue    ,
     75                        bool     is_toplevel=false  );
    7576
    76   public : Parameters  (Parameters & param) ;
    77   public : ~Parameters () ;
     77//public : Parameters  (Parameters & param) ;
     78  public : ~Parameters (void) ;
     79
     80  public : void                 copy      (void);
    7881
    7982  public : Parameters_test      msg_error (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Read_queue.h

    r82 r88  
    1414
    1515#include <iostream>
    16 #include <queue>
     16#include <list>
    1717#include "Common/include/ToString.h"
    1818#include "Common/include/Debug.h"
     
    154154    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    155155  protected : Tread_queue_head_entry_t       * _queue_head;
    156   protected : std::queue<Tread_queue_entry_t *>   * _queue;
     156  protected : std::list<Tread_queue_entry_t *>   * _queue;
    157157
    158158    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Parameters.cpp

    r81 r88  
    3030                          uint32_t nb_spr_write       ,
    3131                          uint32_t size_store_queue   ,
    32                           uint32_t size_load_queue    ):
    33     _size_queue            (size_queue           ),
    34     _nb_context            (nb_context           ),
    35     _nb_front_end          (nb_front_end         ),
    36     _nb_ooo_engine         (nb_ooo_engine        ),
    37     _nb_packet             (nb_packet            ),
    38     _size_general_data     (size_general_data    ),
    39     _size_special_data     (size_special_data    ),
    40     _nb_general_register   (nb_general_register  ),
    41     _nb_special_register   (nb_special_register  ),
    42     _nb_gpr_write          (nb_gpr_write         ),
    43     _nb_spr_write          (nb_spr_write         ),
    44     _size_store_queue      (size_store_queue     ),
    45     _size_load_queue       (size_load_queue      ),
    46 
    47     _nb_gpr_read           (2                    ),
    48     _nb_spr_read           (1                    ),
    49     _size_context_id       (static_cast<uint32_t>(log2(_nb_context         ))),
    50     _size_front_end_id     (static_cast<uint32_t>(log2(_nb_front_end       ))),
    51     _size_ooo_engine_id    (static_cast<uint32_t>(log2(_nb_ooo_engine      ))),
    52     _size_rob_id           (static_cast<uint32_t>(log2(_nb_packet          ))),
    53     _size_general_register (static_cast<uint32_t>(log2(_nb_general_register))),
    54     _size_special_register (static_cast<uint32_t>(log2(_nb_special_register))),
    55 
    56     _have_port_context_id    (_size_context_id    > 0),
    57     _have_port_front_end_id  (_size_front_end_id  > 0),
    58     _have_port_ooo_engine_id (_size_ooo_engine_id > 0),
    59     _have_port_rob_id        (_size_rob_id        > 0),
    60     _have_port_load_queue_ptr(_size_load_queue    > 1),
    61 
    62     _size_internal_queue     (  _size_context_id       //_context_id   
    63                               + _size_front_end_id     //_front_end_id
    64                               + _size_ooo_engine_id    //_ooo_engine_id
    65                               + _size_rob_id           //_rob_id       
    66                               + _size_operation        //_operation   
    67                               + _size_type             //_type         
    68                               + log2(_size_store_queue)//_store_queue_ptr_write
    69                               + log2(_size_load_queue )//_load_queue_ptr_write
    70                               + 1                      //_has_immediat
    71                               + _size_general_data     //_immediat     
    72                               + 1                      //_read_ra     
    73                               + _size_general_register //_num_reg_ra   
    74                               + 1                      //_read_rb     
    75                               + _size_general_register //_num_reg_rb   
    76                               + 1                      //_read_rc     
    77                               + _size_special_register //_num_reg_rc   
    78                               + 1                      //_write_rd     
    79                               + _size_general_register //_num_reg_rd   
    80                               + 1                      //_write_re     
    81                               + _size_special_register //_num_reg_re   
    82                                 )
    83                                
    84 
     32                          uint32_t size_load_queue    ,
     33                          bool     is_toplevel)
    8534  {
    8635    log_printf(FUNC,Read_queue,"Parameters","Begin");
     36
     37    _size_queue              = size_queue           ;
     38    _nb_context              = nb_context           ;
     39    _nb_front_end            = nb_front_end         ;
     40    _nb_ooo_engine           = nb_ooo_engine        ;
     41    _nb_packet               = nb_packet            ;
     42    _nb_general_register     = nb_general_register  ;
     43    _nb_special_register     = nb_special_register  ;
     44    _nb_gpr_write            = nb_gpr_write         ;
     45    _nb_spr_write            = nb_spr_write         ;
     46                             
     47    _nb_gpr_read             = 2                    ;
     48    _nb_spr_read             = 1                    ;
     49
     50    _size_internal_queue     = (  log2(nb_context         ) //_context_id   
     51                                + log2(nb_front_end       ) //_front_end_id
     52                                + log2(nb_ooo_engine      ) //_ooo_engine_id
     53                                + log2(nb_packet          ) //_rob_id       
     54                                + _size_operation           //_operation   
     55                                + _size_type                //_type         
     56                                + log2(size_store_queue   ) //_store_queue_ptr_write
     57                                + log2(size_load_queue    ) //_load_queue_ptr_write
     58                                + 1                         //_has_immediat
     59                                +  size_general_data        //_immediat     
     60                                + 1                         //_read_ra     
     61                                + log2(nb_general_register) //_num_reg_ra   
     62                                + 1                         //_read_rb     
     63                                + log2(nb_general_register) //_num_reg_rb   
     64                                + 1                         //_read_rc     
     65                                + log2(nb_special_register) //_num_reg_rc   
     66                                + 1                         //_write_rd     
     67                                + log2(nb_general_register) //_num_reg_rd   
     68                                + 1                         //_write_re     
     69                                + log2(nb_special_register) //_num_reg_re   
     70                                );
     71
    8772    test();
     73
     74    if (is_toplevel)
     75      {
     76        _size_general_data       = size_general_data    ;
     77        _size_special_data       = size_special_data    ;
     78        _size_store_queue_ptr    = log2(size_store_queue);
     79        _size_load_queue_ptr     = log2(size_load_queue );
     80        _size_context_id         = log2(_nb_context         );
     81        _size_front_end_id       = log2(_nb_front_end       );
     82        _size_ooo_engine_id      = log2(_nb_ooo_engine      );
     83        _size_rob_ptr            = log2(_nb_packet          );
     84        _size_general_register   = log2(_nb_general_register);
     85        _size_special_register   = log2(_nb_special_register);
     86       
     87        _have_port_context_id    = _size_context_id    > 0;
     88        _have_port_front_end_id  = _size_front_end_id  > 0;
     89        _have_port_ooo_engine_id = _size_ooo_engine_id > 0;
     90        _have_port_rob_ptr       = _size_rob_ptr       > 0;
     91        _have_port_load_queue_ptr= _size_load_queue_ptr> 0;
     92       
     93        copy();
     94      }
     95
    8896    log_printf(FUNC,Read_queue,"Parameters","End");
    8997  };
    9098 
    91   Parameters::Parameters (Parameters & param):
    92     _size_queue            (param._size_queue            ),
    93     _nb_context            (param._nb_context            ),
    94     _nb_front_end          (param._nb_front_end          ),
    95     _nb_ooo_engine         (param._nb_ooo_engine         ),
    96     _nb_packet             (param._nb_packet             ),
    97     _size_general_data     (param._size_general_data     ),
    98     _size_special_data     (param._size_special_data     ),
    99     _nb_general_register   (param._nb_general_register   ),
    100     _nb_special_register   (param._nb_special_register   ),
    101     _nb_gpr_write          (param._nb_gpr_write          ),
    102     _nb_spr_write          (param._nb_spr_write          ),
    103     _size_store_queue      (param._size_store_queue      ),
    104     _size_load_queue       (param._size_load_queue       ),
     99//   Parameters::Parameters (Parameters & param):
     100//     _size_queue            (param._size_queue            ),
     101//     _nb_context            (param._nb_context            ),
     102//     _nb_front_end          (param._nb_front_end          ),
     103//     _nb_ooo_engine         (param._nb_ooo_engine         ),
     104//     _nb_packet             (param._nb_packet             ),
     105//     _size_general_data     (param._size_general_data     ),
     106//     _size_special_data     (param._size_special_data     ),
     107//     _nb_general_register   (param._nb_general_register   ),
     108//     _nb_special_register   (param._nb_special_register   ),
     109//     _nb_gpr_write          (param._nb_gpr_write          ),
     110//     _nb_spr_write          (param._nb_spr_write          ),
     111//     _size_store_queue      (param._size_store_queue      ),
     112//     _size_load_queue       (param._size_load_queue       ),
    105113
    106     _nb_gpr_read           (param._nb_gpr_read           ),
    107     _nb_spr_read           (param._nb_spr_read           ),
    108     _size_context_id       (param._size_context_id       ),
    109     _size_front_end_id     (param._size_front_end_id     ),
    110     _size_ooo_engine_id    (param._size_ooo_engine_id    ),
    111     _size_rob_id           (param._size_rob_id           ),
    112     _size_general_register (param._size_general_register ),
    113     _size_special_register (param._size_special_register ),
     114//     _nb_gpr_read           (param._nb_gpr_read           ),
     115//     _nb_spr_read           (param._nb_spr_read           ),
     116//     _size_context_id       (param._size_context_id       ),
     117//     _size_front_end_id     (param._size_front_end_id     ),
     118//     _size_ooo_engine_id    (param._size_ooo_engine_id    ),
     119//     _size_rob_id           (param._size_rob_id           ),
     120//     _size_general_register (param._size_general_register ),
     121//     _size_special_register (param._size_special_register ),
    114122
    115     _have_port_context_id    (param._have_port_context_id   ),
    116     _have_port_front_end_id  (param._have_port_front_end_id ),
    117     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
    118     _have_port_rob_id        (param._have_port_rob_id       ),
    119     _have_port_load_queue_ptr(param._have_port_load_queue_ptr),
     123//     _have_port_context_id    (param._have_port_context_id   ),
     124//     _have_port_front_end_id  (param._have_port_front_end_id ),
     125//     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
     126//     _have_port_rob_id        (param._have_port_rob_id       ),
     127//     _have_port_load_queue_ptr(param._have_port_load_queue_ptr),
    120128
    121     _size_internal_queue     (param._size_internal_queue    )
    122   {
    123     log_printf(FUNC,Read_queue,"Parameters (copy)","Begin");
    124     test();
    125     log_printf(FUNC,Read_queue,"Parameters (copy)","End");
    126   };
     129//     _size_internal_queue     (param._size_internal_queue    )
     130//   {
     131//     log_printf(FUNC,Read_queue,"Parameters (copy)","Begin");
     132//     test();
     133//     log_printf(FUNC,Read_queue,"Parameters (copy)","End");
     134//   };
    127135
    128   Parameters::~Parameters ()
     136  Parameters::~Parameters (void)
    129137  {
    130138    log_printf(FUNC,Read_queue,"~Parameters","Begin");
    131139    log_printf(FUNC,Read_queue,"~Parameters","End");
     140  };
     141
     142  void Parameters::copy (void)
     143  {
     144    log_printf(FUNC,Read_queue,"copy","Begin");
     145    log_printf(FUNC,Read_queue,"copy","End");
    132146  };
    133147
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Parameters_print.cpp

    r81 r88  
    3131    xml.singleton_begin("nb_ooo_engine      "); xml.attribut("value",toString(_nb_ooo_engine      )); xml.singleton_end();
    3232    xml.singleton_begin("nb_packet          "); xml.attribut("value",toString(_nb_packet          )); xml.singleton_end();
    33     xml.singleton_begin("size_general_data  "); xml.attribut("value",toString(_size_general_data  )); xml.singleton_end();
    34     xml.singleton_begin("size_special_data  "); xml.attribut("value",toString(_size_special_data  )); xml.singleton_end();
     33//  xml.singleton_begin("size_general_data  "); xml.attribut("value",toString(_size_general_data  )); xml.singleton_end();
     34//  xml.singleton_begin("size_special_data  "); xml.attribut("value",toString(_size_special_data  )); xml.singleton_end();
    3535    xml.singleton_begin("nb_general_register"); xml.attribut("value",toString(_nb_general_register)); xml.singleton_end();
    3636    xml.singleton_begin("nb_special_register"); xml.attribut("value",toString(_nb_special_register)); xml.singleton_end();
    3737    xml.singleton_begin("nb_gpr_write       "); xml.attribut("value",toString(_nb_gpr_write       )); xml.singleton_end();
    3838    xml.singleton_begin("nb_spr_write       "); xml.attribut("value",toString(_nb_spr_write       )); xml.singleton_end();
    39     xml.singleton_begin("size_store_queue   "); xml.attribut("value",toString(_size_store_queue   )); xml.singleton_end();
    40     xml.singleton_begin("size_load_queue    "); xml.attribut("value",toString(_size_load_queue    )); xml.singleton_end();
     39//  xml.singleton_begin("size_store_queue   "); xml.attribut("value",toString(_size_store_queue   )); xml.singleton_end();
     40//  xml.singleton_begin("size_load_queue    "); xml.attribut("value",toString(_size_load_queue    )); xml.singleton_end();
    4141
    4242    xml.balise_close();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue.cpp

    r82 r88  
    3636    log_printf(FUNC,Read_queue,"Read_queue","Begin");
    3737
     38#if DEBUG_Read_queue == true
     39    log_printf(INFO,Read_queue,FUNCTION,_("<%s> Parameters"),_name.c_str());
     40
     41    std::cout << *param << std::endl;
     42#endif   
     43
    3844#ifdef SYSTEMC
    3945    log_printf(INFO,Read_queue,"Read_queue","Allocation");
     
    4349
    4450#ifdef STATISTICS
    45     log_printf(INFO,Read_queue,FUNCTION,"Allocation of statistics");
    46    
    47     statistics_declaration(param_statistics);
     51    if (usage_is_set(_usage,USE_STATISTICS))
     52      {
     53        log_printf(INFO,Read_queue,FUNCTION,"Allocation of statistics");
     54       
     55        statistics_declaration(param_statistics);
     56      }
    4857#endif
    4958
    5059#ifdef VHDL
    51     // generate the vhdl
    52     log_printf(INFO,Read_queue,"Read_queue","Generate the vhdl");
    53 
    54     vhdl();
    55 #endif
    56 
    57 #ifdef SYSTEMC
     60    if (usage_is_set(_usage,USE_VHDL))
     61      {
     62        // generate the vhdl
     63        log_printf(INFO,Read_queue,"Read_queue","Generate the vhdl");
     64       
     65        vhdl();
     66      }
     67#endif
     68
     69#ifdef SYSTEMC
     70    if (usage_is_set(_usage,USE_SYSTEMC))
     71      {
    5872    log_printf(INFO,Read_queue,"Read_queue","Method - transition");
    5973
     
    206220      }
    207221#endif   
    208 
     222      }
    209223#endif
    210224    log_printf(FUNC,Read_queue,"Read_queue","End");
     
    216230
    217231#ifdef STATISTICS
    218     log_printf(INFO,Read_queue,"~Read_queue","Generate Statistics file");
    219 
    220     delete _stat;
     232    if (usage_is_set(_usage,USE_STATISTICS))
     233      {
     234        log_printf(INFO,Read_queue,"~Read_queue","Generate Statistics file");
     235       
     236        delete _stat;
     237      }
    221238#endif
    222239
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_allocation.cpp

    r82 r88  
    33 * $Id$
    44 *
    5  * [ Description ]
     5 * [ Description ]
    66 *
    77 */
     
    3434    _interfaces = entity->set_interfaces();
    3535
    36     // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     36    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3737
    3838    {
     
    4848     in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
    4949    }
    50     // ~~~~~[ Interface : "read_queue_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     50    // ~~~~~[ Interface : "read_queue_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5151    {
    5252      Interface_fifo * interface = _interfaces->set_interface("read_queue_in"
     
    6666       if(_param->_have_port_ooo_engine_id)
    6767         in_READ_QUEUE_IN_OOO_ENGINE_ID  = interface->set_signal_in  <Tcontext_t        > ("ooo_engine_id",_param->_size_ooo_engine_id    );
    68       if(_param->_have_port_rob_id      )
    69        in_READ_QUEUE_IN_ROB_ID         = interface->set_signal_in  <Tpacket_t         > ("rob_id"      ,_param->_size_rob_id           );
     68      if(_param->_have_port_rob_ptr      )
     69       in_READ_QUEUE_IN_ROB_ID         = interface->set_signal_in  <Tpacket_t         > ("rob_id"      ,_param->_size_rob_ptr           );
    7070       in_READ_QUEUE_IN_OPERATION      = interface->set_signal_in  <Toperation_t      > ("operation"   ,_param->_size_operation        );
    7171       in_READ_QUEUE_IN_TYPE           = interface->set_signal_in  <Ttype_t           > ("type"        ,_param->_size_type             );
    72        in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE = interface->set_signal_in  <Tlsq_ptr_t> ("store_queue_ptr_write", log2(_param->_size_store_queue));
     72       in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE = interface->set_signal_in  <Tlsq_ptr_t> ("store_queue_ptr_write", _param->_size_store_queue_ptr);
    7373       if (_param->_have_port_load_queue_ptr)
    74        in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_in  <Tlsq_ptr_t> ("load_queue_ptr_write" , log2(_param->_size_load_queue ));
     74       in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_in  <Tlsq_ptr_t> ("load_queue_ptr_write" , _param->_size_load_queue_ptr);
    7575       in_READ_QUEUE_IN_HAS_IMMEDIAT   = interface->set_signal_in  <Tcontrol_t        > ("has_immediat",1                             );
    7676       in_READ_QUEUE_IN_IMMEDIAT       = interface->set_signal_in  <Tgeneral_data_t   > ("immediat"    ,_param->_size_general_data     );
     
    8787     }
    8888
    89     // ~~~~~[ Interface : "read_queue_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     89    // ~~~~~[ Interface : "read_queue_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9090    {
    9191      Interface_fifo * interface = _interfaces->set_interface("read_queue_out"
     
    106106      if(_param->_have_port_ooo_engine_id)
    107107        out_READ_QUEUE_OUT_OOO_ENGINE_ID  = interface->set_signal_out <Tcontext_t        > ("ooo_engine_id",_param->_size_ooo_engine_id    );
    108       if(_param->_have_port_rob_id      )
    109         out_READ_QUEUE_OUT_ROB_ID         = interface->set_signal_out <Tpacket_t         > ("rob_id"      ,_param->_size_rob_id           );
     108      if(_param->_have_port_rob_ptr      )
     109        out_READ_QUEUE_OUT_ROB_ID         = interface->set_signal_out <Tpacket_t         > ("rob_id"      ,_param->_size_rob_ptr           );
    110110      out_READ_QUEUE_OUT_OPERATION      = interface->set_signal_out <Toperation_t      > ("operation"   ,_param->_size_operation        );
    111111      out_READ_QUEUE_OUT_TYPE           = interface->set_signal_out <Ttype_t           > ("type"        ,_param->_size_type             );
    112       out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE = interface->set_signal_out <Tlsq_ptr_t> ("store_queue_ptr_write", log2(_param->_size_store_queue));
     112      out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE = interface->set_signal_out <Tlsq_ptr_t> ("store_queue_ptr_write", _param->_size_store_queue_ptr);
    113113      if (_param->_have_port_load_queue_ptr)
    114       out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_out <Tlsq_ptr_t> ("load_queue_ptr_write" , log2(_param->_size_load_queue ));
     114      out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_out <Tlsq_ptr_t> ("load_queue_ptr_write" , _param->_size_load_queue_ptr);
    115115      out_READ_QUEUE_OUT_HAS_IMMEDIAT   = interface->set_signal_out <Tcontrol_t        > ("has_immediat",1                             );
    116116      out_READ_QUEUE_OUT_IMMEDIAT       = interface->set_signal_out <Tgeneral_data_t   > ("immediat"    ,_param->_size_general_data     );
     
    133133     }
    134134
    135     // ~~~~~[ Interface : "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     135    // ~~~~~[ Interface : "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    136136   
    137137    out_GPR_READ_VAL          = new SC_OUT(Tcontrol_t        ) * [_param->_nb_gpr_read];
     
    162162      }
    163163     
    164     // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     164    // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    165165   
    166166    out_SPR_READ_VAL          = new SC_OUT(Tcontrol_t        ) * [_param->_nb_spr_read];
     
    191191      }
    192192
    193     // ~~~~~[ Interface : "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     193    // ~~~~~[ Interface : "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    194194   
    195195     in_GPR_WRITE_VAL          = new SC_IN (Tcontrol_t        ) * [_param->_nb_gpr_write];
     
    216216      }
    217217
    218     // ~~~~~[ Interface : "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     218    // ~~~~~[ Interface : "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    219219   
    220220     in_SPR_WRITE_VAL          = new SC_IN (Tcontrol_t        ) * [_param->_nb_spr_write];
     
    241241      }
    242242
    243     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    244     _queue      = new std::queue<Tread_queue_entry_t *>;
     243    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     244    _queue      = new std::list<Tread_queue_entry_t *>;
    245245    _queue_head = new Tread_queue_head_entry_t;
    246246
    247247#ifdef POSITION
    248     _component->generate_file();
     248    if (usage_is_set(_usage,USE_POSITION))
     249      _component->generate_file();
    249250#endif
    250251
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_deallocation.cpp

    r81 r88  
    33 * $Id$
    44 *
    5  * [ Description ]
     5 * [ Description ]
    66 *
    77 */
     
    2323    log_printf(FUNC,Read_queue,"deallocation","Begin");
    2424
    25     // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     25    if (usage_is_set(_usage,USE_SYSTEMC))
     26      {
     27    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2628    delete     in_CLOCK ;
    2729    delete     in_NRESET;
    2830
    29     // ~~~~~[ Interface : "read_queue_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     31    // ~~~~~[ Interface : "read_queue_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3032    delete     in_READ_QUEUE_IN_VAL            ;
    3133    delete    out_READ_QUEUE_IN_ACK            ;
     
    3739    if(_param->_have_port_ooo_engine_id)
    3840      delete     in_READ_QUEUE_IN_OOO_ENGINE_ID  ;
    39     if(_param->_have_port_rob_id       )
     41    if(_param->_have_port_rob_ptr       )
    4042      delete     in_READ_QUEUE_IN_ROB_ID         ;
    4143    delete     in_READ_QUEUE_IN_OPERATION      ;
     
    5759    delete     in_READ_QUEUE_IN_NUM_REG_RE     ;
    5860
    59     // ~~~~~[ Interface : "read_queue_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     61    // ~~~~~[ Interface : "read_queue_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6062    delete    out_READ_QUEUE_OUT_VAL            ;
    6163    delete     in_READ_QUEUE_OUT_ACK            ;
     
    6769    if(_param->_have_port_ooo_engine_id)
    6870      delete    out_READ_QUEUE_OUT_OOO_ENGINE_ID  ;
    69     if(_param->_have_port_rob_id       )
     71    if(_param->_have_port_rob_ptr       )
    7072      delete    out_READ_QUEUE_OUT_ROB_ID         ;
    7173    delete    out_READ_QUEUE_OUT_OPERATION      ;
     
    9395    delete    out_READ_QUEUE_OUT_NUM_REG_RE     ;
    9496
    95     // ~~~~~[ Interface : "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     97    // ~~~~~[ Interface : "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9698   
    9799    delete [] out_GPR_READ_VAL       ;
     
    103105    delete []  in_GPR_READ_DATA_VAL  ;
    104106
    105     // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     107    // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    106108   
    107109    delete [] out_SPR_READ_VAL       ;
     
    113115    delete []  in_SPR_READ_DATA_VAL  ;
    114116
    115     // ~~~~~[ Interface : "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     117    // ~~~~~[ Interface : "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    116118   
    117119    delete []  in_GPR_WRITE_VAL       ;
     
    121123    delete []  in_GPR_WRITE_DATA      ;
    122124
    123     // ~~~~~[ Interface : "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     125    // ~~~~~[ Interface : "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    124126   
    125127    delete []  in_SPR_WRITE_VAL       ;
     
    128130    delete []  in_SPR_WRITE_NUM_REG   ;
    129131    delete []  in_SPR_WRITE_DATA      ;
     132      }
    130133
    131     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     134    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    132135
    133136    while (_queue->empty() == false)
    134137      {
    135138        delete _queue->front();
    136         _queue->pop();
     139        _queue->pop_front();
    137140      }
    138141    delete _queue;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_end_cycle.cpp

    r81 r88  
    2424
    2525#ifdef STATISTICS
    26     _stat->end_cycle();
     26    if (usage_is_set(_usage,USE_STATISTICS))
     27      _stat->end_cycle();
    2728#endif   
    2829
     
    3031    // Evaluation before read the ouput signal
    3132//  sc_start(0);
    32     _interfaces->testbench();
     33    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
     34      _interfaces->testbench();
    3335#endif
    3436
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_genMealy_read_queue_out_gpr.cpp

    r81 r88  
    2222  void Read_queue::genMealy_read_queue_out_gpr (void)
    2323  {
    24     log_printf(FUNC,Read_queue,FUNCTION,"Begin");
     24    log_begin(Read_queue,FUNCTION);
     25    log_function(Read_queue,FUNCTION,_name.c_str());
    2526
    2627    internal_READ_QUEUE_OUT_DATA_RA_VAL = (// Previous value
     
    3233                                           );
    3334
    34     log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RA_VAL   : %d",internal_READ_QUEUE_OUT_DATA_RA_VAL);
    35     log_printf(TRACE,Read_queue,FUNCTION,"   * _queue_head->_data_ra_val           : %d",_queue_head->_data_ra_val);
    36     log_printf(TRACE,Read_queue,FUNCTION,"   * _queue_head->_read_ra_val           : %d",_queue_head->_read_ra_val);
    37     log_printf(TRACE,Read_queue,FUNCTION,"   * in_GPR_READ_ACK      [0]            : %d",PORT_READ(in_GPR_READ_ACK      [0]));
    38     log_printf(TRACE,Read_queue,FUNCTION,"   * in_GPR_READ_DATA_VAL [0]            : %d",PORT_READ(in_GPR_READ_DATA_VAL [0]));
     35    log_printf(TRACE,Read_queue,FUNCTION,"  * internal_READ_QUEUE_OUT_DATA_RA_VAL   : %d",internal_READ_QUEUE_OUT_DATA_RA_VAL);
     36    log_printf(TRACE,Read_queue,FUNCTION,"    * _queue_head->_data_ra_val           : %d",_queue_head->_data_ra_val);
     37    log_printf(TRACE,Read_queue,FUNCTION,"    * _queue_head->_read_ra_val           : %d",_queue_head->_read_ra_val);
     38    log_printf(TRACE,Read_queue,FUNCTION,"    * in_GPR_READ_ACK      [0]            : %d",PORT_READ(in_GPR_READ_ACK      [0]));
     39    log_printf(TRACE,Read_queue,FUNCTION,"    * in_GPR_READ_DATA_VAL [0]            : %d",PORT_READ(in_GPR_READ_DATA_VAL [0]));
    3940
    4041    internal_READ_QUEUE_OUT_DATA_RB_VAL = (_queue_head->_data_rb_val or
     
    4445                                           );
    4546
    46     log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RB_VAL   : %d",internal_READ_QUEUE_OUT_DATA_RB_VAL);
    47     log_printf(TRACE,Read_queue,FUNCTION,"   * _queue_head->_data_rb_val           : %d",_queue_head->_data_rb_val);
    48     log_printf(TRACE,Read_queue,FUNCTION,"   * _queue_head->_read_rb_val           : %d",_queue_head->_read_rb_val);
    49     log_printf(TRACE,Read_queue,FUNCTION,"   * in_GPR_READ_ACK      [1]            : %d",PORT_READ(in_GPR_READ_ACK      [1]));
    50     log_printf(TRACE,Read_queue,FUNCTION,"   * in_GPR_READ_DATA_VAL [1]            : %d",PORT_READ(in_GPR_READ_DATA_VAL [1]));
     47    log_printf(TRACE,Read_queue,FUNCTION,"  * internal_READ_QUEUE_OUT_DATA_RB_VAL   : %d",internal_READ_QUEUE_OUT_DATA_RB_VAL);
     48    log_printf(TRACE,Read_queue,FUNCTION,"    * _queue_head->_data_rb_val           : %d",_queue_head->_data_rb_val);
     49    log_printf(TRACE,Read_queue,FUNCTION,"    * _queue_head->_read_rb_val           : %d",_queue_head->_read_rb_val);
     50    log_printf(TRACE,Read_queue,FUNCTION,"    * in_GPR_READ_ACK      [1]            : %d",PORT_READ(in_GPR_READ_ACK      [1]));
     51    log_printf(TRACE,Read_queue,FUNCTION,"    * in_GPR_READ_DATA_VAL [1]            : %d",PORT_READ(in_GPR_READ_DATA_VAL [1]));
    5152               
    5253   
     
    8081            if (_queue_head->_num_reg_ra == gpr_write_num_reg)
    8182              {
    82                 log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RA_VAL   - bypass hit (%d)",i);
     83                log_printf(TRACE,Read_queue,FUNCTION,"  * internal_READ_QUEUE_OUT_DATA_RA_VAL   - bypass hit (%d)",i);
    8384
    8485                internal_READ_QUEUE_OUT_DATA_RA_VAL = 1;
     
    9091            if (_queue_head->_num_reg_rb == gpr_write_num_reg)
    9192              {
    92                 log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RB_VAL   - bypass hit (%d)",i);
     93                log_printf(TRACE,Read_queue,FUNCTION,"  * internal_READ_QUEUE_OUT_DATA_RB_VAL   - bypass hit (%d)",i);
    9394                internal_READ_QUEUE_OUT_DATA_RB_VAL = 1;
    9495#ifdef SYSTEMC_VHDL_COMPATIBILITY
     
    106107    PORT_WRITE(out_READ_QUEUE_OUT_DATA_RB    ,internal_READ_QUEUE_OUT_DATA_RB    );
    107108
    108     log_printf(FUNC,Read_queue,FUNCTION,"End");
     109    log_end(Read_queue,FUNCTION);
    109110  };
    110111
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_genMealy_read_queue_out_spr.cpp

    r81 r88  
    2222  void Read_queue::genMealy_read_queue_out_spr (void)
    2323  {
    24     log_printf(FUNC,Read_queue,FUNCTION,"Begin");
     24    log_begin(Read_queue,FUNCTION);
     25    log_function(Read_queue,FUNCTION,_name.c_str());
    2526
    2627    internal_READ_QUEUE_OUT_DATA_RC_VAL = (// Previous value
     
    3233                                           );
    3334
    34     log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL   : %d",internal_READ_QUEUE_OUT_DATA_RC_VAL);
    35     log_printf(TRACE,Read_queue,FUNCTION,"   * _queue_head->_data_rc_val           : %d",_queue_head->_data_rc_val);
    36     log_printf(TRACE,Read_queue,FUNCTION,"   * _queue_head->_read_rc_val           : %d",_queue_head->_read_rc_val);
    37     log_printf(TRACE,Read_queue,FUNCTION,"   * in_SPR_READ_ACK      [0]            : %d",PORT_READ(in_SPR_READ_ACK      [0]));
    38     log_printf(TRACE,Read_queue,FUNCTION,"   * in_SPR_READ_DATA_VAL [0]            : %d",PORT_READ(in_SPR_READ_DATA_VAL [0]));
     35    log_printf(TRACE,Read_queue,FUNCTION,"  * internal_READ_QUEUE_OUT_DATA_RC_VAL   : %d",internal_READ_QUEUE_OUT_DATA_RC_VAL);
     36    log_printf(TRACE,Read_queue,FUNCTION,"    * _queue_head->_data_rc_val           : %d",_queue_head->_data_rc_val);
     37    log_printf(TRACE,Read_queue,FUNCTION,"    * _queue_head->_read_rc_val           : %d",_queue_head->_read_rc_val);
     38    log_printf(TRACE,Read_queue,FUNCTION,"    * in_SPR_READ_ACK      [0]            : %d",PORT_READ(in_SPR_READ_ACK      [0]));
     39    log_printf(TRACE,Read_queue,FUNCTION,"    * in_SPR_READ_DATA_VAL [0]            : %d",PORT_READ(in_SPR_READ_DATA_VAL [0]));
    3940
    4041    internal_READ_QUEUE_OUT_DATA_RC     = (// Test if have an previous access
     
    6061            if (_queue_head->_num_reg_rc == PORT_READ(in_SPR_WRITE_NUM_REG [i]))
    6162              {
    62                 log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL   - bypass hit (%d)",i);
     63                log_printf(TRACE,Read_queue,FUNCTION,"  * internal_READ_QUEUE_OUT_DATA_RC_VAL   - bypass hit (%d)",i);
    6364                internal_READ_QUEUE_OUT_DATA_RC_VAL = 1;
    6465#ifdef SYSTEMC_VHDL_COMPATIBILITY
     
    7475    PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC    ,internal_READ_QUEUE_OUT_DATA_RC    );
    7576
    76     log_printf(FUNC,Read_queue,FUNCTION,"End");
     77    log_end(Read_queue,FUNCTION);
    7778  };
    7879
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_genMealy_read_queue_out_val.cpp

    r81 r88  
    2222  void Read_queue::genMealy_read_queue_out_val (void)
    2323  {
    24     log_printf(FUNC,Read_queue,FUNCTION,"Begin");
     24    log_begin(Read_queue,FUNCTION);
     25    log_function(Read_queue,FUNCTION,_name.c_str());
    2526
    2627    internal_READ_QUEUE_OUT_READ_RA_VAL = (// Previous value
     
    99100    PORT_WRITE(out_READ_QUEUE_OUT_VAL, internal_READ_QUEUE_OUT_VAL);
    100101
    101     log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_VAL           : %d",internal_READ_QUEUE_OUT_VAL);
    102     log_printf(TRACE,Read_queue,FUNCTION,"   * _queue->empty()                     : %d",_queue->empty());
    103     log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RA_VAL : %d",internal_READ_QUEUE_OUT_READ_RA_VAL);
    104     log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_ra_val         : %d",_queue_head->_read_ra_val);
    105     log_printf(TRACE,Read_queue,FUNCTION,"     * in_GPR_READ_ACK      [0]          : %d",PORT_READ(in_GPR_READ_ACK      [0]));
    106     log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RB_VAL : %d",internal_READ_QUEUE_OUT_READ_RB_VAL);
    107     log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_rb_val         : %d",_queue_head->_read_rb_val);
    108     log_printf(TRACE,Read_queue,FUNCTION,"     * in_GPR_READ_ACK      [1]          : %d",PORT_READ(in_GPR_READ_ACK      [1]));
    109     log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RC_VAL : %d",internal_READ_QUEUE_OUT_READ_RC_VAL);
    110     log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_rc_val         : %d",_queue_head->_read_rc_val);
    111     log_printf(TRACE,Read_queue,FUNCTION,"     * in_SPR_READ_ACK      [0]          : %d",PORT_READ(in_SPR_READ_ACK      [0]));
     102    log_printf(TRACE,Read_queue,FUNCTION,"  * internal_READ_QUEUE_OUT_VAL           : %d",internal_READ_QUEUE_OUT_VAL);
     103    log_printf(TRACE,Read_queue,FUNCTION,"    * _queue->empty()                     : %d",_queue->empty());
     104    log_printf(TRACE,Read_queue,FUNCTION,"    * internal_READ_QUEUE_OUT_READ_RA_VAL : %d",internal_READ_QUEUE_OUT_READ_RA_VAL);
     105    log_printf(TRACE,Read_queue,FUNCTION,"      * _queue_head->_read_ra_val         : %d",_queue_head->_read_ra_val);
     106    log_printf(TRACE,Read_queue,FUNCTION,"      * in_GPR_READ_ACK      [0]          : %d",PORT_READ(in_GPR_READ_ACK      [0]));
     107    log_printf(TRACE,Read_queue,FUNCTION,"    * internal_READ_QUEUE_OUT_READ_RB_VAL : %d",internal_READ_QUEUE_OUT_READ_RB_VAL);
     108    log_printf(TRACE,Read_queue,FUNCTION,"      * _queue_head->_read_rb_val         : %d",_queue_head->_read_rb_val);
     109    log_printf(TRACE,Read_queue,FUNCTION,"      * in_GPR_READ_ACK      [1]          : %d",PORT_READ(in_GPR_READ_ACK      [1]));
     110    log_printf(TRACE,Read_queue,FUNCTION,"    * internal_READ_QUEUE_OUT_READ_RC_VAL : %d",internal_READ_QUEUE_OUT_READ_RC_VAL);
     111    log_printf(TRACE,Read_queue,FUNCTION,"      * _queue_head->_read_rc_val         : %d",_queue_head->_read_rc_val);
     112    log_printf(TRACE,Read_queue,FUNCTION,"      * in_SPR_READ_ACK      [0]          : %d",PORT_READ(in_SPR_READ_ACK      [0]));
    112113
    113     log_printf(FUNC,Read_queue,FUNCTION,"End");
     114    log_end(Read_queue,FUNCTION);
    114115  };
    115116
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_genMoore.cpp

    r81 r88  
    2222  void Read_queue::genMoore (void)
    2323  {
    24     log_printf(FUNC,Read_queue,FUNCTION,"Begin");
     24    log_begin(Read_queue,FUNCTION);
     25    log_function(Read_queue,FUNCTION,_name.c_str());
    2526
    2627    bool not_full  = not (_queue->size() == _param->_size_queue);
     
    3940    if(_param->_have_port_ooo_engine_id)
    4041      PORT_WRITE (out_READ_QUEUE_OUT_OOO_ENGINE_ID, _queue_head->_ooo_engine_id);
    41     if(_param->_have_port_rob_id       )
     42    if(_param->_have_port_rob_ptr      )
    4243      PORT_WRITE (out_READ_QUEUE_OUT_ROB_ID      , _queue_head->_rob_id      );
    4344    PORT_WRITE (out_READ_QUEUE_OUT_OPERATION   , _queue_head->_operation   );
     
    7980    PORT_WRITE (out_SPR_READ_VAL           [0], not_empty and _queue_head->_read_rc_val);
    8081    if(_param->_have_port_ooo_engine_id)
    81       PORT_WRITE (out_SPR_READ_OOO_ENGINE_ID [0],               _queue_head->_ooo_engine_id);
     82    PORT_WRITE (out_SPR_READ_OOO_ENGINE_ID [0],               _queue_head->_ooo_engine_id);
    8283    PORT_WRITE (out_SPR_READ_NUM_REG       [0],               _queue_head->_num_reg_rc);
    8384                   
    84     log_printf(FUNC,Read_queue,FUNCTION,"End");
     85    log_end(Read_queue,FUNCTION);
    8586  };
    8687
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_transition.cpp

    r81 r88  
    2424  void Read_queue::transition (void)
    2525  {
    26     log_printf(FUNC,Read_queue,FUNCTION,"Begin");
     26    log_begin(Read_queue,FUNCTION);
     27    log_function(Read_queue,FUNCTION,_name.c_str());
    2728
    2829    if (PORT_READ(in_NRESET) == 0)
     
    3334        // > 2) flush all slot in one cycle
    3435
    35         while (_queue->empty() == false)
    36           _queue->pop();
     36        _queue->clear();
     37
     38        // Init, else error in registerfile
     39        _queue_head->_ooo_engine_id = 0;
    3740      }
    3841    else
     
    4447//        cout << (*_queue_head) << endl;
    4548
    46         log_printf(TRACE,Read_queue,FUNCTION,"Read_queue size (begin) : %d",_queue->size());
     49        log_printf(TRACE,Read_queue,FUNCTION,"  * Read_queue size (begin) : %d",(int)_queue->size());
    4750        // Write to read_queue
    4851
     
    5154        bool need_new_head = false;
    5255       
    53         log_printf(TRACE,Read_queue,FUNCTION," * test transaction READ_QUEUE_IN  : %d,%d",PORT_READ(in_READ_QUEUE_IN_VAL), not_full);
     56        log_printf(TRACE,Read_queue,FUNCTION,"    * test transaction READ_QUEUE_IN  : %d,%d",PORT_READ(in_READ_QUEUE_IN_VAL), not_full);
    5457        if ((PORT_READ(in_READ_QUEUE_IN_VAL) == 1) and not_full)
    5558          {
     
    6265            if(_param->_have_port_ooo_engine_id)
    6366              entry->_ooo_engine_id= PORT_READ(in_READ_QUEUE_IN_OOO_ENGINE_ID);
    64             if(_param->_have_port_rob_id       )
     67            if(_param->_have_port_rob_ptr      )
    6568              entry->_rob_id       = PORT_READ(in_READ_QUEUE_IN_ROB_ID      );
    6669            entry->_operation    = PORT_READ(in_READ_QUEUE_IN_OPERATION   );
     
    8285            entry->_num_reg_re   = PORT_READ(in_READ_QUEUE_IN_NUM_REG_RE  );
    8386
    84             log_printf(TRACE,Read_queue,FUNCTION,"   * push (id : %d-%d)",entry->_context_id, entry->_rob_id);
    85             _queue->push(entry);
    86 
     87            log_printf(TRACE,Read_queue,FUNCTION,"    * push (id : %d-%d)",entry->_context_id, entry->_rob_id);
     88            _queue->push_back(entry);
    8789
    8890            // read next new head
    8991            if (empty)
    9092              {
    91                 log_printf(TRACE,Read_queue,FUNCTION,"     * queue was    empty");
     93                log_printf(TRACE,Read_queue,FUNCTION,"    * queue was    empty");
    9294                need_new_head = true;
    9395              }
     
    9597
    9698        // Read from read_queue
    97         log_printf(TRACE,Read_queue,FUNCTION," * test transaction READ_QUEUE_OUT : %d,%d",internal_READ_QUEUE_OUT_VAL, PORT_READ(in_READ_QUEUE_OUT_ACK));
     99        log_printf(TRACE,Read_queue,FUNCTION,"  * test transaction READ_QUEUE_OUT : %d,%d",internal_READ_QUEUE_OUT_VAL, PORT_READ(in_READ_QUEUE_OUT_ACK));
    98100        if ((    internal_READ_QUEUE_OUT_VAL  == 1) and
    99101            (PORT_READ(in_READ_QUEUE_OUT_ACK) == 1))
    100102          {
    101103            // Pop the entry
    102             log_printf(TRACE,Read_queue,FUNCTION,"   * pop  (id : %d-%d)",_queue->front()->_context_id, _queue->front()->_rob_id);
    103             _queue->pop();
     104            log_printf(TRACE,Read_queue,FUNCTION,"    * pop  (id : %d-%d)",_queue->front()->_context_id, _queue->front()->_rob_id);
     105            _queue->pop_front();
    104106
    105107            // read next new head
    106108            if (_queue->empty() == false)
    107109              {
    108                 log_printf(TRACE,Read_queue,FUNCTION,"     * queue was not empty");
     110                log_printf(TRACE,Read_queue,FUNCTION,"    * queue was not empty");
    109111                need_new_head = true;
    110112              }
     
    128130        if (need_new_head == true)
    129131          {
    130             log_printf(TRACE,Read_queue,FUNCTION," * new head");
     132            log_printf(TRACE,Read_queue,FUNCTION,"  * new head");
    131133            (*_queue_head) = (*_queue->front());
    132134          }
     
    138140//        cout << (*_queue_head) << endl;
    139141
    140         log_printf(TRACE,Read_queue,FUNCTION,"Read_queue size (end  ) : %d",_queue->size());
     142#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Read_queue == true)
     143        log_printf(TRACE,Read_queue,FUNCTION,"  * Dump Read_queue");
     144        log_printf(TRACE,Read_queue,FUNCTION,"    * size : %d",(int)_queue->size());
     145
     146        if (_queue->size()>0)
     147          {
     148//   protected : Tread_queue_head_entry_t       * _queue_head;
     149//   protected : std::queue<Tread_queue_entry_t *>   * _queue;
     150           
     151            log_printf(TRACE,Read_queue,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)",
     152                       0,
     153
     154                       _queue_head->_context_id           ,
     155                       _queue_head->_front_end_id         ,
     156                       _queue_head->_ooo_engine_id        ,
     157                       _queue_head->_rob_id               ,
     158
     159                       _queue_head->_type                 ,
     160                       _queue_head->_operation            ,
     161
     162                       _queue_head->_store_queue_ptr_write,
     163                       _queue_head->_load_queue_ptr_write ,
     164
     165                       _queue_head->_has_immediat         ,
     166                       _queue_head->_immediat             ,
     167
     168                       _queue_head->_read_ra              ,
     169                       _queue_head->_read_ra_val          ,
     170                       _queue_head->_num_reg_ra           ,
     171                       _queue_head->_data_ra_val          ,
     172                       _queue_head->_data_ra              ,
     173
     174                       _queue_head->_read_rb              ,
     175                       _queue_head->_read_rb_val          ,
     176                       _queue_head->_num_reg_rb           ,
     177                       _queue_head->_data_rb_val          ,
     178                       _queue_head->_data_rb              ,
     179
     180                       _queue_head->_read_rc              ,
     181                       _queue_head->_read_rc_val          ,
     182                       _queue_head->_num_reg_rc           ,
     183                       _queue_head->_data_rc_val          ,
     184                       _queue_head->_data_rc              ,
     185
     186                       _queue_head->_write_rd             ,
     187                       _queue_head->_num_reg_rd           ,
     188                       
     189                       _queue_head->_write_re             ,
     190                       _queue_head->_num_reg_re           ,
     191
     192                       toString_type(_queue_head->_type).c_str());
     193
     194
     195            std::list<Tread_queue_entry_t *>::iterator it=_queue->begin();
     196            ++it; // first is already printed
     197            uint32_t i=1;
     198
     199            for (;it!=_queue->end(); ++it)
     200              {
     201                log_printf(TRACE,Read_queue,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d   %.4d           , %.1d   %.4d           , %.1d   %.4d     , %.1d %.4d, %.1d %.4d (%s)",
     202                           i,
     203                           
     204                           (*it)->_context_id           ,
     205                           (*it)->_front_end_id         ,
     206                           (*it)->_ooo_engine_id        ,
     207                           (*it)->_rob_id               ,
     208                           
     209                           (*it)->_type                 ,
     210                           (*it)->_operation            ,
     211                           
     212                           (*it)->_store_queue_ptr_write,
     213                           (*it)->_load_queue_ptr_write ,
     214                           
     215                           (*it)->_has_immediat         ,
     216                           (*it)->_immediat             ,
     217                           
     218                           (*it)->_read_ra              ,
     219//                         (*it)->_read_ra_val          ,
     220                           (*it)->_num_reg_ra           ,
     221//                         (*it)->_data_ra_val          ,
     222//                         (*it)->_data_ra              ,
     223                           
     224                           (*it)->_read_rb              ,
     225//                         (*it)->_read_rb_val          ,
     226                           (*it)->_num_reg_rb           ,
     227//                         (*it)->_data_rb_val          ,
     228//                         (*it)->_data_rb              ,
     229                           
     230                           (*it)->_read_rc              ,
     231//                         (*it)->_read_rc_val          ,
     232                           (*it)->_num_reg_rc           ,
     233//                         (*it)->_data_rc_val          ,
     234//                         (*it)->_data_rc              ,
     235                           
     236                           (*it)->_write_rd             ,
     237                           (*it)->_num_reg_rd           ,
     238                           
     239                           (*it)->_write_re             ,
     240                           (*it)->_num_reg_re           ,
     241
     242                           toString_type((*it)->_type).c_str());
     243
     244                ++i;
     245              }
     246          }
     247#endif
     248
     249
    141250      }
    142251
    143252#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    144     end_cycle ();
     253        end_cycle ();
    145254#endif
    146255
    147     log_printf(FUNC,Read_queue,FUNCTION,"End");
     256    log_end(Read_queue,FUNCTION);
    148257  };
    149258
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/Makefile

    r81 r88  
    2424library_clean                   : Reservation_station_library_clean
    2525
     26local_clean                     :
     27
    2628include                         ../Makefile.deps
    2729include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/include/test.h

    r81 r88  
    1515#include <sys/time.h>
    1616
     17#include "Common/include/Time.h"
    1718#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Reservation_station.h"
    1819
     
    3132              morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Parameters * param);
    3233
    33 class Time
    34 {
    35 private : timeval time_begin;
    36 // private : timeval time_end;
    37  
    38 public  : Time ()
    39   {
    40     gettimeofday(&time_begin     ,NULL);
    41   };
    42 
    43 public  : ~Time ()
    44   {
    45     cout << *this;
    46   };
    47 
    48 public  : friend ostream& operator<< (ostream& output_stream,
    49                                       const Time & x)
    50   {
    51     timeval time_end;
    52    
    53     gettimeofday(&time_end       ,NULL);
    54    
    55     uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
    56 
    57     double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
    58    
    59     output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl;
    60 
    61     return output_stream;
    62   }
    63 };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/src/main.cpp

    r81 r88  
    8686         ,size_store_queue
    8787         ,size_load_queue
     88         ,true //is_toplevel
    8889         );
    8990     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/src/test.cpp

    r82 r88  
    2222#endif
    2323
     24  Tusage_t _usage = USE_ALL;
     25
     26//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     27//   _usage = usage_unset(_usage,USE_VHDL                 );
     28//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     29//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     30//   _usage = usage_unset(_usage,USE_POSITION             );
     31   _usage = usage_unset(_usage,USE_STATISTICS           );
     32//   _usage = usage_unset(_usage,USE_INFORMATION          );
     33
    2434  Reservation_station * _Reservation_station = new Reservation_station
    2535    (name.c_str(),
     
    2838#endif
    2939     _param,
    30      USE_ALL);
     40     _usage);
    3141 
    3242#ifdef SYSTEMC
     
    185195  if (_param->_have_port_ooo_engine_id)
    186196  (*(_Reservation_station-> in_INSERT_OOO_ENGINE_ID    )) (*( in_INSERT_OOO_ENGINE_ID    ));
    187   if (_param->_have_port_rob_id)
     197  if (_param->_have_port_rob_ptr)
    188198  (*(_Reservation_station-> in_INSERT_ROB_ID           )) (*( in_INSERT_ROB_ID           ));
    189199  (*(_Reservation_station-> in_INSERT_OPERATION        )) (*( in_INSERT_OPERATION        ));
     
    221231  if (_param->_have_port_ooo_engine_id)
    222232  (*(_Reservation_station->out_RETIRE_OOO_ENGINE_ID  [i])) (*(out_RETIRE_OOO_ENGINE_ID  [i]));
    223   if (_param->_have_port_rob_id)
     233  if (_param->_have_port_rob_ptr)
    224234  (*(_Reservation_station->out_RETIRE_ROB_ID         [i])) (*(out_RETIRE_ROB_ID         [i]));
    225235  (*(_Reservation_station->out_RETIRE_OPERATION      [i])) (*(out_RETIRE_OPERATION      [i]));
     
    417427              if (_param->_have_port_ooo_engine_id)
    418428              in_INSERT_OOO_ENGINE_ID  ->write(insert_ooo_engine_id);
    419               if (_param->_have_port_rob_id)
     429              if (_param->_have_port_rob_ptr)
    420430              in_INSERT_ROB_ID      ->write(request_in);
    421431              in_INSERT_OPERATION   ->write(0);
     
    610620                {
    611621                  Tpacket_t  rob_id;
    612                   if (_param->_have_port_rob_id)
     622                  if (_param->_have_port_rob_ptr)
    613623                    rob_id = out_RETIRE_ROB_ID [i]->read();
    614624                  else
     
    667677  if (_param->_have_port_ooo_engine_id) 
    668678  delete     in_INSERT_OOO_ENGINE_ID  ;
    669   if (_param->_have_port_rob_id
     679  if (_param->_have_port_rob_ptr
    670680  delete     in_INSERT_ROB_ID      ;
    671681  delete     in_INSERT_OPERATION   ;
     
    701711  if (_param->_have_port_ooo_engine_id) 
    702712  delete [] out_RETIRE_OOO_ENGINE_ID  ;
    703   if (_param->_have_port_rob_id
     713  if (_param->_have_port_rob_ptr
    704714  delete [] out_RETIRE_ROB_ID   ;
    705715  delete [] out_RETIRE_OPERATION   ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Parameters.h

    r81 r88  
    2626  {
    2727    //-----[ fields ]------------------------------------------------------------
    28   public : const uint32_t    _size_queue           ;
    29   public : const uint32_t    _nb_inst_retire       ;
    30   public : const uint32_t    _nb_context           ;
    31   public : const uint32_t    _nb_front_end         ;
    32   public : const uint32_t    _nb_ooo_engine        ;
    33   public : const uint32_t    _nb_packet            ;
    34   public : const uint32_t    _size_general_data    ;
    35   public : const uint32_t    _size_special_data    ;
    36   public : const uint32_t    _nb_general_register  ;
    37   public : const uint32_t    _nb_special_register  ;
    38   public : const uint32_t    _nb_gpr_write         ;
    39   public : const uint32_t    _nb_spr_write         ;
    40   public : const uint32_t    _nb_bypass_write      ;//if nb_bypass=0, then bypass is desactivated
    41   public : const uint32_t    _nb_bypass_memory     ;//if nb_bypass=0, then bypass is desactivated
    42   public : const uint32_t    _size_store_queue     ;
    43   public : const uint32_t    _size_load_queue      ;
     28  public : uint32_t    _size_queue           ;
     29  public : uint32_t    _nb_inst_retire       ;
     30  public : uint32_t    _nb_context           ;
     31  public : uint32_t    _nb_front_end         ;
     32  public : uint32_t    _nb_ooo_engine        ;
     33  public : uint32_t    _nb_packet            ;
     34//public : uint32_t    _size_general_data    ;
     35//public : uint32_t    _size_special_data    ;
     36  public : uint32_t    _nb_general_register  ;
     37  public : uint32_t    _nb_special_register  ;
     38  public : uint32_t    _nb_gpr_write         ;
     39  public : uint32_t    _nb_spr_write         ;
     40  public : uint32_t    _nb_bypass_write      ;//if nb_bypass=0, then bypass is desactivated
     41  public : uint32_t    _nb_bypass_memory     ;//if nb_bypass=0, then bypass is desactivated
     42//public : uint32_t    _size_store_queue     ;
     43//public : uint32_t    _size_load_queue      ;
     44    /*
     45  public : bool        _have_immediat        ;
     46  public : bool        _have_gpr_ra          ;
     47  public : bool        _have_gpr_rb          ;
     48  public : bool        _have_spr_rc          ;
     49  public : bool        _have_gpr_rd          ;
     50  public : bool        _have_spr_re          ;
     51    */
     52//public : uint32_t    _size_context_id      ;
     53//public : uint32_t    _size_front_end_id    ;
     54//public : uint32_t    _size_ooo_engine_id   ;
     55//public : uint32_t    _size_rob_ptr         ;
     56//public : uint32_t    _size_general_register;
     57//public : uint32_t    _size_special_register;
    4458
    45     /*
    46   public : const bool        _have_immediat        ;
    47   public : const bool        _have_gpr_ra          ;
    48   public : const bool        _have_gpr_rb          ;
    49   public : const bool        _have_spr_rc          ;
    50   public : const bool        _have_gpr_rd          ;
    51   public : const bool        _have_spr_re          ;
    52     */
    53   public : const uint32_t    _size_context_id      ;
    54   public : const uint32_t    _size_front_end_id    ;
    55   public : const uint32_t    _size_ooo_engine_id   ;
    56   public : const uint32_t    _size_rob_id          ;
    57   public : const uint32_t    _size_general_register;
    58   public : const uint32_t    _size_special_register;
    59 
    60   public : const bool        _have_port_context_id   ;
    61   public : const bool        _have_port_front_end_id ;
    62   public : const bool        _have_port_ooo_engine_id;
    63   public : const bool        _have_port_rob_id       ;
    64   public : const bool        _have_port_load_queue_ptr;
     59//public : bool        _have_port_context_id   ;
     60//public : bool        _have_port_front_end_id ;
     61//public : bool        _have_port_ooo_engine_id;
     62//public : bool        _have_port_rob_ptr      ;
     63//public : bool        _have_port_load_queue_ptr;
    6564
    6665    //-----[ methods ]-----------------------------------------------------------
     
    8079                        uint32_t nb_bypass_memory   ,
    8180                        uint32_t size_store_queue   ,
    82                         uint32_t size_load_queue    );
     81                        uint32_t size_load_queue    ,
     82                        bool     is_toplevel=false);
    8383
    84   public : Parameters  (Parameters & param) ;
     84//   public : Parameters  (Parameters & param) ;
    8585  public : ~Parameters () ;
     86
     87  public :        void            copy       (void);
    8688
    8789  public :        Parameters_test msg_error  (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Parameters.cpp

    r81 r88  
    3535                          uint32_t nb_bypass_memory   ,
    3636                          uint32_t size_store_queue   ,
    37                           uint32_t size_load_queue    ):
    38     _size_queue            (size_queue           ),
    39     _nb_inst_retire        (nb_inst_retire       ),
    40     _nb_context            (nb_context           ),
    41     _nb_front_end          (nb_front_end         ),
    42     _nb_ooo_engine         (nb_ooo_engine        ),
    43     _nb_packet             (nb_packet            ),
    44     _size_general_data     (size_general_data    ),
    45     _size_special_data     (size_special_data    ),
    46     _nb_general_register   (nb_general_register  ),
    47     _nb_special_register   (nb_special_register  ),
    48     _nb_gpr_write          (nb_gpr_write         ),
    49     _nb_spr_write          (nb_spr_write         ),
    50     _nb_bypass_write       (nb_bypass_write      ),
    51     _nb_bypass_memory      (nb_bypass_memory     ),
    52     _size_store_queue      (size_store_queue     ),
    53     _size_load_queue       (size_load_queue      ),
    54 
    55     _size_context_id       (static_cast<uint32_t>(log2(_nb_context         ))),
    56     _size_front_end_id     (static_cast<uint32_t>(log2(_nb_front_end       ))),
    57     _size_ooo_engine_id    (static_cast<uint32_t>(log2(_nb_ooo_engine      ))),
    58     _size_rob_id           (static_cast<uint32_t>(log2(_nb_packet          ))),
    59     _size_general_register (static_cast<uint32_t>(log2(_nb_general_register))),
    60     _size_special_register (static_cast<uint32_t>(log2(_nb_special_register))),
    61 
    62     _have_port_context_id    (_size_context_id    > 0),
    63     _have_port_front_end_id  (_size_front_end_id  > 0),
    64     _have_port_ooo_engine_id (_size_ooo_engine_id > 0),
    65     _have_port_rob_id        (_size_rob_id        > 0),
    66     _have_port_load_queue_ptr(_size_load_queue    > 1)
     37                          uint32_t size_load_queue    ,
     38                          bool     is_toplevel)
    6739  {
    6840    log_printf(FUNC,Reservation_station,FUNCTION,"Begin");
     41
     42    _size_queue              = size_queue           ;
     43    _nb_inst_retire          = nb_inst_retire       ;
     44    _nb_context              = nb_context           ;
     45    _nb_front_end            = nb_front_end         ;
     46    _nb_ooo_engine           = nb_ooo_engine        ;
     47    _nb_packet               = nb_packet            ;
     48    _nb_general_register     = nb_general_register  ;
     49    _nb_special_register     = nb_special_register  ;
     50    _nb_gpr_write            = nb_gpr_write         ;
     51    _nb_spr_write            = nb_spr_write         ;
     52    _nb_bypass_write         = nb_bypass_write      ;
     53    _nb_bypass_memory        = nb_bypass_memory     ;
     54
    6955    test();
     56
     57    if (is_toplevel)
     58      {
     59        _size_context_id         = log2(_nb_context         );
     60        _size_front_end_id       = log2(_nb_front_end       );
     61        _size_ooo_engine_id      = log2(_nb_ooo_engine      );
     62        _size_rob_ptr            = log2(_nb_packet          );
     63        _size_general_register   = log2(_nb_general_register);
     64        _size_special_register   = log2(_nb_special_register);
     65        _size_general_data       = size_general_data         ;
     66        _size_special_data       = size_special_data         ;
     67        _size_store_queue_ptr    = log2(size_store_queue    );
     68        _size_load_queue_ptr     = log2(size_load_queue     );
     69       
     70        _have_port_context_id    = _size_context_id     > 0;
     71        _have_port_front_end_id  = _size_front_end_id   > 0;
     72        _have_port_ooo_engine_id = _size_ooo_engine_id  > 0;
     73        _have_port_rob_ptr       = _size_rob_ptr        > 0;
     74        _have_port_load_queue_ptr= _size_load_queue_ptr > 0;
     75
     76        copy();
     77      }
     78
    7079    log_printf(FUNC,Reservation_station,FUNCTION,"End");
    7180  };
    7281 
     82// #undef  FUNCTION
     83// #define FUNCTION "Reservation_station::Parameters (copy)"
     84//   Parameters::Parameters (Parameters & param):
     85//     _size_queue            (param._size_queue            ),
     86//     _nb_inst_retire        (param._nb_inst_retire        ),
     87//     _nb_context            (param._nb_context            ),
     88//     _nb_front_end          (param._nb_front_end          ),
     89//     _nb_ooo_engine         (param._nb_ooo_engine         ),
     90//     _nb_packet             (param._nb_packet             ),
     91//     _size_general_data     (param._size_general_data     ),
     92//     _size_special_data     (param._size_special_data     ),
     93//     _nb_general_register   (param._nb_general_register   ),
     94//     _nb_special_register   (param._nb_special_register   ),
     95//     _nb_gpr_write          (param._nb_gpr_write          ),
     96//     _nb_spr_write          (param._nb_spr_write          ),
     97//     _nb_bypass_write       (param._nb_bypass_write       ),
     98//     _nb_bypass_memory      (param._nb_bypass_memory      ),
     99//     _size_store_queue      (param._size_store_queue      ),
     100//     _size_load_queue       (param._size_load_queue       ),
     101
     102//     _size_context_id       (param._size_context_id       ),
     103//     _size_front_end_id     (param._size_front_end_id     ),
     104//     _size_ooo_engine_id    (param._size_ooo_engine_id    ),
     105//     _size_rob_id           (param._size_rob_id           ),
     106//     _size_general_register (param._size_general_register ),
     107//     _size_special_register (param._size_special_register ),
     108
     109//     _have_port_context_id    (param._have_port_context_id   ),
     110//     _have_port_front_end_id  (param._have_port_front_end_id ),
     111//     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
     112//     _have_port_rob_id        (param._have_port_rob_id       ),
     113//     _have_port_load_queue_ptr(param._have_port_load_queue_ptr)
     114//   {
     115//     log_printf(FUNC,Reservation_station,FUNCTION,"Begin");
     116//     test();
     117//     log_printf(FUNC,Reservation_station,FUNCTION,"End");
     118//   };
     119
    73120#undef  FUNCTION
    74 #define FUNCTION "Reservation_station::Parameters (copy)"
    75   Parameters::Parameters (Parameters & param):
    76     _size_queue            (param._size_queue            ),
    77     _nb_inst_retire        (param._nb_inst_retire        ),
    78     _nb_context            (param._nb_context            ),
    79     _nb_front_end          (param._nb_front_end          ),
    80     _nb_ooo_engine         (param._nb_ooo_engine         ),
    81     _nb_packet             (param._nb_packet             ),
    82     _size_general_data     (param._size_general_data     ),
    83     _size_special_data     (param._size_special_data     ),
    84     _nb_general_register   (param._nb_general_register   ),
    85     _nb_special_register   (param._nb_special_register   ),
    86     _nb_gpr_write          (param._nb_gpr_write          ),
    87     _nb_spr_write          (param._nb_spr_write          ),
    88     _nb_bypass_write       (param._nb_bypass_write       ),
    89     _nb_bypass_memory      (param._nb_bypass_memory      ),
    90     _size_store_queue      (param._size_store_queue      ),
    91     _size_load_queue       (param._size_load_queue       ),
    92 
    93     _size_context_id       (param._size_context_id       ),
    94     _size_front_end_id     (param._size_front_end_id     ),
    95     _size_ooo_engine_id    (param._size_ooo_engine_id    ),
    96     _size_rob_id           (param._size_rob_id           ),
    97     _size_general_register (param._size_general_register ),
    98     _size_special_register (param._size_special_register ),
    99 
    100     _have_port_context_id    (param._have_port_context_id   ),
    101     _have_port_front_end_id  (param._have_port_front_end_id ),
    102     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
    103     _have_port_rob_id        (param._have_port_rob_id       ),
    104     _have_port_load_queue_ptr(param._have_port_load_queue_ptr)
     121#define FUNCTION "Reservation_station::~Parameters"
     122  Parameters::~Parameters (void)
    105123  {
    106124    log_printf(FUNC,Reservation_station,FUNCTION,"Begin");
    107     test();
    108125    log_printf(FUNC,Reservation_station,FUNCTION,"End");
    109126  };
    110127
    111128#undef  FUNCTION
    112 #define FUNCTION "Reservation_station::~Parameters"
    113   Parameters::~Parameters ()
     129#define FUNCTION "Reservation_station::copy"
     130  void Parameters::copy (void)
    114131  {
    115132    log_printf(FUNC,Reservation_station,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Parameters_print.cpp

    r81 r88  
    4242    xml.singleton_begin("nb_bypass_write    "); xml.attribut("value",toString(_nb_bypass_write    )); xml.singleton_end();
    4343    xml.singleton_begin("nb_bypass_memory   "); xml.attribut("value",toString(_nb_bypass_memory   )); xml.singleton_end();
    44     xml.singleton_begin("size_store_queue   "); xml.attribut("value",toString(_size_store_queue   )); xml.singleton_end();
    45     xml.singleton_begin("size_load_queue    "); xml.attribut("value",toString(_size_load_queue    )); xml.singleton_end();
     44//  xml.singleton_begin("size_store_queue   "); xml.attribut("value",toString(_size_store_queue   )); xml.singleton_end();
     45//  xml.singleton_begin("size_load_queue    "); xml.attribut("value",toString(_size_load_queue    )); xml.singleton_end();
    4646    xml.balise_close();
    4747
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station.cpp

    r82 r88  
    3939    log_printf(FUNC,Reservation_station,FUNCTION,"Begin");
    4040
     41#if DEBUG_Reservation_station == true
     42    log_printf(INFO,Reservation_station,FUNCTION,_("<%s> Parameters"),_name.c_str());
     43
     44    std::cout << *param << std::endl;
     45#endif   
     46
    4147#ifdef SYSTEMC
    4248    log_printf(INFO,Reservation_station,FUNCTION,"Allocation");
     
    4652
    4753#ifdef STATISTICS
    48     log_printf(INFO,Reservation_station,FUNCTION,"Allocation of statistics");
    49 
    50     statistics_declaration(param_statistics);
     54    if (usage_is_set(_usage,USE_STATISTICS))
     55      {
     56        log_printf(INFO,Reservation_station,FUNCTION,"Allocation of statistics");
     57       
     58        statistics_declaration(param_statistics);
     59      }
    5160#endif
    5261
    5362#ifdef VHDL
    54     // generate the vhdl
    55     log_printf(INFO,Reservation_station,FUNCTION,"Generate the vhdl");
    56 
    57     vhdl();
     63    if (usage_is_set(_usage,USE_VHDL))
     64      {
     65        // generate the vhdl
     66        log_printf(INFO,Reservation_station,FUNCTION,"Generate the vhdl");
     67       
     68        vhdl();
     69      }
    5870#endif
    5971
    6072#ifdef SYSTEMC
     73    if (usage_is_set(_usage,USE_SYSTEMC))
     74      {
    6175//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    6276    log_printf(INFO,Reservation_station,FUNCTION,"Method - transition");
     
    8094    // List dependency information
    8195#endif   
    82 
     96      }
    8397#endif
    8498    log_printf(FUNC,Reservation_station,FUNCTION,"End");
     
    92106
    93107#ifdef STATISTICS
    94     log_printf(INFO,Reservation_station,FUNCTION,"Generate Statistics file");
    95 
    96     delete _stat;
     108    if (usage_is_set(_usage,USE_STATISTICS))
     109      {
     110        log_printf(INFO,Reservation_station,FUNCTION,"Generate Statistics file");
     111       
     112        delete _stat;
     113      }
    97114#endif
    98115
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_allocation.cpp

    r82 r88  
    33 * $Id$
    44 *
    5  * [ Description ]
     5 * [ Description ]
    66 *
    77 */
     
    3737    _interfaces = entity->set_interfaces();
    3838
    39     // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     39    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4040
    4141      Interface * interface = _interfaces->set_interface(""
     
    5050     in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
    5151
    52     // ~~~~~[ Interface : "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~
     52    // ~~~~~[ Interface : "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5353    {
    5454      Interface_fifo * interface = _interfaces->set_interface("insert"
     
    6868      if (_param->_have_port_ooo_engine_id)
    6969       in_INSERT_OOO_ENGINE_ID  = interface->set_signal_in <Tcontext_t        > ("ooo_engine_id"  ,_param->_size_ooo_engine_id    );
    70       if (_param->_have_port_rob_id)
    71        in_INSERT_ROB_ID         = interface->set_signal_in <Tpacket_t         > ("rob_id"         ,_param->_size_rob_id        );
     70      if (_param->_have_port_rob_ptr)
     71       in_INSERT_ROB_ID         = interface->set_signal_in <Tpacket_t         > ("rob_id"         ,_param->_size_rob_ptr        );
    7272       in_INSERT_OPERATION      = interface->set_signal_in <Toperation_t      > ("operation"      ,_param->_size_operation        );
    7373       in_INSERT_TYPE           = interface->set_signal_in <Ttype_t           > ("type"           ,_param->_size_type             );
    74        in_INSERT_STORE_QUEUE_PTR_WRITE = interface->set_signal_in <Tlsq_ptr_t> ("store_queue_ptr_write" ,log2(_param->_size_store_queue));
     74       in_INSERT_STORE_QUEUE_PTR_WRITE = interface->set_signal_in <Tlsq_ptr_t> ("store_queue_ptr_write" ,_param->_size_store_queue_ptr);
    7575       if (_param->_have_port_load_queue_ptr)
    76        in_INSERT_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_in <Tlsq_ptr_t> ("load_queue_ptr_write"  ,log2(_param->_size_load_queue) );
     76       in_INSERT_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_in <Tlsq_ptr_t> ("load_queue_ptr_write"  ,_param->_size_load_queue_ptr );
    7777       in_INSERT_HAS_IMMEDIAT   = interface->set_signal_in <Tcontrol_t        > ("has_immediat"   ,1                             );
    7878       in_INSERT_IMMEDIAT       = interface->set_signal_in <Tgeneral_data_t   > ("immediat"       ,_param->_size_general_data     );
     
    9595     }
    9696
    97     // ~~~~~[ Interface : "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~
     97    // ~~~~~[ Interface : "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~
    9898    out_RETIRE_VAL            = new SC_OUT(Tcontrol_t        ) * [_param->_nb_inst_retire];
    9999     in_RETIRE_ACK            = new SC_IN (Tcontrol_t        ) * [_param->_nb_inst_retire];
     
    104104    if (_param->_have_port_ooo_engine_id)
    105105    out_RETIRE_OOO_ENGINE_ID  = new SC_OUT(Tcontext_t        ) * [_param->_nb_inst_retire];
    106     if (_param->_have_port_rob_id)
     106    if (_param->_have_port_rob_ptr)
    107107    out_RETIRE_ROB_ID         = new SC_OUT(Tpacket_t         ) * [_param->_nb_inst_retire];
    108108    out_RETIRE_OPERATION      = new SC_OUT(Toperation_t      ) * [_param->_nb_inst_retire];
     
    138138        if (_param->_have_port_ooo_engine_id)
    139139        out_RETIRE_OOO_ENGINE_ID[i] = interface->set_signal_out<Tcontext_t        > ("ooo_engine_id",_param->_size_ooo_engine_id);
    140         if (_param->_have_port_rob_id)
    141         out_RETIRE_ROB_ID       [i] = interface->set_signal_out<Tpacket_t         > ("rob_id"       ,_param->_size_rob_id);
     140        if (_param->_have_port_rob_ptr)
     141        out_RETIRE_ROB_ID       [i] = interface->set_signal_out<Tpacket_t         > ("rob_id"       ,_param->_size_rob_ptr);
    142142        out_RETIRE_OPERATION    [i] = interface->set_signal_out<Toperation_t      > ("operation"    ,_param->_size_operation);
    143143        out_RETIRE_TYPE         [i] = interface->set_signal_out<Ttype_t           > ("type"         ,_param->_size_type);
    144         out_RETIRE_STORE_QUEUE_PTR_WRITE [i] = interface->set_signal_out<Tlsq_ptr_t> ("store_queue_ptr_write" ,log2(_param->_size_store_queue));
     144        out_RETIRE_STORE_QUEUE_PTR_WRITE [i] = interface->set_signal_out<Tlsq_ptr_t> ("store_queue_ptr_write" ,_param->_size_store_queue_ptr);
    145145        if (_param->_have_port_load_queue_ptr)
    146         out_RETIRE_LOAD_QUEUE_PTR_WRITE  [i] = interface->set_signal_out<Tlsq_ptr_t> ("load_queue_ptr_write"  ,log2(_param->_size_load_queue) );
     146        out_RETIRE_LOAD_QUEUE_PTR_WRITE  [i] = interface->set_signal_out<Tlsq_ptr_t> ("load_queue_ptr_write"  ,_param->_size_load_queue_ptr );
    147147
    148148        out_RETIRE_HAS_IMMEDIAT [i] = interface->set_signal_out<Tcontrol_t        > ("has_immediat" ,1);
     
    157157      }
    158158
    159     // ~~~~~[ Interface : "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     159    // ~~~~~[ Interface : "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    160160     in_GPR_WRITE_VAL          = new SC_IN (Tcontrol_t        ) * [_param->_nb_gpr_write];
    161161     if (_param->_have_port_ooo_engine_id)
     
    181181      }
    182182
    183     // ~~~~~[ Interface : "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     183    // ~~~~~[ Interface : "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    184184     in_SPR_WRITE_VAL          = new SC_IN (Tcontrol_t        ) * [_param->_nb_spr_write];
    185185     if (_param->_have_port_ooo_engine_id)
     
    205205      }
    206206
    207     // ~~~~~[ Interface : "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     207    // ~~~~~[ Interface : "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    208208     if (_param->_have_port_ooo_engine_id)
    209209     in_BYPASS_WRITE_OOO_ENGINE_ID  = new SC_IN (Tcontext_t        ) * [_param->_nb_bypass_write];
     
    235235      }
    236236
    237     // ~~~~~[ Interface : "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     237    // ~~~~~[ Interface : "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    238238     in_BYPASS_MEMORY_VAL          = new SC_IN (Tcontrol_t        ) * [_param->_nb_bypass_memory];
    239239     if (_param->_have_port_ooo_engine_id)
     
    260260
    261261
    262     // ~~~~~[ internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     262    if (usage_is_set(_usage,USE_SYSTEMC))
     263      {
     264    // ~~~~~[ internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    263265    internal_RETIRE_VAL  = new Tcontrol_t [_param->_nb_inst_retire];
    264266    internal_RETIRE_SLOT = new uint32_t   [_param->_nb_inst_retire];
    265 
    266     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    267 
    268 #ifdef POSITION
    269     _component->generate_file();
     267      }
     268
     269    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     270
     271#ifdef POSITION
     272    if (usage_is_set(_usage,USE_POSITION))
     273      _component->generate_file();
    270274#endif
    271275#ifdef  SYSTEMC_VHDL_COMPATIBILITY
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_deallocation.cpp

    r81 r88  
    2828    log_printf(FUNC,Reservation_station,FUNCTION,"Begin");
    2929
     30    if (usage_is_set(_usage,USE_SYSTEMC))
     31      {
    3032    delete     in_CLOCK ;
    3133    delete     in_NRESET;
     
    3941    if (_param->_have_port_ooo_engine_id)
    4042    delete     in_INSERT_OOO_ENGINE_ID ;
    41     if (_param->_have_port_rob_id)
     43    if (_param->_have_port_rob_ptr)
    4244    delete     in_INSERT_ROB_ID        ;
    4345    delete     in_INSERT_OPERATION     ;
     
    7375    if (_param->_have_port_ooo_engine_id)
    7476    delete [] out_RETIRE_OOO_ENGINE_ID ;
    75     if (_param->_have_port_rob_id)
     77    if (_param->_have_port_rob_ptr)
    7678    delete [] out_RETIRE_ROB_ID        ;
    7779    delete [] out_RETIRE_OPERATION     ;
     
    119121    // ~~~~~[ internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    120122    delete []  internal_RETIRE_VAL;
    121 
     123    delete []  internal_RETIRE_SLOT;
     124      }
    122125    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    123126
     
    139142}; // end namespace multi_execute_loop
    140143}; // end namespace core
    141 
    142144}; // end namespace behavioural
    143145}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_end_cycle.cpp

    r81 r88  
    2626
    2727#ifdef STATISTICS
    28     _stat->end_cycle();
     28    if (usage_is_set(_usage,USE_STATISTICS))
     29      _stat->end_cycle();
    2930#endif   
    3031
     
    3233    // Evaluation before read the ouput signal
    3334//     sc_start(0);
    34     _interfaces->testbench();
     35    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
     36      _interfaces->testbench();
    3537#endif
    3638    log_printf(FUNC,Reservation_station,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_genMoore.cpp

    r81 r88  
    2424  void Reservation_station::genMoore (void)
    2525  {
    26     log_printf(FUNC,Reservation_station,FUNCTION,"Begin");
     26    log_begin(Reservation_station,FUNCTION);
     27    log_function(Reservation_station,FUNCTION,_name.c_str());
    2728
    2829    // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~
     
    9798            if (_param->_have_port_ooo_engine_id)
    9899            PORT_WRITE(out_RETIRE_OOO_ENGINE_ID [i],_queue[index_find]._ooo_engine_id);
    99             if (_param->_have_port_rob_id)
     100            if (_param->_have_port_rob_ptr)
    100101            PORT_WRITE(out_RETIRE_ROB_ID        [i],_queue[index_find]._rob_id);
    101102            PORT_WRITE(out_RETIRE_OPERATION     [i],_queue[index_find]._operation);
     
    116117      }
    117118
    118     log_printf(FUNC,Reservation_station,FUNCTION,"End");
     119    log_end(Reservation_station,FUNCTION);
    119120  };
    120121
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_transition.cpp

    r81 r88  
    2020
    2121#ifdef  SYSTEMC_VHDL_COMPATIBILITY
    22 #define dump_queue() \
    23   do\
    24   {\
    25    log_printf(TRACE,Reservation_station,FUNCTION," * dump queue");\
    26    log_printf(TRACE,Reservation_station,FUNCTION,"   * nb_elt : %d",_queue_nb_elt);\
    27    for (uint32_t j=0;j<_param->_size_queue; j++)\
    28    {\
    29      cout << "\t"\
    30           << "[" << j << "] "\
    31           << "{" << _queue[j]._rob_id << " - "<< _queue[j]._context_id << "} " << " - "<< _queue[j]._front_end_id << "} " << " - "<< _queue[j]._ooo_engine_id << "} "\
    32           << _queue[j]._data_ra_val << ", "\
    33           << _queue[j]._num_reg_ra  << " - "\
    34           << _queue[j]._data_rb_val << ","\
    35           << _queue[j]._num_reg_rb  << " - "\
    36           << _queue[j]._data_rc_val << ","\
    37           << _queue[j]._num_reg_rc  \
    38           << endl;\
    39     }\
    40   } while (0)
    41 #else
    42 #define dump_queue() \
    43   do\
    44   {\
    45    log_printf(TRACE,Reservation_station,FUNCTION," * dump queue");\
    46    log_printf(TRACE,Reservation_station,FUNCTION,"   * nb_elt : %d",_queue_nb_elt);\
    47    for (uint32_t j=0;j<_param->_size_queue; j++)\
    48    {\
    49      cout << "\t"\
    50           << "[" << (*_queue_control)[j] << "] "\
    51           << "{" << _queue[(*_queue_control)[j]]._rob_id << " - "<< _queue[(*_queue_control)[j]]._context_id << "} " << " - "<< _queue[(*_queue_control)[j]]._front_end_id << "} " << " - "<< _queue[(*_queue_control)[j]]._ooo_engine_id << "} "\
    52           << _queue[(*_queue_control)[j]]._data_ra_val << ", "\
    53           << _queue[(*_queue_control)[j]]._num_reg_ra  << " - "\
    54           << _queue[(*_queue_control)[j]]._data_rb_val << ","\
    55           << _queue[(*_queue_control)[j]]._num_reg_rb  << " - "\
    56           << _queue[(*_queue_control)[j]]._data_rc_val << ","\
    57           << _queue[(*_queue_control)[j]]._num_reg_rc  \
    58           << endl;\
    59     }\
    60   } while (0)
     22#define dump_queue()                                                    \
     23  do                                                                    \
     24    {                                                                   \
     25      log_printf(TRACE,Reservation_station,FUNCTION,"  * Dump Reservation Station");  \
     26      for (uint32_t it_dump=0;it_dump<_param->_size_queue; it_dump++)   \
     27        log_printf(TRACE,Reservation_station,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \
     28                   it_dump,                                             \
     29                   _queue[it_dump]._context_id           ,              \
     30                   _queue[it_dump]._front_end_id         ,              \
     31                   _queue[it_dump]._ooo_engine_id        ,              \
     32                   _queue[it_dump]._rob_id               ,              \
     33                   _queue[it_dump]._type                 ,              \
     34                   _queue[it_dump]._operation            ,              \
     35                   _queue[it_dump]._store_queue_ptr_write,              \
     36                   _queue[it_dump]._load_queue_ptr_write ,              \
     37                   _queue[it_dump]._has_immediat         ,              \
     38                   _queue[it_dump]._immediat             ,              \
     39                   _queue[it_dump]._num_reg_ra           ,              \
     40                   _queue[it_dump]._data_ra_val          ,              \
     41                   _queue[it_dump]._data_ra              ,              \
     42                   _queue[it_dump]._num_reg_rb           ,              \
     43                   _queue[it_dump]._data_rb_val          ,              \
     44                   _queue[it_dump]._data_rb              ,              \
     45                   _queue[it_dump]._num_reg_rc           ,              \
     46                   _queue[it_dump]._data_rc_val          ,              \
     47                   _queue[it_dump]._data_rc              ,              \
     48                   _queue[it_dump]._write_rd             ,              \
     49                   _queue[it_dump]._num_reg_rd           ,              \
     50                   _queue[it_dump]._write_re             ,              \
     51                   _queue[it_dump]._num_reg_re           ,              \
     52                   toString_type(_queue[it_dump]._type).c_str());       \
     53    } while (0)
     54#else
     55#define dump_queue()                                                    \
     56  do                                                                    \
     57    {                                                                   \
     58      log_printf(TRACE,Reservation_station,FUNCTION,"  * Dump Reservation Station"); \
     59      log_printf(TRACE,Reservation_station,FUNCTION,"    * nb_elt : %d",_queue_control->nb_elt()); \
     60      for (uint32_t it_dump=0;it_dump<_param->_size_queue; it_dump++)   \
     61        log_printf(TRACE,Reservation_station,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \
     62                   (*_queue_control)[it_dump],                          \
     63                   _queue[(*_queue_control)[it_dump]]._context_id           , \
     64                   _queue[(*_queue_control)[it_dump]]._front_end_id         , \
     65                   _queue[(*_queue_control)[it_dump]]._ooo_engine_id        , \
     66                   _queue[(*_queue_control)[it_dump]]._rob_id               , \
     67                   _queue[(*_queue_control)[it_dump]]._type                 , \
     68                   _queue[(*_queue_control)[it_dump]]._operation            , \
     69                   _queue[(*_queue_control)[it_dump]]._store_queue_ptr_write, \
     70                   _queue[(*_queue_control)[it_dump]]._load_queue_ptr_write , \
     71                   _queue[(*_queue_control)[it_dump]]._has_immediat         , \
     72                   _queue[(*_queue_control)[it_dump]]._immediat             , \
     73                   _queue[(*_queue_control)[it_dump]]._num_reg_ra           , \
     74                   _queue[(*_queue_control)[it_dump]]._data_ra_val          , \
     75                   _queue[(*_queue_control)[it_dump]]._data_ra              , \
     76                   _queue[(*_queue_control)[it_dump]]._num_reg_rb           , \
     77                   _queue[(*_queue_control)[it_dump]]._data_rb_val          , \
     78                   _queue[(*_queue_control)[it_dump]]._data_rb              , \
     79                   _queue[(*_queue_control)[it_dump]]._num_reg_rc           , \
     80                   _queue[(*_queue_control)[it_dump]]._data_rc_val          , \
     81                   _queue[(*_queue_control)[it_dump]]._data_rc              , \
     82                   _queue[(*_queue_control)[it_dump]]._write_rd             , \
     83                   _queue[(*_queue_control)[it_dump]]._num_reg_rd           , \
     84                   _queue[(*_queue_control)[it_dump]]._write_re             , \
     85                   _queue[(*_queue_control)[it_dump]]._num_reg_re           , \
     86                   toString_type(_queue[(*_queue_control)[it_dump]]._type).c_str());       \
     87    } while (0)
    6188#endif
    6289
     
    6592  void Reservation_station::transition (void)
    6693  {
    67     log_printf(FUNC,Reservation_station,FUNCTION,"Begin");
     94    log_begin(Reservation_station,FUNCTION);
     95    log_function(Reservation_station,FUNCTION,_name.c_str());
    6896
    6997    if (PORT_READ(in_NRESET) == 0)
     
    89117                //uint32_t index = (*_queue_control)[i];
    90118
    91                 log_printf(NONE,Reservation_station,FUNCTION,"POP  [%d]",i);
     119                log_printf(NONE,Reservation_station,FUNCTION,"  * POP  [%d]",i);
    92120
    93121                uint32_t index  = internal_RETIRE_SLOT[i];
     
    102130//                   << " * index       : " << index << endl;
    103131
    104                 log_printf(NONE,Reservation_station,FUNCTION," * index         : %d",index);
     132                log_printf(NONE,Reservation_station,FUNCTION,"    * index         : %d",index);
    105133              }
    106134          }
     
    140168                    if (PORT_READ(in_GPR_WRITE_NUM_REG [j]) == _queue[index]._num_reg_ra)
    141169                      {
    142                         log_printf(TRACE,Reservation_station,FUNCTION," -> GPR_WRITE     [%d] - Hit queue[%d]-GPR_RA[%d]",i,index,_queue[index]._num_reg_ra);
     170                        log_printf(TRACE,Reservation_station,FUNCTION,"    -> GPR_WRITE     [%d] - Hit queue[%d]-GPR_RA[%d]",i,index,_queue[index]._num_reg_ra);
    143171                        _queue[index]._data_ra_val = 1;
    144172                        _queue[index]._data_ra     = PORT_READ(in_GPR_WRITE_DATA [j]);
     
    146174                    if (PORT_READ(in_GPR_WRITE_NUM_REG [j]) == _queue[index]._num_reg_rb)
    147175                      {
    148                         log_printf(TRACE,Reservation_station,FUNCTION," -> GPR_WRITE     [%d] - Hit queue[%d]-GPR_RB[%d]",i,index,_queue[index]._num_reg_rb);
     176                        log_printf(TRACE,Reservation_station,FUNCTION,"    -> GPR_WRITE     [%d] - Hit queue[%d]-GPR_RB[%d]",i,index,_queue[index]._num_reg_rb);
    149177                        _queue[index]._data_rb_val = 1;
    150178                        _queue[index]._data_rb     = PORT_READ(in_GPR_WRITE_DATA [j]);
     
    165193                    (PORT_READ(in_SPR_WRITE_NUM_REG       [j]) == _queue[index]._num_reg_rc))
    166194                  {
    167                     log_printf(TRACE,Reservation_station,FUNCTION," -> SPR_WRITE     [%d] - Hit queue[%d]-SPR_RC[%d]",i,index,_queue[index]._num_reg_rc);
     195                    log_printf(TRACE,Reservation_station,FUNCTION,"    -> SPR_WRITE     [%d] - Hit queue[%d]-SPR_RC[%d]",i,index,_queue[index]._num_reg_rc);
    168196                    _queue[index]._data_rc_val = 1;
    169197                    _queue[index]._data_rc     = PORT_READ(in_SPR_WRITE_DATA [j]);
     
    185213                    if (PORT_READ(in_BYPASS_WRITE_GPR_NUM_REG[j]) == _queue[index]._num_reg_ra)
    186214                      {
    187                         log_printf(TRACE,Reservation_station,FUNCTION," -> BYPASS_WRITE  [%d] - Hit queue[%d]-GPR_RA[%d]",i,index,_queue[index]._num_reg_ra);
     215                        log_printf(TRACE,Reservation_station,FUNCTION,"    -> BYPASS_WRITE  [%d] - Hit queue[%d]-GPR_RA[%d]",i,index,_queue[index]._num_reg_ra);
    188216                        _queue[index]._data_ra_val = 1;
    189217                        _queue[index]._data_ra     = PORT_READ(in_BYPASS_WRITE_GPR_DATA [j]);
     
    191219                    if (PORT_READ(in_BYPASS_WRITE_GPR_NUM_REG [j]) == _queue[index]._num_reg_rb)
    192220                      {
    193                         log_printf(TRACE,Reservation_station,FUNCTION," -> BYPASS_WRITE  [%d] - Hit queue[%d]-GPR_RB[%d]",i,index,_queue[index]._num_reg_rb);
     221                        log_printf(TRACE,Reservation_station,FUNCTION,"    -> BYPASS_WRITE  [%d] - Hit queue[%d]-GPR_RB[%d]",i,index,_queue[index]._num_reg_rb);
    194222                        _queue[index]._data_rb_val = 1;
    195223                        _queue[index]._data_rb     = PORT_READ(in_BYPASS_WRITE_GPR_DATA [j]);
     
    199227                        (PORT_READ(in_BYPASS_WRITE_SPR_NUM_REG[j]) == _queue[index]._num_reg_rc))
    200228                      {
    201                         log_printf(TRACE,Reservation_station,FUNCTION," -> BYPASS_WRITE  [%d] - Hit queue[%d]-SPR_RC[%d]",i,index,_queue[index]._num_reg_rc);
     229                        log_printf(TRACE,Reservation_station,FUNCTION,"    -> BYPASS_WRITE  [%d] - Hit queue[%d]-SPR_RC[%d]",i,index,_queue[index]._num_reg_rc);
    202230                        _queue[index]._data_rc_val = 1;
    203231                        _queue[index]._data_rc     = PORT_READ(in_BYPASS_WRITE_SPR_DATA [j]);
     
    218246                    if (PORT_READ(in_BYPASS_MEMORY_NUM_REG [j]) == _queue[index]._num_reg_ra)
    219247                      {
    220                         log_printf(TRACE,Reservation_station,FUNCTION," -> BYPASS_MEMORY [%d] - Hit queue[%d]-GPR_RA[%d]",i,index,_queue[index]._num_reg_ra);
     248                        log_printf(TRACE,Reservation_station,FUNCTION,"    -> BYPASS_MEMORY [%d] - Hit queue[%d]-GPR_RA[%d]",i,index,_queue[index]._num_reg_ra);
    221249                        _queue[index]._data_ra_val = 1;
    222250                        _queue[index]._data_ra     = PORT_READ(in_BYPASS_MEMORY_DATA [j]);
     
    224252                    if (PORT_READ(in_BYPASS_MEMORY_NUM_REG [j]) == _queue[index]._num_reg_rb)
    225253                      {
    226                         log_printf(TRACE,Reservation_station,FUNCTION," -> BYPASS_MEMORY [%d] - Hit queue[%d]-GPR_RB[%d]",i,index,_queue[index]._num_reg_rb);
     254                        log_printf(TRACE,Reservation_station,FUNCTION,"    -> BYPASS_MEMORY [%d] - Hit queue[%d]-GPR_RB[%d]",i,index,_queue[index]._num_reg_rb);
    227255                        _queue[index]._data_rb_val = 1;
    228256                        _queue[index]._data_rb     = PORT_READ(in_BYPASS_MEMORY_DATA [j]);
     
    235263            (    internal_INSERT_ACK  == 1))
    236264          {
    237             log_printf(TRACE,Reservation_station,FUNCTION,"PUSH");
     265            log_printf(TRACE,Reservation_station,FUNCTION,"  * PUSH");
    238266
    239267            // Write in reservation station
     
    246274            index = _queue_control->push();
    247275#endif
    248             log_printf(TRACE,Reservation_station,FUNCTION," * index         : %d",index);
     276            log_printf(TRACE,Reservation_station,FUNCTION,"    * index         : %d",index);
    249277
    250278            if (_param->_have_port_context_id)
     
    254282            if (_param->_have_port_ooo_engine_id)
    255283            _queue[index]._ooo_engine_id   = PORT_READ(in_INSERT_OOO_ENGINE_ID  );
    256             if (_param->_have_port_rob_id)
     284            if (_param->_have_port_rob_ptr)
    257285            _queue[index]._rob_id          = PORT_READ(in_INSERT_ROB_ID         );
    258286            _queue[index]._operation       = PORT_READ(in_INSERT_OPERATION      );
     
    283311      }
    284312
     313    dump_queue();
     314
    285315    end_cycle ();
    286316
    287     log_printf(FUNC,Reservation_station,FUNCTION,"End");
     317    log_end(Reservation_station,FUNCTION);
    288318  };
    289319
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/SelfTest/Makefile

    r81 r88  
    2424library_clean                   : Read_unit_library_clean
    2525
     26local_clean                     :
     27
    2628include                         $(DIR_COMPONENT)/Makefile.deps
    2729include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/SelfTest/configuration.cfg

    r81 r88  
    11Read_unit
    2 4       4       *2      # size_read_queue         
    3 4       4       *2      # size_reservation_station
     24       8       *2      # size_read_queue         
     34       8       *2      # size_reservation_station
    441       1       *2      # nb_context             
    551       1       *2      # nb_front_end           
    6 1       4       *2      # nb_ooo_engine           
     61       4       *4      # nb_ooo_engine           
    7764      64      *2      # nb_packet               
    8832      32      *2      # size_general_data       
     
    101064      64      *2      # nb_general_register     
    111116      16      *2      # nb_special_register     
    12 2       2       *2      # nb_gpr_write           
    13 2       2       *2      # nb_spr_write           
    14 4       4       *2      # size_store_queue       
    15 1       4       *4      # size_load_queue         
    16 2       2       *2      # nb_inst_retire         
    17 2       2       *2      # nb_bypass_write         
    18 2       2       *2      # nb_bypass_memory       
     124       4       *4      # nb_gpr_write           
     134       4       *4      # nb_spr_write           
     144       4       *2      # size_store_queue
     154       4       *4      # size_load_queue         
     164       4       *4      # nb_inst_retire         
     174       4       *4      # nb_bypass_write         
     184       4       *4      # nb_bypass_memory       
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/SelfTest/src/main.cpp

    r81 r88  
    8585         _nb_inst_retire          ,
    8686         _nb_bypass_write         ,
    87          _nb_bypass_memory        );
     87         _nb_bypass_memory        ,
     88         true // is_toplevel
     89         );
    8890     
    8991      msg(_("%s"),param->print(1).c_str());
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/SelfTest/src/test.cpp

    r82 r88  
    77 */
    88
    9 #define NB_ITERATION  1
    10 #define CYCLE_MAX     (128*NB_ITERATION)
     9#define NB_ITERATION  16
     10#define CYCLE_MAX     (1024*NB_ITERATION)
    1111
    1212#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/SelfTest/include/test.h"
    1313#include "Common/include/Test.h"
     14#include "Common/include/BitManipulation.h"
    1415#include "Behavioural/include/Allocation.h"
     16
     17class write_req_t
     18{
     19  public : uint32_t ooo;
     20  public : uint32_t reg;
     21
     22  write_req_t (uint32_t ooo,
     23               uint32_t reg)
     24  {
     25    this->ooo = ooo;
     26    this->reg = reg;
     27  }
     28};
    1529
    1630void test (string name,
     
    2236  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50);
    2337#endif
     38
     39  Tusage_t _usage = USE_ALL;
     40
     41//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     42//   _usage = usage_unset(_usage,USE_VHDL                 );
     43//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     44//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     45//   _usage = usage_unset(_usage,USE_POSITION             );
     46//   _usage = usage_unset(_usage,USE_STATISTICS           );
     47//   _usage = usage_unset(_usage,USE_INFORMATION          );
    2448
    2549  Read_unit * _Read_unit = new Read_unit
     
    2953#endif
    3054     _param,
    31      USE_ALL);
     55     _usage);
    3256 
    3357#ifdef SYSTEMC
     
    130154  if (_param->_have_port_ooo_engine_id)
    131155  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_OOO_ENGINE_ID         );
    132   if (_param->_have_port_packet_id)
     156  if (_param->_have_port_rob_ptr)
    133157  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_PACKET_ID             );
    134158  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_OPERATION             );
     
    157181  if (_param->_have_port_ooo_engine_id)
    158182  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_OOO_ENGINE_ID        ,_param->_nb_inst_retire);
    159   if (_param->_have_port_packet_id)
     183  if (_param->_have_port_rob_ptr)
    160184  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_PACKET_ID            ,_param->_nb_inst_retire);
    161185  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_OPERATION            ,_param->_nb_inst_retire);
     
    213237  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
    214238   
     239  // Initialisation
     240  const uint32_t seed = 0;
     241//const uint32_t seed = static_cast<uint32_t>(time(NULL));
     242
     243  srand(seed);
     244
     245  SC_START(0);
     246
    215247  Time * _time = new Time();
    216248
     
    218250   * Simulation - Begin
    219251   ********************************************************/
    220 
     252  {
    221253  // Initialisation
    222254
    223   const uint32_t seed = 0;
    224 //const uint32_t seed = static_cast<uint32_t>(time(NULL));
    225 
    226   srand(seed);
    227 
    228   SC_START(0);
     255  const uint32_t nb_request = _param->_nb_packet;
     256
     257  Tcontext_t         _ooo_engine_id [nb_request];
     258  Tcontrol_t         _read_ra    [nb_request];
     259  Tgeneral_address_t _num_reg_ra [nb_request];
     260  Tcontrol_t         _read_rb    [nb_request];
     261  Tgeneral_address_t _num_reg_rb [nb_request];
     262  Tcontrol_t         _read_rc    [nb_request];
     263  Tspecial_address_t _num_reg_rc [nb_request];
     264
     265  // emulation of registerFile
     266  Tcontrol_t         _gpr_val    [_param->_nb_general_register][_param->_nb_ooo_engine];
     267  Tgeneral_data_t    _gpr        [_param->_nb_general_register][_param->_nb_ooo_engine];
     268  Tcontrol_t         _spr_val    [_param->_nb_special_register][_param->_nb_ooo_engine];
     269  Tspecial_data_t    _spr        [_param->_nb_special_register][_param->_nb_ooo_engine];
     270
    229271  LABEL("Initialisation");
    230 
    231   LABEL("Reset");
     272  in_READ_UNIT_IN_VAL ->write(0);
     273  for (uint32_t i=0; i<_param->_nb_inst_retire  ; i++)
     274    in_READ_UNIT_OUT_ACK [i]->write(0);
     275  for (uint32_t i=0; i<_param->_nb_gpr_write    ; i++)
     276    in_GPR_WRITE_VAL               [i]->write(0);
     277  for (uint32_t i=0; i<_param->_nb_spr_write    ; i++)
     278    in_SPR_WRITE_VAL               [i]->write(0);
     279  for (uint32_t i=0; i<_param->_nb_bypass_write ; i++)
     280    {
     281      in_BYPASS_WRITE_GPR_VAL      [i]->write(0);
     282      in_BYPASS_WRITE_SPR_VAL      [i]->write(0);
     283    }
     284  for (uint32_t i=0; i<_param->_nb_bypass_memory; i++)
     285    in_BYPASS_MEMORY_VAL           [i]->write(0);
     286
    232287  in_NRESET->write(0);
    233288  SC_START(5);
    234   in_NRESET->write(1); 
     289  in_NRESET->write(1);
    235290
    236291  LABEL("Loop of Test");
     
    240295      LABEL("Iteration %d",iteration);
    241296
    242       SC_START(1);
     297      int32_t percent_transaction_queue_in     = (rand()%50)+25;
     298      int32_t percent_transaction_queue_out    = (rand()%50)+25;
     299      int32_t percent_registerfile_valid       = (rand()%50)+25;
     300      int32_t percent_transaction_registerfile = (rand()%50)+25;
     301      int32_t percent_transaction_bypass       = (rand()%50)+25;
     302     
     303      LABEL("Initialisation");
     304
     305      for (uint32_t i=0; i<nb_request; i++)
     306        {
     307          _ooo_engine_id   [i] = rand()% _param->_nb_ooo_engine            ;
     308          _read_ra         [i] = rand()% 2                              ;
     309          _num_reg_ra      [i] = rand()% _param->_nb_general_register   ;
     310          _read_rb         [i] = rand()% 2                              ;
     311          _num_reg_rb      [i] = rand()% _param->_nb_general_register   ;
     312          _read_rc         [i] = rand()% 2                              ;
     313          _num_reg_rc      [i] = rand()% _param->_nb_special_register   ;
     314        }
     315     
     316      // emulation of registerFile
     317      for (uint32_t j=0; j<_param->_nb_ooo_engine; j++)
     318        {
     319          for (uint32_t i=0; i<_param->_nb_general_register; i++)
     320            {
     321              _gpr_val      [i][j] = ((rand()%100) < percent_registerfile_valid);
     322              _gpr          [i][j] = range<Tgeneral_data_t>(rand(),_param->_size_general_data);
     323            }
     324          for (uint32_t i=0; i<_param->_nb_special_register; i++)
     325            {
     326              _spr_val      [i][j] = ((rand()%100) < percent_registerfile_valid);
     327              _spr          [i][j] = range<Tspecial_data_t>(rand(),_param->_size_special_data);
     328            }
     329        }
     330      // End initialisation .......
     331
     332      uint32_t request_in  = 0;
     333      uint32_t request_out = 0;
     334      bool     request_out_wait [nb_request];
     335
     336      for (uint32_t i=0; i<nb_request; i++)
     337        request_out_wait [i] = true;
     338     
     339//       bool can_gpr_use [_param->_nb_ooo_engine][_param->_nb_general_register];
     340//       bool can_spr_use [_param->_nb_ooo_engine][_param->_nb_special_register];
     341
     342      list<write_req_t> write_req_gpr;
     343      list<write_req_t> write_req_spr;
     344
     345      while (request_out < nb_request)
     346        {
     347          LABEL("request_in         : %d",request_in );
     348          LABEL("request_out        : %d",request_out);
     349          for (uint32_t i=0; i<nb_request; i++)
     350            if (request_out_wait [i])
     351              LABEL("request_out_wait   : %d",i);
     352          LABEL("write_req_gpr size : %d",write_req_gpr.size());
     353          LABEL("write_req_spr size : %d",write_req_spr.size());
     354
     355//        for (uint32_t j=0; j<_param->_nb_ooo_engine; j++)
     356//          {
     357//            for (uint32_t i=0; i<_param->_nb_general_register; i++)
     358//              can_gpr_use [j][i] = true;
     359//            for (uint32_t i=0; i<_param->_nb_special_register; i++)
     360//              can_spr_use [j][i] = true;
     361//          }
     362
     363          Tcontrol_t         read_unit_in_val = (request_in < nb_request) and ((rand()%100) < percent_transaction_queue_in);
     364          Tcontext_t         read_unit_in_ooo_engine_id;
     365          Tgeneral_address_t read_unit_in_num_reg_ra;
     366          Tgeneral_address_t read_unit_in_num_reg_rb;
     367          Tspecial_address_t read_unit_in_num_reg_rc;
     368
     369          in_READ_UNIT_IN_VAL         ->write(read_unit_in_val);
     370          if (read_unit_in_val)
     371            {
     372              bool               data_val;
     373              read_unit_in_ooo_engine_id = _ooo_engine_id [request_in];
     374              read_unit_in_num_reg_ra    = _num_reg_ra [request_in];
     375              read_unit_in_num_reg_rb    = _num_reg_rb [request_in];
     376              read_unit_in_num_reg_rc    = _num_reg_rc [request_in];
     377
     378              if (_param->_have_port_context_id)
     379              in_READ_UNIT_IN_CONTEXT_ID     ->write((2*read_unit_in_ooo_engine_id)%_param->_nb_context  );
     380              if (_param->_have_port_front_end_id)
     381              in_READ_UNIT_IN_FRONT_END_ID   ->write((3*read_unit_in_ooo_engine_id)%_param->_nb_front_end);
     382              if (_param->_have_port_ooo_engine_id)
     383              in_READ_UNIT_IN_OOO_ENGINE_ID  ->write(read_unit_in_ooo_engine_id);
     384              if (_param->_have_port_rob_ptr)
     385              in_READ_UNIT_IN_PACKET_ID   ->write(request_in);
     386              in_READ_UNIT_IN_OPERATION   ->write(0);
     387              in_READ_UNIT_IN_TYPE        ->write(0);
     388              in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE->write(0);
     389              if (_param->_have_port_load_queue_ptr)
     390              in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ->write(0);
     391              in_READ_UNIT_IN_HAS_IMMEDIAT->write(0);
     392              in_READ_UNIT_IN_IMMEDIAT    ->write(0);
     393              in_READ_UNIT_IN_READ_RA     ->write(_read_ra[request_in]);
     394              data_val = not(_read_ra[request_in]) or _gpr_val[read_unit_in_num_reg_ra][read_unit_in_ooo_engine_id];
     395
     396              if (not data_val)
     397                if (rand ()%2)
     398                  write_req_gpr.push_back (write_req_t(read_unit_in_ooo_engine_id,read_unit_in_num_reg_ra));
     399                else
     400                  write_req_gpr.push_front(write_req_t(read_unit_in_ooo_engine_id,read_unit_in_num_reg_ra));
     401
     402
     403              in_READ_UNIT_IN_NUM_REG_RA  ->write(read_unit_in_num_reg_ra);
     404//            in_READ_UNIT_IN_DATA_RA_VAL ->write(data_val);
     405//            in_READ_UNIT_IN_DATA_RA     ->write((data_val)?_gpr[read_unit_in_num_reg_ra][read_unit_in_ooo_engine_id]:0);
     406              in_READ_UNIT_IN_READ_RB     ->write(_read_rb[request_in]);
     407              data_val = not(_read_rb[request_in]) or _gpr_val[read_unit_in_num_reg_rb][read_unit_in_ooo_engine_id];
     408
     409              if (not data_val)
     410                if (rand ()%2)
     411                  write_req_gpr.push_back (write_req_t(read_unit_in_ooo_engine_id,read_unit_in_num_reg_rb));
     412                else
     413                  write_req_gpr.push_front(write_req_t(read_unit_in_ooo_engine_id,read_unit_in_num_reg_rb));
     414
     415
     416              in_READ_UNIT_IN_NUM_REG_RB  ->write(read_unit_in_num_reg_rb);                           
     417//            in_READ_UNIT_IN_DATA_RB_VAL ->write(data_val);                           
     418//            in_READ_UNIT_IN_DATA_RB     ->write((data_val)?_gpr[read_unit_in_num_reg_rb][read_unit_in_ooo_engine_id]:0);
     419              in_READ_UNIT_IN_READ_RC     ->write(_read_rc[request_in]);
     420              data_val = not(_read_rc[request_in]) or _spr_val[read_unit_in_num_reg_rc][read_unit_in_ooo_engine_id];
     421
     422              if (not data_val)
     423                if (rand ()%2)
     424                  write_req_spr.push_back (write_req_t(read_unit_in_ooo_engine_id,read_unit_in_num_reg_rc));
     425                else
     426                  write_req_spr.push_front(write_req_t(read_unit_in_ooo_engine_id,read_unit_in_num_reg_rc));
     427
     428              in_READ_UNIT_IN_NUM_REG_RC  ->write(read_unit_in_num_reg_rc);                           
     429//            in_READ_UNIT_IN_DATA_RC_VAL ->write(data_val);                           
     430//            in_READ_UNIT_IN_DATA_RC     ->write((data_val)?_spr[read_unit_in_num_reg_rc][read_unit_in_ooo_engine_id]:0);
     431              in_READ_UNIT_IN_WRITE_RD    ->write(0);
     432              in_READ_UNIT_IN_NUM_REG_RD  ->write(0);
     433              in_READ_UNIT_IN_WRITE_RE    ->write(0);
     434              in_READ_UNIT_IN_NUM_REG_RE  ->write(0);
     435
     436//            can_gpr_use [read_unit_in_ooo_engine_id][read_unit_in_num_reg_ra] = false;
     437//            can_gpr_use [read_unit_in_ooo_engine_id][read_unit_in_num_reg_rb] = false;
     438//            can_spr_use [read_unit_in_ooo_engine_id][read_unit_in_num_reg_rc] = false;
     439            }
     440                 
     441          for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
     442            in_READ_UNIT_OUT_ACK[i]->write((rand()%100)<percent_transaction_queue_out);
     443
     444          // RegisterFile access
     445          for (uint32_t i=0; i<_param->_nb_gpr_read ; i++)
     446            {
     447              Tcontrol_t ack = (rand()%100) < percent_transaction_registerfile;
     448              in_GPR_READ_ACK      [i]->write(ack);
     449
     450              SC_START(0);
     451
     452              if (out_GPR_READ_VAL [i]->read())
     453                {
     454                  Tgeneral_address_t num_reg    = out_GPR_READ_NUM_REG       [i]->read();
     455                  Tcontext_t         ooo_engine = (_param->_have_port_ooo_engine_id)?out_GPR_READ_OOO_ENGINE_ID [i]->read():0;
     456                  Tgeneral_data_t    data       = _gpr    [num_reg][ooo_engine];
     457                  Tcontrol_t         data_val   = _gpr_val[num_reg][ooo_engine];
     458                 
     459                  if (ack)
     460                    LABEL(" * GPR_READ      [%d] - gpr[%d][%d] ->  (%d) 0x%x",i,num_reg,ooo_engine,data_val,data);
     461                 
     462                  in_GPR_READ_DATA     [i]->write(data);
     463                  in_GPR_READ_DATA_VAL [i]->write(data_val);
     464                }
     465            }
     466
     467          for (uint32_t i=0; i<_param->_nb_spr_read ; i++)
     468            {
     469              Tcontrol_t ack = (rand()%100) < percent_transaction_registerfile;
     470              in_SPR_READ_ACK      [i]->write(ack);
     471
     472              SC_START(0);
     473
     474              if (out_SPR_READ_VAL [i]->read())
     475                {
     476                  Tspecial_address_t num_reg    = out_SPR_READ_NUM_REG       [i]->read();
     477                  Tcontext_t         ooo_engine = (_param->_have_port_ooo_engine_id)?out_SPR_READ_OOO_ENGINE_ID [i]->read():0;
     478                  Tspecial_data_t    data       = _spr    [num_reg][ooo_engine];
     479                  Tcontrol_t         data_val   = _spr_val[num_reg][ooo_engine];
     480                 
     481                  if (ack)
     482                    LABEL(" * SPR_READ      [%d] - spr[%d][%d] ->  (%d) 0x%x",i,num_reg,ooo_engine,data_val,data);
     483                 
     484                  in_SPR_READ_DATA     [i]->write(data);
     485                  in_SPR_READ_DATA_VAL [i]->write(data_val);
     486                }
     487            }
     488
     489          list<write_req_t>::iterator it_gpr = write_req_gpr.begin();
     490          list<write_req_t>::iterator it_spr = write_req_spr.begin();
     491
     492          LABEL("Bypass Network :");
     493          for (uint32_t i=0; i<_param->_nb_gpr_write; i++)
     494            {
     495              Tcontext_t         ooo_engine = (it_gpr != write_req_gpr.end())?(*it_gpr).ooo:0;
     496              Tgeneral_address_t num_reg    = (it_gpr != write_req_gpr.end())?(*it_gpr).reg:0;
     497              Tcontrol_t         val     = (_gpr_val [num_reg][ooo_engine]== 0)?((rand()%100) < percent_transaction_registerfile):0;
     498              Tgeneral_data_t    data    = range<Tgeneral_data_t>(rand(),_param->_size_general_data);
     499           
     500              val = (val// and can_spr_use [ooo_engine][num_reg]
     501                     and (it_gpr != write_req_gpr.end()));
     502
     503              in_GPR_WRITE_VAL            [i]->write(val);           
     504              if (_param->_have_port_ooo_engine_id)
     505              in_GPR_WRITE_OOO_ENGINE_ID  [i]->write(ooo_engine);
     506              in_GPR_WRITE_NUM_REG        [i]->write(num_reg);
     507              in_GPR_WRITE_DATA           [i]->write(data);
     508
     509              if (val)
     510                {
     511                  LABEL(" * GPR_WRITE     [%d] - gpr[%d][%d] <- 0x%x",i,num_reg,ooo_engine,data);
     512
     513//                can_gpr_use [ooo_engine][num_reg] = false;
     514
     515                  _gpr     [num_reg][ooo_engine] = data;
     516                  _gpr_val [num_reg][ooo_engine] = 1;
     517                }
     518
     519              if (it_gpr != write_req_gpr.end())
     520                it_gpr ++;
     521            }
     522          for (uint32_t i=0; i<_param->_nb_spr_write; i++)
     523            {
     524              Tcontext_t         ooo_engine = (it_spr != write_req_spr.end())?(*it_spr).ooo:0;
     525              Tgeneral_address_t num_reg    = (it_spr != write_req_spr.end())?(*it_spr).reg:0;
     526
     527              Tcontrol_t         val     = (_spr_val [num_reg][ooo_engine]== 0)?((rand()%100) < percent_transaction_registerfile):0;
     528              Tspecial_data_t    data    = range<Tspecial_data_t>(rand(),_param->_size_special_data);
     529
     530              val = (val // and can_spr_use [ooo_engine][num_reg]
     531                     and (it_spr != write_req_spr.end()));
     532
     533              in_SPR_WRITE_VAL            [i]->write(val);           
     534              if (_param->_have_port_ooo_engine_id)
     535              in_SPR_WRITE_OOO_ENGINE_ID  [i]->write(ooo_engine);
     536              in_SPR_WRITE_NUM_REG        [i]->write(num_reg);
     537              in_SPR_WRITE_DATA           [i]->write(data);
     538
     539              if (val == 1)
     540                {
     541                  LABEL(" * SPR_WRITE     [%d] - spr[%d][%d] <- 0x%x",i,num_reg,ooo_engine,data);
     542                 
     543//                can_spr_use [ooo_engine][num_reg] = false;
     544
     545                  _spr     [num_reg][ooo_engine] = data;
     546                  _spr_val [num_reg][ooo_engine] = 1;
     547                }
     548
     549              if (it_spr != write_req_spr.end())
     550                it_spr ++;
     551
     552            }
     553
     554          for (uint32_t i=0; i<_param->_nb_bypass_write; i++)
     555            {
     556              Tcontext_t         ooo_engine = (it_gpr != write_req_gpr.end())?(*it_gpr).ooo:0;
     557              Tgeneral_address_t gpr_num_reg= (it_gpr != write_req_gpr.end())?(*it_gpr).reg:0;
     558
     559              if (_param->_have_port_ooo_engine_id)
     560              in_BYPASS_WRITE_OOO_ENGINE_ID [i]->write(ooo_engine);
     561
     562              Tcontrol_t         gpr_val     = (_gpr_val [gpr_num_reg][ooo_engine]== 0)?((rand()%100) < percent_transaction_bypass):0;
     563              Tgeneral_data_t    gpr_data    = range<Tgeneral_data_t>(rand(),_param->_size_general_data);
     564             
     565              gpr_val = (gpr_val // and can_gpr_use [ooo_engine][gpr_num_reg]
     566                         and (it_gpr != write_req_gpr.end()));
     567
     568              in_BYPASS_WRITE_GPR_VAL    [i]->write(gpr_val);         
     569              in_BYPASS_WRITE_GPR_NUM_REG[i]->write(gpr_num_reg);
     570              in_BYPASS_WRITE_GPR_DATA   [i]->write(gpr_data);
     571
     572              if (gpr_val)
     573                {
     574                  LABEL(" * BYPASS_WRITE  [%d] - gpr[%d][%d] <- 0x%x",i,gpr_num_reg,ooo_engine,gpr_data);
     575//                can_gpr_use [ooo_engine][gpr_num_reg] = false;
     576
     577                  _gpr     [gpr_num_reg][ooo_engine] = gpr_data;
     578                  _gpr_val [gpr_num_reg][ooo_engine] = 1;
     579                }
     580
     581              if (it_gpr != write_req_gpr.end())
     582                it_gpr ++;
     583
     584              Tspecial_address_t spr_num_reg = (it_spr != write_req_spr.end())?(*it_spr).reg:0;
     585              Tcontrol_t         spr_val     = (_spr_val [spr_num_reg][ooo_engine]== 0)?((rand()%100) < percent_transaction_bypass):0;
     586              Tspecial_data_t    spr_data    = range<Tspecial_data_t>(rand(),_param->_size_special_data);
     587             
     588              spr_val = (spr_val // and can_spr_use [ooo_engine][spr_num_reg]
     589                         and (it_spr != write_req_spr.end()) and ((*it_spr).ooo == ooo_engine));
     590
     591              in_BYPASS_WRITE_SPR_VAL    [i]->write(spr_val);         
     592              in_BYPASS_WRITE_SPR_NUM_REG[i]->write(spr_num_reg);
     593              in_BYPASS_WRITE_SPR_DATA   [i]->write(spr_data);
     594
     595              if (spr_val)
     596                {
     597                  LABEL(" * BYPASS_WRITE  [%d] - spr[%d][%d] <- 0x%x",i,spr_num_reg,ooo_engine,spr_data);
     598
     599//                can_spr_use [ooo_engine][spr_num_reg] = false;
     600
     601                  _spr     [spr_num_reg][ooo_engine] = spr_data;
     602                  _spr_val [spr_num_reg][ooo_engine] = 1;
     603                }
     604
     605              if (it_spr != write_req_spr.end())
     606                it_spr ++;
     607            }
     608
     609          for (uint32_t i=0; i<_param->_nb_bypass_memory; i++)
     610            {
     611              Tcontext_t         ooo_engine = (it_gpr != write_req_gpr.end())?(*it_gpr).ooo:0;
     612              Tgeneral_address_t num_reg    = (it_gpr != write_req_gpr.end())?(*it_gpr).reg:0;
     613
     614              if (_param->_have_port_ooo_engine_id)
     615              in_BYPASS_MEMORY_OOO_ENGINE_ID [i]->write(ooo_engine);
     616
     617              Tcontrol_t         val     = (_gpr_val [num_reg][ooo_engine]== 0)?((rand()%100) < percent_transaction_bypass):0;
     618              Tgeneral_data_t    data    = range<Tgeneral_data_t>(rand(),_param->_size_general_data);
     619             
     620              val = (val // and can_gpr_use [ooo_engine][num_reg]
     621                     and (it_gpr != write_req_gpr.end()));
     622
     623              in_BYPASS_MEMORY_VAL    [i]->write(val);       
     624              in_BYPASS_MEMORY_NUM_REG[i]->write(num_reg);
     625              in_BYPASS_MEMORY_DATA   [i]->write(data);
     626
     627              if (val)
     628                {
     629                  LABEL(" * BYPASS_MEMORY [%d] - gpr[%d][%d] <- 0x%x",i,num_reg,ooo_engine,data);
     630                 
     631//                can_gpr_use [ooo_engine][num_reg] = false;
     632
     633                  _gpr     [num_reg][ooo_engine] = data;
     634                  _gpr_val [num_reg][ooo_engine] = 1;
     635                }
     636
     637              if (it_gpr != write_req_gpr.end())
     638                it_gpr ++;
     639            }
     640
     641          SC_START(0); // to mealy function
     642         
     643//        LABEL("Test     READ_UNIT_IN  : "+toString(in_READ_UNIT_IN_VAL->read())+","+toString(out_READ_UNIT_IN_ACK->read()));
     644          if (( in_READ_UNIT_IN_VAL->read() == 1) and
     645              (out_READ_UNIT_IN_ACK->read() == 1))
     646            {
     647              LABEL("Accepted READ_UNIT_IN  number : %d",request_in);
     648              request_in  ++;
     649            }
     650
     651          for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
     652            {
     653              LABEL("Test     READ_UNIT_OUT %d : %d,%d",i,out_READ_UNIT_OUT_VAL[i]->read(),in_READ_UNIT_OUT_ACK[i]->read());
     654              if ((out_READ_UNIT_OUT_VAL [i]->read() == 1) and
     655                  ( in_READ_UNIT_OUT_ACK [i]->read() == 1))
     656                {
     657                  Tpacket_t  packet_id;
     658                  if (_param->_have_port_rob_ptr)
     659                    packet_id = out_READ_UNIT_OUT_PACKET_ID [i]->read();
     660                  else
     661                    packet_id = 0;
     662                  LABEL("Accepted READ_UNIT_OUT [%d] number : %d, request number : %d",i,packet_id,request_out);
     663                  TEST(bool, request_out_wait [packet_id] , true);
     664
     665                  request_out ++;
     666                  request_out_wait [packet_id] = false;
     667
     668                  Tcontext_t ooo_engine_id = _ooo_engine_id [packet_id];
     669                 
     670                  if (_param->_have_port_context_id)
     671                  TEST(Tcontext_t        ,out_READ_UNIT_OUT_CONTEXT_ID   [i]->read(),(2*ooo_engine_id)%_param->_nb_context  );
     672                  if (_param->_have_port_front_end_id)
     673                  TEST(Tcontext_t        ,out_READ_UNIT_OUT_FRONT_END_ID [i]->read(),(3*ooo_engine_id)%_param->_nb_front_end);
     674                  if (_param->_have_port_ooo_engine_id)
     675                  TEST(Tcontext_t        ,out_READ_UNIT_OUT_OOO_ENGINE_ID[i]->read(),ooo_engine_id);
     676
     677                  if (_read_ra [packet_id])
     678                  TEST(Tgeneral_data_t   ,out_READ_UNIT_OUT_DATA_RA   [i]->read(),_gpr[_num_reg_ra[packet_id]][ooo_engine_id]);
     679                 
     680                  if (_read_rb [packet_id])
     681                  TEST(Tgeneral_data_t   ,out_READ_UNIT_OUT_DATA_RB   [i]->read(),_gpr[_num_reg_rb[packet_id]][ooo_engine_id]);
     682                 
     683                  if (_read_rc [packet_id])
     684                  TEST(Tspecial_data_t   ,out_READ_UNIT_OUT_DATA_RC   [i]->read(),_spr[_num_reg_rc[packet_id]][ooo_engine_id]);
     685                }
     686            }
     687         
     688          SC_START(1);   
     689
     690          for (list<write_req_t>::iterator it = write_req_gpr.begin();
     691               it != write_req_gpr.end();
     692               )
     693            {
     694              if (_gpr_val [(*it).reg][(*it).ooo] == 1)
     695                it = write_req_gpr.erase(it);
     696              else
     697                it ++;
     698            }
     699
     700          for (list<write_req_t>::iterator it = write_req_spr.begin();
     701               it != write_req_spr.end();
     702               )
     703            {
     704              if (_spr_val [(*it).reg][(*it).ooo] == 1)
     705                it = write_req_spr.erase(it);
     706              else
     707                it ++;
     708            }
     709        }
     710
     711      for (uint32_t i=0; i<nb_request; i++)
     712        TEST(bool, request_out_wait [i] , false);
    243713    }
     714  }
    244715
    245716  /********************************************************
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/include/Parameters.h

    r81 r88  
    2626  {
    2727    //-----[ fields ]------------------------------------------------------------
    28   public : const uint32_t    _size_read_queue         ;
    29   public : const uint32_t    _size_reservation_station;
    30   public : const uint32_t    _nb_context              ;
    31   public : const uint32_t    _nb_front_end            ;
    32   public : const uint32_t    _nb_ooo_engine           ;
    33   public : const uint32_t    _nb_packet               ;
    34   public : const uint32_t    _size_general_data       ;
    35   public : const uint32_t    _size_special_data       ;
    36   public : const uint32_t    _nb_general_register     ;
    37   public : const uint32_t    _nb_special_register     ;
    38   public : const uint32_t    _nb_gpr_write            ;
    39   public : const uint32_t    _nb_spr_write            ;
    40   public : const uint32_t    _size_store_queue        ;
    41   public : const uint32_t    _size_load_queue         ;
    42   public : const uint32_t    _nb_inst_retire          ;
    43   public : const uint32_t    _nb_bypass_write         ;
    44   public : const uint32_t    _nb_bypass_memory        ;
    45                                                      
    46   public : const uint32_t    _nb_gpr_read             ;
    47   public : const uint32_t    _nb_spr_read             ;   
    48   public : const uint32_t    _size_context_id         ;
    49   public : const uint32_t    _size_front_end_id       ;
    50   public : const uint32_t    _size_ooo_engine_id      ;
    51   public : const uint32_t    _size_packet_id          ;
    52   public : const uint32_t    _size_general_register   ;
    53   public : const uint32_t    _size_special_register   ;
     28  public : uint32_t    _size_read_queue         ;
     29  public : uint32_t    _size_reservation_station;
     30  public : uint32_t    _nb_context              ;
     31  public : uint32_t    _nb_front_end            ;
     32  public : uint32_t    _nb_ooo_engine           ;
     33  public : uint32_t    _nb_packet               ;
     34//public : uint32_t    _size_general_data       ;
     35//public : uint32_t    _size_special_data       ;
     36  public : uint32_t    _nb_general_register     ;
     37  public : uint32_t    _nb_special_register     ;
     38  public : uint32_t    _nb_gpr_write            ;
     39  public : uint32_t    _nb_spr_write            ;
     40//public : uint32_t    _size_store_queue        ;
     41//public : uint32_t    _size_load_queue         ;
     42  public : uint32_t    _nb_inst_retire          ;
     43  public : uint32_t    _nb_bypass_write         ;
     44  public : uint32_t    _nb_bypass_memory        ;
     45                                             
     46  public : uint32_t    _nb_gpr_read             ;
     47  public : uint32_t    _nb_spr_read             ;   
     48//public : uint32_t    _size_context_id         ;
     49//public : uint32_t    _size_front_end_id       ;
     50//public : uint32_t    _size_ooo_engine_id      ;
     51//public : uint32_t    _size_packet_id          ;
     52//public : uint32_t    _size_general_register   ;
     53//public : uint32_t    _size_special_register   ;
    5454
    55   public : const bool        _have_port_context_id    ;
    56   public : const bool        _have_port_front_end_id  ;
    57   public : const bool        _have_port_ooo_engine_id ;
    58   public : const bool        _have_port_packet_id     ;
    59   public : const bool        _have_port_load_queue_ptr;
     55//public : bool        _have_port_context_id    ;
     56//public : bool        _have_port_front_end_id  ;
     57//public : bool        _have_port_ooo_engine_id ;
     58//public : bool        _have_port_packet_id     ;
     59//public : bool        _have_port_load_queue_ptr;
    6060
    6161  public : morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::read_queue         ::Parameters * _param_read_queue;
     
    7979                        uint32_t nb_inst_retire          ,
    8080                        uint32_t nb_bypass_write         ,
    81                         uint32_t nb_bypass_memory        );
    82   public : Parameters  (Parameters & param) ;
     81                        uint32_t nb_bypass_memory        ,
     82                        bool     is_toplevel=false);
     83//public : Parameters  (Parameters & param) ;
    8384  public : ~Parameters () ;
     85
     86  public :        void            copy       (void);
    8487
    8588  public :        Parameters_test msg_error  (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Parameters.cpp

    r81 r88  
    2020#define FUNCTION "Read_unit::Parameters"
    2121  Parameters::Parameters (uint32_t size_read_queue         ,
    22                           uint32_t size_reservation_station,
    23                           uint32_t nb_context              ,
    24                           uint32_t nb_front_end            ,
    25                           uint32_t nb_ooo_engine           ,
    26                           uint32_t nb_packet               ,
    27                           uint32_t size_general_data       ,
    28                           uint32_t size_special_data       ,
    29                           uint32_t nb_general_register     ,
    30                           uint32_t nb_special_register     ,
    31                           uint32_t nb_gpr_write            ,
    32                           uint32_t nb_spr_write            ,
    33                           uint32_t size_store_queue        ,
    34                           uint32_t size_load_queue         ,
    35                           uint32_t nb_inst_retire          ,
    36                           uint32_t nb_bypass_write         ,
    37                           uint32_t nb_bypass_memory        ):
    38     _size_read_queue          (size_read_queue         ),
    39     _size_reservation_station (size_reservation_station),
    40     _nb_context               (nb_context              ),
    41     _nb_front_end             (nb_front_end            ),
    42     _nb_ooo_engine            (nb_ooo_engine           ),
    43     _nb_packet                (nb_packet               ),
    44     _size_general_data        (size_general_data       ),
    45     _size_special_data        (size_special_data       ),
    46     _nb_general_register      (nb_general_register     ),
    47     _nb_special_register      (nb_special_register     ),
    48     _nb_gpr_write             (nb_gpr_write            ),
    49     _nb_spr_write             (nb_spr_write            ),
    50     _size_store_queue         (size_store_queue        ),
    51     _size_load_queue          (size_load_queue         ),
    52     _nb_inst_retire           (nb_inst_retire          ),
    53     _nb_bypass_write          (nb_bypass_write         ),
    54     _nb_bypass_memory         (nb_bypass_memory        ),
    55    
    56     _nb_gpr_read              (2),
    57     _nb_spr_read              (1),   
    58     _size_context_id          (log2(nb_context         )),
    59     _size_front_end_id        (log2(nb_front_end       )),
    60     _size_ooo_engine_id       (log2(nb_ooo_engine      )),
    61     _size_packet_id           (log2(nb_packet          )),
    62     _size_general_register    (log2(nb_general_register)),
    63     _size_special_register    (log2(nb_special_register)),
    64    
    65     _have_port_context_id     (_size_context_id   >0),
    66     _have_port_front_end_id   (_size_front_end_id >0),
    67     _have_port_ooo_engine_id  (_size_ooo_engine_id>0),
    68     _have_port_packet_id      (_size_packet_id    >0),
    69     _have_port_load_queue_ptr (_size_load_queue   >1)
     22                          uint32_t size_reservation_station,
     23                          uint32_t nb_context              ,
     24                          uint32_t nb_front_end            ,
     25                          uint32_t nb_ooo_engine           ,
     26                          uint32_t nb_packet               ,
     27                          uint32_t size_general_data       ,
     28                          uint32_t size_special_data       ,
     29                          uint32_t nb_general_register     ,
     30                          uint32_t nb_special_register     ,
     31                          uint32_t nb_gpr_write            ,
     32                          uint32_t nb_spr_write            ,
     33                          uint32_t size_store_queue        ,
     34                          uint32_t size_load_queue         ,
     35                          uint32_t nb_inst_retire          ,
     36                          uint32_t nb_bypass_write         ,
     37                          uint32_t nb_bypass_memory        ,
     38                          bool     is_toplevel)
    7039  {
    7140    log_printf(FUNC,Read_unit,FUNCTION,"Begin");
    7241
     42    _size_read_queue          = size_read_queue         ;
     43    _size_reservation_station = size_reservation_station;
     44    _nb_context               = nb_context              ;
     45    _nb_front_end             = nb_front_end            ;
     46    _nb_ooo_engine            = nb_ooo_engine           ;
     47    _nb_packet                = nb_packet               ;
     48    _nb_general_register      = nb_general_register     ;
     49    _nb_special_register      = nb_special_register     ;
     50    _nb_gpr_write             = nb_gpr_write            ;
     51    _nb_spr_write             = nb_spr_write            ;
     52    _nb_inst_retire           = nb_inst_retire          ;
     53    _nb_bypass_write          = nb_bypass_write         ;
     54    _nb_bypass_memory         = nb_bypass_memory        ;
     55   
     56    _nb_gpr_read              = 2;
     57    _nb_spr_read              = 1;   
     58
    7359    _param_read_queue = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::read_queue::Parameters
    74       ( _size_read_queue   
    75         ,_nb_context         
    76         ,_nb_front_end       
    77         ,_nb_ooo_engine
    78         ,_nb_packet         
    79         ,_size_general_data 
    80         ,_size_special_data 
    81         ,_nb_general_register
    82         ,_nb_special_register
    83         ,_nb_gpr_write
    84         ,_nb_spr_write
    85         ,_size_store_queue
    86         ,_size_load_queue
    87         );
     60      (_size_read_queue   
     61      ,_nb_context         
     62      ,_nb_front_end       
     63      ,_nb_ooo_engine
     64      ,_nb_packet         
     65      , size_general_data 
     66      , size_special_data 
     67      ,_nb_general_register
     68      ,_nb_special_register
     69      ,_nb_gpr_write
     70      ,_nb_spr_write
     71      , size_store_queue
     72      , size_load_queue
     73      );
    8874
    8975    _param_reservation_station = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Parameters
    90         (size_reservation_station
    91          ,nb_inst_retire     
    92          ,nb_context         
    93          ,nb_front_end       
    94          ,nb_ooo_engine
    95          ,nb_packet         
    96          ,size_general_data 
    97          ,size_special_data 
    98          ,nb_general_register
    99          ,nb_special_register
    100          ,nb_gpr_write
    101          ,nb_spr_write
    102          ,nb_bypass_write
    103          ,nb_bypass_memory
    104          ,size_store_queue
    105          ,size_load_queue
    106          );
    107 
     76        (_size_reservation_station
     77        ,_nb_inst_retire     
     78        ,_nb_context         
     79        ,_nb_front_end       
     80        ,_nb_ooo_engine
     81        ,_nb_packet         
     82        , size_general_data 
     83        , size_special_data 
     84        ,_nb_general_register
     85        ,_nb_special_register
     86        ,_nb_gpr_write
     87        ,_nb_spr_write
     88        ,_nb_bypass_write
     89        ,_nb_bypass_memory
     90        , size_store_queue
     91        , size_load_queue
     92        );
    10893
    10994    test();
     95
     96    if (is_toplevel)
     97      {
     98        _size_context_id          = log2(nb_context         );
     99        _size_front_end_id        = log2(nb_front_end       );
     100        _size_ooo_engine_id       = log2(nb_ooo_engine      );
     101        _size_rob_ptr             = log2(nb_packet          );
     102        _size_general_register    = log2(nb_general_register);
     103        _size_special_register    = log2(nb_special_register);
     104        _size_general_data        = size_general_data       ;
     105        _size_special_data        = size_special_data       ;
     106        _size_store_queue_ptr     = log2(size_store_queue   );
     107        _size_load_queue_ptr      = log2(size_load_queue    );
     108       
     109        _have_port_context_id     = _size_context_id     > 0;
     110        _have_port_front_end_id   = _size_front_end_id   > 0;
     111        _have_port_ooo_engine_id  = _size_ooo_engine_id  > 0;
     112        _have_port_rob_ptr        = _size_rob_ptr        > 0;
     113        _have_port_load_queue_ptr = _size_load_queue_ptr > 0;
     114
     115        copy();
     116      }
    110117
    111118    log_printf(FUNC,Read_unit,FUNCTION,"End");
    112119  };
    113120 
     121// #undef  FUNCTION
     122// #define FUNCTION "Read_unit::Parameters (copy)"
     123//   Parameters::Parameters (Parameters & param):
     124//     _size_read_queue          (param._size_read_queue         ),
     125//     _size_reservation_station (param._size_reservation_station),
     126//     _nb_context               (param._nb_context              ),
     127//     _nb_front_end             (param._nb_front_end            ),
     128//     _nb_ooo_engine            (param._nb_ooo_engine           ),
     129//     _nb_packet                (param._nb_packet               ),
     130//     _size_general_data        (param._size_general_data       ),
     131//     _size_special_data        (param._size_special_data       ),
     132//     _nb_general_register      (param._nb_general_register     ),
     133//     _nb_special_register      (param._nb_special_register     ),
     134//     _nb_gpr_write             (param._nb_gpr_write            ),
     135//     _nb_spr_write             (param._nb_spr_write            ),
     136//     _size_store_queue         (param._size_store_queue        ),
     137//     _size_load_queue          (param._size_load_queue         ),
     138//     _nb_inst_retire           (param._nb_inst_retire          ),
     139//     _nb_bypass_write          (param._nb_bypass_write         ),
     140//     _nb_bypass_memory         (param._nb_bypass_memory        ),
     141
     142//     _nb_gpr_read              (param._nb_gpr_read             ),
     143//     _nb_spr_read              (param._nb_spr_read             ),   
     144//     _size_context_id          (param._size_context_id         ),
     145//     _size_front_end_id        (param._size_front_end_id       ),
     146//     _size_ooo_engine_id       (param._size_ooo_engine_id      ),
     147//     _size_packet_id           (param._size_packet_id          ),
     148//     _size_general_register    (param._size_general_register   ),
     149//     _size_special_register    (param._size_special_register   ),
     150
     151//     _have_port_context_id     (param._have_port_context_id    ),
     152//     _have_port_front_end_id   (param._have_port_front_end_id  ),
     153//     _have_port_ooo_engine_id  (param._have_port_ooo_engine_id ),
     154//     _have_port_packet_id      (param._have_port_packet_id     ),
     155//     _have_port_load_queue_ptr (param._have_port_load_queue_ptr)
     156//   {
     157//     log_printf(FUNC,Read_unit,FUNCTION,"Begin");
     158
     159//     _param_read_queue          = param._param_read_queue         ;
     160//     _param_reservation_station = param._param_reservation_station;
     161
     162//     test();
     163
     164//     log_printf(FUNC,Read_unit,FUNCTION,"End");
     165//   };
     166
    114167#undef  FUNCTION
    115 #define FUNCTION "Read_unit::Parameters (copy)"
    116   Parameters::Parameters (Parameters & param):
    117     _size_read_queue          (param._size_read_queue         ),
    118     _size_reservation_station (param._size_reservation_station),
    119     _nb_context               (param._nb_context              ),
    120     _nb_front_end             (param._nb_front_end            ),
    121     _nb_ooo_engine            (param._nb_ooo_engine           ),
    122     _nb_packet                (param._nb_packet               ),
    123     _size_general_data        (param._size_general_data       ),
    124     _size_special_data        (param._size_special_data       ),
    125     _nb_general_register      (param._nb_general_register     ),
    126     _nb_special_register      (param._nb_special_register     ),
    127     _nb_gpr_write             (param._nb_gpr_write            ),
    128     _nb_spr_write             (param._nb_spr_write            ),
    129     _size_store_queue         (param._size_store_queue        ),
    130     _size_load_queue          (param._size_load_queue         ),
    131     _nb_inst_retire           (param._nb_inst_retire          ),
    132     _nb_bypass_write          (param._nb_bypass_write         ),
    133     _nb_bypass_memory         (param._nb_bypass_memory        ),
    134 
    135     _nb_gpr_read              (param._nb_gpr_read             ),
    136     _nb_spr_read              (param._nb_spr_read             ),   
    137     _size_context_id          (param._size_context_id         ),
    138     _size_front_end_id        (param._size_front_end_id       ),
    139     _size_ooo_engine_id       (param._size_ooo_engine_id      ),
    140     _size_packet_id           (param._size_packet_id          ),
    141     _size_general_register    (param._size_general_register   ),
    142     _size_special_register    (param._size_special_register   ),
    143 
    144     _have_port_context_id     (param._have_port_context_id    ),
    145     _have_port_front_end_id   (param._have_port_front_end_id  ),
    146     _have_port_ooo_engine_id  (param._have_port_ooo_engine_id ),
    147     _have_port_packet_id      (param._have_port_packet_id     ),
    148     _have_port_load_queue_ptr (param._have_port_load_queue_ptr)
     168#define FUNCTION "Read_unit::~Parameters"
     169  Parameters::~Parameters (void)
    149170  {
    150171    log_printf(FUNC,Read_unit,FUNCTION,"Begin");
    151172
    152     _param_read_queue          = param._param_read_queue         ;
    153     _param_reservation_station = param._param_reservation_station;
    154 
    155     test();
     173    delete _param_read_queue;
     174    delete _param_reservation_station;
    156175
    157176    log_printf(FUNC,Read_unit,FUNCTION,"End");
     
    159178
    160179#undef  FUNCTION
    161 #define FUNCTION "Read_unit::~Parameters"
    162   Parameters::~Parameters ()
     180#define FUNCTION "Read_unit::copy"
     181  void Parameters::copy (void)
    163182  {
    164183    log_printf(FUNC,Read_unit,FUNCTION,"Begin");
    165184
    166     delete _param_read_queue;
    167     delete _param_reservation_station;
     185    COPY(_param_read_queue);
     186    COPY(_param_reservation_station);
    168187
    169188    log_printf(FUNC,Read_unit,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Parameters_print.cpp

    r81 r88  
    3939    xml.singleton_begin("nb_gpr_write            "); xml.attribut("value",toString(_nb_gpr_write            )); xml.singleton_end();
    4040    xml.singleton_begin("nb_spr_write            "); xml.attribut("value",toString(_nb_spr_write            )); xml.singleton_end();
    41     xml.singleton_begin("size_store_queue        "); xml.attribut("value",toString(_size_store_queue        )); xml.singleton_end();
    42     xml.singleton_begin("size_load_queue         "); xml.attribut("value",toString(_size_load_queue         )); xml.singleton_end();
     41//  xml.singleton_begin("size_store_queue        "); xml.attribut("value",toString(_size_store_queue        )); xml.singleton_end();
     42//  xml.singleton_begin("size_load_queue         "); xml.attribut("value",toString(_size_load_queue         )); xml.singleton_end();
    4343    xml.singleton_begin("nb_inst_retire          "); xml.attribut("value",toString(_nb_inst_retire          )); xml.singleton_end();
    4444    xml.singleton_begin("nb_bypass_write         "); xml.attribut("value",toString(_nb_bypass_write         )); xml.singleton_end();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Read_unit.cpp

    r81 r88  
    3838    log_printf(FUNC,Read_unit,FUNCTION,"Begin");
    3939
     40#if DEBUG_Read_unit == true
     41    log_printf(INFO,Read_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
     42
     43    std::cout << *param << std::endl;
     44#endif   
     45
    4046    log_printf(INFO,Read_unit,FUNCTION,"Allocation");
    4147
     
    4753
    4854#ifdef STATISTICS
    49     if (_usage & USE_STATISTICS)
     55    if (usage_is_set(_usage,USE_STATISTICS))
    5056      {
    5157        log_printf(INFO,Read_unit,FUNCTION,"Allocation of statistics");
     
    5662
    5763#ifdef VHDL
    58     if (_usage & USE_VHDL)
     64    if (usage_is_set(_usage,USE_VHDL))
    5965      {
    6066        // generate the vhdl
     
    6672
    6773#ifdef SYSTEMC
    68     if (_usage & USE_SYSTEMC)
     74    if (usage_is_set(_usage,USE_SYSTEMC))
    6975      {
    7076        log_printf(INFO,Read_unit,FUNCTION,"Method - transition");
     
    9096
    9197#ifdef STATISTICS
    92     if (_usage & USE_STATISTICS)
     98    if (usage_is_set(_usage,USE_STATISTICS))
    9399      {
    94100        log_printf(INFO,Read_unit,FUNCTION,"Generate Statistics file");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Read_unit_allocation.cpp

    r82 r88  
    4848                                                         ,IN
    4949                                                         ,SOUTH,
    50                                                          "Generalist interface"
     50                                                         _("Generalist interface")
    5151#endif
    5252                                                         );
     
    5757    // ~~~~~[ Interface "read_unit_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5858     {
    59        ALLOC_INTERFACE("read_unit_in", IN, WEST, "Enter of new operation");
     59       ALLOC_INTERFACE("read_unit_in", IN, WEST, _("Enter of new operation"));
    6060
    6161       ALLOC_VALACK_IN    ( in_READ_UNIT_IN_VAL,VAL);
     
    6464       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_FRONT_END_ID         ,"front_end_id"         ,Tcontext_t        ,_param->_size_front_end_id );
    6565       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_OOO_ENGINE_ID        ,"ooo_engine_id"        ,Tcontext_t        ,_param->_size_ooo_engine_id);
    66        ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_PACKET_ID            ,"packet_id"            ,Tpacket_t         ,_param->_size_packet_id    );
     66       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_PACKET_ID            ,"packet_id"            ,Tpacket_t         ,_param->_size_rob_ptr    );
    6767       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_OPERATION            ,"operation"            ,Toperation_t      ,_param->_size_operation    );
    6868       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type         );
    69        ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,log2(_param->_size_store_queue));
    70        ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,log2(_param->_size_load_queue));
     69       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     70       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr);
    7171       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1);
    7272       ALLOC_SIGNAL_IN ( in_READ_UNIT_IN_IMMEDIAT             ,"immediat"             ,Tgeneral_data_t   ,_param->_size_general_data);
     
    8585    // ~~~~~[ Interface "read_unit_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    8686     {
    87        ALLOC1_INTERFACE("read_unit_out", OUT, EAST, "Output of operation. All operand is valid.", _param->_nb_inst_retire);
     87       ALLOC1_INTERFACE("read_unit_out", OUT, EAST, _("Output of operation. All operand is valid."), _param->_nb_inst_retire);
    8888
    8989       ALLOC1_VALACK_OUT   (out_READ_UNIT_OUT_VAL,VAL);
     
    9292       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_FRONT_END_ID         ,"front_end_id"         ,Tcontext_t        ,_param->_size_front_end_id    );
    9393       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_OOO_ENGINE_ID        ,"ooo_engine_id"        ,Tcontext_t        ,_param->_size_ooo_engine_id   );
    94        ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_PACKET_ID            ,"packet_id"            ,Tpacket_t         ,_param->_size_packet_id       );
     94       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_PACKET_ID            ,"packet_id"            ,Tpacket_t         ,_param->_size_rob_ptr       );
    9595       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_OPERATION            ,"operation"            ,Toperation_t      ,_param->_size_operation       );
    9696       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            );
    97        ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,log2(_param->_size_store_queue));
    98        ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,log2(_param->_size_load_queue ));
     97       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     98       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr);
    9999       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             );
    100100       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_IMMEDIAT             ,"immediat"             ,Tgeneral_data_t   ,_param->_size_general_data    );
     
    110110    // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    111111     {
    112        ALLOC1_INTERFACE("gpr_read", OUT, SOUTH, "Read port.", _param->_nb_gpr_read);
     112       ALLOC1_INTERFACE("gpr_read", OUT, SOUTH, _("Read port."), _param->_nb_gpr_read);
    113113
    114114       ALLOC1_VALACK_OUT   (out_GPR_READ_VAL,VAL);
     
    122122    // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    123123     {
    124        ALLOC1_INTERFACE("spr_read", OUT, SOUTH, "Read port.", _param->_nb_spr_read);
     124       ALLOC1_INTERFACE("spr_read", OUT, SOUTH, _("Read port."), _param->_nb_spr_read);
    125125
    126126       ALLOC1_VALACK_OUT   (out_SPR_READ_VAL,VAL);
     
    134134    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    135135     {
    136        ALLOC1_INTERFACE("gpr_write", IN , SOUTH, "Write port.", _param->_nb_gpr_write);
     136       ALLOC1_INTERFACE("gpr_write", IN , SOUTH, _("Write port."), _param->_nb_gpr_write);
    137137
    138138       ALLOC1_VALACK_IN    ( in_GPR_WRITE_VAL,VAL);
     
    144144    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    145145     {
    146        ALLOC1_INTERFACE("spr_write", IN , SOUTH, "Write port.", _param->_nb_spr_write);
     146       ALLOC1_INTERFACE("spr_write", IN , SOUTH, _("Write port."), _param->_nb_spr_write);
    147147
    148148       ALLOC1_VALACK_IN    ( in_SPR_WRITE_VAL,VAL);
     
    154154    // ~~~~~[ Interface "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    155155     {
    156        ALLOC1_INTERFACE("bypass_write", IN , NORTH, "Output of write_queue.", _param->_nb_bypass_write);
     156       ALLOC1_INTERFACE("bypass_write", IN , NORTH, _("Output of write_queue."), _param->_nb_bypass_write);
    157157
    158158       ALLOC1_SIGNAL_IN ( in_BYPASS_WRITE_OOO_ENGINE_ID,"ooo_engine_id",Tcontext_t        ,_param->_size_ooo_engine_id   );
     
    167167    // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    168168     {
    169        ALLOC1_INTERFACE("bypass_memory", IN , NORTH, "Output of write_queue.", _param->_nb_bypass_memory);
     169       ALLOC1_INTERFACE("bypass_memory", IN , NORTH, _("Output of write_queue."), _param->_nb_bypass_memory);
    170170
    171171       ALLOC1_SIGNAL_IN ( in_BYPASS_MEMORY_VAL          ,"val"          ,Tcontrol_t        ,1);
     
    177177    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    178178
    179     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    180 
    181179     std::string name;
    182180
    183181     {
    184182       name = _name+"_read_queue";
     183       log_printf(INFO,Core,FUNCTION,_("Create   : %s"),name.c_str());
    185184       
    186185       _component_read_queue  = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::read_queue::Read_queue
     
    200199     {
    201200       name = _name+"_reservation_station";
    202        
     201       log_printf(INFO,Core,FUNCTION,_("Create   : %s"),name.c_str());     
     202 
    203203       _component_reservation_station  = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Reservation_station
    204204         (name.c_str()
     
    219219     {
    220220       name = _name+"_read_queue";
    221        std::cout << "Instance : " << name << std::endl;
     221       log_printf(INFO,Core,FUNCTION,_("Instance : %s"),name.c_str());
     222
    222223       {
    223224#ifdef POSITION
     
    246247         if (_param->_have_port_ooo_engine_id)
    247248         _component->port_map(name, "in_READ_QUEUE_IN_OOO_ENGINE_ID"        ,dest, "in_READ_UNIT_IN_OOO_ENGINE_ID"        );
    248          if (_param->_have_port_packet_id)
     249         if (_param->_have_port_rob_ptr)
    249250         _component->port_map(name, "in_READ_QUEUE_IN_ROB_ID"               ,dest, "in_READ_UNIT_IN_PACKET_ID"            );
    250251         _component->port_map(name, "in_READ_QUEUE_IN_OPERATION"            ,dest, "in_READ_UNIT_IN_OPERATION"            );
     
    283284         if (_param->_have_port_ooo_engine_id)
    284285         _component->port_map(name,"out_READ_QUEUE_OUT_OOO_ENGINE_ID"        ,dest, "in_INSERT_OOO_ENGINE_ID"        );
    285          if (_param->_have_port_packet_id)
     286         if (_param->_have_port_rob_ptr)
    286287         _component->port_map(name,"out_READ_QUEUE_OUT_ROB_ID"               ,dest, "in_INSERT_ROB_ID"               );
    287288         _component->port_map(name,"out_READ_QUEUE_OUT_OPERATION"            ,dest, "in_INSERT_OPERATION"            );
     
    379380     {
    380381       name = _name+"_reservation_station";
    381        std::cout << "Instance : " << name << std::endl;
     382       log_printf(INFO,Core,FUNCTION,_("Instance : %s"),name.c_str());
    382383       {
    383384#ifdef POSITION
     
    407408         if (_param->_have_port_ooo_engine_id)
    408409         _component->port_map(name, "in_INSERT_OOO_ENGINE_ID"        ,dest,"out_READ_QUEUE_OUT_OOO_ENGINE_ID"        );
    409          if (_param->_have_port_packet_id)
     410         if (_param->_have_port_rob_ptr)
    410411         _component->port_map(name, "in_INSERT_ROB_ID"               ,dest,"out_READ_QUEUE_OUT_ROB_ID"               );
    411412         _component->port_map(name, "in_INSERT_OPERATION"            ,dest,"out_READ_QUEUE_OUT_OPERATION"            );
     
    452453           if (_param->_have_port_ooo_engine_id)
    453454           _component->port_map(name,"out_RETIRE_"+toString(i)+"_OOO_ENGINE_ID"        ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_OOO_ENGINE_ID"        );
    454            if (_param->_have_port_packet_id)
     455           if (_param->_have_port_rob_ptr)
    455456           _component->port_map(name,"out_RETIRE_"+toString(i)+"_ROB_ID"               ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_PACKET_ID"            );
    456457           _component->port_map(name,"out_RETIRE_"+toString(i)+"_OPERATION"            ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_OPERATION"            );
     
    535536     }
    536537     
    537 
    538 #ifdef POSITION
    539     _component->generate_file();
     538#if DEBUG_Read_unit == true
     539     _component->test_map();
     540#endif
     541
     542#ifdef POSITION
     543     if (usage_is_set(_usage,USE_POSITION))
     544       _component->generate_file();
    540545#endif
    541546
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Read_unit_deallocation.cpp

    r81 r88  
    2323    log_printf(FUNC,Read_unit,FUNCTION,"Begin");
    2424
    25     if (_usage & USE_SYSTEMC)
     25    if (usage_is_set(_usage,USE_SYSTEMC))
    2626      {
    2727        delete     in_CLOCK ;
     
    3737        if (_param->_have_port_ooo_engine_id)
    3838        delete     in_READ_UNIT_IN_OOO_ENGINE_ID        ;
    39         if (_param->_have_port_packet_id)
     39        if (_param->_have_port_rob_ptr)
    4040        delete     in_READ_UNIT_IN_PACKET_ID            ;
    4141        delete     in_READ_UNIT_IN_OPERATION            ;
     
    6666        if (_param->_have_port_ooo_engine_id)
    6767        delete [] out_READ_UNIT_OUT_OOO_ENGINE_ID        ;
    68         if (_param->_have_port_packet_id)
     68        if (_param->_have_port_rob_ptr)
    6969        delete [] out_READ_UNIT_OUT_PACKET_ID            ;
    7070        delete [] out_READ_UNIT_OUT_OPERATION            ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Read_unit_end_cycle.cpp

    r81 r88  
    2525
    2626#ifdef STATISTICS
    27     _stat->end_cycle();
     27    if (usage_is_set(_usage,USE_STATISTICS))
     28      _stat->end_cycle();
    2829#endif   
    2930
     
    3132    // Evaluation before read the ouput signal
    3233//  sc_start(0);
    33     _interfaces->testbench();
     34    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
     35      _interfaces->testbench();
    3436#endif
    3537
Note: See TracChangeset for help on using the changeset viewer.