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