source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h @ 29

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

Changement de classes de gestions des Interfaces.

-> simplification pour les déclarations de ports, application pour le composant Select_Priority_Fixed.
-> !!! essayer de supprimer la redondance dans les fichierx xxx_vhdl_testbench_transition.cpp

File size: 2.2 KB
Line 
1#ifndef morpheo_behavioural_Signal_h
2#define morpheo_behavioural_Signal_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#include <stdint.h>
12#include <iostream>
13#include "Behavioural/include/Direction.h"
14#include "Behavioural/include/XML.h"
15#include "Include/ToString.h"
16#include "Include/Debug.h"
17
18using namespace std;
19
20namespace morpheo              {
21namespace behavioural          {
22
23  typedef enum {PORT_VHDL_YES_TESTBENCH_YES,
24                PORT_VHDL_YES_TESTBENCH_NO ,
25                PORT_VHDL_NO_TESTBENCH_YES ,
26                PORT_VHDL_NO_TESTBENCH_NO  } presence_port_t;
27
28  class Signal
29  {
30    // -----[ fields ]----------------------------------------------------
31  public    : const string          _name         ;
32  public    : const direction_t     _direction    ;
33  public    : const uint32_t        _size         ;
34  public    : const presence_port_t _presence_port;
35
36    // -----[ methods ]---------------------------------------------------
37  public    :                   Signal          (string          name          ,
38                                                 direction_t     direction     ,
39                                                 uint32_t        size          ,
40                                                 presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES);
41  public    :                   ~Signal         ();
42
43  public    : XML               toXML           (void);
44
45  public    : friend ostream&   operator<<      (ostream& output_stream,
46                                                 morpheo::behavioural::Signal & x);
47
48  };
49}; // end namespace behavioural         
50
51  template<>           inline std::string toString<morpheo::behavioural::presence_port_t>(const morpheo::behavioural::presence_port_t& x)
52  {
53    switch (x)
54      {
55      case morpheo::behavioural::PORT_VHDL_YES_TESTBENCH_YES : return "Port is in VHDL's model and TestBench's model" ; break;
56      case morpheo::behavioural::PORT_VHDL_YES_TESTBENCH_NO  : return "Port is in VHDL's model                      " ; break;
57      case morpheo::behavioural::PORT_VHDL_NO_TESTBENCH_YES  : return "Port is in                  TestBench's model" ; break;
58      case morpheo::behavioural::PORT_VHDL_NO_TESTBENCH_NO   : return "Port is in none model                        " ; break;
59      default                                                : return "";                                               break;
60      }
61  }
62
63}; // end namespace morpheo             
64
65#endif
Note: See TracBrowser for help on using the repository browser.