Changes between Version 67 and Version 68 of library_stdio


Ignore:
Timestamp:
Apr 12, 2015, 1:09:34 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • library_stdio

    v67 v68  
    4545 ==  __Coprocessors related system calls__ ==
    4646
    47 The GIET_VM allows user applications to use hardware accelerators (called coprocessors). These coprocessors can be distributed in the architecture, but there is at most one coprocessor per cluster. To be supported by the GIET_VM, a coprocessor must use the ''vci_mwmr_dma'' component, that is a generic multi-channels DMA controller.
    48 
    49 On the coprocessor side, it provides TO_COPROC or FROM_COPROC ports, that implement FIFO interfaces. Coprocessor can request to transfer one or several bursts of 32 bits words on a TO_COPROC or FROM_COPROC port, without address. The burst size (generally a cache line), the number of TO_COPROC and FROM_COPROC ports, and the number of bursts for a given port are hardware parameters. Each port define a private communication channel between the coprocessor and a user memory buffer. The total number of channels cannot be larger than 16. A channel is identified by an index, and the TO_COPROC channels have the smallest indexes.
    50 
    51 Each communication channel implements three transfer modes that can be configured by software:
    52  * In '''MODE_MWMR''', the channel transfer an "infinite" data stream, between the coprocessor port and a MWMR software FIFO in memory. The MWMR_DMA controller  implements the 7 steps MWMR protocol.
    53  * In '''MODE_DMA_IRQ''', the channel transfer a single buffer between the coprocessor port and the memory. The number of VCI burst for a given channel depends on the memory buffer size, and the MWMR_DMA controller signals the transfer completion with an interrupt.
    54  * The '''MODE_DMA_NO_IRQ''', is similar to the previous one, but the channel stops when the transfer is completed, without rising an interrupt.
     47The GIET_VM allows user applications to use hardware accelerators (called coprocessors). These coprocessors can be distributed in the architecture, but there is at most one coprocessor per cluster. To be supported by the GIET_VM, a coprocessor must use the '''vci_mwmr_dma''' component, that is a generic multi-channels DMA controller.
     48
     49On the coprocessor side, it provides TO_COPROC or FROM_COPROC ports, that implement FIFO interfaces. Coprocessor can request to transfer one or several bursts of 32 bits words on a TO_COPROC or FROM_COPROC port, without address. The burst size (generally a cache line), the number of TO_COPROC and FROM_COPROC ports, and the number of bursts for a given port are hardware parameters, depending on the coprocessor type. Each port define a private communication channel between the coprocessor and a user memory buffer. The total number of channels cannot be larger than 16. A channel is identified by an index, and the TO_COPROC channels have the smallest indexes.
     50
     51The '''vci_mwmr_dma''' component implements two transfer modes that can be configured by the user application through dedicate system calls.
     52 * In '''MODE_MWMR''', each channel FSM  implements the 7 steps MWMR protocol. It is activated by writing a non-zero value in the CHANNEL_RUNNING register, and transfer an "infinite" data stream, between the coprocessor port and a MWMR software FIFO in memory. There is no transfer completion signaling, as the synchronisation is done through the MWMR FIFOs. The MWR IRQ is only asserted if a VCI error is reported in memory access.
     53 * In '''MODE_DMA_IRQ''' or '''MODE_DMA_NO_IRQ, each channel FSM transfer a single buffer between the coprocessor port and the memory. It is activated by writing a non-zero value in the CHANNEL_RUNNING register. When transfer is completed, the channel FSM keep blocked until a zero value is written in the CHANNEL_RUNNING register. In MODE_DMA_IRQ, the calling task is descheduled after coprocessor activation in the ''giet_coproc_start()'' system call. The transfer completion is signaled by the WMR IRQ that updates the ''_coproc_done'' / ''_coproc_status'' variables, deactivate the coprocessor, and resume the calling task.  In '''MODE_DMA_NO_IRQ''', the ''giet_coproc_start()'' is not blocking, and the user task must use the ''giet_coproc_completed()'' system call to detect transfer completion (by polling the coprocessor registers).
    5554
    5655'''WARNING''' : For all channels, the memory buffer address and size  must be multiple of the hardware burst size.
    5756
    58 The VCI transactions corresponding to different channels are interleaved and parallelized on the VCI network.
    59 
    60 Besides these communication channels, the ''vci_mwmr_dma'' component support up to 16 coprocessor-specific configuration/status registers. The ''configuration'' registers are Read and Write. The ''status'' registers are Read only.
     57'''WARNING''': If all channels are not running in the same mode, the result is unpredictable.
     58
     59The VCI transactions corresponding to different TO_COPROC / FROM_COPROC channels are interleaved and parallelized on the VCI network.
     60
     61Besides the TO_COPROC/FROM_COPROC communication channels, the '''vci_mwmr_dma''' component support up to 16 coprocessor-specific configuration/status registers.
     62 * The '''configuration''' registers are Read and Write.
     63 * The '''status''' registers are Read only.
    6164
    6265
     
    6770|| MWR_COPROC_CPY  ||   Memory Copy                      ||    1                 ||          1               ||        1        ||       0        ||     
    6871
    69  === 1) void '''giet_coproc_alloc'''( unsigned int   coproc_type,  unsigned int*  coproc_key, unsigned int* coproc_info ) ===
    70 This function allocates a private coprocessor to the calling task, taking a lock to grant exclusive ownership, and register the key in the task context.
     72 === 1) void '''giet_coproc_alloc'''( unsigned int   coproc_type , unsigned int* coproc_info ) ===
     73This function allocates a private coprocessor to the calling task, taking a lock to grant exclusive ownership, and register the coprocessor coordinates in the task context.
    7174In the current implementation, the task exit if there is no coprocessor of requested type in the same cluster as the calling task.
    72 In case of success, it returns an access key and the coprocessor characteristics in the '''coproc_info''' and '''coproc_key''' variables.
     75In case of success, it returns the coprocessor characteristics in the '''coproc_info''' variable.
    7376 * '''coproc_type''' : see supported types above.
    74  * '''coproc_key''' (return value) : identifier for coprocessor access.
    7577 * '''coproc_info''' (return value) :  nb_to_coprocs = info[7:0] / nb_from_coproc = info[15:8] / nb_config = info[23:16] / nb_status = info[31:24]
    7678
    77  === 2) void '''giet_coproc_release'''( unsigned int  coproc_key ) ===
     79 === 2) void '''giet_coproc_release'''( ) ===
    7880 This function releases the coprocessor allocated to the calling task.
    79  * '''coproc_key''' : coprocessor identifier.
    80 
    81  === 3) void '''giet_coproc_channel_init'''( unsigned int  coproc_key,  unsigned int channel,  giet_coproc_channel_t*  desc ) ===
    82 This function initializes a communication channel. It uses the he following structure (defined in the [source:soft/giet_vm/giet_libs/stdio.h stdio.h] file) to specify the channel parameters:
     81
     82 === 3) void '''giet_coproc_channel_init'''( unsigned int channel , giet_coproc_channel_t*  desc ) ===
     83This function initializes a TO_COPROC/FROM_COPROC communication channel. It uses the he following structure (defined in the [source:soft/giet_vm/giet_libs/stdio.h stdio.h] file) to specify the channel parameters:
    8384{{{
    8485typedef struct giet_coproc_channel
     
    9192} giet_coproc_channel_t;
    9293}}}
    93  * '''coproc_key''' : coprocessor identifier.
    9494 * '''channel''' communication channel index. TO_COPROC channels use the smallest indexes.
    9595 * '''desc''' pointer on the giet_coproc_channel_t structure.
    9696
    97  === 4) void '''giet_coproc_start'''( unsigned int  coproc_key ) ===
    98 This function activates the communication channels and the allocated coprocessor.
    99  * '''coproc_key''' : coprocessor identifier.
    100 
    101  === 5) void '''giet_coproc_stop'''( unsigned int  coproc_key ) ===
    102 This function desactivates the communication channels and the allocated coprocessor.
    103  * '''coproc_key''' : coprocessor identifier.
    104 
    105  === 6) void '''giet_coproc_completed'''(  unsigned int coproc_key  ) ===
     97 === 4) void '''giet_coproc_start'''( unsigned int index ) ===
     98This function activates all communication channels and the allocated coprocessor itself.
     99 * '''index''' : coprocessor register index to be written for activation.
     100
     101 === 5) void '''giet_coproc_stop'''( unsigned int index ) ===
     102This function desactivates all communication channels and the allocated coprocessor itself.
     103* '''index''' : coprocessor register index to be written for activation.
     104
     105 === 6) void '''giet_coproc_completed'''( ) ===
    106106This blocking function can be used to synchronize a software task with an hardware coprocessor running in DMA_NO_IRQ mode.
    107107It polls the status register of all communication channels, and returns only when all transfers are completed.
    108 This function exit when one status register indicates a  bus error (illegal memory access).
    109  * '''coproc_key''' : coprocessor identifier.
     108This function exit when at least one channel status register indicates a  bus error (illegal memory access).
    110109
    111110
     
    299298 === 8) void '''giet_get_xy'''( void* ptr, unsigned int* px, unsigned int* py ) ===
    300299This function takes as input a virtual address (''ptr'' argument), and returns through the ''px,py'' arguments the coordinates of the cluster containing the physical address associated to ''ptr''. In case of error (unmapped virtual address), it makes a giet_exit(). 
    301