Changes between Version 1 and Version 2 of Component/Vci Multi Dma
- Timestamp:
- Apr 13, 2011, 2:23:53 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Component/Vci Multi Dma
v1 v2 11 11 * It is acting as an initiator to do the transfer. 12 12 13 Th is hardwarecomponent supports up to 16 simultaneous DMA transfers,14 corresponding to 16 independant DMA channels. 13 The !VCIMultiDma component supports up to 16 simultaneous DMA transfers, 14 corresponding to 16 independant DMA channels. As there is only one VCI port, the general arbitration policy between the active channels is round-robin. 15 15 16 As there is only one VCI port, the general arbitration policy between the 17 active channels is round-robin.16 The number of channels and the max burst length are constructor parameters. 17 The burst length parameter must be multiple of 4 bytes. 18 18 19 Each channet has its own set of memory mapped registers, and for each 19 This component makes the assumption that the VCI RDATA & WDATA fiels have 32 bits. 20 The source buffer base address, the destination buffer base address and the buffer length 21 mus be multiple of 4 bytes. The buffer length is not constrained to be a multiple of 22 the burst length. 23 24 Each channel has its own set of memory mapped registers, and for each 20 25 channel a specific IRQ can be is optionally asserted when transfer is completed. 21 26 22 This hardware component checks for segmentation violation, and can be used 23 as a default target. 27 Each channel k has 5 memory-mapped registers : 24 28 25 This component has 5 memory-mapped registers : 26 27 * '''DMA_SRC''' (Read / Write) 29 * '''DMA_SRC[k]''' (Read / Write) 28 30 It defines the physical address of the source buffer. 29 31 30 * '''DMA_DST ''' (Read / Write)32 * '''DMA_DST[k]''' (Read / Write) 31 33 It defines the physical address of the destination buffer. 32 34 33 * '''DMA_LEN ''' (Read / Write)35 * '''DMA_LEN[k]''' (Read / Write) 34 36 It defines the length of transfer, in bytes. This register must be written after writing into 35 37 registers DMA_SRC & DMA_DST, as the writing into the DMA_LEN register starts the transfer. … … 37 39 This register can be used to test the DMA coprocessor status. 38 40 39 * '''DMA_RESET ''' (Write-only)41 * '''DMA_RESET[k]''' (Write-only) 40 42 Writing any value into this pseudo-register makes a clean re-initialisation of the DMA coprocessor: 41 43 The on-going VCI transaction is completed before the coprocessor returns the IDLE state. 42 44 This write access must be used by the software ISR to aknowledge the DMA IRQ. 43 45 44 * '''DMA_IRQ_DISABLED ''' (Read / Write)46 * '''DMA_IRQ_DISABLED[k]''' (Read / Write) 45 47 A non zero value disables the IRQ line. The RESET value is zero. 46 48 47 For extensibility issues, you should access the DMA using globally-defined offsets.49 The aligned segment size associated to this VCI target is 1 Kbytes, as only 10 address bits are decoded : the 6 MSB bits define the target register, and the next 4 bits define the channel index. 48 50 49 You should include file `soclib/dma.h` from your software, it 51 For extensibility issues, you should access the DMA using globally-defined offsets, and 52 you should include file `soclib/dma.h` in your software, it 50 53 defines `DMA_SRC`, `DMA_DST`, `DMA_LEN`, `DMA_RESET`, `DMA_IRQ_DISABLED`. 51 54 52 Sample code: 53 {{{ 54 #include "soclib/dma.h" 55 56 static const volatile void* dma = 0xc0000000; 57 58 void * memcpy(void *dst, const void *src, const size_t len) 59 { 60 soclib_io_set( dma, DMA_DST, dst ); 61 soclib_io_set( dma, DMA_SRC, src ); 62 soclib_io_set( dma, DMA_LEN, len ); 63 while( soclib_io_get( dma, DMA_LEN ) ) 64 ; 65 return dst; 66 } 67 68 }}} 69 70 (add -I/path/to/soclib/include to your compilation command-line) 55 This hardware component checks for segmentation violation, and can be used 56 as a default target. 71 57 72 58 == 2) Component definition & usage == 73 59 74 source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_ dma/caba/metadata/vci_dma.sd60 source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_multi_dma/caba/metadata/vci_multi_dma.sd 75 61 76 62 See [wiki:SoclibCc/VciParameters SoclibCc/VciParameters] 77 63 {{{ 78 Uses( 'vci_ dma' )64 Uses( 'vci_multi_dma' ) 79 65 }}} 80 66 … … 83 69 === CABA sources === 84 70 85 * interface : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_ dma/caba/source/include/vci_dma.h86 * implementation : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_ dma/caba/source/src/vci_dma.cpp71 * interface : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_multi_dma/caba/source/include/vci_multi_dma.h 72 * implementation : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_multi_dma/caba/source/src/vci_multi_dma.cpp 87 73 88 74 === CABA Constructor parameters === … … 93 79 const soclib::common::IntTab &srcid, // Initiator index 94 80 const soclib::common::IntTab &tgtid, // Target index 95 const size_t burst_size ); // Number of bytes transfered in a burst 81 const size_t burst_size, // Max number of bytes transfered in a burst 82 const size_t channels ); // Number of channels 96 83 }}} 97 84 98 85 === CABA Ports === 99 86 100 * sc_in<bool>'''p_resetn''' : Global system reset101 * sc_in<bool>'''p_clk''' : Global system clock102 * soclib::caba::!VciTarget<vci_param>'''p_vci_target''' : The VCI target port103 * soclib::caba::!VciInitiator<vci_param>'''p_vci_initiator''' : The VCI initiator port104 * sc_out<bool> '''p_irq''' : Interrupt port87 * '''p_resetn''' : Global system reset 88 * '''p_clk''' : Global system clock 89 * '''p_vci_target''' : The VCI target port 90 * '''p_vci_initiator''' : The VCI initiator port 91 * '''p_irq[k]''' : As many output IRQ ports as the number of channels 105 92 106 93 == 4) TLM-DT implementation ==