source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_interface_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.8 KB
Line 
1#ifdef POSITION
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/include/Component.h"
10
11namespace morpheo              {
12namespace behavioural          {
13
14  void Component::interface_map (string component_src ,
15                                 string port_src      ,
16                                 string component_dest,
17                                 string port_dest     )
18  {
19    // First entity
20    Entity * entity_dest = find_entity(component_dest);
21
22    string name_entity = _entity->get_name();
23
24    if (entity_dest == NULL)
25      throw (ErrorMorpheo ("Component \""+name_entity+"\", port map with unknow component \""+component_dest+"\"."));
26
27    bool is_top_level_dest = (name_entity == component_dest);
28
29    Interface * interface_dest = entity_dest->find_interface(port_dest);
30   
31    if (interface_dest == NULL)
32      throw (ErrorMorpheo ("Component \""+name_entity+"\", port map with component \""+component_dest+"\" and a unknow interface \""+port_dest+"\"."));
33
34    // Second entity
35    Entity * entity_src = find_entity(component_src);
36
37    if (entity_src == NULL)
38      throw (ErrorMorpheo ("Component \""+name_entity+"\", port map with unknow component \""+component_src+"\"."));
39
40    bool is_top_level_src = (name_entity == component_src);
41
42    Interface * interface_src = entity_src->find_interface(port_src);
43
44    if (interface_src == NULL)
45      throw (ErrorMorpheo ("Component \""+name_entity+"\", port map with component \""+component_src+"\" and a unknow interface \""+port_src+"\"."));
46
47    // all is ok - link
48    if (is_top_level_dest == false)
49      interface_dest->interface_map(static_cast<void *>(entity_src   ),
50                                    static_cast<void *>(interface_src));
51   
52    if (is_top_level_src == false)
53      interface_src->interface_map(static_cast<void *>(entity_dest   ),
54                                   static_cast<void *>(interface_dest));
55   
56  };
57
58}; // end namespace behavioural         
59}; // end namespace morpheo             
60#endif
Note: See TracBrowser for help on using the repository browser.