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