source: branches/v4/platforms/almos-tsarv3-platforms/multi-clusters/tsarv4_cluster_xbar/caba/source/include/tsarv4_cluster_xbar.h

Last change on this file was 259, checked in by almaless, 12 years ago

Introduce ALMOS used platforms for TSAR.
See the package's README file for more information.

File size: 8.5 KB
Line 
1//////////////////////////////////////////////////////////////////////////////
2// File: tsarv4_cluster_xbar.h
3// Author: Alain Greiner
4// Copyright: UPMC/LIP6
5// Date : march 2011
6// This program is released under the GNU public license
7//////////////////////////////////////////////////////////////////////////////
8// This file define a TSAR cluster architecture without virtual memory,
9// - It uses the virtual_dspin_router  as distributed global interconnect
10// - It uses the vci_local_crossbar as local interconnect
11// - It uses the vci_cc_xcache_wrapper_v4
12// - It uses the vci_mem_cache_v4
13// - It contains a private RAM a variable latency to emulate the L3 cache
14// - It can contains 1, 2 or 4 processors
15// - Each processor has a private local TTY terminal (vci_multi_tty)
16// - Each processor has a private dma channel (vci_multi_dma)
17// - It uses the vci_xicu interrupt controller
18// - The nprocs tty irq are connected to IRQ_IN[0]...IRQ_IN[3]
19// - The nprocs dma irq are connected to IRQ_IN[4]...IRQ_IN[7]
20// - The peripherals BDEV, FBUF, and the boot BROM are in the cluster
21//   containing address 0xBFC00000, and the bdev_irq is connected to IRQ_IN[8]
22//////////////////////////////////////////////////////////////////////////////////
23
24#ifndef SOCLIB_CABA_TSAR_CLUSTER_V4_XBAR_H
25#define SOCLIB_CABA_TSAR_CLUSTER_V4_XBAR_H
26
27#include <systemc>
28#include <sys/time.h>
29#include <iostream>
30#include <sstream>
31#include <cstdlib>
32#include <cstdarg>
33
34//#include "gdbserver.h"
35#include "virtual_dspin_router.h"
36#include "mapping_table.h"
37#include "mips32.h"
38#include "vci_simple_ram.h"
39#include "vci_xicu.h"
40#include "vci_multi_tty.h"
41#include "vci_block_device_tsar_v2.h"
42#include "vci_framebuffer.h"
43#include "vci_dma_tsar_v2.h"
44#include "vci_logger.h"
45#include "config.h"
46
47#if USE_LOCAL_RING
48#include "vci_local_ring_fast.h"
49#else
50#include "vci_local_crossbar.h"
51#include "vci_vdspin_target_wrapper.h"
52#include "vci_vdspin_initiator_wrapper.h"
53#endif
54
55#if USE_MEMCACHE_V3
56#include "vci_mem_cache_v3.h"
57#include "vci_cc_vcache_wrapper2_v1.h"
58#endif
59
60#if USE_MEMCACHE_V4
61#include "vci_mem_cache_v4.h"
62#include "vci_cc_xcache_wrapper_v4.h"
63#endif
64
65
66#if !(USE_MEMCACHE_V3 ^ USE_MEMCACHE_V4)
67#error One version of TSAR memory system must be provieded (V3 or V4)
68#endif
69
70#if (USE_LOGGER_ON_CPUs && USE_PROFILER_ON_CPUs)
71#error Either Logger or Profiler can be used, you have to make a choice !
72#endif
73
74
75#if USE_PROFILER_ON_CPUs
76#include "vci_profiler.h"
77#endif
78
79namespace soclib {
80namespace caba  {
81
82///////////////////////////////////////////////////////////////////////////
83template<typename vci_param, typename iss_t, int cmd_width, int rsp_width>
84class TsarV4ClusterXbar
85///////////////////////////////////////////////////////////////////////////
86    : public soclib::caba::BaseModule
87{
88
89  public:
90
91        // Ports
92        sc_in<bool>                                             p_clk;
93        sc_in<bool>                                             p_resetn;
94        soclib::caba::DspinOutput<cmd_width>                    **p_cmd_out;
95        soclib::caba::DspinInput<cmd_width>                     **p_cmd_in;
96        soclib::caba::DspinOutput<rsp_width>                    **p_rsp_out;
97        soclib::caba::DspinInput<rsp_width>                     **p_rsp_in;
98
99        // interrupt signals
100        sc_signal<bool>                 signal_false;
101        sc_signal<bool>                 signal_proc_it[4];
102        //sc_signal<bool>               signal_irq_mdma[4];
103        sc_signal<bool>                 signal_irq_cdma;
104        sc_signal<bool>*                signal_irq_mtty;
105        sc_signal<bool>                 signal_irq_bdev;
106       
107        // DSPIN signals between DSPIN routers and VCI/DSPIN wrappers
108        DspinSignals<cmd_width>         signal_dspin_cmd_l2g_d; 
109        DspinSignals<cmd_width>         signal_dspin_cmd_g2l_d; 
110        DspinSignals<cmd_width>         signal_dspin_cmd_l2g_c;
111        DspinSignals<cmd_width>         signal_dspin_cmd_g2l_c; 
112        DspinSignals<rsp_width>         signal_dspin_rsp_l2g_d; 
113        DspinSignals<rsp_width>         signal_dspin_rsp_g2l_d; 
114        DspinSignals<rsp_width>         signal_dspin_rsp_l2g_c;
115        DspinSignals<rsp_width>         signal_dspin_rsp_g2l_c;
116
117        // VCI signals between VCI/DSPIN wrappers and local crossbars
118        VciSignals<vci_param>           signal_vci_l2g_d; 
119        VciSignals<vci_param>           signal_vci_g2l_d; 
120        VciSignals<vci_param>           signal_vci_l2g_c; 
121        VciSignals<vci_param>           signal_vci_g2l_c; 
122
123        // Direct VCI signals
124        VciSignals<vci_param>           signal_vci_ini_d_proc[4]; 
125        VciSignals<vci_param>           signal_vci_ini_d_bdev; 
126        VciSignals<vci_param>           signal_vci_ini_d_cdma; 
127
128        VciSignals<vci_param>           signal_vci_tgt_d_memc;
129        VciSignals<vci_param>           signal_vci_tgt_d_mtty;
130        VciSignals<vci_param>           signal_vci_tgt_d_xicu;
131        VciSignals<vci_param>           signal_vci_tgt_d_bdev;
132        VciSignals<vci_param>           signal_vci_tgt_d_cdma;
133        VciSignals<vci_param>           signal_vci_tgt_d_brom;
134        VciSignals<vci_param>           signal_vci_tgt_d_fbuf;
135
136        // Coherence VCi signals
137        VciSignals<vci_param>           signal_vci_ini_c_proc[4];
138        VciSignals<vci_param>           signal_vci_tgt_c_proc[4];
139        VciSignals<vci_param>           signal_vci_ini_c_memc;
140        VciSignals<vci_param>           signal_vci_tgt_c_memc;
141
142        // external RAM VCI signal
143        VciSignals<vci_param>           signal_vci_xram;
144       
145        // Components
146
147#if USE_MEMCACHE_V4
148        VciCcXCacheWrapperV4<vci_param, iss_t>*                         proc[4];
149        VciMemCacheV4<vci_param>*                                       memc;
150#endif
151
152#if USE_MEMCACHE_V3
153        VciCcVCacheWrapper2V1<vci_param, iss_t>*                        proc[4];
154        VciMemCacheV3<vci_param>*                                       memc;
155#endif
156
157#if USE_PROFILER_ON_CPUs
158        soclib::caba::VciProfiler<vci_param, iss_t> *profiler[4];
159#endif
160
161#if USE_LOGGER_ON_CPUs
162        VciLogger<vci_param> *vci_logger[10];
163#endif
164
165#if USE_LOGGER_ON_DMA
166        VciLogger<vci_param> *vci_dma_logger;
167#endif
168
169        VciXicu<vci_param>*                                             xicu;
170
171#if USE_LOCAL_RING
172        VciLocalRingFast<vci_param,cmd_width,rsp_width>*                xbard;
173        VciLocalRingFast<vci_param,cmd_width,rsp_width>*                xbarc;
174#else
175        VciLocalCrossbar<vci_param>*                                    xbard;
176        VciLocalCrossbar<vci_param>*                                    xbarc;
177        VciVdspinTargetWrapper<vci_param,cmd_width,rsp_width>*          tgtwrapperd;
178        VciVdspinInitiatorWrapper<vci_param,cmd_width,rsp_width>*       iniwrapperd;
179        VciVdspinTargetWrapper<vci_param,cmd_width,rsp_width>*          tgtwrapperc;
180        VciVdspinInitiatorWrapper<vci_param,cmd_width,rsp_width>*       iniwrapperc;
181#endif
182        VirtualDspinRouter<cmd_width>*                                  cmdrouter;
183        VirtualDspinRouter<rsp_width>*                                  rsprouter;
184        VciSimpleRam<vci_param>*                                        brom;
185        VciMultiTty<vci_param>*                                         mtty;
186
187#if USE_FRAME_BUFFER
188        VciFrameBuffer<vci_param>*                                      fbuf;
189#else
190        VciLogger<vci_param>*                                           fbuf;
191#endif
192
193        VciBlockDeviceTsarV2<vci_param>*                                bdev;
194        VciDmaTsarV2<vci_param>*                                        cdma;
195        VciSimpleRam<vci_param>*                                        xram;
196
197        TsarV4ClusterXbar(      sc_module_name  insname,
198                        size_t          nprocs,                                 // number of processors
199                        size_t          n_x,                                    // x coordinate
200                        size_t          n_y,                                    // y coordinate
201                        size_t          n_cluster,                              // y + ymax*x
202                        const           soclib::common::MappingTable &mtd,      // direct mapping table
203                        const           soclib::common::MappingTable &mtc,      // coherence mapping table
204                        const           soclib::common::MappingTable &mtx,      // xram mapping table
205                        size_t          x_width,                                // x field number of bits
206                        size_t          y_width,                                // y field number of bits
207                        size_t          tgtid_memc,
208                        size_t          tgtid_xicu,
209                        size_t          tgtid_fbuf,
210                        size_t          tgtid_mtty,
211                        size_t          tgtid_brom,
212                        size_t          tgtid_bdev,
213                        size_t          tgtid_mdma,
214                        size_t          memc_ways,                              // number of ways for MEMC
215                        size_t          memc_sets,                              // number of sets for MEMC
216                        size_t          l1_i_ways,                              // number of ways for L1 ICACHE
217                        size_t          l1_i_sets,                              // number of sets for L1 ICACHE
218                        size_t          l1_d_ways,                              // number of ways for L1 DCACHE
219                        size_t          l1_d_sets,                              // number of sets for L1 DCACHE
220                        size_t          xram_latency,                           // external ram latency
221                        bool            io,                                     // I/O cluster if true
222                        size_t          xfb,                                    // frame buffer pixels
223                        size_t          yfb,                                    // frame buffer lines
224                        size_t          fb_mode,                                // frame buffer subsampling mode
225                        char*           disk_name,                              // virtual disk name for BDEV
226                        size_t          block_size,                             // block size for BDEV
227                        const Loader    &loader);                               // loader for BROM
228
229        ~TsarV4ClusterXbar();
230};
231}}
232
233#endif
Note: See TracBrowser for help on using the repository browser.