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


Ignore:
Timestamp:
Mar 10, 2015, 1:12:20 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Component/Vci Mwmr Dma

    v1 v1  
     1[wiki:Component SocLib Components General Index]
     2
     3= !VciMwmrDma =
     4
     5== 1) Functional Description ==
     6
     7This VCI component can be used to connect an hardware coprocessor to a VCI interconnect.
     8
     9On the coprocessor side, it provides a variable number of TO_COPROC and FROM_COPROC ports,  defining a fifo-like interface, without addresses.
     10 * on a TO_COPROC port the coprocessor can request to read a vector of 32 bits words.
     11 * on a FROM_COPROC port the coprocessor can request to write a vector of 32 bits words. 
     12Each TO_COPROC or FROM_COPROC port define a communication channel to a memory buffer.
     13Each channel contains a private hardware fifo (two 32 bits slots).
     14The number of TO_COPROC and FROM_COPROC channels, are constructor parameters.
     15The total number of channels cannot be larger than 16.
     16
     17On the VCI side, this component is both a VCI target and a VCI initiator:
     18 * It is addressed as a target to be configured.
     19 * It is acting as an initiator to do the data transfers
     20It makes the assumption that the VCI RDATA & WDATA fields have 32 bits, but the VCI address field can have up to 64 bits. The VCI TRDID and PKTID fields must have at least 4 bits.
     21
     22'''WARNING''' : This DMA controller uses bursts to transfer the data, and a constructor parameter define the burst size (typically a cache line). This introduce the following constraints:
     23 * The memory buffer address and size  must be multiple of the burst size.
     24 * The number of bytes requested by the coprocessor on a TO_COPROC or FROM_COPROC port must be an integer number of bursts.
     25
     26Each channel FSM implements two operating modes that can be defined by software:
     27 * In '''DMA_MODE''', the channel FSM transfer a single buffer between the memory and the coprocessor port. The number of VCI burst depends on both the memory buffer size, and the burst size. In this mode the software must define the channel configuration by writing the data buffer address and size in the channel configuration registers. An optional interrupt can be activated when the requested transfer is completed.
     28 * In '''MWMR_MODE''', the channel FSM transfer an "infinite" data stream, between the coprocessor port and a MWMR channel (software FIFO in memory). In this mode the software must write in the channel configuration registers the data buffer address and size, but also the MWMR FIFO descriptor address and the lock address, as the channel FSM implements the 7 steps MWMR protocol.
     29   1 - Read the ticket for queuing lock (1 flit VCI READ)
     30   2 - Increment atomically the ticket (VCI CAS)
     31   3 - Read the lock current value (1 flit VCI READ)
     32   4 - Read the channel status (3 flits VCI READ)
     33   5 - Transfer the data (N flits VCI READ or WRITE)
     34   6 - Upate the status (3 flits VCI WRITE)
     35   7 - Release the lock (1 flit VCI WRITE)
     36
     37Several channels can simultaneously run in different modes, and the various VCI transactions corresponding to different channels are interleaved and parallelized on the VCI network. The maximum number of simultaneous VCI transactions is equal to the number of channels.
     38
     39Besides the communication channels, this MWMR controller provides a variable number
     40of coprocessor specific ''configuration'' or ''status'' 32 bits registers:
     41 * '''CONFIG''' registers are Read/Write
     42 * '''STATUS''' registers are Read-Only
     43
     44== 2) Addressable registers ==
     45
     46For each communication channel, the software addressable registers are the following
     47 * '''CHANNEL_BUFFER_LSB[k]'''     data buffer physical address 32 LSB bits    (MWMR or DMA)
     48
     49 * '''CHANNEL_BUFFER_MSB[k]'''     data buffer physical address extend bits    (MWMR or DMA)
     50
     51 * '''CHANNEL_MWMR_LSB[k]'''       channel status physical address 32 LSB bits (MWMR   only)
     52
     53 * '''CHANNEL_MWMR_MSB[k]'''       channel status physical address extend bits (MWMR   only)
     54
     55 * '''CHANNEL_LOCK_LSB[k]'''       channel lock physical address 32 LSB bits   (MWMR   only)
     56
     57 * '''CHANNEL_LOCK_MSB[k]'''       channel lock physical address extend bits   (MWMR   only)
     58
     59 * '''CHANNEL_WAY[k]'''            channel direction (TO_COPROC / FROM_COPROC) (MWMR or DMA)
     60
     61 * '''CHANNEL_MODE[k]'''           MWMR / DMA_IRQ / DMA_NO_IRQ                 (MWMR or DMA)
     62
     63 * '''CHANNEL_SIZE[k]'''           data buffer size (bytes)                    (MWMR or DMA)
     64
     65 * '''CHANNEL_RUN[k]'''            channel activation/deativation              (MWMR or DMA)
     66
     67 * '''CHANNEL_STATUS[k]'''                                                     (MWMR or DMA)
     68
     69
     70Sets the width of one item of the selected MWMR channel (in bytes).
     71
     72 * `MWMR_CONFIG_BUFFER_ADDR`
     73Sets the address of the data buffer for the selected MWMR channel.
     74
     75 * `MWMR_CONFIG_RUNNING`
     76A boolean enabling the selected MWMR channel.
     77
     78This hardware component cheks for segmentation violation, and can be used
     79as a default target.
     80
     81For extensibility issues, you should access these registers using these globally-defined offsets.
     82You should include the `soclib/MwmrDma.h`file in your software, that defines all useful offsets and constants.
     83
     84== 3) Component definition & usage ==
     85
     86source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_mwmr_dma/caba/metadata/vci_mwmr_dma.sd
     87See [wiki:SoclibCc/VciParameters SoclibCc/VciParameters]
     88{{{
     89Uses( 'vci_mwmr_dma' )
     90}}}
     91
     92== 4) CABA  Implementation ==
     93
     94=== CABA sources ===
     95
     96 * interface : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_mwmr_dma/caba/source/include/vci_mwmr_dma.h
     97 * implementation : source:trunk/soclib/soclib/module/infrastructure_component/dma_infrastructure/vci_mwmr_dma/caba/source/src/vci_mwmr_dma.cpp
     98
     99=== CABA Constructor ===
     100{{{
     101VciMwmrDma(
     102        sc_module_name name,  // instance name
     103        const MappingTable &mt,  // mapping table
     104        const IntTab &srcid,  // VCI initiator index
     105        const IntTab &tgtid,  // VCI target index
     106        const size_t n_to_coproc,  // number of TO_COPROC channels
     107        const size_t n_from_coproc, // number of FROM_COPROC channels
     108        const size_t n_config,     // number of configuration registers
     109        const size_t n_status,   // number of status registers
     110        const size_t burst_size )  // number of bytes
     111}}}
     112
     113=== CABA Ports ===
     114
     115 * sc_in<bool> '''p_resetn''' : Global system reset
     116 * sc_in<bool> '''p_clk''' : Global system clock
     117 * soclib::caba::!VciTarget<vci_param> '''p_vci_target''' : The VCI target port
     118 * soclib::caba::!VciInitiator<vci_param> '''p_vci_initiator''' : The VCI initiator port
     119 * soclib::caba::!ToCoprocOutput<uint32_t,uint8_t> '''p_to_coproc[]''' : to coprocessor ports
     120 * soclib::caba::!FromCoprocInput<uint32_t,uint8_t> '''p_from_coproc[]''' : from coprocessor ports
     121 * sc_out<uint32_t> '''p_config[]''' : Configuration ports
     122 * sc_in<uint32_t> '''p_status[]''' : Status ports
     123 * sc_out<bool> '''p_irq''' : IRQ output port
     124
     125== 5) TLM-DT Implementation ==
     126
     127Not available yet.
     128