Ignore:
Timestamp:
Jan 15, 2009, 6:19:08 PM (15 years ago)
Author:
rosiere
Message:

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_min.cfg

    r100 r101  
    331       1       *2      #_size_data
    440       1       +1      #_nb_port_slot
     50       0       +1      #_have_port_write
     60       0       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_size_queue_log2.cfg

    r100 r101  
    3332      32      *2      #_size_data
    440       0       *2      #_nb_port_slot
     51       1       +1      #_have_port_write
     61       1       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_size_queue_no_log2.cfg

    r100 r101  
    3332      32      *2      #_size_data
    440       0       *2      #_nb_port_slot
     51       1       +1      #_have_port_write
     61       1       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_slot_out_size_queue_log2.cfg

    r100 r101  
    3332      32      *2      #_size_data
    441       8       *2      #_nb_port_slot
     51       1       +1      #_have_port_write
     61       1       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_slot_out_size_queue_no_log2.cfg

    r100 r101  
    3332      32      *2      #_size_data
    441       8       *2      #_nb_port_slot
     51       1       +1      #_have_port_write
     61       1       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/main.cpp

    r100 r101  
    88#include "Behavioural/Generic/Queue/SelfTest/include/test.h"
    99
    10 #define NB_PARAMS 3
     10#define NB_PARAMS 5
    1111
    1212void usage (int argc, char * argv[])
     
    1414  cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl
    1515       << "list_params is :" << endl
    16        << " - size_queue   (uint32_t)" << endl
    17        << " - size_data    (uint32_t)" << endl
    18        << " - nb_port_slot (uint32_t)" << endl
     16       << " - size_queue      (uint32_t)" << endl
     17       << " - size_data       (uint32_t)" << endl
     18       << " - nb_port_slot    (uint32_t)" << endl
     19       << " - have_port_write (bool    )" << endl
     20       << " - have_port_read  (bool    )" << endl
    1921       << "" << endl;
    2022
     
    3739  uint32_t       x = 1;
    3840 
    39   const string   name         =      argv[x++];
    40   const uint32_t size_queue   = atoi(argv[x++]);
    41   const uint32_t size_data    = atoi(argv[x++]);
    42   const uint32_t nb_port_slot = atoi(argv[x++]);
    43 
     41  const string   name            =      argv[x++];
     42  const uint32_t size_queue      = fromString<uint32_t>(argv[x++]);
     43  const uint32_t size_data       = fromString<uint32_t>(argv[x++]);
     44  const uint32_t nb_port_slot    = fromString<uint32_t>(argv[x++]);
     45  const bool     have_port_write = fromString<bool>(argv[x++]);
     46  const bool     have_port_read  = fromString<bool>(argv[x++]);
    4447  try
    4548    {
     
    4750        (size_queue,
    4851         size_data ,
    49          nb_port_slot
     52         nb_port_slot,
     53         have_port_write,
     54         have_port_read
    5055        );
    5156     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/test.cpp

    r100 r101  
    5858  ALLOC1_SC_SIGNAL(out_SLOT_VAL   ,"out_SLOT_VAL"   ,Tcontrol_t,_param->_nb_port_slot);
    5959  ALLOC1_SC_SIGNAL(out_SLOT_DATA  ,"out_SLOT_DATA"  ,Tdata_t   ,_param->_nb_port_slot);
     60  ALLOC0_SC_SIGNAL(out_PTR_WRITE  ,"out_PTR_WRITE"  ,Tptr_t    );
     61  ALLOC0_SC_SIGNAL(out_PTR_READ   ,"out_PTR_READ"   ,Tptr_t    );
    6062 
    6163  /********************************************************
     
    7678  INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_VAL   ,_param->_nb_port_slot);
    7779  INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_DATA  ,_param->_nb_port_slot);
     80  if (_param->_have_port_ptr_write)
     81  INSTANCE0_SC_SIGNAL(_Queue,out_PTR_WRITE  );
     82  if (_param->_have_port_ptr_read )
     83  INSTANCE0_SC_SIGNAL(_Queue,out_PTR_READ   );
    7884
    7985  cout << "<" << name << "> Start Simulation ............" << endl;
     
    168174  DELETE1_SC_SIGNAL(out_SLOT_VAL   ,_param->_nb_port_slot);
    169175  DELETE1_SC_SIGNAL(out_SLOT_DATA  ,_param->_nb_port_slot);
    170 
     176  DELETE0_SC_SIGNAL(out_PTR_WRITE  );
     177  DELETE0_SC_SIGNAL(out_PTR_READ   );
    171178#endif
    172179
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Parameters.h

    r100 r101  
    2222  {
    2323    //-----[ fields ]------------------------------------------------------------
    24   public : const uint32_t _size_queue  ;
    25   public : const uint32_t _size_data   ;
    26   public : const uint32_t _nb_port_slot;
     24  public : const uint32_t _size_queue         ;
     25  public : const uint32_t _size_data          ;
     26  public : const uint32_t _nb_port_slot       ;
     27  public : const bool     _have_port_ptr_write;
     28  public : const bool     _have_port_ptr_read ;
     29
     30  public : const uint32_t _size_ptr           ;
     31  public : const bool     _have_port_ptr      ;
    2732
    2833    //-----[ methods ]-----------------------------------------------------------
    29   public : Parameters  (uint32_t size_queue,
    30                         uint32_t size_data ,
    31                         uint32_t nb_port_slot);
     34  public : Parameters  (uint32_t size_queue         ,
     35                        uint32_t size_data          ,
     36                        uint32_t nb_port_slot       ,
     37                        bool     have_port_ptr_write,
     38                        bool     have_port_ptr_read );
    3239
    3340//   public : Parameters  (Parameters & param) ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Queue.h

    r100 r101  
    7878  public    : SC_OUT(Tdata_t   )           ** out_SLOT_DATA;
    7979
     80    // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     81  public    : SC_OUT(Tptr_t    )            * out_PTR_WRITE;
     82  public    : SC_OUT(Tptr_t    )            * out_PTR_READ ;
     83
    8084    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    8185  protected : morpheo::behavioural::generic::queue_control::Queue_Control * _queue_control;
     
    8791  protected : Tcontrol_t                      internal_INSERT_ACK;
    8892  protected : Tcontrol_t                      internal_RETIRE_VAL;
    89 
    9093#endif
    9194
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Parameters.cpp

    r100 r101  
    77
    88#include "Behavioural/Generic/Queue/include/Parameters.h"
    9 
     9#include "Common/include/Log2.h"
    1010namespace morpheo {
    1111namespace behavioural {
     
    1616#undef  FUNCTION
    1717#define FUNCTION "Queue::Parameters"
    18   Parameters::Parameters (uint32_t size_queue,
    19                           uint32_t size_data ,
    20                           uint32_t nb_port_slot):
    21     _size_queue   (size_queue),
    22     _size_data    (size_data ),
    23     _nb_port_slot (nb_port_slot)
     18  Parameters::Parameters (uint32_t size_queue         ,
     19                          uint32_t size_data          ,
     20                          uint32_t nb_port_slot       ,
     21                          bool     have_port_ptr_write,
     22                          bool     have_port_ptr_read ):
     23    _size_queue          (size_queue),
     24    _size_data           (size_data ),
     25    _nb_port_slot        (nb_port_slot),
     26    _have_port_ptr_write (have_port_ptr_write and (log2(size_queue)>0)),
     27    _have_port_ptr_read  (have_port_ptr_read  and (log2(size_queue)>0)),
     28    _size_ptr            (log2(size_queue)),
     29    _have_port_ptr       (have_port_ptr_write or have_port_ptr_read)
    2430  {
    2531    log_printf(FUNC,Queue,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_allocation.cpp

    r100 r101  
    7272      ALLOC1_SIGNAL_OUT(out_SLOT_DATA ,"data",Tdata_t,_param->_size_data);
    7373    }
     74
     75    // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     76    if (_param->_have_port_ptr)
     77    {
     78      ALLOC0_INTERFACE("ptr", OUT, EAST, _("Internal pointer."));
     79     
     80      if (_param->_have_port_ptr_write)
     81      ALLOC0_SIGNAL_OUT(out_PTR_WRITE ,"write",Tptr_t,_param->_size_ptr);
     82      if (_param->_have_port_ptr_read )
     83      ALLOC0_SIGNAL_OUT(out_PTR_READ  ,"read" ,Tptr_t,_param->_size_ptr);
     84    }
    7485     
    7586    if (usage_is_set(_usage,USE_SYSTEMC))
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_deallocation.cpp

    r100 r101  
    3636        DELETE1_SIGNAL(out_SLOT_VAL    ,_param->_nb_port_slot,1);
    3737        DELETE1_SIGNAL(out_SLOT_DATA   ,_param->_nb_port_slot,_param->_size_data);
     38
     39        if (_param->_have_port_ptr_write)
     40        DELETE0_SIGNAL(out_PTR_WRITE   ,_param->_size_ptr);
     41        if (_param->_have_port_ptr_read )
     42        DELETE0_SIGNAL(out_PTR_READ    ,_param->_size_ptr);
    3843       
    3944        // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_genMoore.cpp

    r100 r101  
    2020    log_printf(FUNC,Queue,FUNCTION,"Begin");
    2121
     22    //---------------------------------------------
    2223    // Output
     24    //---------------------------------------------
    2325    internal_INSERT_ACK = not _queue_control->full();
    2426    internal_RETIRE_VAL = not _queue_control->empty();
     
    2830    PORT_WRITE(out_RETIRE_DATA,_queue_data[(*_queue_control)[0]]);
    2931
     32    //---------------------------------------------
    3033    // Slot
     34    //---------------------------------------------
    3135    // Note : Slot 0 is the same slot as retire interface.
    3236    uint32_t nb_elt = _queue_control->nb_elt();
     
    3741        PORT_WRITE(out_SLOT_DATA [i],_queue_data[(*_queue_control)[i]]);
    3842      }
     43
     44    //---------------------------------------------
     45    // Pointer
     46    //---------------------------------------------
     47    if (_param->_have_port_ptr_write)
     48    PORT_WRITE(out_PTR_WRITE, _queue_control->ptr_push());
     49    if (_param->_have_port_ptr_read )
     50    PORT_WRITE(out_PTR_READ , _queue_control->ptr_pop ());
    3951
    4052    log_printf(FUNC,Queue,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_vhdl_body.cpp

    r100 r101  
    6262          else
    6363            vhdl->set_body   (0,"out_SLOT_"+toString(i)+"_DATA       <= reg_DATA(conv_integer(0));");
     64      }
     65
     66    if (_param->_have_port_ptr)
     67      {
     68    vhdl->set_body   (0,"");
     69    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     70    vhdl->set_comment(0," Slot");
     71    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     72    vhdl->set_body   (0,"");
     73    if (_param->_have_port_ptr_write)
     74    vhdl->set_body   (0,"out_PTR_WRITE         <= signal_PTR_WRITE;");
     75    if (_param->_have_port_ptr_read)
     76    vhdl->set_body   (0,"out_PTR_READ          <= signal_PTR_READ;");
    6477      }
    6578
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/include/Queue_Control.h

    r81 r101  
    3535  public  : void     clear    (void);
    3636
     37  public  : uint32_t ptr_pop  (uint32_t index=0);
     38  public  : uint32_t ptr_push (void);
     39
     40
    3741  public  : uint32_t push     (void);
    3842  public  : uint32_t push_ovf (void);
    39   public  : void     pop      (uint32_t);
     43  public  : void     pop      (uint32_t index);
    4044  public  : void     pop      (void);
    41   public  : void     pop_ovf  (uint32_t);
     45  public  : void     pop_ovf  (uint32_t index);
    4246  public  : void     pop_ovf  (void);
    4347   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h

    r88 r101  
    2121  class Parameters : public morpheo::behavioural::Parameters
    2222  {
    23   public : const uint32_t _nb_port_read ;
    24   public : const uint32_t _nb_port_write;
    25   public : const uint32_t _nb_port_read_write;
    26   public : const uint32_t _nb_word      ;
    27   public : const uint32_t _size_word    ;
    28   public : const uint32_t _size_address ;
    29   public : const bool     _have_port_address;
     23  public : const uint32_t    _nb_port_read ;
     24  public : const uint32_t    _nb_port_write;
     25  public : const uint32_t    _nb_port_read_write;
     26  public : const uint32_t    _nb_word      ;
     27  public : const uint32_t    _size_word    ;
     28  public : const uint32_t    _size_address ;
     29  public : const bool        _have_port_address;
     30  public : const bool        _have_init_value;
     31  public : const std::string _init_value;
    3032
    31   public : Parameters (uint32_t nb_port_read ,
    32                        uint32_t nb_port_write,
    33                        uint32_t nb_port_read_write,
    34                        uint32_t nb_word      ,
    35                        uint32_t size_word    );
     33  public : Parameters (uint32_t    nb_port_read ,
     34                       uint32_t    nb_port_write,
     35                       uint32_t    nb_port_read_write,
     36                       uint32_t    nb_word      ,
     37                       uint32_t    size_word    ,
     38                       std::string init_value="");
    3639//   public : Parameters (Parameters & param) ;
    3740  public : ~Parameters () ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters.cpp

    r88 r101  
    1414namespace registerfile_monolithic    {
    1515
    16   Parameters::Parameters (uint32_t nb_port_read ,
    17                           uint32_t nb_port_write,
    18                           uint32_t nb_port_read_write ,
    19                           uint32_t nb_word      ,
    20                           uint32_t size_word     
     16  Parameters::Parameters (uint32_t    nb_port_read ,
     17                          uint32_t    nb_port_write,
     18                          uint32_t    nb_port_read_write ,
     19                          uint32_t    nb_word      ,
     20                          uint32_t    size_word    ,
     21                          std::string init_value
    2122                          ) :
    2223    _nb_port_read      (nb_port_read ),
     
    2627    _size_word         (size_word    ),
    2728    _size_address      (static_cast<uint32_t>(log2(_nb_word))),
    28     _have_port_address (_size_address != 0)
    29 
     29    _have_port_address (_size_address != 0),
     30    _have_init_value   (init_value != ""),
     31    _init_value        (init_value)
    3032  {
    3133    test();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_msg_error.cpp

    r81 r101  
    3333      test.error("you need a write port");
    3434
     35    // Need test init_value
     36
    3537    return test;
    3638  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp

    r88 r101  
    1818    log_printf(FUNC,RegisterFile,"transition","Begin");
    1919
    20     for (uint32_t i=0; i<_param->_nb_port_write; i++)
     20    if (_param->_have_init_value and (PORT_READ(in_NRESET) == 0))
    2121      {
    22         // Have a write?
    23         if ( PORT_READ(in_WRITE_VAL[i]) == true)
    24           {
     22        for (uint32_t i=0; i<_param->_nb_word; ++i)
     23          reg_DATA[i] = fromString<Tdata_t>(_param->_init_value);
     24      }
     25    else
     26      {
     27        for (uint32_t i=0; i<_param->_nb_port_write; i++)
     28          {
     29            // Have a write?
     30            if ( PORT_READ(in_WRITE_VAL[i]) == true)
     31              {
    2532#ifdef STATISTICS
    26             if (usage_is_set(_usage,USE_STATISTICS))
    27               (*_stat_nb_write) ++;
    28 #endif   
    29 
    30             Taddress_t address;
    31             if (_param->_have_port_address)
    32               address = PORT_READ(in_WRITE_ADDRESS[i]);
    33             else
    34               address = 0;
    35 
    36             Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
    37            
    38             log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
    39 
    40             // Write in registerFile
    41             reg_DATA[address] = data;
    42           }
    43       }
    44     for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
    45       {
    46         // Have a read_write?
    47         if (PORT_READ(in_READ_WRITE_VAL[i]) == true)
    48           {
    49             if (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE)
    50               {
    51 #ifdef STATISTICS
    52                 if (usage_is_set(_usage,USE_STATISTICS))
     33                if (usage_is_set(_usage,USE_STATISTICS))
    5334                  (*_stat_nb_write) ++;
    5435#endif   
    55                
    56                 Taddress_t address;
    57                 if (_param->_have_port_address)
    58                   address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
    59                 else
    60                   address = 0;
    61                 Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
    62                
    63                 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
    64                
    65                 // Write in registerFile
    66                 reg_DATA[address] = data;
    67               }
     36               
     37                Taddress_t address = (_param->_have_port_address)?PORT_READ(in_WRITE_ADDRESS[i]):0;
     38                Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
     39               
     40                log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     41               
     42                // Write in registerFile
     43                reg_DATA[address] = data;
     44              }
     45          }
     46        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
     47          {
     48            // Have a read_write?
     49            if (PORT_READ(in_READ_WRITE_VAL[i]) == true)
     50              {
     51                if (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE)
     52                  {
    6853#ifdef STATISTICS
    69             else
    70               {
    71                 if (usage_is_set(_usage,USE_STATISTICS))
    72                   (*_stat_nb_read) ++;
    73               }
     54                    if (usage_is_set(_usage,USE_STATISTICS))
     55                      (*_stat_nb_write) ++;
    7456#endif   
    75           }
     57                   
     58                    Taddress_t address = (_param->_have_port_address)?PORT_READ(in_READ_WRITE_ADDRESS[i]):0;
     59                    Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
     60                   
     61                    log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     62                   
     63                    // Write in registerFile
     64                    reg_DATA[address] = data;
     65                  }
     66#ifdef STATISTICS
     67                else
     68                  {
     69                    if (usage_is_set(_usage,USE_STATISTICS))
     70                      (*_stat_nb_read) ++;
     71                  }
     72#endif   
     73              }
     74          }
    7675      }
    7776
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp

    r94 r101  
    6565    vhdl->set_body   (0,"begin  -- process RegisterFile_write");
    6666    vhdl->set_body   (1,"if in_CLOCK'event and in_CLOCK = '1' then");
     67
     68    if (_param->_have_init_value)
     69      {
     70        vhdl->set_body   (2,"if in_NRESET = '0' then");
     71       
     72        std::string init_value = ((_param->_size_word>1)?"\"":"'")+_param->_init_value+((_param->_size_word>1)?"\"":"'");
     73       
     74        for (uint32_t i=0; i<_param->_nb_word; ++i)
     75          vhdl->set_body   (3,"reg_DATA("+toString(i)+") <= "+init_value+";");
     76
     77        vhdl->set_body   (2,"else");
     78      }
    6779   
    6880    for (uint32_t i = 0; i < _param->_nb_port_write; i++)
     
    92104
    93105    vhdl->set_body   (1,"end if;");
     106
     107    if (_param->_have_init_value)
     108      vhdl->set_body   (1,"end if;");
     109
    94110    vhdl->set_body   (0,"end process RegisterFile_write;");
    95111  };
Note: See TracChangeset for help on using the changeset viewer.