[189] | 1 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 2 | // File: tsarv4_cluster_mmu.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 | |
---|
| 9 | #ifndef SOCLIB_CABA_TSAR_CLUSTER_V4_MMU_H |
---|
| 10 | #define SOCLIB_CABA_TSAR_CLUSTER_V4_MMU_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 "virtual_dspin_router.h" |
---|
| 26 | #include "vci_vdspin_target_wrapper.h" |
---|
| 27 | #include "vci_vdspin_initiator_wrapper.h" |
---|
| 28 | #include "vci_multi_tty.h" |
---|
| 29 | #include "vci_block_device_tsar_v4.h" |
---|
| 30 | #include "vci_framebuffer.h" |
---|
| 31 | #include "vci_multi_dma.h" |
---|
| 32 | #include "vci_mem_cache_v4.h" |
---|
| 33 | #include "vci_cc_vcache_wrapper_v4.h" |
---|
| 34 | |
---|
| 35 | namespace soclib { |
---|
| 36 | namespace caba { |
---|
| 37 | |
---|
| 38 | /////////////////////////////////////////////////////////////////////////// |
---|
| 39 | template<typename vci_param, typename iss_t, int cmd_width, int rsp_width> |
---|
| 40 | class TsarV4ClusterMmu |
---|
| 41 | /////////////////////////////////////////////////////////////////////////// |
---|
| 42 | : public soclib::caba::BaseModule |
---|
| 43 | { |
---|
| 44 | |
---|
| 45 | public: |
---|
| 46 | |
---|
| 47 | // Ports |
---|
[255] | 48 | sc_in<bool> p_clk; |
---|
| 49 | sc_in<bool> p_resetn; |
---|
[189] | 50 | soclib::caba::DspinOutput<cmd_width> **p_cmd_out; |
---|
| 51 | soclib::caba::DspinInput<cmd_width> **p_cmd_in; |
---|
[255] | 52 | soclib::caba::DspinOutput<rsp_width> **p_rsp_out; |
---|
| 53 | soclib::caba::DspinInput<rsp_width> **p_rsp_in; |
---|
[189] | 54 | |
---|
[255] | 55 | // interrupt signals |
---|
| 56 | sc_signal<bool> signal_false; |
---|
| 57 | sc_signal<bool> signal_proc_it[8]; |
---|
| 58 | sc_signal<bool> signal_irq_mdma[8]; |
---|
| 59 | sc_signal<bool> signal_irq_mtty[23]; |
---|
[189] | 60 | sc_signal<bool> signal_irq_bdev; |
---|
| 61 | |
---|
| 62 | // DSPIN signals between DSPIN routers and VCI/DSPIN wrappers |
---|
| 63 | DspinSignals<cmd_width> signal_dspin_cmd_l2g_d; |
---|
| 64 | DspinSignals<cmd_width> signal_dspin_cmd_g2l_d; |
---|
| 65 | DspinSignals<cmd_width> signal_dspin_cmd_l2g_c; |
---|
| 66 | DspinSignals<cmd_width> signal_dspin_cmd_g2l_c; |
---|
| 67 | DspinSignals<rsp_width> signal_dspin_rsp_l2g_d; |
---|
| 68 | DspinSignals<rsp_width> signal_dspin_rsp_g2l_d; |
---|
| 69 | DspinSignals<rsp_width> signal_dspin_rsp_l2g_c; |
---|
| 70 | DspinSignals<rsp_width> signal_dspin_rsp_g2l_c; |
---|
| 71 | |
---|
| 72 | // VCI signals between VCI/DSPIN wrappers and local crossbars |
---|
| 73 | VciSignals<vci_param> signal_vci_l2g_d; |
---|
| 74 | VciSignals<vci_param> signal_vci_g2l_d; |
---|
| 75 | VciSignals<vci_param> signal_vci_l2g_c; |
---|
| 76 | VciSignals<vci_param> signal_vci_g2l_c; |
---|
| 77 | |
---|
| 78 | // Direct VCI signals |
---|
| 79 | VciSignals<vci_param> signal_vci_ini_d_proc[4]; |
---|
| 80 | VciSignals<vci_param> signal_vci_ini_d_bdev; |
---|
| 81 | VciSignals<vci_param> signal_vci_ini_d_mdma; |
---|
| 82 | |
---|
| 83 | VciSignals<vci_param> signal_vci_tgt_d_memc; |
---|
| 84 | VciSignals<vci_param> signal_vci_tgt_d_mtty; |
---|
| 85 | VciSignals<vci_param> signal_vci_tgt_d_xicu; |
---|
| 86 | VciSignals<vci_param> signal_vci_tgt_d_bdev; |
---|
| 87 | VciSignals<vci_param> signal_vci_tgt_d_mdma; |
---|
| 88 | VciSignals<vci_param> signal_vci_tgt_d_brom; |
---|
| 89 | VciSignals<vci_param> signal_vci_tgt_d_fbuf; |
---|
| 90 | |
---|
| 91 | // Coherence VCi signals |
---|
| 92 | VciSignals<vci_param> signal_vci_ini_c_proc[4]; |
---|
| 93 | VciSignals<vci_param> signal_vci_tgt_c_proc[4]; |
---|
| 94 | VciSignals<vci_param> signal_vci_ini_c_memc; |
---|
| 95 | VciSignals<vci_param> signal_vci_tgt_c_memc; |
---|
| 96 | |
---|
| 97 | // external RAM VCI signal |
---|
| 98 | VciSignals<vci_param> signal_vci_xram; |
---|
| 99 | |
---|
[255] | 100 | // Components |
---|
[189] | 101 | |
---|
[255] | 102 | VciCcVCacheWrapperV4<vci_param, iss_t>* proc[8]; |
---|
| 103 | VciMemCacheV4<vci_param>* memc; |
---|
| 104 | VciXicu<vci_param>* xicu; |
---|
| 105 | VciLocalCrossbar<vci_param>* xbard; |
---|
| 106 | VciLocalCrossbar<vci_param>* xbarc; |
---|
| 107 | VciVdspinTargetWrapper<vci_param,cmd_width,rsp_width>* tgtwrapperd; |
---|
| 108 | VciVdspinInitiatorWrapper<vci_param,cmd_width,rsp_width>* iniwrapperd; |
---|
| 109 | VciVdspinTargetWrapper<vci_param,cmd_width,rsp_width>* tgtwrapperc; |
---|
| 110 | VciVdspinInitiatorWrapper<vci_param,cmd_width,rsp_width>* iniwrapperc; |
---|
| 111 | VirtualDspinRouter<cmd_width>* cmdrouter; |
---|
| 112 | VirtualDspinRouter<rsp_width>* rsprouter; |
---|
| 113 | VciSimpleRam<vci_param>* brom; |
---|
| 114 | VciMultiTty<vci_param>* mtty; |
---|
| 115 | VciFrameBuffer<vci_param>* fbuf; |
---|
| 116 | VciBlockDeviceTsarV4<vci_param>* bdev; |
---|
| 117 | VciMultiDma<vci_param>* mdma; |
---|
| 118 | VciSimpleRam<vci_param>* xram; |
---|
[189] | 119 | |
---|
[255] | 120 | TsarV4ClusterMmu(sc_module_name insname, |
---|
| 121 | size_t nb_procs, // number of processors |
---|
| 122 | size_t nb_ttys, // number of TTY terminals |
---|
| 123 | size_t nb_dmas, // number of DMA channels |
---|
| 124 | size_t x, // x coordinate |
---|
| 125 | size_t y, // y coordinate |
---|
| 126 | size_t cluster, // y + ymax*x |
---|
| 127 | const soclib::common::MappingTable &mtd, // direct mapping table |
---|
| 128 | const soclib::common::MappingTable &mtc, // coherence mapping table |
---|
| 129 | const soclib::common::MappingTable &mtx, // xram mapping table |
---|
| 130 | size_t x_width, // x field number of bits |
---|
| 131 | size_t y_width, // y field number of bits |
---|
| 132 | size_t tgtid_memc, |
---|
| 133 | size_t tgtid_xicu, |
---|
| 134 | size_t tgtid_fbuf, |
---|
| 135 | size_t tgtid_mtty, |
---|
| 136 | size_t tgtid_brom, |
---|
| 137 | size_t tgtid_bdev, |
---|
| 138 | size_t tgtid_mdma, |
---|
| 139 | size_t memc_ways, |
---|
| 140 | size_t memc_sets, |
---|
| 141 | size_t l1_i_ways, |
---|
| 142 | size_t l1_i_sets, |
---|
| 143 | size_t l1_d_ways, |
---|
| 144 | size_t l1_d_sets, |
---|
| 145 | size_t xram_latency, // external ram latency |
---|
| 146 | bool io, // I/O cluster if true |
---|
| 147 | size_t xfb, // frame buffer pixels |
---|
| 148 | size_t yfb, // frame buffer lines |
---|
| 149 | char* disk_name, // virtual disk name for BDEV |
---|
| 150 | size_t block_size, // block size for BDEV |
---|
| 151 | const Loader &loader, // loader for BROM |
---|
| 152 | uint32_t frozen_cycles, // max frozen cycles |
---|
| 153 | uint32_t start_debug_cycle, |
---|
| 154 | bool memc_debug_ok, |
---|
| 155 | bool proc_debug_ok); |
---|
[189] | 156 | |
---|
| 157 | ~TsarV4ClusterMmu(); |
---|
| 158 | }; |
---|
| 159 | }} |
---|
| 160 | |
---|
| 161 | #endif |
---|