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

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

Modification des classes d'encapsulation des interfaces :

  • gère les signaux à écrire dans le vhdl
  • les traces pour le testbench
  • la génération des vhdl structurelles

-> test sur la Pattern History Table

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