Changes between Initial Version and Version 1 of Component/Vci Multi Dma


Ignore:
Timestamp:
Apr 13, 2011, 10:04:16 AM (13 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Component/Vci Multi Dma

    v1 v1  
     1[wiki:Component SocLib Components General Index]
     2
     3= !VciMultiDma =
     4
     5== 1) Functional Description ==
     6
     7As the !VciDma component, this component  moves data from
     8a source memory buffer to a destination memory buffer.
     9It 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
     13This hardware component supports up to 16 simultaneous DMA transfers,
     14corresponding to 16 independant DMA channels.
     15
     16As there is only one VCI port, the general arbitration policy between the
     17active channels is round-robin.
     18
     19Each channet has its own set of memory mapped registers, and for each
     20channel a specific IRQ can be is optionally asserted when transfer is completed.
     21
     22This hardware component checks for segmentation violation, and can be used
     23as a default target.
     24
     25This component has 5 memory-mapped registers :
     26
     27 * '''DMA_SRC''' (Read / Write)
     28It defines the physical address of the source buffer.
     29
     30 * '''DMA_DST''' (Read / Write)
     31It defines the physical address of the destination buffer.
     32
     33 * '''DMA_LEN''' (Read / Write)
     34It defines the length of transfer, in bytes. This register must be written after writing into
     35registers DMA_SRC & DMA_DST, as the writing into the DMA_LEN register starts the transfer.
     36This register gets back to 0 when transfer is finished.
     37This register can be used to test the DMA coprocessor status.
     38
     39 * '''DMA_RESET''' (Write-only)
     40Writing any value into this pseudo-register makes a clean re-initialisation of the DMA coprocessor:
     41The on-going VCI transaction is completed before the coprocessor returns the IDLE state.
     42This write access must be used by the software ISR to aknowledge the DMA IRQ.
     43
     44 * '''DMA_IRQ_DISABLED''' (Read / Write)
     45A non zero value disables the IRQ line. The RESET value is zero.
     46
     47For extensibility issues, you should access the DMA using globally-defined offsets.
     48
     49You should include file `soclib/dma.h` from your software, it
     50defines `DMA_SRC`, `DMA_DST`, `DMA_LEN`, `DMA_RESET`, `DMA_IRQ_DISABLED`.
     51
     52Sample code:
     53{{{
     54#include "soclib/dma.h"
     55
     56static const volatile void* dma = 0xc0000000;
     57
     58void * 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)
     71
     72== 2) Component definition & usage ==
     73
     74source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_dma/caba/metadata/vci_dma.sd
     75
     76See [wiki:SoclibCc/VciParameters SoclibCc/VciParameters]
     77{{{
     78Uses( 'vci_dma' )
     79}}}
     80
     81== 3) CABA  Implementation ==
     82
     83=== CABA sources ===
     84 
     85 * interface : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_dma/caba/source/include/vci_dma.h
     86 * implementation : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_dma/caba/source/src/vci_dma.cpp
     87
     88=== CABA Constructor parameters ===
     89{{{
     90VciDma(
     91     sc_module_name name,   //  Component Name
     92     const soclib::common::MappingTable &mt,   // MappingTable
     93     const soclib::common::IntTab &srcid,  // Initiator index
     94     const soclib::common::IntTab &tgtid,  // Target index
     95     const size_t burst_size );   //  Number of bytes transfered in a burst
     96}}}
     97
     98===  CABA Ports ===
     99
     100 * sc_in<bool> '''p_resetn''' : Global system reset
     101 * sc_in<bool> '''p_clk''' : Global system clock
     102 * soclib::caba::!VciTarget<vci_param> '''p_vci_target''' : The VCI target port
     103 * soclib::caba::!VciInitiator<vci_param> '''p_vci_initiator''' : The VCI initiator port
     104 * sc_out<bool> '''p_irq''' : Interrupt port
     105
     106== 4) TLM-DT implementation ==
     107
     108The TLM-DT implementation is not available yet.