source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp @ 43

Last change on this file since 43 was 43, checked in by rosiere, 17 years ago

Modif mineur : ajout d'info de débug

Release non stable

File size: 1.9 KB
RevLine 
[31]1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
[42]8#include "Behavioural/include/Component.h"
[31]9
10namespace morpheo              {
11namespace behavioural          {
12
[43]13#undef  FUNCTION
14#define FUNCTION "Component::port_map"
[42]15  void Component::port_map (string component_src ,
16                            string port_src      ,
17                            string component_dest,
18                            string port_dest     )
[31]19  {
[43]20    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
21
[42]22    string name_entity = _entity->get_name();
[31]23
[42]24    // First entity
25    Entity * entity_dest = find_entity(component_dest);
[31]26
[42]27    if (entity_dest == NULL)
[43]28      throw (ErrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", port map with unknow component \""+component_dest+"\"."));
[31]29
[42]30    Signal * signal_dest = entity_dest->find_signal (port_dest);
[31]31
[42]32    if (signal_dest == NULL)
[43]33      throw (ErrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", port map with component \""+component_dest+"\" and a unknow signal \""+port_dest+"\"."));
[31]34
[42]35    // Second entity
36    Entity * entity_src = find_entity(component_src);
[31]37
[42]38    if (entity_src == NULL)
[43]39      throw (ErrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", port map with unknow component \""+component_src+"\"."));
[31]40
[42]41    Signal * signal_src = entity_src->find_signal (port_src);
[31]42
[42]43    if (signal_src == NULL)
[43]44      throw (ErrorMorpheo ("<Component::port_map> in component \""+name_entity+"\", port map with component \""+component_src+"\" and a unknow signal \""+port_src+"\"."));
[31]45
[42]46    // If all is ok, mapping
[43]47   
48    //cout << " - " << entity_src->get_name() << "("<< signal_src->get_name() << ")" << "\t-> " << entity_dest->get_name() << "(" << signal_dest->get_name() << ")" << endl;
49
[42]50    signal_src ->link   (signal_dest);
[43]51    //signal_dest->mapping(signal_src );
52   
53    log_printf(FUNC,Behavioural,FUNCTION,"End");
[31]54  };
55
56}; // end namespace behavioural         
57}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.