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/src
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • 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.