1 | #ifndef morpheo_behavioural_core_dcache_access_Dcache_Access_h |
---|
2 | #define morpheo_behavioural_core_dcache_access_Dcache_Access_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Dcache_Access.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 | |
---|
16 | #include "Behavioural/Core/Dcache_Access/include/Parameters.h" |
---|
17 | #include "Behavioural/Core/Dcache_Access/include/Types.h" |
---|
18 | #ifdef STATISTICS |
---|
19 | #include "Behavioural/include/Stat.h" |
---|
20 | #endif |
---|
21 | #include "Behavioural/include/Component.h" |
---|
22 | #ifdef VHDL |
---|
23 | #include "Behavioural/include/Vhdl.h" |
---|
24 | #endif |
---|
25 | #include "Behavioural/include/Usage.h" |
---|
26 | |
---|
27 | #include "Common/include/ToString.h" |
---|
28 | #include "Common/include/Debug.h" |
---|
29 | |
---|
30 | #include "Behavioural/Generic/Priority/include/Priority.h" |
---|
31 | |
---|
32 | #include <iostream> |
---|
33 | |
---|
34 | namespace morpheo { |
---|
35 | namespace behavioural { |
---|
36 | |
---|
37 | namespace core { |
---|
38 | namespace dcache_access { |
---|
39 | |
---|
40 | |
---|
41 | class Dcache_Access |
---|
42 | #if SYSTEMC |
---|
43 | : public sc_module |
---|
44 | #endif |
---|
45 | { |
---|
46 | // -----[ fields ]---------------------------------------------------- |
---|
47 | // Parameters |
---|
48 | protected : const std::string _name; |
---|
49 | protected : const Parameters * _param; |
---|
50 | private : const Tusage_t _usage; |
---|
51 | |
---|
52 | #ifdef STATISTICS |
---|
53 | public : Stat * _stat; |
---|
54 | |
---|
55 | private : counter_t ** _stat_nb_access; |
---|
56 | private : counter_t ** _stat_nb_access_conflit; |
---|
57 | #endif |
---|
58 | |
---|
59 | public : Component * _component; |
---|
60 | private : Interfaces * _interfaces; |
---|
61 | |
---|
62 | #ifdef SYSTEMC |
---|
63 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
64 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
65 | public : SC_CLOCK * in_CLOCK ; |
---|
66 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
67 | |
---|
68 | // ~~~~~[ Interface "dcache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
69 | public : SC_OUT(Tcontrol_t ) ** out_DCACHE_REQ_VAL ;//[nb_dcache_port] |
---|
70 | public : SC_IN (Tcontrol_t ) ** in_DCACHE_REQ_ACK ;//[nb_dcache_port] |
---|
71 | public : SC_OUT(Tcontext_t ) ** out_DCACHE_REQ_THREAD_ID ;//[nb_dcache_port] |
---|
72 | public : SC_OUT(Tpacket_t ) ** out_DCACHE_REQ_PACKET_ID ;//[nb_dcache_port] |
---|
73 | public : SC_OUT(Tdcache_address_t ) ** out_DCACHE_REQ_ADDRESS ;//[nb_dcache_port] |
---|
74 | public : SC_OUT(Tdcache_data_t ) ** out_DCACHE_REQ_WDATA ;//[nb_dcache_port] |
---|
75 | public : SC_OUT(Tdcache_type_t ) ** out_DCACHE_REQ_TYPE ;//[nb_dcache_port] |
---|
76 | |
---|
77 | // ~~~~~[ Interface "dcache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
78 | public : SC_IN (Tcontrol_t ) ** in_DCACHE_RSP_VAL ;//[nb_dcache_port] |
---|
79 | public : SC_OUT(Tcontrol_t ) ** out_DCACHE_RSP_ACK ;//[nb_dcache_port] |
---|
80 | public : SC_IN (Tcontext_t ) ** in_DCACHE_RSP_THREAD_ID ;//[nb_dcache_port] |
---|
81 | public : SC_IN (Tpacket_t ) ** in_DCACHE_RSP_PACKET_ID ;//[nb_dcache_port] |
---|
82 | public : SC_IN (Tdcache_data_t ) ** in_DCACHE_RSP_RDATA ;//[nb_dcache_port] |
---|
83 | public : SC_IN (Tdcache_error_t ) ** in_DCACHE_RSP_ERROR ;//[nb_dcache_port] |
---|
84 | |
---|
85 | // ~~~~~[ Interface "lsq_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
86 | public : SC_IN (Tcontrol_t ) **** in_LSQ_REQ_VAL ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
87 | public : SC_OUT(Tcontrol_t ) **** out_LSQ_REQ_ACK ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
88 | public : SC_IN (Tcontext_t ) **** in_LSQ_REQ_THREAD_ID ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
89 | public : SC_IN (Tpacket_t ) **** in_LSQ_REQ_PACKET_ID ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
90 | public : SC_IN (Tdcache_address_t ) **** in_LSQ_REQ_ADDRESS ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
91 | public : SC_IN (Tdcache_data_t ) **** in_LSQ_REQ_WDATA ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
92 | public : SC_IN (Tdcache_type_t ) **** in_LSQ_REQ_TYPE ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
93 | |
---|
94 | // ~~~~~[ Interface "lsq_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
95 | public : SC_OUT(Tcontrol_t ) **** out_LSQ_RSP_VAL ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
96 | public : SC_IN (Tcontrol_t ) **** in_LSQ_RSP_ACK ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
97 | public : SC_OUT(Tcontext_t ) **** out_LSQ_RSP_THREAD_ID ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
98 | public : SC_OUT(Tpacket_t ) **** out_LSQ_RSP_PACKET_ID ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
99 | public : SC_OUT(Tdcache_data_t ) **** out_LSQ_RSP_RDATA ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
100 | public : SC_OUT(Tdcache_error_t ) **** out_LSQ_RSP_ERROR ;//[nb_execute_loop][nb_load_store_unit][nb_cache_access] |
---|
101 | |
---|
102 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
103 | private : generic::priority::Priority * _priority; |
---|
104 | |
---|
105 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
106 | |
---|
107 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
108 | |
---|
109 | #ifdef STATISTICS |
---|
110 | private : uint32_t * _internal_DCACHE_REQ_NB_ACCESS ; //[nb_dcache_port] |
---|
111 | private : uint32_t * _internal_DCACHE_REQ_NB_ACCESS_CONFLIT; //[nb_dcache_port] |
---|
112 | #endif |
---|
113 | |
---|
114 | #endif |
---|
115 | |
---|
116 | // -----[ Methods ]--------------------------------------------------- |
---|
117 | |
---|
118 | #ifdef SYSTEMC |
---|
119 | SC_HAS_PROCESS (Dcache_Access); |
---|
120 | #endif |
---|
121 | public : Dcache_Access |
---|
122 | ( |
---|
123 | #ifdef SYSTEMC |
---|
124 | sc_module_name name, |
---|
125 | #else |
---|
126 | std::string name, |
---|
127 | #endif |
---|
128 | #ifdef STATISTICS |
---|
129 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
130 | #endif |
---|
131 | Parameters * param, |
---|
132 | morpheo::behavioural::Tusage_t usage |
---|
133 | ); |
---|
134 | public : ~Dcache_Access (void); |
---|
135 | |
---|
136 | private : void allocation ( |
---|
137 | #ifdef STATISTICS |
---|
138 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
139 | #else |
---|
140 | void |
---|
141 | #endif |
---|
142 | ); |
---|
143 | private : void deallocation (void); |
---|
144 | |
---|
145 | #ifdef SYSTEMC |
---|
146 | public : void transition (void); |
---|
147 | //public : void genMoore (void); |
---|
148 | public : void genMealy_req (void); |
---|
149 | public : void genMealy_rsp (void); |
---|
150 | |
---|
151 | #endif |
---|
152 | |
---|
153 | #if VHDL |
---|
154 | public : void vhdl (void); |
---|
155 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
156 | private : void vhdl_body (Vhdl * & vhdl); |
---|
157 | #endif |
---|
158 | |
---|
159 | #ifdef STATISTICS |
---|
160 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
161 | public : void statistics_deallocation (void); |
---|
162 | #endif |
---|
163 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
164 | private : void end_cycle (void); |
---|
165 | #endif |
---|
166 | }; |
---|
167 | |
---|
168 | }; // end namespace dcache_access |
---|
169 | }; // end namespace core |
---|
170 | |
---|
171 | }; // end namespace behavioural |
---|
172 | }; // end namespace morpheo |
---|
173 | |
---|
174 | #endif |
---|