source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp @ 94

Last change on this file since 94 was 94, checked in by rosiere, 15 years ago

Update document on Vhdl generation.

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1/*
2 * $Id: Interface_get_signal.cpp 94 2008-12-15 11:04:03Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/include/Interface.h"
9#include "Common/include/Tabulation.h"
10
11namespace morpheo              {
12namespace behavioural          {
13
14  std::string Interface::get_signal (void)
15  {
16    log_printf(FUNC,Behavioural,"get_signal","Begin");
17
18    uint32_t               depth          = 0;
19    std::string                 separator      = ",\n";
20    bool                   last_separator = false;
21
22
23    std::list<Signal*>::iterator i    = _list_signal->begin();
24    bool                         empty = _list_signal->empty();
25
26    std::string                 tab   = morpheo::tab(depth);
27    std::ostringstream          text;
28
29    if (not empty)
30      {
31        // First
32        if (i != _list_signal->end())
33          {
34            text << tab << **i;
35            ++i;
36          }
37       
38        while (i != _list_signal->end())
39          {
40            text << separator;
41            text << tab << **i;
42            ++i;
43          }
44        if (last_separator)
45          text << separator;
46      }
47
48    log_printf(FUNC,Behavioural,"get_signal","End");
49
50    return text.str();
51  };
52
53#ifdef VHDL
54#  ifdef VHDL_TESTBENCH
55
56#undef  FUNCTION
57#define FUNCTION "Interface::get_signal"
58  void Interface::get_signal (std::list<std::string> * & list_signal)
59  {
60    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
61
62    if (not _list_signal->empty())
63      {
64        std::list<Signal*>::iterator i = _list_signal->begin();
65       
66        while (i != _list_signal->end())
67          {
68            (*i)->get_name_vhdl (list_signal);
69            ++i;
70          }
71      }
72
73    log_printf(FUNC,Behavioural,FUNCTION,"End");
74  };
75#  endif
76#endif
77
78#undef  FUNCTION
79#define FUNCTION "Interface::get_signal_list"
80  std::list<Signal *> * Interface::get_signal_list (void)
81    {
82      log_printf(FUNC,Behavioural,FUNCTION,"Begin");
83      std::list<Signal *> * _return = _list_signal;
84      log_printf(FUNC,Behavioural,FUNCTION,"End");
85
86      return _return;
87    }
88
89}; // end namespace behavioural         
90}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.