1 | #ifndef morpheo_behavioural_generic_registerfile_registerfile_multi_banked_RegisterFile_Multi_Banked_h |
---|
2 | #define morpheo_behavioural_generic_registerfile_registerfile_multi_banked_RegisterFile_Multi_Banked_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id$ |
---|
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 | #include "Common/include/Debug.h" |
---|
18 | |
---|
19 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h" |
---|
20 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h" |
---|
21 | #ifdef STATISTICS |
---|
22 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Statistics.h" |
---|
23 | #endif |
---|
24 | #include "Behavioural/include/Component.h" |
---|
25 | #ifdef VHDL |
---|
26 | #include "Behavioural/include/Vhdl.h" |
---|
27 | #endif |
---|
28 | |
---|
29 | using namespace std; |
---|
30 | |
---|
31 | namespace morpheo { |
---|
32 | namespace behavioural { |
---|
33 | namespace generic { |
---|
34 | namespace registerfile { |
---|
35 | namespace registerfile_multi_banked { |
---|
36 | |
---|
37 | |
---|
38 | class RegisterFile_Multi_Banked |
---|
39 | #if SYSTEMC |
---|
40 | : public sc_module |
---|
41 | #endif |
---|
42 | { |
---|
43 | // -----[ fields ]---------------------------------------------------- |
---|
44 | // Parameters |
---|
45 | protected : const string _name; |
---|
46 | |
---|
47 | protected : const Parameters * _param; |
---|
48 | //#ifdef STATISTICS |
---|
49 | // protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; |
---|
50 | //#endif |
---|
51 | |
---|
52 | #ifdef STATISTICS |
---|
53 | private : Statistics * _stat; |
---|
54 | #endif |
---|
55 | |
---|
56 | public : Component * _component; |
---|
57 | private : Interfaces * _interfaces; |
---|
58 | |
---|
59 | #ifdef SYSTEMC |
---|
60 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
61 | // Interface |
---|
62 | public : SC_CLOCK * in_CLOCK ; |
---|
63 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
64 | |
---|
65 | // ----- Interface Read |
---|
66 | public : SC_IN (Tcontrol_t) ** in_READ_VAL ; |
---|
67 | public : SC_OUT (Tcontrol_t) ** out_READ_ACK ; |
---|
68 | public : SC_IN (Taddress_t) ** in_READ_ADDRESS ; |
---|
69 | public : SC_OUT (Tdata_t) ** out_READ_DATA ; |
---|
70 | |
---|
71 | // ----- Interface Write |
---|
72 | public : SC_IN (Tcontrol_t) ** in_WRITE_VAL ; |
---|
73 | public : SC_OUT (Tcontrol_t) ** out_WRITE_ACK ; |
---|
74 | public : SC_IN (Taddress_t) ** in_WRITE_ADDRESS; |
---|
75 | public : SC_IN (Tdata_t) ** in_WRITE_DATA ; |
---|
76 | |
---|
77 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
78 | |
---|
79 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
80 | private : SC_REGISTER (Tdata_t) *** reg_DATA ; |
---|
81 | |
---|
82 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
83 | private : bool * internal_WRITE_VAL; |
---|
84 | private : Taddress_t * internal_WRITE_BANK; |
---|
85 | private : Taddress_t * internal_WRITE_NUM_REG; |
---|
86 | |
---|
87 | // function pointer |
---|
88 | public : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_transition ) (void); |
---|
89 | public : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_genMealy_read ) (void); |
---|
90 | public : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_genMealy_write) (void); |
---|
91 | #endif |
---|
92 | |
---|
93 | // -----[ methods ]--------------------------------------------------- |
---|
94 | |
---|
95 | #ifdef SYSTEMC |
---|
96 | SC_HAS_PROCESS (RegisterFile_Multi_Banked); |
---|
97 | #endif |
---|
98 | public : RegisterFile_Multi_Banked ( |
---|
99 | #ifdef SYSTEMC |
---|
100 | sc_module_name name, |
---|
101 | #else |
---|
102 | string name, |
---|
103 | #endif |
---|
104 | #ifdef STATISTICS |
---|
105 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
106 | #endif |
---|
107 | Parameters * param ); |
---|
108 | |
---|
109 | public : ~RegisterFile_Multi_Banked (void); |
---|
110 | |
---|
111 | #ifdef SYSTEMC |
---|
112 | private : void allocation (void); |
---|
113 | private : void deallocation (void); |
---|
114 | |
---|
115 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
116 | |
---|
117 | private : Taddress_t address_bank (Taddress_t address); |
---|
118 | private : Taddress_t address_num_reg (Taddress_t address); |
---|
119 | |
---|
120 | public : void transition (void); |
---|
121 | public : void genMealy_read (void); |
---|
122 | public : void genMealy_write (void); |
---|
123 | |
---|
124 | public : void full_crossbar_transition (void); |
---|
125 | public : void full_crossbar_genMealy_read (void); |
---|
126 | public : void full_crossbar_genMealy_write (void); |
---|
127 | |
---|
128 | public : void partial_crossbar_transition (void); |
---|
129 | public : void partial_crossbar_genMealy_read (void); |
---|
130 | public : void partial_crossbar_genMealy_write(void); |
---|
131 | |
---|
132 | //#endif |
---|
133 | #endif |
---|
134 | #ifdef STATISTICS |
---|
135 | public : string statistics (uint32_t depth); |
---|
136 | #endif |
---|
137 | |
---|
138 | #if VHDL |
---|
139 | public : void vhdl (void); |
---|
140 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
141 | private : void vhdl_body (Vhdl * & vhdl); |
---|
142 | #endif |
---|
143 | |
---|
144 | #ifdef VHDL_TESTBENCH |
---|
145 | private : void vhdl_testbench_transition (void); |
---|
146 | #endif |
---|
147 | }; |
---|
148 | |
---|
149 | }; // end namespace registerfile_multi_banked |
---|
150 | }; // end namespace registerfile |
---|
151 | }; // end namespace generic |
---|
152 | |
---|
153 | }; // end namespace behavioural |
---|
154 | }; // end namespace morpheo |
---|
155 | |
---|
156 | #endif |
---|