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

Last change on this file since 78 was 78, checked in by rosiere, 16 years ago

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 3.2 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 (uint32_t depth, bool top_level)
17  {
18    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
19
20    std::string str = "";
21    std::string tab = std::string(depth,'\t');
22//     log_printf(NONE,Behavioural,FUNCTION, "%s* Signal \"%s\"",tab.c_str(),_name.c_str());
23//     log_printf(NONE,Behavioural,FUNCTION, "%s%d - %d - %d",tab.c_str(),
24//             _is_map_as_toplevel_dest,
25//             _is_map_as_component_src,
26//             _is_map_as_component_dest);
27    bool _return = true;
28
29    if (top_level == true)
30      {
31        switch (_direction)
32          {
33          case morpheo::behavioural::IN       : 
34            {
35              if (_is_map_as_toplevel_dest == false)
36                {
37                  _return = false;
38
39                  str = "Signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
40                }
41              break;
42            }
43          case morpheo::behavioural::OUT      : 
44            {
45              if (_is_map_as_toplevel_dest == false)
46                {
47                  _return = false;
48                  str = "Signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
49                }
50              break;
51            }
52            //case morpheo::behavioural::INTERNAL :
53            //case morpheo::behavioural::INOUT    :
54          default    : break;
55          }
56      }
57    else
58      {
59        // internal signal :
60        // Component --- I/O       (as_src)
61        // Component --- Component (as_src and as_dest)
62
63        switch (_direction)
64          {
65          case morpheo::behavioural::IN       : 
66            {
67              if (_is_map_as_component_src == false)
68                {
69                  _return = false;
70                 
71                  str = "Signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
72                }
73              break;
74            }
75          case morpheo::behavioural::OUT      : 
76            {
77              if (_is_map_as_component_src == false)
78                {
79                  _return = false;
80                 
81                  str = "Signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
82                }
83              break;
84            }
85          case morpheo::behavioural::INTERNAL : 
86            {
87              if (_is_map_as_component_src  == false)
88                {
89                  _return = false;
90                 
91                  str = "Internal signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
92                }
93
94              if (_is_map_as_component_dest == false)
95                {
96                  if (_return == false)
97                    str+="\n";
98
99                  _return = false;
100                 
101                  str += "Internal signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
102                }
103
104              break;
105            }
106            //case morpheo::behavioural::INOUT    :
107          default    : break;
108          }
109      }
110   
111    log_printf(FUNC,Behavioural,FUNCTION,"End");
112
113
114
115    if (_return == false)
116      {
117        log_printf(NONE,Behavioural,FUNCTION, "%s* %s",tab.c_str(),str.c_str());
118       
119#ifndef DEBUG
120        std::cerr << str << std::endl;
121#endif
122      }
123    else
124      {
125//      log_printf(NONE,Behavioural,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),_name.c_str());
126      }
127   
128    return _return;
129  };
130
131}; // end namespace behavioural         
132}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.