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 | |
---|
18 | using namespace std; |
---|
19 | |
---|
20 | namespace morpheo { |
---|
21 | namespace 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 | friend class Interface; |
---|
31 | |
---|
32 | // -----[ fields ]---------------------------------------------------- |
---|
33 | private : const string _name ; |
---|
34 | private : const direction_t _direction ; |
---|
35 | private : const uint32_t _size ; |
---|
36 | private : const presence_port_t _presence_port; |
---|
37 | |
---|
38 | // -----[ methods ]--------------------------------------------------- |
---|
39 | public : Signal (string name , |
---|
40 | direction_t direction , |
---|
41 | uint32_t size , |
---|
42 | presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES); |
---|
43 | public : Signal (const Signal &); |
---|
44 | public : ~Signal (); |
---|
45 | |
---|
46 | public : XML toXML (void); |
---|
47 | |
---|
48 | public : friend ostream& operator<< (ostream& output_stream, |
---|
49 | morpheo::behavioural::Signal & x); |
---|
50 | |
---|
51 | }; |
---|
52 | }; // end namespace behavioural |
---|
53 | |
---|
54 | template<> inline std::string toString<morpheo::behavioural::presence_port_t>(const morpheo::behavioural::presence_port_t& x) |
---|
55 | { |
---|
56 | switch (x) |
---|
57 | { |
---|
58 | case morpheo::behavioural::PORT_VHDL_YES_TESTBENCH_YES : return "Port is in VHDL's model and TestBench's model" ; break; |
---|
59 | case morpheo::behavioural::PORT_VHDL_YES_TESTBENCH_NO : return "Port is in VHDL's model " ; break; |
---|
60 | case morpheo::behavioural::PORT_VHDL_NO_TESTBENCH_YES : return "Port is in TestBench's model" ; break; |
---|
61 | case morpheo::behavioural::PORT_VHDL_NO_TESTBENCH_NO : return "Port is in none model " ; break; |
---|
62 | default : return ""; break; |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | }; // end namespace morpheo |
---|
67 | |
---|
68 | #endif |
---|