1 | ////////////////////////////////////////////////////////////////////////////// |
---|
2 | // File: tsar_iob_cluster.h |
---|
3 | // Author: Alain Greiner |
---|
4 | // Copyright: UPMC/LIP6 |
---|
5 | // Date : april 2013 |
---|
6 | // This program is released under the GNU public license |
---|
7 | ////////////////////////////////////////////////////////////////////////////// |
---|
8 | |
---|
9 | #ifndef SOCLIB_CABA_TSAR_IOB_CLUSTER_H |
---|
10 | #define SOCLIB_CABA_TSAR_IOB_CLUSTER_H |
---|
11 | |
---|
12 | #include <systemc> |
---|
13 | #include <sys/time.h> |
---|
14 | #include <iostream> |
---|
15 | #include <sstream> |
---|
16 | #include <cstdlib> |
---|
17 | #include <cstdarg> |
---|
18 | |
---|
19 | #include "gdbserver.h" |
---|
20 | #include "mapping_table.h" |
---|
21 | #include "mips32.h" |
---|
22 | #include "vci_simple_ram.h" |
---|
23 | #include "vci_xicu.h" |
---|
24 | #include "vci_local_crossbar.h" |
---|
25 | #include "dspin_local_crossbar.h" |
---|
26 | #include "vci_dspin_initiator_wrapper.h" |
---|
27 | #include "vci_dspin_target_wrapper.h" |
---|
28 | #include "dspin_router.h" |
---|
29 | #include "vci_multi_dma.h" |
---|
30 | #include "vci_mem_cache.h" |
---|
31 | #include "vci_cc_vcache_wrapper.h" |
---|
32 | #include "vci_io_bridge.h" |
---|
33 | #include "vci_simple_rom.h" |
---|
34 | |
---|
35 | namespace soclib { namespace caba { |
---|
36 | |
---|
37 | /////////////////////////////////////////////////////////////////////////// |
---|
38 | template<typename vci_param_int, |
---|
39 | typename vci_param_ext, |
---|
40 | size_t dspin_int_cmd_width, |
---|
41 | size_t dspin_int_rsp_width, |
---|
42 | size_t dspin_ram_cmd_width, |
---|
43 | size_t dspin_ram_rsp_width> |
---|
44 | class TsarIobCluster |
---|
45 | /////////////////////////////////////////////////////////////////////////// |
---|
46 | : public soclib::caba::BaseModule |
---|
47 | { |
---|
48 | |
---|
49 | public: |
---|
50 | |
---|
51 | // Ports |
---|
52 | sc_in<bool> p_clk; |
---|
53 | sc_in<bool> p_resetn; |
---|
54 | |
---|
55 | // Thes two ports are used to connect IOB to IOX nework in top cell |
---|
56 | soclib::caba::VciInitiator<vci_param_ext>* p_vci_iob_iox_ini; |
---|
57 | soclib::caba::VciTarget<vci_param_ext>* p_vci_iob_iox_tgt; |
---|
58 | |
---|
59 | // These arrays of ports are used to connect the INT & RAM networks in top cell |
---|
60 | soclib::caba::DspinOutput<dspin_int_cmd_width>** p_dspin_int_cmd_out; |
---|
61 | soclib::caba::DspinInput<dspin_int_cmd_width>** p_dspin_int_cmd_in; |
---|
62 | soclib::caba::DspinOutput<dspin_int_rsp_width>** p_dspin_int_rsp_out; |
---|
63 | soclib::caba::DspinInput<dspin_int_rsp_width>** p_dspin_int_rsp_in; |
---|
64 | |
---|
65 | soclib::caba::DspinOutput<dspin_ram_cmd_width>* p_dspin_ram_cmd_out; |
---|
66 | soclib::caba::DspinInput<dspin_ram_cmd_width>* p_dspin_ram_cmd_in; |
---|
67 | soclib::caba::DspinOutput<dspin_ram_rsp_width>* p_dspin_ram_rsp_out; |
---|
68 | soclib::caba::DspinInput<dspin_ram_rsp_width>* p_dspin_ram_rsp_in; |
---|
69 | |
---|
70 | // interrupt signals |
---|
71 | sc_signal<bool> signal_false; |
---|
72 | sc_signal<bool> signal_proc_it[16]; |
---|
73 | sc_signal<bool> signal_irq_mdma[8]; |
---|
74 | sc_signal<bool> signal_irq_memc; |
---|
75 | |
---|
76 | // INT network DSPIN signals between DSPIN routers and DSPIN local_crossbars |
---|
77 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_cmd_l2g_d; |
---|
78 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_cmd_g2l_d; |
---|
79 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_m2p_l2g_c; |
---|
80 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_m2p_g2l_c; |
---|
81 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_clack_l2g_c; |
---|
82 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_clack_g2l_c; |
---|
83 | DspinSignals<dspin_int_rsp_width> signal_int_dspin_rsp_l2g_d; |
---|
84 | DspinSignals<dspin_int_rsp_width> signal_int_dspin_rsp_g2l_d; |
---|
85 | DspinSignals<dspin_int_rsp_width> signal_int_dspin_p2m_l2g_c; |
---|
86 | DspinSignals<dspin_int_rsp_width> signal_int_dspin_p2m_g2l_c; |
---|
87 | |
---|
88 | // INT network VCI signals between VCI components and VCI local crossbar |
---|
89 | VciSignals<vci_param_int> signal_int_vci_ini_proc[8]; |
---|
90 | VciSignals<vci_param_int> signal_int_vci_ini_mdma; |
---|
91 | VciSignals<vci_param_int> signal_int_vci_ini_iobx; |
---|
92 | |
---|
93 | VciSignals<vci_param_int> signal_int_vci_tgt_memc; |
---|
94 | VciSignals<vci_param_int> signal_int_vci_tgt_xicu; |
---|
95 | VciSignals<vci_param_int> signal_int_vci_tgt_mdma; |
---|
96 | VciSignals<vci_param_int> signal_int_vci_tgt_brom; |
---|
97 | VciSignals<vci_param_int> signal_int_vci_tgt_iobx; |
---|
98 | |
---|
99 | VciSignals<vci_param_int> signal_int_vci_l2g; |
---|
100 | VciSignals<vci_param_int> signal_int_vci_g2l; |
---|
101 | |
---|
102 | // Coherence DSPIN signals between DSPIN local crossbars and CC components |
---|
103 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_m2p_memc; |
---|
104 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_clack_memc; |
---|
105 | DspinSignals<dspin_int_rsp_width> signal_int_dspin_p2m_memc; |
---|
106 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_m2p_proc[8]; |
---|
107 | DspinSignals<dspin_int_cmd_width> signal_int_dspin_clack_proc[8]; |
---|
108 | DspinSignals<dspin_int_rsp_width> signal_int_dspin_p2m_proc[8]; |
---|
109 | |
---|
110 | // RAM network VCI signals between VCI components and VCI/DSPIN wrappers |
---|
111 | VciSignals<vci_param_ext> signal_ram_vci_ini_memc; |
---|
112 | VciSignals<vci_param_ext> signal_ram_vci_ini_iobx; |
---|
113 | VciSignals<vci_param_ext> signal_ram_vci_tgt_xram; |
---|
114 | |
---|
115 | // RAM network DSPIN signals between VCI/DSPIN wrappers, RAM dspin crossbar |
---|
116 | // and routers |
---|
117 | DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_xram_t; |
---|
118 | DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_xram_t; |
---|
119 | DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_memc_i; |
---|
120 | DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_memc_i; |
---|
121 | DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_iob_i; |
---|
122 | DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_iob_i; |
---|
123 | DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_xbar; |
---|
124 | DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_xbar; |
---|
125 | DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_false; |
---|
126 | DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_false; |
---|
127 | |
---|
128 | ////////////////////////////////////// |
---|
129 | // Hardwate Components (pointers) |
---|
130 | ////////////////////////////////////// |
---|
131 | VciCcVCacheWrapper<vci_param_int, |
---|
132 | dspin_int_cmd_width, |
---|
133 | dspin_int_rsp_width, |
---|
134 | GdbServer<Mips32ElIss> >* proc[8]; |
---|
135 | |
---|
136 | VciMemCache<vci_param_int, |
---|
137 | vci_param_ext, |
---|
138 | dspin_int_rsp_width, |
---|
139 | dspin_int_cmd_width>* memc; |
---|
140 | |
---|
141 | VciDspinInitiatorWrapper<vci_param_ext, |
---|
142 | dspin_ram_cmd_width, |
---|
143 | dspin_ram_rsp_width>* memc_ram_wi; |
---|
144 | |
---|
145 | VciXicu<vci_param_int>* xicu; |
---|
146 | |
---|
147 | VciMultiDma<vci_param_int>* mdma; |
---|
148 | |
---|
149 | VciSimpleRom<vci_param_int>* brom; |
---|
150 | |
---|
151 | VciLocalCrossbar<vci_param_int>* int_xbar_d; |
---|
152 | |
---|
153 | VciDspinInitiatorWrapper<vci_param_int, |
---|
154 | dspin_int_cmd_width, |
---|
155 | dspin_int_rsp_width>* int_wi_gate_d; |
---|
156 | |
---|
157 | VciDspinTargetWrapper<vci_param_int, |
---|
158 | dspin_int_cmd_width, |
---|
159 | dspin_int_rsp_width>* int_wt_gate_d; |
---|
160 | |
---|
161 | DspinLocalCrossbar<dspin_int_cmd_width>* int_xbar_m2p_c; |
---|
162 | DspinLocalCrossbar<dspin_int_rsp_width>* int_xbar_p2m_c; |
---|
163 | DspinLocalCrossbar<dspin_int_cmd_width>* int_xbar_clack_c; |
---|
164 | |
---|
165 | DspinRouter<dspin_int_cmd_width>** int_router_cmd; |
---|
166 | DspinRouter<dspin_int_rsp_width>** int_router_rsp; |
---|
167 | |
---|
168 | VciSimpleRam<vci_param_ext>* xram; |
---|
169 | |
---|
170 | VciDspinTargetWrapper<vci_param_ext, |
---|
171 | dspin_ram_cmd_width, |
---|
172 | dspin_ram_rsp_width>* xram_ram_wt; |
---|
173 | |
---|
174 | DspinRouter<dspin_ram_cmd_width>* ram_router_cmd; |
---|
175 | DspinRouter<dspin_ram_rsp_width>* ram_router_rsp; |
---|
176 | |
---|
177 | DspinLocalCrossbar<dspin_ram_cmd_width>* ram_xbar_cmd; |
---|
178 | DspinLocalCrossbar<dspin_ram_rsp_width>* ram_xbar_rsp; |
---|
179 | |
---|
180 | |
---|
181 | // IO Network Components (not instanciated in all clusters) |
---|
182 | |
---|
183 | VciIoBridge<vci_param_int, |
---|
184 | vci_param_ext>* iob; |
---|
185 | |
---|
186 | VciDspinInitiatorWrapper<vci_param_ext, |
---|
187 | dspin_ram_cmd_width, |
---|
188 | dspin_ram_rsp_width>* iob_ram_wi; |
---|
189 | |
---|
190 | // cluster constructor |
---|
191 | TsarIobCluster( sc_module_name insname, |
---|
192 | size_t nb_procs, |
---|
193 | size_t nb_dmas, |
---|
194 | size_t x, // x coordinate |
---|
195 | size_t y, // y coordinate |
---|
196 | size_t x_size, |
---|
197 | size_t y_size, |
---|
198 | |
---|
199 | size_t p_width, // pid field bits |
---|
200 | |
---|
201 | const soclib::common::MappingTable &mt_int, |
---|
202 | const soclib::common::MappingTable &mt_ext, |
---|
203 | const soclib::common::MappingTable &mt_iox, |
---|
204 | |
---|
205 | size_t x_width, // x field bits |
---|
206 | size_t y_width, // y field bits |
---|
207 | size_t l_width, // l field bits |
---|
208 | |
---|
209 | size_t int_memc_tgt_id, |
---|
210 | size_t int_xicu_tgt_id, |
---|
211 | size_t int_mdma_tgt_id, |
---|
212 | size_t int_brom_tgt_id, |
---|
213 | size_t int_iobx_tgt_id, |
---|
214 | size_t int_proc_ini_id, |
---|
215 | size_t int_mdma_ini_id, |
---|
216 | size_t int_iobx_ini_id, |
---|
217 | |
---|
218 | size_t ram_xram_tgt_id, |
---|
219 | size_t ram_memc_ini_id, |
---|
220 | size_t ram_iobx_ini_id, |
---|
221 | |
---|
222 | bool is_io, |
---|
223 | size_t iox_iobx_tgt_id, |
---|
224 | size_t iox_iobx_ini_id, |
---|
225 | |
---|
226 | size_t memc_ways, |
---|
227 | size_t memc_sets, |
---|
228 | size_t l1_i_ways, |
---|
229 | size_t l1_i_sets, |
---|
230 | size_t l1_d_ways, |
---|
231 | size_t l1_d_sets, |
---|
232 | size_t xram_latency, |
---|
233 | size_t xcu_nb_inputs, |
---|
234 | |
---|
235 | bool distboot, |
---|
236 | |
---|
237 | const Loader &loader, // loader for XRAM |
---|
238 | |
---|
239 | uint32_t frozen_cycles, |
---|
240 | uint32_t start_debug_cycle, |
---|
241 | bool memc_debug_ok, |
---|
242 | bool proc_debug_ok, |
---|
243 | bool iob0_debug_ok ); |
---|
244 | |
---|
245 | ~TsarIobCluster(); |
---|
246 | |
---|
247 | protected: |
---|
248 | |
---|
249 | SC_HAS_PROCESS(TsarIobCluster); |
---|
250 | |
---|
251 | void init(); |
---|
252 | |
---|
253 | |
---|
254 | }; |
---|
255 | |
---|
256 | }} |
---|
257 | |
---|
258 | #endif |
---|
259 | |
---|
260 | // Local Variables: |
---|
261 | // tab-width: 3 |
---|
262 | // c-basic-offset: 3 |
---|
263 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
264 | // indent-tabs-mode: nil |
---|
265 | // End: |
---|
266 | |
---|
267 | // vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3 |
---|
268 | // |
---|