1 | #ifndef morpheo_behavioural_generic_registerfile_registerfile_monolithic_RegisterFile_Monolithic |
---|
2 | #define morpheo_behavioural_generic_registerfile_registerfile_monolithic_RegisterFile_Monolithic |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id$ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #ifdef SYSTEMC |
---|
12 | #include "systemc.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | #include "Include/Debug.h" |
---|
16 | #include "Include/ToString.h" |
---|
17 | #include <iostream> |
---|
18 | using namespace std; |
---|
19 | |
---|
20 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h" |
---|
21 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h" |
---|
22 | #ifdef STATISTICS |
---|
23 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h" |
---|
24 | #endif |
---|
25 | #ifdef VHDL |
---|
26 | #include "Behavioural/include/Vhdl.h" |
---|
27 | #endif |
---|
28 | #ifdef VHDL_TESTBENCH |
---|
29 | #include "Behavioural/include/Vhdl_Testbench.h" |
---|
30 | #endif |
---|
31 | |
---|
32 | using namespace std; |
---|
33 | |
---|
34 | namespace morpheo { |
---|
35 | namespace behavioural { |
---|
36 | namespace generic { |
---|
37 | namespace registerfile { |
---|
38 | namespace registerfile_monolithic { |
---|
39 | |
---|
40 | class RegisterFile_Monolithic |
---|
41 | #if SYSTEMC |
---|
42 | : public sc_module |
---|
43 | #endif |
---|
44 | { |
---|
45 | // -----[ fields ]---------------------------------------------------- |
---|
46 | // Parameters |
---|
47 | protected : const string _name; |
---|
48 | |
---|
49 | protected : const Parameters _param; |
---|
50 | #ifdef STATISTICS |
---|
51 | private : Statistics * _stat; |
---|
52 | |
---|
53 | private : uint32_t _stat_nb_read; |
---|
54 | private : uint32_t _stat_nb_write; |
---|
55 | #endif |
---|
56 | |
---|
57 | #ifdef VHDL_TESTBENCH |
---|
58 | private : Vhdl_Testbench * _vhdl_testbench; |
---|
59 | #endif |
---|
60 | |
---|
61 | #ifdef SYSTEMC |
---|
62 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
63 | // Interface |
---|
64 | public : SC_CLOCK * in_CLOCK ; |
---|
65 | public : SC_CLOCK * in_NRESET ; |
---|
66 | |
---|
67 | // ----- Interface Read |
---|
68 | public : SC_IN (Tcontrol_t) ** in_READ_VAL ; |
---|
69 | public : SC_OUT (Tcontrol_t) ** out_READ_ACK ; |
---|
70 | public : SC_IN (Taddress_t) ** in_READ_ADDRESS ; |
---|
71 | public : SC_OUT (Tdata_t) ** out_READ_DATA ; |
---|
72 | |
---|
73 | // ----- Interface Write |
---|
74 | public : SC_IN (Tcontrol_t) ** in_WRITE_VAL ; |
---|
75 | public : SC_OUT (Tcontrol_t) ** out_WRITE_ACK ; |
---|
76 | public : SC_IN (Taddress_t) ** in_WRITE_ADDRESS; |
---|
77 | public : SC_IN (Tdata_t) ** in_WRITE_DATA ; |
---|
78 | |
---|
79 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
80 | private : SC_REGISTER (Tdata_t) ** reg_DATA ; |
---|
81 | |
---|
82 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
83 | #endif |
---|
84 | |
---|
85 | // -----[ methods ]--------------------------------------------------- |
---|
86 | |
---|
87 | #ifdef SYSTEMC |
---|
88 | SC_HAS_PROCESS (RegisterFile_Monolithic); |
---|
89 | #endif |
---|
90 | |
---|
91 | public : RegisterFile_Monolithic ( |
---|
92 | #ifdef SYSTEMC |
---|
93 | sc_module_name name, |
---|
94 | #else |
---|
95 | string name, |
---|
96 | #endif |
---|
97 | #ifdef STATISTICS |
---|
98 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
99 | #endif |
---|
100 | Parameters param ); |
---|
101 | |
---|
102 | public : RegisterFile_Monolithic (Parameters param ); |
---|
103 | public : ~RegisterFile_Monolithic (void); |
---|
104 | |
---|
105 | #ifdef SYSTEMC |
---|
106 | private : void allocation (void); |
---|
107 | private : void deallocation (void); |
---|
108 | |
---|
109 | public : void transition (void); |
---|
110 | //public : void genMoore (void) {/* empty */}; |
---|
111 | public : void genMealy_read (void); |
---|
112 | #endif |
---|
113 | |
---|
114 | #ifdef STATISTICS |
---|
115 | public : string statistics (uint32_t depth); |
---|
116 | #endif |
---|
117 | #if VHDL |
---|
118 | private : void vhdl (void); |
---|
119 | private : void vhdl_port (Vhdl & vhdl); |
---|
120 | private : void vhdl_type (Vhdl & vhdl); |
---|
121 | private : void vhdl_signal (Vhdl & vhdl); |
---|
122 | private : void vhdl_body (Vhdl & vhdl); |
---|
123 | #endif |
---|
124 | |
---|
125 | #ifdef VHDL_TESTBENCH |
---|
126 | private : void vhdl_testbench (Vhdl_Testbench & vhdl_testbench); |
---|
127 | private : void vhdl_testbench_port (Vhdl_Testbench & vhdl_testbench); |
---|
128 | private : void vhdl_testbench_transition (Vhdl_Testbench & vhdl_testbench); |
---|
129 | #endif |
---|
130 | |
---|
131 | }; |
---|
132 | |
---|
133 | }; // end namespace registerfile_monolithic |
---|
134 | }; // end namespace registerfile |
---|
135 | }; // end namespace generic |
---|
136 | }; // end namespace behavioural |
---|
137 | }; // end namespace morpheo |
---|
138 | |
---|
139 | #endif |
---|