Changeset 396 for trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp
- Timestamp:
- May 28, 2013, 11:02:08 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp
r389 r396 15 15 // - Each processor has a private dma channel (vci_multi_dma) 16 16 // - It uses the vci_xicu interrupt controller 17 // - The peripherals MTTY, BDEV, FBUF, MNIC and BROM are in the cluster 18 // containing address 0xBFC00000. 17 // - The peripherals MTTY, BDEV, FBUF, MNIC and BROM are in cluster (0,0) 19 18 // - The Multi-TTY component controls up to 15 terminals. 20 19 // - Each Multi-DMA component controls up to 8 DMA channels. … … 26 25 #include "../include/tsar_xbar_cluster.h" 27 26 28 #define tmpl(x) template<\29 typename iss_t,int cmd_width, int rsp_width> \30 x TsarXbarCluster<\31 iss_t, cmd_width, rsp_width\32 >33 27 34 28 namespace soclib { 35 29 namespace caba { 36 30 37 ////////////////////////////////////////////////////////////////////////// 38 // Constructor 39 ////////////////////////////////////////////////////////////////////////// 40 tmpl(/**/)::TsarXbarCluster( 31 //////////////////////////////////////////////////////////////////////////////////// 32 template<size_t dspin_cmd_width, 33 size_t dspin_rsp_width, 34 typename vci_param_int, 35 typename vci_param_ext> TsarXbarCluster<dspin_cmd_width, 36 dspin_rsp_width, 37 vci_param_int, 38 vci_param_ext>::TsarXbarCluster( 39 //////////////////////////////////////////////////////////////////////////////////// 41 40 sc_module_name insname, 42 41 size_t nb_procs, … … 86 85 { 87 86 // Vectors of ports definition 88 89 p_cmd_ in = alloc_elems<DspinInput<cmd_width> >("p_cmd_in", 2, 4);90 p_ cmd_out = alloc_elems<DspinOutput<cmd_width> >("p_cmd_out", 2, 4);91 p_rsp_ in = alloc_elems<DspinInput<rsp_width> >("p_rsp_in", 2, 4);92 p_rsp_out = alloc_elems<DspinOutput<rsp_width> >("p_rsp_out", 2, 4); 93 87 p_cmd_in = alloc_elems<DspinInput<dspin_cmd_width> >("p_cmd_in", 2, 4); 88 p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> >("p_cmd_out", 2, 4); 89 p_rsp_in = alloc_elems<DspinInput<dspin_rsp_width> >("p_rsp_in", 2, 4); 90 p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> >("p_rsp_out", 2, 4); 91 92 ///////////////////////////////////////////////////////////////////////////// 94 93 // Components definition 95 96 // on direct network : local srcid[proc] in [0..nb_procs-1]97 // on direct network : local srcid[mdma] = nb_procs98 // on direct network : local srcid[bdev] = nb_procs + 199 100 // on coherence network : local srcid[proc] in [0...nb_procs-1]101 // on coherence network : local srcid[memc] = nb_procs102 103 94 ///////////////////////////////////////////////////////////////////////////// 104 95 std::cout << " - building proc_" << x_id << "_" << y_id << "-*" << std::endl; … … 107 98 { 108 99 std::ostringstream sproc; 109 sproc << "proc_" << p; 110 proc[p] = new VciCcVCacheWrapper<vci_param_d, cmd_width, rsp_width, iss_t>( 100 sproc << "proc_" << x_id << "_" << y_id << "_" << p; 101 proc[p] = new VciCcVCacheWrapper<vci_param_int, 102 dspin_cmd_width, 103 dspin_rsp_width, 104 GdbServer<Mips32ElIss> >( 111 105 sproc.str().c_str(), 112 106 cluster_id*nb_procs + p, // GLOBAL PROC_ID … … 130 124 std::ostringstream swip; 131 125 swip << "wi_proc_" << x_id << "_" << y_id << p; 132 wi_proc[p] = new VciDspinInitiatorWrapper<vci_param_d,cmd_width,rsp_width>( 126 wi_proc[p] = new VciDspinInitiatorWrapper<vci_param_int, 127 dspin_cmd_width, 128 dspin_rsp_width>( 133 129 swip.str().c_str(), 134 130 x_width + y_width + l_width); … … 138 134 std::cout << " - building memc_" << x_id << "_" << y_id << std::endl; 139 135 140 memc = new VciMemCache<vci_param_d, vci_param_x, rsp_width, cmd_width>( 141 "memc", 136 std::ostringstream smemc; 137 smemc << "memc_" << x_id << "_" << y_id; 138 memc = new VciMemCache<vci_param_int, 139 vci_param_ext, 140 dspin_rsp_width, 141 dspin_cmd_width>( 142 smemc.str().c_str(), 142 143 mtd, // Mapping Table direct space 143 144 mtx, // Mapping Table external space … … 153 154 memc_debug_ok ); 154 155 155 wt_memc = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>( 156 wt_memc = new VciDspinTargetWrapper<vci_param_int, 157 dspin_cmd_width, 158 dspin_rsp_width>( 156 159 "wt_memc", 157 160 x_width + y_width + l_width); … … 160 163 std::cout << " - building xram_" << x_id << "_" << y_id << std::endl; 161 164 162 xram = new VciSimpleRam<vci_param_x>( 163 "xram", 165 std::ostringstream sxram; 166 sxram << "xram_" << x_id << "_" << y_id; 167 xram = new VciSimpleRam<vci_param_ext>( 168 sxram.str().c_str(), 164 169 IntTab(cluster_id), 165 170 mtx, … … 170 175 std::cout << " - building xicu_" << x_id << "_" << y_id << std::endl; 171 176 172 xicu = new VciXicu<vci_param_d>( 173 "xicu", 177 std::ostringstream sxicu; 178 sxicu << "xicu_" << x_id << "_" << y_id; 179 xicu = new VciXicu<vci_param_int>( 180 sxicu.str().c_str(), 174 181 mtd, // mapping table 175 182 IntTab(cluster_id, tgtid_xicu), // TGTID_D … … 179 186 nb_procs); // number of output IRQs 180 187 181 wt_xicu = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>( 188 wt_xicu = new VciDspinTargetWrapper<vci_param_int, 189 dspin_cmd_width, 190 dspin_rsp_width>( 182 191 "wt_xicu", 183 192 x_width + y_width + l_width); … … 186 195 std::cout << " - building mdma_" << x_id << "_" << y_id << std::endl; 187 196 188 mdma = new VciMultiDma<vci_param_d>( 189 "mdma", 197 std::ostringstream smdma; 198 smdma << "mdma_" << x_id << "_" << y_id; 199 mdma = new VciMultiDma<vci_param_int>( 200 smdma.str().c_str(), 190 201 mtd, 191 202 IntTab(cluster_id, nb_procs), // SRCID … … 194 205 nb_dmas); // number of IRQs 195 206 196 wt_mdma = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>( 207 wt_mdma = new VciDspinTargetWrapper<vci_param_int, 208 dspin_cmd_width, 209 dspin_rsp_width>( 197 210 "wt_mdma", 198 211 x_width + y_width + l_width); 199 212 200 wi_mdma = new VciDspinInitiatorWrapper<vci_param_d,cmd_width,rsp_width>( 213 wi_mdma = new VciDspinInitiatorWrapper<vci_param_int, 214 dspin_cmd_width, 215 dspin_rsp_width>( 201 216 "wi_mdma", 202 217 x_width + y_width + l_width); … … 213 228 } 214 229 215 xbar_cmd_d = new DspinLocalCrossbar< cmd_width>(230 xbar_cmd_d = new DspinLocalCrossbar<dspin_cmd_width>( 216 231 "xbar_cmd_d", 217 232 mtd, // mapping table … … 227 242 std::cout << " - building xbar_rsp_d_" << x_id << "_" << y_id << std::endl; 228 243 229 xbar_rsp_d = new DspinLocalCrossbar< rsp_width>(244 xbar_rsp_d = new DspinLocalCrossbar<dspin_rsp_width>( 230 245 "xbar_rsp_d", 231 246 mtd, // mapping table … … 241 256 std::cout << " - building xbar_m2p_c" << x_id << "_" << y_id << std::endl; 242 257 243 xbar_m2p_c = new DspinLocalCrossbar< cmd_width>(258 xbar_m2p_c = new DspinLocalCrossbar<dspin_cmd_width>( 244 259 "xbar_m2p_c", 245 260 mtd, // mapping table … … 255 270 std::cout << " - building xbar_p2m_c_" << x_id << "_" << y_id << std::endl; 256 271 257 xbar_p2m_c = new DspinLocalCrossbar< rsp_width>(272 xbar_p2m_c = new DspinLocalCrossbar<dspin_rsp_width>( 258 273 "xbar_p2m_c", 259 274 mtd, // mapping table … … 269 284 std::cout << " - building router_cmd_" << x_id << "_" << y_id << std::endl; 270 285 271 router_cmd = new VirtualDspinRouter< cmd_width>(286 router_cmd = new VirtualDspinRouter<dspin_cmd_width>( 272 287 "router_cmd", 273 288 x_id,y_id, // coordinate in the mesh … … 278 293 std::cout << " - building router_rsp_" << x_id << "_" << y_id << std::endl; 279 294 280 router_rsp = new VirtualDspinRouter< rsp_width>(295 router_rsp = new VirtualDspinRouter<dspin_rsp_width>( 281 296 "router_rsp", 282 297 x_id,y_id, // coordinates in mesh … … 290 305 std::cout << " - building brom" << std::endl; 291 306 292 brom = new VciSimpleRam<vci_param_d>( 293 "brom", 294 IntTab(cluster_id, tgtid_brom), 295 mtd, 296 loader); 297 298 wt_brom = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_brom", 307 brom = new VciSimpleRam<vci_param_int>( 308 "brom", 309 IntTab(cluster_id, tgtid_brom), 310 mtd, 311 loader); 312 313 wt_brom = new VciDspinTargetWrapper<vci_param_int, 314 dspin_cmd_width, 315 dspin_rsp_width>( 316 "wt_brom", 299 317 x_width + y_width + l_width); 300 318 … … 302 320 std::cout << " - building fbuf" << std::endl; 303 321 304 fbuf = new VciFrameBuffer<vci_param_d>( 305 "fbuf", 306 IntTab(cluster_id, tgtid_fbuf), 307 mtd, 308 xfb, yfb); 309 310 wt_fbuf = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_fbuf", 322 fbuf = new VciFrameBuffer<vci_param_int>( 323 "fbuf", 324 IntTab(cluster_id, tgtid_fbuf), 325 mtd, 326 xfb, yfb); 327 328 wt_fbuf = new VciDspinTargetWrapper<vci_param_int, 329 dspin_cmd_width, 330 dspin_rsp_width>( 331 "wt_fbuf", 311 332 x_width + y_width + l_width); 312 333 … … 314 335 std::cout << " - building bdev" << std::endl; 315 336 316 bdev = new VciBlockDeviceTsar<vci_param_d>( 317 "bdev", 318 mtd, 319 IntTab(cluster_id, nb_procs+1), 320 IntTab(cluster_id, tgtid_bdev), 321 disk_name, 322 block_size, 323 64); // burst size 324 325 wt_bdev = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_bdev", 326 x_width + y_width + l_width); 327 wi_bdev = new VciDspinInitiatorWrapper<vci_param_d,cmd_width,rsp_width>("wi_bdev", 337 bdev = new VciBlockDeviceTsar<vci_param_int>( 338 "bdev", 339 mtd, 340 IntTab(cluster_id, nb_procs+1), 341 IntTab(cluster_id, tgtid_bdev), 342 disk_name, 343 block_size, 344 64); // burst size 345 346 wt_bdev = new VciDspinTargetWrapper<vci_param_int, 347 dspin_cmd_width, 348 dspin_rsp_width>( 349 "wt_bdev", 350 x_width + y_width + l_width); 351 352 wi_bdev = new VciDspinInitiatorWrapper<vci_param_int, 353 dspin_cmd_width, 354 dspin_rsp_width>( 355 "wi_bdev", 328 356 x_width + y_width + l_width); 329 357 … … 331 359 std::cout << " - building mnic" << std::endl; 332 360 333 mnic = new VciMultiNic<vci_param_d>( 334 "mnic", 335 IntTab(cluster_id, tgtid_mnic), 336 mtd, 337 nic_channels, 338 nic_rx_name, 339 nic_tx_name, 340 0, // mac_4 address 341 0 ); // mac_2 address 342 343 wt_mnic = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_mnic", 361 mnic = new VciMultiNic<vci_param_int>( 362 "mnic", 363 IntTab(cluster_id, tgtid_mnic), 364 mtd, 365 nic_channels, 366 nic_rx_name, 367 nic_tx_name, 368 0, // mac_4 address 369 0 ); // mac_2 address 370 371 wt_mnic = new VciDspinTargetWrapper<vci_param_int, 372 dspin_cmd_width, 373 dspin_rsp_width>( 374 "wt_mnic", 344 375 x_width + y_width + l_width); 345 376 … … 354 385 vect_names.push_back(term_name.str().c_str()); 355 386 } 356 mtty = new VciMultiTty<vci_param_d>( 357 "mtty", 358 IntTab(cluster_id, tgtid_mtty), 359 mtd, 360 vect_names); 361 362 wt_mtty = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_mtty", 363 x_width + y_width + l_width); 364 387 mtty = new VciMultiTty<vci_param_int>( 388 "mtty", 389 IntTab(cluster_id, tgtid_mtty), 390 mtd, 391 vect_names); 392 393 wt_mtty = new VciDspinTargetWrapper<vci_param_int, 394 dspin_cmd_width, 395 dspin_rsp_width>( 396 "wt_mtty", 397 x_width + y_width + l_width); 365 398 } 366 399 … … 679 712 } // end constructor 680 713 681 /////////////////////////////////////////////////////////////////////////// 682 // destructor 683 /////////////////////////////////////////////////////////////////////////// 684 tmpl(/**/)::~TsarXbarCluster() {} 685 } 686 } 687 714 }} 688 715 689 716 // Local Variables:
Note: See TracChangeset
for help on using the changeset viewer.