1 | #ifndef morpheo_behavioural_generic_shifter_Shifter_h |
---|
2 | #define morpheo_behavioural_generic_shifter_Shifter_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Shifter.h 82 2008-05-01 16:48:45Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #ifdef SYSTEMC |
---|
12 | #include "systemc.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | #include <iostream> |
---|
16 | #include "Common/include/ToString.h" |
---|
17 | |
---|
18 | #include "Behavioural/Generic/Shifter/include/Parameters.h" |
---|
19 | #include "Behavioural/Generic/Shifter/include/Types.h" |
---|
20 | #ifdef STATISTICS |
---|
21 | #include "Behavioural/include/Stat.h" |
---|
22 | #endif |
---|
23 | #ifdef VHDL |
---|
24 | #include "Behavioural/include/Vhdl.h" |
---|
25 | #endif |
---|
26 | #include "Behavioural/include/Component.h" |
---|
27 | #include "Behavioural/include/Usage.h" |
---|
28 | |
---|
29 | namespace morpheo { |
---|
30 | namespace behavioural { |
---|
31 | namespace generic { |
---|
32 | namespace shifter { |
---|
33 | |
---|
34 | |
---|
35 | class Shifter |
---|
36 | #if SYSTEMC |
---|
37 | : public sc_module |
---|
38 | #endif |
---|
39 | { |
---|
40 | // -----[ fields ]---------------------------------------------------- |
---|
41 | // Parameters |
---|
42 | protected : const std::string _name; |
---|
43 | protected : const Parameters * _param; |
---|
44 | private : const Tusage_t _usage; |
---|
45 | |
---|
46 | #ifdef STATISTICS |
---|
47 | public : Stat * _stat; |
---|
48 | #endif |
---|
49 | |
---|
50 | public : Component * _component; |
---|
51 | private : Interfaces * _interfaces; |
---|
52 | |
---|
53 | #ifdef SYSTEMC |
---|
54 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
55 | public : SC_CLOCK * in_CLOCK ; |
---|
56 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
57 | |
---|
58 | // Interface "shifter" |
---|
59 | public : SC_IN (Tdata_t) ** in_SHIFTER_DATA ; |
---|
60 | public : SC_IN (Tshift_t) ** in_SHIFTER_SHIFT ; |
---|
61 | public : SC_IN (Tdirection_t) ** in_SHIFTER_DIRECTION ; |
---|
62 | public : SC_IN (Ttype_t) ** in_SHIFTER_TYPE ; |
---|
63 | public : SC_IN (Tcarry_t) ** in_SHIFTER_CARRY ; |
---|
64 | public : SC_IN (Tcontrol_t) ** in_SHIFTER_CARRY_IN ; // Completion == type bool |
---|
65 | public : SC_IN (Tdata_t) ** in_SHIFTER_COMPLETION; // Completion != type bool |
---|
66 | public : SC_OUT(Tdata_t) ** out_SHIFTER_DATA ; |
---|
67 | |
---|
68 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
69 | |
---|
70 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
71 | #endif |
---|
72 | |
---|
73 | // -----[ methods ]--------------------------------------------------- |
---|
74 | |
---|
75 | #ifdef SYSTEMC |
---|
76 | SC_HAS_PROCESS (Shifter); |
---|
77 | #endif |
---|
78 | |
---|
79 | public : Shifter ( |
---|
80 | #ifdef SYSTEMC |
---|
81 | sc_module_name name, |
---|
82 | #else |
---|
83 | std::string name, |
---|
84 | #endif |
---|
85 | #ifdef STATISTICS |
---|
86 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
87 | #endif |
---|
88 | Parameters * param, |
---|
89 | morpheo::behavioural::Tusage_t usage |
---|
90 | ); |
---|
91 | |
---|
92 | public : Shifter (Parameters param ); |
---|
93 | public : ~Shifter (void); |
---|
94 | |
---|
95 | #ifdef SYSTEMC |
---|
96 | private : void allocation (void); |
---|
97 | private : void deallocation (void); |
---|
98 | |
---|
99 | #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) |
---|
100 | public : void transition (void); |
---|
101 | #endif |
---|
102 | public : void genMealy_shift (void); |
---|
103 | #endif |
---|
104 | |
---|
105 | #if VHDL |
---|
106 | public : void vhdl (void); |
---|
107 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
108 | private : void vhdl_body (Vhdl * & vhdl); |
---|
109 | #endif |
---|
110 | |
---|
111 | #ifdef STATISTICS |
---|
112 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
113 | #endif |
---|
114 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
115 | private : void end_cycle (void); |
---|
116 | #endif |
---|
117 | }; |
---|
118 | |
---|
119 | }; // end namespace shifter |
---|
120 | }; // end namespace generic |
---|
121 | |
---|
122 | }; // end namespace behavioural |
---|
123 | }; // end namespace morpheo |
---|
124 | |
---|
125 | #endif |
---|