Ignore:
Timestamp:
Dec 5, 2007, 1:40:16 PM (17 years ago)
Author:
rosiere
Message:

register_unit : systemc et VHDL ok

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural
Files:
4 added
4 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/SelfTest/src/test.cpp

    r64 r65  
    374374  LABEL("Initialisation");
    375375
     376  in_NRESET->write(0);
     377  SC_START(5);
     378  in_NRESET->write(1);
     379
    376380  for (uint32_t i=0; i<_param->_nb_gpr_read ; i++)
    377381    in_GPR_READ_VAL  [i]->write(0);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Parameters.cpp

    r60 r65  
    5858
    5959    _size_gpr_address = log2(nb_general_register [0]);
    60    
     60
    6161    for (uint32_t i=1; i<nb_ooo_engine; i++)
    62       if (log2(nb_general_register [i]) > _size_gpr_address)
    63         _size_gpr_address = log2(nb_general_register [i]);
     62      {
     63        uint32_t new_size = log2(nb_general_register [i]);
     64        if (new_size > _size_gpr_address)
     65          _size_gpr_address = new_size;
     66      }
    6467
    6568    _size_spr_address = log2(nb_special_register [0]);
    66    
     69
    6770    for (uint32_t i=1; i<nb_ooo_engine; i++)
    68       if (log2(nb_special_register [i]) > _size_spr_address)
    69         _size_spr_address = log2(nb_special_register [i]);
     71      {
     72        uint32_t new_size = log2(nb_special_register [i]);
     73        if (new_size > _size_spr_address)
     74          _size_spr_address = new_size;
     75      }
     76
    7077
    7178    _param_gpr         = new morpheo::behavioural::generic::registerfile::Parameters * [_nb_ooo_engine];
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Register_unit_allocation.cpp

    r62 r65  
    7272        if (_param->_have_port_ooo_engine_id == true)
    7373          in_GPR_READ_OOO_ENGINE_ID [i]= interface->set_signal_in <Tcontext_t        > ("ooo_engine_id" , log2(_param->_nb_ooo_engine));
    74         in_GPR_READ_NUM_REG       [i]= interface->set_signal_in <Tgeneral_address_t> ("num_reg"       , log2(_param->_size_gpr_address));
     74        in_GPR_READ_NUM_REG       [i]= interface->set_signal_in <Tgeneral_address_t> ("num_reg"       , _param->_size_gpr_address);
    7575        out_GPR_READ_DATA          [i]= interface->set_signal_out<Tgeneral_data_t   > ("data"          , _param->_size_general_data);
    7676        out_GPR_READ_DATA_VAL      [i]= interface->set_signal_out<Tcontrol_t        > ("data_val"      , 1);
     
    9999        if (_param->_have_port_ooo_engine_id == true)
    100100          in_GPR_WRITE_OOO_ENGINE_ID [i]= interface->set_signal_in <Tcontext_t        > ("ooo_engine_id" , log2(_param->_nb_ooo_engine));
    101         in_GPR_WRITE_NUM_REG       [i]= interface->set_signal_in <Tgeneral_address_t> ("num_reg"       , log2(_param->_size_gpr_address));
     101        in_GPR_WRITE_NUM_REG       [i]= interface->set_signal_in <Tgeneral_address_t> ("num_reg"       , _param->_size_gpr_address);
    102102        in_GPR_WRITE_DATA          [i]= interface->set_signal_in <Tgeneral_data_t   > ("data"          , _param->_size_general_data);
    103103      }
     
    126126        if (_param->_have_port_ooo_engine_id == true)
    127127          in_SPR_READ_OOO_ENGINE_ID [i]= interface->set_signal_in <Tcontext_t        > ("ooo_engine_id" , log2(_param->_nb_ooo_engine));
    128         in_SPR_READ_NUM_REG       [i]= interface->set_signal_in <Tspecial_address_t> ("num_reg"       , log2(_param->_size_spr_address));
     128        in_SPR_READ_NUM_REG       [i]= interface->set_signal_in <Tspecial_address_t> ("num_reg"       , _param->_size_spr_address);
    129129        out_SPR_READ_DATA          [i]= interface->set_signal_out<Tspecial_data_t   > ("data"          , _param->_size_special_data);
    130130        out_SPR_READ_DATA_VAL      [i]= interface->set_signal_out<Tcontrol_t        > ("data_val"      , 1);
     
    153153        if (_param->_have_port_ooo_engine_id == true)
    154154          in_SPR_WRITE_OOO_ENGINE_ID [i]= interface->set_signal_in <Tcontext_t        > ("ooo_engine_id" , log2(_param->_nb_ooo_engine));
    155         in_SPR_WRITE_NUM_REG       [i]= interface->set_signal_in <Tspecial_address_t> ("num_reg"       , log2(_param->_size_spr_address));
     155        in_SPR_WRITE_NUM_REG       [i]= interface->set_signal_in <Tspecial_address_t> ("num_reg"       , _param->_size_spr_address);
    156156        in_SPR_WRITE_DATA          [i]= interface->set_signal_in <Tspecial_data_t   > ("data"          , _param->_size_special_data);
    157157      }
     
    190190            out_INSERT_ROB_ACK        [i][j] = interface->set_signal_valack_out (ACK);
    191191            in_INSERT_ROB_RD_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("rd_use"    , 1);
    192             in_INSERT_ROB_RD_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_num_reg", log2(_param->_size_gpr_address));
     192            in_INSERT_ROB_RD_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_num_reg", _param->_size_gpr_address);
    193193            in_INSERT_ROB_RE_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("re_use"    , 1);
    194             in_INSERT_ROB_RE_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_num_reg", log2(_param->_size_spr_address));
     194            in_INSERT_ROB_RE_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_num_reg", _param->_size_spr_address);
    195195             
    196196          }
     
    238238            out_RETIRE_ROB_ACK            [i][j] = interface->set_signal_valack_out (ACK);
    239239            in_RETIRE_ROB_RD_OLD_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("rd_old_use"    , 1);
    240             in_RETIRE_ROB_RD_OLD_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_old_num_reg", log2(_param->_size_gpr_address));
     240            in_RETIRE_ROB_RD_OLD_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_old_num_reg", _param->_size_gpr_address);
    241241            in_RETIRE_ROB_RE_OLD_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("re_old_use"    , 1);
    242             in_RETIRE_ROB_RE_OLD_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_old_num_reg", log2(_param->_size_spr_address));
     242            in_RETIRE_ROB_RE_OLD_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_old_num_reg", _param->_size_spr_address);
    243243            in_RETIRE_ROB_RD_NEW_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("rd_new_use"    , 1);
    244             in_RETIRE_ROB_RD_NEW_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_new_num_reg", log2(_param->_size_gpr_address));
     244            in_RETIRE_ROB_RD_NEW_NUM_REG [i][j] = interface->set_signal_in <Tgeneral_address_t> ("rd_new_num_reg", _param->_size_gpr_address);
    245245            in_RETIRE_ROB_RE_NEW_USE     [i][j] = interface->set_signal_in <Tcontrol_t        > ("re_new_use"    , 1);
    246             in_RETIRE_ROB_RE_NEW_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_new_num_reg", log2(_param->_size_spr_address));
     246            in_RETIRE_ROB_RE_NEW_NUM_REG [i][j] = interface->set_signal_in <Tspecial_address_t> ("re_new_num_reg", _param->_size_spr_address);
    247247          }
    248248      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h

    r62 r65  
    5555  private   : const string          _name          ;
    5656  private   : const direction_t     _direction     ;
    57   private   : const uint32_t        _size          ;
    5857  private   : const presence_port_t _presence_port ;
     58  private   :       uint32_t        _size          ;
    5959
    6060  private   : Signal *              _connect_to_signal;   // the actual implementaion, this signal link with one signal (but if signal is an output, it can be connect with many signal ...)
     
    8181  public    : string            get_name                (void);
    8282  public    : uint32_t          get_size                (void);
     83  public    : void              set_size                (uint32_t size);
     84  public    : void              set_size_max            (uint32_t size);
     85
    8386  public    : Signal *          get_connect_to_signal   (void);
    8487  public    : Signal *          get_connect_from_signal (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h

    r44 r65  
    1818#include "Common/include/ToString.h"
    1919#include "Common/include/Debug.h"
     20#include "Common/include/ErrorMorpheo.h"
    2021
    2122using namespace std;
     
    127128  public    : void             set_body_component_port_map (list<string> & list_port_map      ,
    128129                                                            string         name_port          ,
    129                                                             string         name_signal        );
     130                                                            uint32_t       size_port          ,
     131                                                            string         name_signal        ,
     132                                                            uint32_t       size_signal        );
    130133
    131134  private   : string           get_library_ieee            (uint32_t    depth                 );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp

    r62 r65  
    8888          }
    8989
    90         signal_dest  = signal_internal (entity_productor, signal_productor);
     90        signal_dest= signal_internal (entity_productor, signal_productor);
     91        signal_dest->set_size_max(signal_src->get_size());
     92
    9193        dest_is_port = false;
    9294      }
     
    131133    if (signal_src->get_direction() != OUT)
    132134      throw (ErrorMorpheo ("<Component::port_map> the direction of the signal '"+signal_src->get_name()+"' must be OUT."));
     135
     136    Signal * signal_dest;
     137
     138    signal_dest= signal_internal (entity_src, signal_src);
     139    signal_dest->set_size_max(signal_src->get_size());
    133140   
    134141    try
    135142      {
    136         signal_src->link(signal_internal (entity_src, signal_src),
     143        signal_src->link(signal_dest,
    137144                         false);
    138145      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp

    r58 r65  
    140140//                              else
    141141//                                {
    142 //                                  cout << "Kane à dit : " << signal_dest->get_name() << endl;
    143142//                                  // Test if output
    144143//                                  if (signal_dest->get_direction() == OUT)
     
    156155//                                    }                             
    157156//                                }
    158                                
    159                                   vhdl->set_body_component_port_map (list_port_map, name_src, name_dest);
     157                                 
     158                                  vhdl->set_body_component_port_map (list_port_map,
     159                                                                     name_src , signal_src ->get_size(),
     160                                                                     name_dest, signal_dest->get_size() );
    160161                                }
    161162                              ++k;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp

    r62 r65  
    1717    _name          (name         ),
    1818    _direction     (direction    ),
    19     _size          (size         ),
    2019    _presence_port ((direction==INTERNAL)?PORT_VHDL_NO_TESTBENCH_NO:presence_port)
    2120  {
    2221    log_printf(FUNC,Behavioural,"Signal","Begin");
    23     _is_allocate   = false;
    24     _is_map_as_src = false;
    25     _is_map_as_dest= false;
     22    _size                = size;
     23    _is_allocate         = false;
     24    _is_map_as_src       = false;
     25    _is_map_as_dest      = false;
    2626    _connect_from_signal = NULL;
    2727    _connect_to_signal   = NULL;
    28     _sc_signal     = NULL;
    29     _sc_signal_map = NULL;
    30     _type_info     = UNKNOW;
     28    _sc_signal           = NULL;
     29    _sc_signal_map       = NULL;
     30    _type_info           = UNKNOW;
    3131#ifdef VHDL_TESTBENCH
    32     _list_value    = new list<string>;
     32    _list_value          = new list<string>;
    3333#endif
    3434    log_printf(FUNC,Behavioural,"Signal","End");
     
    3838    _name          (signal._name         ),
    3939    _direction     (signal._direction    ),
    40     _size          (signal._size         ),
    4140    _presence_port (signal._presence_port)
    4241  {
    4342    log_printf(FUNC,Behavioural,"Signal (copy)","Begin");
    44     _is_allocate    = signal._is_allocate;
    45     _is_map_as_src  = signal._is_map_as_src ;
    46     _is_map_as_dest = signal._is_map_as_dest;
     43    _size                = signal._size;
     44    _is_allocate         = signal._is_allocate;
     45    _is_map_as_src       = signal._is_map_as_src ;
     46    _is_map_as_dest      = signal._is_map_as_dest;
    4747    _connect_from_signal = signal._connect_from_signal;
    4848    _connect_to_signal   = signal._connect_to_signal;
    49     _sc_signal      = signal._sc_signal    ;
    50     _sc_signal_map  = signal._sc_signal_map;
    51     _type_info      = signal._type_info ;
     49    _sc_signal           = signal._sc_signal    ;
     50    _sc_signal_map       = signal._sc_signal_map;
     51    _type_info           = signal._type_info ;
    5252#ifdef VHDL_TESTBENCH
    53     _list_value     = signal._list_value;
     53    _list_value          = signal._list_value;
    5454#endif
    5555    log_printf(FUNC,Behavioural,"Signal (copy)","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_connect_from_signal.cpp

    r44 r65  
    1717  {
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     19
    1920    Signal * _return = _connect_from_signal;
     21
     22    while ((_return != NULL) and
     23           (_return->get_direction () == INTERNAL))
     24      _return = _return->get_connect_from_signal();
     25
    2026    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2127
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_connect_to_signal.cpp

    r44 r65  
    1717  {
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     19
    1920    Signal * _return = _connect_to_signal;
     21
     22    while ((_return != NULL) and
     23           (_return->get_direction () == INTERNAL))
     24      _return = _return->get_connect_to_signal();
     25
    2026    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2127
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp

    r62 r65  
    2929      throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal_dest->get_name()+"\", because the first signal is already mapped."));
    3030
    31     //     log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (before) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal_dest->_sc_signal_map));
    32 
    3331    // List of all case
    3432    //
     
    5553    signal_dest->_is_map_as_dest      = true;
    5654
     55    // an internal signal and port can't be a source.
     56    // also, to fill the connect_to_signal's field
     57    if ((signal_src->_direction == OUT) and
     58        (signal_dest->_direction == INTERNAL))
     59      {
     60        signal_dest->_connect_to_signal = signal_src;
     61      }
     62
    5763    // vhdl_testbench : to read an output producte by a internal component
    5864    // TODO : à vérifier !!!!!!!!!!!!
     
    6369    connect (signal_dest);
    6470
    65     //  log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (after ) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal_dest->_sc_signal_map));
    66    
    6771    log_printf(FUNC,Behavioural,FUNCTION,"End");
    6872  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component_port_map.cpp

    r43 r65  
    2020  void Vhdl::set_body_component_port_map (list<string> & list_port_map      ,
    2121                                          string         name_port          ,
    22                                           string         name_signal        )
     22                                          uint32_t       size_port          ,
     23                                          string         name_signal        ,
     24                                          uint32_t       size_signal        )
    2325  {
    2426    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    25     set_list(list_port_map, name_port + "\t=>" + name_signal);
     27
     28    if (size_port > size_signal)
     29      throw (ErrorMorpheo ("<Vhdl::set_body_component_port_map> size of port '"+name_port+"' ("+toString(size_port)+") is greater than size of signal '"+name_signal+"' ("+toString(size_signal)+")."));
     30
     31    string str_size = "";
     32
     33    // test if size is different (possible if multi write
     34    if (size_port != size_signal)
     35      str_size = std_logic_range(size_port);
     36   
     37    set_list(list_port_map, name_port + "\t=>" + name_signal+str_size);
     38     
    2639    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2740  };
Note: See TracChangeset for help on using the changeset viewer.