Changeset 972 for trunk/platforms/tsar_generic_iob
- Timestamp:
- Apr 11, 2015, 8:26:46 PM (10 years ago)
- Location:
- trunk/platforms/tsar_generic_iob
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_iob/arch.py
r966 r972 19 19 # 20 20 # All clusters contain (nb_procs) processors, one L2 cache, one XCU, and 21 # one DMA controller.21 # one optional hardware coprocessor connected to a MWMR_DMA controller. 22 22 # 23 23 # The "constructor" parameters (defined in Makefile) are: … … 27 27 # - nb_ttys : number of TTY channels 28 28 # - fbf_width : frame_buffer width = frame_buffer heigth 29 # - ioc_type : can be 'BDV','HBA','SDC', but not 'RDK' 30 # 31 # The other hardware parameters (defined below) are: 29 # - ioc_type : can be 'BDV','HBA','SDC', but not 'RDK' 30 # 31 # 32 # The other hardware parameters (defined in this script) are: 32 33 # - nb_nics : number of NIC channels 33 34 # - nb_cmas : number of CMA channels … … 40 41 # - use_ramdisk : use a ramdisk when True 41 42 # - vseg_increment : address increment for replicated vsegs 43 # - mwr_type : coprocessor type / can be 'GCD','DCT','NOPE' 44 # - use_dma : one single channel DMA per cluster if non zero 42 45 # 43 46 # Regarding the boot and kernel vsegs mapping : … … 59 62 nb_ttys = 1, 60 63 fbf_width = 128, 61 ioc_type = ' BDV' ):64 ioc_type = 'HBA' ): 62 65 63 66 ### define architecture constants … … 71 74 p_width = 4 72 75 paddr_width = 40 73 irq_per_proc = 4 # NetBSD constraint76 irq_per_proc = 4 74 77 peri_increment = 0x10000 75 76 ### parameters checking 78 mwr_type = 'CPY' 79 80 ### constructor parameters checking 77 81 78 82 assert( nb_procs <= (1 << p_width) ) … … 90 94 91 95 assert( ioc_type in [ 'BDV' , 'HBA' , 'SDC' ] ) 96 97 assert( mwr_type in [ 'GCD' , 'DCT' , 'CPY' , 'NONE' ] ) 92 98 93 99 ### define platform name … … 104 110 xcu_size = 0x1000 # 4 Kbytes 105 111 106 dma_base = 0x00B1000000107 dma_size = 0x1000 # 4 Kbytes112 mwr_base = 0x00B1000000 113 mwr_size = 0x1000 # 4 Kbytes 108 114 109 115 mmc_base = 0x00B2000000 … … 207 213 208 214 ### components replicated in all clusters 209 ram =mapping.addRam( 'RAM', base = ram_base + offset,215 mapping.addRam( 'RAM', base = ram_base + offset, 210 216 size = ram_size ) 211 212 mmc = mapping.addPeriph( 'MMC', base = mmc_base + offset,213 size = mmc_size, ptype = 'MMC' )214 215 dma = mapping.addPeriph( 'DMA', base = dma_base + offset,216 size = dma_size, ptype = 'DMA',217 channels = nb_procs )218 217 219 218 xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset, … … 223 222 224 223 mapping.addIrq( xcu, index = 0, isrtype = 'ISR_MMC' ) 225 226 for i in xrange ( dma.channels ): 227 mapping.addIrq( xcu, index = 1+i, isrtype = 'ISR_DMA', 228 channel = i ) 224 mapping.addIrq( xcu, index = 1, isrtype = 'ISR_MWR' ) 225 226 mapping.addPeriph( 'MMC', base = mmc_base + offset, 227 size = mmc_size, ptype = 'MMC' ) 228 229 if ( mwr_type == 'GCD' ): 230 mapping.addPeriph( 'MWR', base = mwr_base + offset, 231 size = mwr_size, ptype = 'MWR', subtype = 'GCD', 232 arg0 = 2, arg1 = 1, arg2 = 1, arg3 = 0 ) 233 234 if ( mwr_type == 'DCT' ): 235 mapping.addPeriph( 'MWR', base = mwr_base + offset, 236 size = mwr_size, ptype = 'MWR', subtype = 'DCT', 237 arg0 = 1, arg1 = 1, arg2 = 1, arg3 = 0 ) 238 239 if ( mwr_type == 'CPY' ): 240 mapping.addPeriph( 'MWR', base = mwr_base + offset, 241 size = mwr_size, ptype = 'MWR', subtype = 'CPY', 242 arg0 = 1, arg1 = 1, arg2 = 1, arg3 = 0 ) 229 243 230 244 for p in xrange ( nb_procs ): 231 mapping.addProc( x , y, p )245 mapping.addProc( x , y , p ) 232 246 233 247 ### external peripherals in cluster_io … … 406 420 local = False, big = False ) 407 421 408 mapping.addGlobal( 'seg_dma_%d_%d' %(x,y), dma_base + offset, dma_size,409 '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'DMA',410 local = False, big = False )411 412 422 mapping.addGlobal( 'seg_mmc_%d_%d' %(x,y), mmc_base + offset, mmc_size, 413 423 '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'MMC', 414 424 local = False, big = False ) 425 426 if ( mwr_type != 'NONE' ): 427 mapping.addGlobal( 'seg_mwr_%d_%d' %(x,y), mwr_base + offset, mwr_size, 428 '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'MWR', 429 local = False, big = False ) 415 430 416 431 return mapping -
trunk/platforms/tsar_generic_iob/top.cpp
r966 r972 48 48 // - IOPIC HWI[31:16] connected to IRQ_TTY_RX[15:0] 49 49 // 50 // Besides the external peripherals, each cluster contains one XICU component, 51 // and one multi channels DMA component. 52 // The XICU component is mainly used to handle WTI IRQs, as only 53 // 1 + NB_PROCS_MAX HWI IRQs are connected to XICU in each cluster: 50 // Each cluster contains the following component: 51 // - From 1 to 8 MIP32 processors 52 // - One L2 cache controller 53 // - One XICU component, 54 // - One - optional - single channel DMA controler, 55 // - One - optional - hardware coprocessor 56 // The XICU component is mainly used to handle WTI IRQs, as at most 57 // 2 HWI IRQs are connected to XICU in each cluster: 54 58 // - IRQ_IN[0] : MMC 55 // - IRQ_IN[1] : DMA channel 0 56 // - IRQ_IN[2] : DMA channel 1 57 // - ... ... 58 // - IRQ_IN[NB_PROCS_MAX] : DMA channel NB_PROCS_MAX 59 // - IRQ_IN[1] : MWR 59 60 // 60 61 // All clusters are identical, but cluster(0,0) and cluster(XMAX-1,YMAX-1) … … 131 132 #include "mapping_table.h" 132 133 134 135 133 136 #include "tsar_iob_cluster.h" 134 137 #include "vci_chbuf_dma.h" … … 144 147 #include "alloc_elems.h" 145 148 146 /////////////////////////////////////////////////// 147 // OS 148 /////////////////////////////////////////////////// 149 150 ////////////////////////////////////////////////////////////////// 151 // Coprocessor type (must be replicated in tsar_iob_cluster) 152 ////////////////////////////////////////////////////////////////// 153 154 #define MWR_COPROC_CPY 0 155 #define MWR_COPROC_DCT 1 156 #define MWR_COPROC_GCD 2 157 158 ////////////////////////////////////////////////////////////////// 159 // For ALMOS 160 ////////////////////////////////////////////////////////////////// 161 149 162 #define USE_ALMOS 0 150 163 … … 153 166 #define almos_archinfo_pathname "arch-info.bin@0xBFC08000:D" 154 167 155 /////////////////////////////////////////////////// 156 // 157 /////////////////////////////////////////////////// 168 ////////////////////////////////////////////////////////////////// 169 // Parallelisation 170 ////////////////////////////////////////////////////////////////// 158 171 159 172 #define USING_OPENMP 0 … … 163 176 #endif 164 177 165 /////////////////////////////////////////////////////////// 178 ////////////////////////////////////////////////////////////////// 166 179 // DSPIN parameters 167 /////////////////////////////////////////////////////////// 180 ////////////////////////////////////////////////////////////////// 168 181 169 182 #define dspin_int_cmd_width 39 … … 173 186 #define dspin_ram_rsp_width 64 174 187 175 /////////////////////////////////////////////////////////// 188 ////////////////////////////////////////////////////////////////// 176 189 // VCI fields width for the 3 VCI networks 177 /////////////////////////////////////////////////////////// 190 ////////////////////////////////////////////////////////////////// 178 191 179 192 #define vci_cell_width_int 4 … … 214 227 #define L1_DSETS 64 215 228 229 #if BOOT_DEBUG_ELF 230 _printf("\n[DEBUG BOOT_ELF] P[%d,%d,%d] copy segment %d :\n" 231 " vaddr = %x / size = %x / paddr = %l\n", 232 x , y , p , seg_id , seg_vaddr , seg_memsz , seg_paddr ); 233 #endif 216 234 #define DISK_IMAGE_NAME "../../../giet_vm/hdd/virt_hdd.dmg" 217 235 … … 249 267 // Two different initiators cannot have the same SRCID, but a given 250 268 // initiator can have two alias SRCIDs: 251 // - Internal initiators (procs, m dma) are replicated in all clusters,269 // - Internal initiators (procs, mwmr) are replicated in all clusters, 252 270 // and each initiator has one single SRCID. 253 271 // - External initiators (disk, cdma) are not replicated, but can be … … 263 281 264 282 #define PROC_LOCAL_SRCID 0x0 // from 0 to 7 265 #define M DMA_LOCAL_SRCID 0x8283 #define MWMR_LOCAL_SRCID 0x8 266 284 #define IOBX_LOCAL_SRCID 0x9 267 285 #define MEMC_LOCAL_SRCID 0xA … … 276 294 #define INT_MEMC_TGT_ID 0 277 295 #define INT_XICU_TGT_ID 1 278 #define INT_M DMA_TGT_ID 2296 #define INT_MWMR_TGT_ID 2 279 297 #define INT_IOBX_TGT_ID 3 280 298 281 299 #define INT_PROC_INI_ID 0 // from 0 to (NB_PROCS_MAX-1) 282 #define INT_M DMA_INI_ID (NB_PROCS_MAX)300 #define INT_MWMR_INI_ID (NB_PROCS_MAX) 283 301 #define INT_IOBX_INI_ID (NB_PROCS_MAX+1) 284 302 … … 439 457 // checking hardware parameters 440 458 assert( (XMAX <= 16) and 441 "TheXMAX parameter cannot be larger than 16" );459 "Error in tsar_generic_iob : XMAX parameter cannot be larger than 16" ); 442 460 443 461 assert( (YMAX <= 16) and 444 "TheYMAX parameter cannot be larger than 16" );462 "Error in tsar_generic_iob : YMAX parameter cannot be larger than 16" ); 445 463 446 464 assert( (NB_PROCS_MAX <= 8) and 447 "NB_PROCS_MAX parameter cannot be larger than 8" );465 "Error in tsar_generic_iob : NB_PROCS_MAX parameter cannot be larger than 8" ); 448 466 449 467 assert( (XCU_NB_HWI > NB_PROCS_MAX) and 450 "XCU_NB_HWI must be larger than NB_PROCS_MAX" );468 "Error in tsar_generic_iob : XCU_NB_HWI must be larger than NB_PROCS_MAX" ); 451 469 452 470 assert( (XCU_NB_PTI >= NB_PROCS_MAX) and 453 "XCU_NB_PTI cannot be smaller than NB_PROCS_MAX" );471 "Error in tsar_generic_iob : XCU_NB_PTI cannot be smaller than NB_PROCS_MAX" ); 454 472 455 473 assert( (XCU_NB_WTI >= 4*NB_PROCS_MAX) and 456 "XCU_NB_WTI cannot be smaller than 4*NB_PROCS_MAX" );474 "Error in tsar_generic_iob : XCU_NB_WTI cannot be smaller than 4*NB_PROCS_MAX" ); 457 475 458 476 assert( (XCU_NB_OUT >= 4*NB_PROCS_MAX) and 459 "XCU_NB_OUT cannot be smaller than 4*NB_PROCS_MAX" );477 "Error in tsar_generic_iob : XCU_NB_OUT cannot be smaller than 4*NB_PROCS_MAX" ); 460 478 461 assert( (NB_DMA_CHANNELS >= NB_PROCS_MAX) and462 "The NB_DMA_CHANNELS parameter cannot be larger than 8" );463 464 479 assert( (NB_TTY_CHANNELS >= 1) and (NB_TTY_CHANNELS <= 16) and 465 "TheNB_TTY_CHANNELS parameter cannot be larger than 16" );480 "Error in tsar_generic_iob : NB_TTY_CHANNELS parameter cannot be larger than 16" ); 466 481 467 482 assert( (NB_NIC_CHANNELS <= 2) and 468 "TheNB_NIC_CHANNELS parameter cannot be larger than 2" );483 "Error in tsar_generic_iob : NB_NIC_CHANNELS parameter cannot be larger than 2" ); 469 484 470 485 assert( (NB_CMA_CHANNELS <= 4) and 471 "TheNB_CMA_CHANNELS parameter cannot be larger than 4" );486 "Error in tsar_generic_iob : NB_CMA_CHANNELS parameter cannot be larger than 4" ); 472 487 473 488 assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and 474 "You must have X_WIDTH == Y_WIDTH == 4"); 489 "Error in tsar_generic_iob : You must have X_WIDTH == Y_WIDTH == 4"); 490 491 assert( ((USE_MWR_CPY + USE_MWR_GCD + USE_MWR_DCT) == 1) and 492 "Error in tsar_generic_iob : No MWR coprocessor found in hard_config.h"); 493 494 assert( ((USE_IOC_HBA + USE_IOC_BDV + USE_IOC_SDC) == 1) and 495 "Error in tsar_generic_iob : NoIOC controller found in hard_config.h"); 475 496 476 497 std::cout << std::endl << std::dec … … 478 499 << " - YMAX = " << YMAX << std::endl 479 500 << " - NB_PROCS_MAX = " << NB_PROCS_MAX << std::endl 480 << " - NB_DMA_CHANNELS = " << NB_DMA_CHANNELS << std::endl481 501 << " - NB_TTY_CHANNELS = " << NB_TTY_CHANNELS << std::endl 482 502 << " - NB_NIC_CHANNELS = " << NB_NIC_CHANNELS << std::endl … … 492 512 << " - DEBUG_PROCID = " << debug_proc_id << std::endl 493 513 << " - DEBUG_MEMCID = " << debug_memc_id << std::endl 514 << " - DEBUG_XRAMID = " << debug_xram_id << std::endl 494 515 << " - DEBUG_XRAMID = " << debug_xram_id << std::endl; 495 516 … … 529 550 // - two levels address decoding for commands 530 551 // - two levels srcid decoding for responses 531 // - NB_PROCS_MAX + 2 (M DMA, IOBX) local initiators per cluster532 // - 4 local targets (MEMC, XICU, M DMA, IOBX) per cluster552 // - NB_PROCS_MAX + 2 (MWMR, IOBX) local initiators per cluster 553 // - 4 local targets (MEMC, XICU, MWMR, IOBX) per cluster 533 554 ///////////////////////////////////////////////////////////////////// 534 555 MappingTable maptab_int( vci_address_width, … … 563 584 IntTab(cluster(x,y), INT_XICU_TGT_ID), not cacheable)); 564 585 565 std::ostringstream sm dma;566 sm dma << "int_seg_mdma_" << x << "_" << y;567 maptab_int.add(Segment(sm dma.str(), SEG_DMA_BASE+offset, SEG_DMA_SIZE,568 IntTab(cluster(x,y), INT_M DMA_TGT_ID), not cacheable));586 std::ostringstream smwmr; 587 smwmr << "int_seg_mwmr_" << x << "_" << y; 588 maptab_int.add(Segment(smwmr.str(), SEG_MWR_BASE+offset, SEG_MWR_SIZE, 589 IntTab(cluster(x,y), INT_MWMR_TGT_ID), not cacheable)); 569 590 570 591 // the following segments are only defined in cluster_iob0 or in cluster_iob1 … … 616 637 // and the port index on the local interconnect. 617 638 618 maptab_int.srcid_map( IntTab( cluster(x,y), M DMA_LOCAL_SRCID ),619 IntTab( cluster(x,y), INT_M DMA_INI_ID ) );639 maptab_int.srcid_map( IntTab( cluster(x,y), MWMR_LOCAL_SRCID ), 640 IntTab( cluster(x,y), INT_MWMR_INI_ID ) ); 620 641 621 642 maptab_int.srcid_map( IntTab( cluster(x,y), IOBX_LOCAL_SRCID ), … … 1022 1043 dspin_ram_rsp_width>* clusters[XMAX][YMAX]; 1023 1044 1045 unsigned int coproc_type; 1046 if ( USE_MWR_CPY ) coproc_type = MWR_COPROC_CPY; 1047 if ( USE_MWR_DCT ) coproc_type = MWR_COPROC_DCT; 1048 if ( USE_MWR_GCD ) coproc_type = MWR_COPROC_GCD; 1049 1024 1050 #if USING_OPENMP 1025 1051 #pragma omp parallel … … 1050 1076 IOX_IOB0_TGT_ID : 1051 1077 IOX_IOB1_TGT_ID ; 1078 1052 1079 1053 1080 std::ostringstream sc; … … 1062 1089 sc.str().c_str(), 1063 1090 NB_PROCS_MAX, 1064 NB_DMA_CHANNELS,1065 1091 x, 1066 1092 y, … … 1079 1105 INT_MEMC_TGT_ID, 1080 1106 INT_XICU_TGT_ID, 1081 INT_M DMA_TGT_ID,1107 INT_MWMR_TGT_ID, 1082 1108 INT_IOBX_TGT_ID, 1083 1109 1084 1110 INT_PROC_INI_ID, 1085 INT_M DMA_INI_ID,1111 INT_MWMR_INI_ID, 1086 1112 INT_IOBX_INI_ID, 1087 1113 … … 1106 1132 XCU_NB_WTI, 1107 1133 XCU_NB_OUT, 1134 1135 coproc_type, 1108 1136 1109 1137 loader, … … 1501 1529 clusters[x][y]->signal_int_vci_tgt_xicu.print_trace(xicu_signame.str()); 1502 1530 1503 // clusters[x][y]->mdma->print_trace(); 1504 // std::ostringstream mdma_tgt_signame; 1505 // mdma_tgt_signame << "[SIG]MDMA_TGT_" << x << "_" << y; 1506 // clusters[x][y]->signal_int_vci_tgt_mdma.print_trace(mdma_tgt_signame.str()); 1507 // std::ostringstream mdma_ini_signame; 1508 // mdma_ini_signame << "[SIG]MDMA_INI_" << x << "_" << y; 1509 // clusters[x][y]->signal_int_vci_ini_mdma.print_trace(mdma_ini_signame.str()); 1531 // coprocessor in cluster(x,y) 1532 clusters[x][y]->mwmr->print_trace(); 1533 std::ostringstream mwmr_tgt_signame; 1534 mwmr_tgt_signame << "[SIG]MWMR_TGT_" << x << "_" << y; 1535 clusters[x][y]->signal_int_vci_tgt_mwmr.print_trace(mwmr_tgt_signame.str()); 1536 std::ostringstream mwmr_ini_signame; 1537 mwmr_ini_signame << "[SIG]MWMR_INI_" << x << "_" << y; 1538 clusters[x][y]->signal_int_vci_ini_mwmr.print_trace(mwmr_ini_signame.str()); 1539 if ( USE_MWR_CPY ) clusters[x][y]->cpy->print_trace(); 1540 if ( USE_MWR_DCT ) clusters[x][y]->dct->print_trace(); 1541 if ( USE_MWR_GCD ) clusters[x][y]->gcd->print_trace(); 1510 1542 1511 1543 // local interrupts in cluster(x,y) … … 1514 1546 << " ACTIVE" << std::endl; 1515 1547 1516 for ( size_t c = 0 ; c < NB_DMA_CHANNELS ; c++ ) 1517 { 1518 if( clusters[x][y]->signal_irq_mdma[c].read() ) 1519 std::cout << "### IRQ_DMA_" << std::dec << x << "_" << y << "_" << c 1520 << " ACTIVE" << std::endl; 1521 } 1548 if( clusters[x][y]->signal_irq_mwmr.read() ) 1549 std::cout << "### IRQ_MWR_" << std::dec << x << "_" << y 1550 << " ACTIVE" << std::endl; 1522 1551 1523 1552 for ( size_t c = 0 ; c < NB_PROCS_MAX ; c++ ) -
trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/metadata/tsar_iob_cluster.sd
r836 r972 29 29 Uses('common:iss2'), 30 30 Uses('common:elf_file_loader'), 31 Uses('caba:coproc_signals'), 31 32 32 33 # internal network components … … 47 48 cell_size = parameter.Reference('vci_data_width_int')), 48 49 49 Uses('caba:vci_m ulti_dma',50 Uses('caba:vci_mwmr_dma', 50 51 cell_size = parameter.Reference('vci_data_width_int')), 52 53 Uses('caba:coproc_gcd'), 54 Uses('caba:coproc_dct'), 55 Uses('caba:coproc_cpy'), 51 56 52 57 Uses('caba:vci_local_crossbar', -
trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/include/tsar_iob_cluster.h
r959 r972 28 28 #include "dspin_router.h" 29 29 #include "virtual_dspin_router.h" 30 #include "vci_m ulti_dma.h"30 #include "vci_mwmr_dma.h" 31 31 #include "vci_mem_cache.h" 32 32 #include "vci_cc_vcache_wrapper.h" 33 33 #include "vci_io_bridge.h" 34 #include "coproc_signals.h" 35 #include "coproc_gcd.h" 36 #include "coproc_dct.h" 37 #include "coproc_cpy.h" 34 38 35 39 namespace soclib { namespace caba { … … 71 75 sc_signal<bool> signal_false; 72 76 sc_signal<bool> signal_proc_it[32]; 73 sc_signal<bool> signal_irq_m dma[8];77 sc_signal<bool> signal_irq_mwmr; 74 78 sc_signal<bool> signal_irq_memc; 75 79 80 // Coprocessor signals 81 CoprocSignals<uint32_t,uint8_t> signal_to_coproc[8]; 82 CoprocSignals<uint32_t,uint8_t> signal_from_coproc[8]; 83 sc_signal<uint32_t> signal_config_coproc[8]; 84 sc_signal<uint32_t> signal_status_coproc[8]; 85 76 86 // INT network DSPIN signals between DSPIN routers and DSPIN local_crossbars 77 87 DspinSignals<dspin_int_cmd_width> signal_int_dspin_cmd_l2g_d; … … 88 98 // INT network VCI signals between VCI components and VCI local crossbar 89 99 VciSignals<vci_param_int> signal_int_vci_ini_proc[8]; 90 VciSignals<vci_param_int> signal_int_vci_ini_m dma;100 VciSignals<vci_param_int> signal_int_vci_ini_mwmr; 91 101 VciSignals<vci_param_int> signal_int_vci_ini_iobx; 92 102 93 103 VciSignals<vci_param_int> signal_int_vci_tgt_memc; 94 104 VciSignals<vci_param_int> signal_int_vci_tgt_xicu; 95 VciSignals<vci_param_int> signal_int_vci_tgt_m dma;105 VciSignals<vci_param_int> signal_int_vci_tgt_mwmr; 96 106 VciSignals<vci_param_int> signal_int_vci_tgt_iobx; 97 107 … … 144 154 VciXicu<vci_param_int>* xicu; 145 155 146 VciMultiDma<vci_param_int>* mdma; 156 VciMwmrDma<vci_param_int>* mwmr; 157 158 CoprocGcd* gcd; 159 CoprocDct* dct; 160 CoprocCpy* cpy; 147 161 148 162 VciLocalCrossbar<vci_param_int>* int_xbar_d; … … 188 202 TsarIobCluster( sc_module_name insname, 189 203 size_t nb_procs, 190 size_t nb_dmas,191 204 size_t x, // x coordinate 192 205 size_t y, // y coordinate … … 205 218 size_t int_memc_tgt_id, 206 219 size_t int_xicu_tgt_id, 207 size_t int_m dma_tgt_id,220 size_t int_mwmr_tgt_id, 208 221 size_t int_iobx_tgt_id, 209 222 size_t int_proc_ini_id, 210 size_t int_m dma_ini_id,223 size_t int_mwmr_ini_id, 211 224 size_t int_iobx_ini_id, 212 225 … … 231 244 size_t xcu_nb_irq, 232 245 246 size_t coproc_type, 247 233 248 const Loader &loader, // loader for XRAM 234 249 … … 245 260 void init(); 246 261 247 248 262 }; 249 263 -
trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp
r959 r972 15 15 #include "../include/tsar_iob_cluster.h" 16 16 17 #define MWR_COPROC_CPY 0 18 #define MWR_COPROC_DCT 1 19 #define MWR_COPROC_GCD 2 20 17 21 #define tmpl(x) \ 18 22 template<typename vci_param_int , typename vci_param_ext,\ … … 26 30 namespace soclib { namespace caba { 27 31 28 ////////////////////////////////////////////////////////////////////////// 29 // Constructor 30 ////////////////////////////////////////////////////////////////////////// 32 ///////////////////////////////////////////////////////////////////////////// 31 33 tmpl(/**/)::TsarIobCluster( 32 ////////////////////////////////////////////////////////////////////////// 34 ///////////////////////////////////////////////////////////////////////////// 33 35 sc_module_name insname, 34 36 size_t nb_procs, 35 size_t nb_dmas,36 37 size_t x_id, 37 38 size_t y_id, … … 50 51 size_t int_memc_tgt_id, // local index 51 52 size_t int_xicu_tgt_id, // local index 52 size_t int_m dma_tgt_id, // local index53 size_t int_mwmr_tgt_id, // local index 53 54 size_t int_iobx_tgt_id, // local index 54 55 55 56 size_t int_proc_ini_id, // local index 56 size_t int_m dma_ini_id, // local index57 size_t int_mwmr_ini_id, // local index 57 58 size_t int_iobx_ini_id, // local index 58 59 … … 77 78 size_t xcu_nb_out, 78 79 80 size_t coproc_type, 81 79 82 const Loader &loader, 80 83 … … 88 91 p_resetn("resetn") 89 92 { 90 assert( (x_id < xmax) and (y_id < ymax) and "Illegal cluster coordinates"); 93 assert( (x_id < xmax) and (y_id < ymax) and 94 "Error in tsar_iob_cluster : Illegal cluster coordinates"); 91 95 92 96 size_t cluster_id = (x_id<<4) + y_id; … … 186 190 xcu_nb_out); // number of output IRQs 187 191 188 //////////// MDMA 189 std::ostringstream s_mdma; 190 s_mdma << "mdma_" << x_id << "_" << y_id; 191 mdma = new VciMultiDma<vci_param_int>( 192 s_mdma.str().c_str(), 192 //////////// MWMR controller and coprocessor 193 std::ostringstream s_mwmr; 194 std::ostringstream s_copro; 195 s_mwmr << "mwmr_" << x_id << "_" << y_id; 196 197 if ( coproc_type == MWR_COPROC_CPY) 198 { 199 s_copro << "cpy_" << x_id << "_" << y_id; 200 cpy = new CoprocCpy( s_copro.str().c_str(), 64 ); // burst size 201 202 mwmr = new VciMwmrDma<vci_param_int>( 203 s_mwmr.str().c_str(), 193 204 mt_int, 194 IntTab(cluster_id, nb_procs), // SRCID 195 IntTab(cluster_id, int_mdma_tgt_id), // TGTID 196 64, // burst size 197 nb_dmas); // number of IRQs 205 IntTab(cluster_id, int_mwmr_ini_id), // SRCID 206 IntTab(cluster_id, int_mwmr_tgt_id), // TGTID 207 1, // nb to_coproc ports 208 1, // nb from_coproc ports 209 1, // nb config registers 210 0, // nb status registers 211 64 ); // burst size (bytes) 212 } 213 if ( coproc_type == MWR_COPROC_DCT ) 214 { 215 s_copro << "dct_" << x_id << "_" << y_id; 216 dct = new CoprocDct( s_copro.str().c_str(), 64 , 16 ); // burst size / latency 217 218 mwmr = new VciMwmrDma<vci_param_int>( 219 s_mwmr.str().c_str(), 220 mt_int, 221 IntTab(cluster_id, int_mwmr_ini_id), // SRCID 222 IntTab(cluster_id, int_mwmr_tgt_id), // TGTID 223 1, // nb to_coproc ports 224 1, // nb from_coproc ports 225 1, // nb config registers 226 0, // nb status registers 227 64 ); // burst size (bytes) 228 } 229 if ( coproc_type == MWR_COPROC_GCD ) 230 { 231 s_copro << "gcd_" << x_id << "_" << y_id; 232 gcd = new CoprocGcd( s_copro.str().c_str(), 64 ); // burst size 233 234 mwmr = new VciMwmrDma<vci_param_int>( 235 s_mwmr.str().c_str(), 236 mt_int, 237 IntTab(cluster_id, int_mwmr_ini_id), // SRCID 238 IntTab(cluster_id, int_mwmr_tgt_id), // TGTID 239 2, // nb to_coproc ports 240 1, // nb from_coproc ports 241 1, // nb config registers 242 0, // nb status registers 243 64 ); // burst size (bytes) 244 } 198 245 199 246 /////////// Direct LOCAL_XBAR(S) … … 435 482 int_xbar_d->p_to_target[int_memc_tgt_id] (signal_int_vci_tgt_memc); 436 483 int_xbar_d->p_to_target[int_xicu_tgt_id] (signal_int_vci_tgt_xicu); 437 int_xbar_d->p_to_target[int_m dma_tgt_id] (signal_int_vci_tgt_mdma);438 int_xbar_d->p_to_initiator[int_m dma_ini_id] (signal_int_vci_ini_mdma);484 int_xbar_d->p_to_target[int_mwmr_tgt_id] (signal_int_vci_tgt_mwmr); 485 int_xbar_d->p_to_initiator[int_mwmr_ini_id] (signal_int_vci_ini_mwmr); 439 486 for (size_t p = 0; p < nb_procs; p++) 440 487 int_xbar_d->p_to_initiator[int_proc_ini_id + p] (signal_int_vci_ini_proc[p]); … … 513 560 { 514 561 if ( i == 0 ) xicu->p_hwi[i] (signal_irq_memc); 515 else if ( i <= nb_dmas ) xicu->p_hwi[i] (signal_irq_mdma[i-1]);562 else if ( i == 1 ) xicu->p_hwi[i] (signal_irq_mwmr); 516 563 else xicu->p_hwi[i] (signal_false); 517 564 } … … 546 593 xram_ram_wt->p_vci (signal_ram_vci_tgt_xram); 547 594 548 /////////////////////////////////// MDMA 549 mdma->p_clk (this->p_clk); 550 mdma->p_resetn (this->p_resetn); 551 mdma->p_vci_target (signal_int_vci_tgt_mdma); 552 mdma->p_vci_initiator (signal_int_vci_ini_mdma); 553 for (size_t i=0 ; i<nb_dmas ; i++) 554 mdma->p_irq[i] (signal_irq_mdma[i]); 595 /////////////////////////////////// GCD coprocessor 596 if ( coproc_type == MWR_COPROC_GCD ) 597 { 598 gcd->p_clk (this->p_clk); 599 gcd->p_resetn (this->p_resetn); 600 gcd->p_opa (signal_to_coproc[0]); 601 gcd->p_opb (signal_to_coproc[1]); 602 gcd->p_res (signal_from_coproc[0]); 603 gcd->p_config (signal_config_coproc[0]); 604 605 mwmr->p_clk (this->p_clk); 606 mwmr->p_resetn (this->p_resetn); 607 mwmr->p_vci_target (signal_int_vci_tgt_mwmr); 608 mwmr->p_vci_initiator (signal_int_vci_ini_mwmr); 609 mwmr->p_to_coproc[0] (signal_to_coproc[0]); 610 mwmr->p_to_coproc[1] (signal_to_coproc[1]); 611 mwmr->p_from_coproc[0] (signal_from_coproc[0]); 612 mwmr->p_config[0] (signal_config_coproc[0]); 613 mwmr->p_irq (signal_irq_mwmr); 614 } 615 616 /////////////////////////////////// DCT coprocessor 617 if ( coproc_type == MWR_COPROC_DCT ) 618 { 619 dct->p_clk (this->p_clk); 620 dct->p_resetn (this->p_resetn); 621 dct->p_in (signal_to_coproc[0]); 622 dct->p_out (signal_from_coproc[0]); 623 dct->p_config (signal_config_coproc[0]); 624 625 mwmr->p_clk (this->p_clk); 626 mwmr->p_resetn (this->p_resetn); 627 mwmr->p_vci_target (signal_int_vci_tgt_mwmr); 628 mwmr->p_vci_initiator (signal_int_vci_ini_mwmr); 629 mwmr->p_to_coproc[0] (signal_to_coproc[0]); 630 mwmr->p_from_coproc[0] (signal_from_coproc[0]); 631 mwmr->p_config[0] (signal_config_coproc[0]); 632 mwmr->p_irq (signal_irq_mwmr); 633 } 634 635 /////////////////////////////////// CPY coprocessor 636 if ( coproc_type == MWR_COPROC_CPY ) 637 { 638 cpy->p_clk (this->p_clk); 639 cpy->p_resetn (this->p_resetn); 640 cpy->p_load (signal_to_coproc[0]); 641 cpy->p_store (signal_from_coproc[0]); 642 cpy->p_config (signal_config_coproc[0]); 643 644 mwmr->p_clk (this->p_clk); 645 mwmr->p_resetn (this->p_resetn); 646 mwmr->p_vci_target (signal_int_vci_tgt_mwmr); 647 mwmr->p_vci_initiator (signal_int_vci_ini_mwmr); 648 mwmr->p_to_coproc[0] (signal_to_coproc[0]); 649 mwmr->p_from_coproc[0] (signal_from_coproc[0]); 650 mwmr->p_config[0] (signal_config_coproc[0]); 651 mwmr->p_irq (signal_irq_mwmr); 652 } 555 653 556 654 //////////////////////////// RAM network CMD & RSP routers … … 624 722 signal_ram_dspin_cmd_false.write = false; 625 723 signal_ram_dspin_rsp_false.read = true; 626 } // end init724 } 627 725 628 726 }}
Note: See TracChangeset
for help on using the changeset viewer.