source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_test_map.cpp @ 62

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

Modification en profondeur de Component-port_map.
Compilation ok pour Register_unit ... a tester (systemC et vhdl)

File size: 1.5 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/include/Signal.h"
9
10
11namespace morpheo              {
12namespace behavioural          {
13
14#undef  FUNCTION
15#define FUNCTION "Signal::test_map"
16  bool Signal::test_map (bool top_level)
17  {
18    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
19
20    log_printf(INFO,Behavioural,FUNCTION, "     * Signal \"%s\"",_name.c_str());
21
22    bool _return = false;
23
24    if (top_level == true)
25      {
26        _return = _is_map_as_dest; 
27             
28        switch (_direction)
29          {
30          case morpheo::behavioural::IN       : 
31            {
32              if (_return == false)
33                cerr << "Signal \"" << _name << "\" is not mapped with an outpout port or a component." << endl;
34              break;
35            }
36          case morpheo::behavioural::OUT      : 
37            {
38              if (_return == false)
39                cerr << "Signal \"" << _name << "\" is not mapped with an input port or a component." << endl;
40              break;
41            }
42            //case morpheo::behavioural::INTERNAL : return "internal" ; break;
43            //case morpheo::behavioural::INOUT    : return "inout"    ; break;
44          default    : break;
45          }
46      }
47    else
48      {
49        _return = _is_map_as_src and _is_map_as_dest;
50
51        if (_return == false)
52          {
53            if (_is_map_as_src  == false)
54              cerr << "Signal \"" << _name << "\" is not mapped as source" << endl;
55            if (_is_map_as_dest == false)
56              cerr << "Signal \"" << _name << "\" is not mapped as destination" << endl;
57          }
58      }
59   
60    log_printf(FUNC,Behavioural,FUNCTION,"End");
61   
62    return _return;
63  };
64
65}; // end namespace behavioural         
66}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.