| 1 | [wiki:Component SocLib Components General Index] |
| 2 | |
| 3 | = !VciChbufDma = |
| 4 | |
| 5 | == 1) Functional Description == |
| 6 | |
| 7 | As the !VciDma component, this component moves data from |
| 8 | a source memory buffer to a destination memory buffer. |
| 9 | It is both a target and an initiator. |
| 10 | * It is addressed as a target to be configured for a transfer. |
| 11 | * It is acting as an initiator to do the transfer. |
| 12 | |
| 13 | The !VciMultiDma component supports up to 8 simultaneous DMA transfers, |
| 14 | corresponding to 8 independant DMA channels. As there is only one VCI initiator port, the general arbitration policy between the active channels is round-robin. |
| 15 | |
| 16 | The number of channels (CHANNELS) and the burst length (MAX_BURST_LENGTH) are constructor parameters. The burst length parameter must be multiple of 4 bytes. |
| 17 | |
| 18 | This component makes the assumption that the VCI RDATA & WDATA fiels have 32 bits. |
| 19 | The source buffer base address, the destination buffer base address and the buffer length |
| 20 | mus be multiple of 4 bytes. The buffer length is not constrained to be a multiple of |
| 21 | the burst length. |
| 22 | |
| 23 | Each channel has its own set of memory mapped registers, and for each |
| 24 | channel a specific IRQ can be optionally asserted when transfer is completed. |
| 25 | |
| 26 | Each channel k has 5 memory-mapped registers : |
| 27 | |
| 28 | * '''DMA_SRC[k]''' (Read / Write) |
| 29 | It defines the physical address of the source buffer. |
| 30 | |
| 31 | * '''DMA_DST[k]''' (Read / Write) |
| 32 | It defines the physical address of the destination buffer. |
| 33 | |
| 34 | * '''DMA_LEN[k]''' (Read / Write) |
| 35 | A write access defines the length of the transfer (in bytes), and starts the transfer. |
| 36 | A read access returns the DMA channel status. The relevant values for the status are: |
| 37 | || Cnannel Status || Value || |
| 38 | ||DMA_IDLE || 2 || |
| 39 | ||DMA_SUCCESS || 0 || |
| 40 | ||DMA_READ_ERROR || 1 || |
| 41 | ||DMA_WRITE_ERROR || 3 || |
| 42 | ||DMA_BUSY || >3 || |
| 43 | |
| 44 | * '''DMA_RESET[k]''' (Write-only) |
| 45 | Writing any value into this pseudo-register makes a clean re-initialisation of the DMA coprocessor: |
| 46 | The on-going VCI transaction is completed before the coprocessor returns the IDLE state. |
| 47 | This write access must be used by the software ISR to aknowledge the DMA IRQ. |
| 48 | |
| 49 | * '''DMA_IRQ_DISABLED[k]''' (Read / Write) |
| 50 | A non zero value disables the IRQ line. The RESET value is zero. |
| 51 | |
| 52 | In order to support various protection mechanisms, each channel akes 4K bytes in the address space. The segment size is 32 K bytes, and the segment associated to this peripheral must be aligned on a 32K bytes boundary. Only 8 address bits are decoded : |
| 53 | * The five bits ADDRESS[4:0] define the target register. |
| 54 | * The three bits ADDRESS[14:12] define the channel index. |
| 55 | |
| 56 | For extensibility issues, you should access the DMA using globally-defined offsets, and |
| 57 | you should include file `soclib/dma.h` in your software, it |
| 58 | defines `DMA_SRC`, `DMA_DST`, `DMA_LEN`, `DMA_RESET`, `DMA_IRQ_DISABLED`. |
| 59 | |
| 60 | This hardware component checks for segmentation violation, and can be used |
| 61 | as a default target. |
| 62 | |
| 63 | == 2) Component definition & usage == |
| 64 | |
| 65 | source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_chbuf_dma/caba/metadata/vci_chbuf_dma.sd |
| 66 | |
| 67 | See [wiki:SoclibCc/VciParameters SoclibCc/VciParameters] |
| 68 | {{{ |
| 69 | Uses( 'vci_chbuf_dma' ) |
| 70 | }}} |
| 71 | |
| 72 | == 3) CABA Implementation == |
| 73 | |
| 74 | === CABA sources === |
| 75 | |
| 76 | * interface : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_chbuf_dma/caba/source/include/vci_chbuf_dma.h |
| 77 | * implementation : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_chbuf_dma/caba/source/src/vci_chbuf_dma.cpp |
| 78 | |
| 79 | === CABA Constructor parameters === |
| 80 | {{{ |
| 81 | VciChbufDma( |
| 82 | sc_module_name name, // Component Name |
| 83 | const soclib::common::MappingTable &mt, // MappingTable |
| 84 | const soclib::common::IntTab &srcid, // Initiator index |
| 85 | const soclib::common::IntTab &tgtid, // Target index |
| 86 | const size_t burst_max_length, // Max number of bytes transfered in a burst |
| 87 | const size_t channels ); // Number of channels |
| 88 | }}} |
| 89 | |
| 90 | === CABA Ports === |
| 91 | |
| 92 | * '''p_resetn''' : Global system reset |
| 93 | * '''p_clk''' : Global system clock |
| 94 | * '''p_vci_target''' : The VCI target port |
| 95 | * '''p_vci_initiator''' : The VCI initiator port |
| 96 | * '''p_irq[k]''' : As many output IRQ ports as the number of channels |
| 97 | |
| 98 | == 4) TLM-DT implementation == |
| 99 | |
| 100 | The TLM-DT implementation is not available yet. |