| 45 | == Coprocessors related system calls == |
| 46 | |
| 47 | The GIET_VM allows user applications to use hardware coprocessors. These coprocessors can be distributed in the architecture, |
| 48 | 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 multi-channels DMA controller. |
| 49 | |
| 50 | On the coprocessor side, it provides TO_COPROC and FROM_COPROC ports, that implement FIFO interfaces. Coprocessor can request to read (or write) one or several bursts of 32 bits words on a TO_COPROC port (FROM_COPROC for a write), without address. The burst size (generally a cache line) is a global hardware parameter. The number of TO_COPROC and FROM_COPROC ports, and the number of bursts for a given port depends on each coprocessor implementation. Each port define a private communication channel |
| 51 | to a 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. |
| 52 | |
| 53 | Each channel implements three transfer modes that can be defined by software: |
| 54 | * 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. |
| 55 | * In '''MODE_DMA_IRQ''', the channel transfer a single buffer between the memory and the coprocessor port. 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. |
| 56 | * The '''MODE_DMA_NO_IRQ''', is similar to the previous one, but the the channel stops when the transfer is completed, without rising an interrupt. |
| 57 | |
| 58 | '''WARNING''' : For all channels, the memory buffer address and size must be multiple of the burst size. |
| 59 | |
| 60 | Several 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. |
| 61 | |
| 62 | Besides these communication channels |
| 63 | |
| 64 | The list of supported coprocessors and their characteristics is defined below: |
| 65 | || coproc_type || nb_to_coproc || nb_from_coproc || nb_config || nb_status || |
| 66 | || COPROC_TYPE_GCD || 2 || 1 || 1 || 0 || |
| 67 | || COPROC_TYPE_DCT || 1 || 1 || 1 || 0 || |
| 68 | |
| 69 | === 1) void '''giet_coproc_alloc'''( unsigned int coproc_type, unsigned int* info, unsigned int* cluster_xy ) === |
| 70 | This function allocates a private coprocessor to the calling task, taking a lock to grant exclusive ownership. |
| 71 | In 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 the coprocessor characteristics in the '''coproc_info''' and '''cluster_xy''' variables. |
| 73 | * '''coproc_type''' : COPROC_TYPE_GCD / COPROC_TYPE_DCT |
| 74 | * '''coproc_info''' : nb_to_coprocs = info[7:0] / nb_from_coproc = info[15:8] / nb_config = info[23:16] / nb_status = info[31:24] |
| 75 | * '''clusterrequested coprocessor type |
| 76 | |
| 77 | === 2) void '''giet_coproc_channel_init'''( unsigned int cluster_xy, unsigned int channel, giet_coproc_channel_t* desc ) === |
| 78 | |
| 79 | === 3) void '''giet_coproc_channel_start'''( unsigned int cluster_xy, unsigned int channel ) === |
| 80 | |
| 81 | === 4) void '''giet_coproc_channel_stop'''( unsigned int cluster_xy, unsigned int channel ) === |
| 82 | |
| 83 | |