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. |
| 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, 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 | |
| 51 | The '''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). |
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 | |
| 59 | The VCI transactions corresponding to different TO_COPROC / FROM_COPROC channels are interleaved and parallelized on the VCI network. |
| 60 | |
| 61 | Besides 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. |
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 ) === |
| 73 | This 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. |
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 ) === |
| 98 | This 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 ) === |
| 102 | This 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'''( ) === |