ADM-XRC SDK 2.8.1 User Guide (Linux)
© Copyright 2001-2009 Alpha Data
Prototype
ADMXRC_STATUS ADMXRC_ConfigureFromBufferDMA( ADMXRC_HANDLE Card, void* Buffer, DWORD Length, DWORD DmaChan, PHANDLE Event);
Arguments
Argument | Type | Purpose |
Card | In | Handle of card to configure |
Buffer | In | FPGA configuration data |
Length | In | Length of FPGA configuration data |
Channel | In | DMA channel to use for the operation |
Event | In/out | Event to use to wait for completion |
Return value
Value | Meaning |
ADMXRC_SUCCESS | The FPGA was successfully configured |
ADMXRC_INVALID_HANDLE | Card is not a valid handle to a card |
ADMXRC_INVALID_PARAMETER | An invalid parameter was passed |
ADMXRC_NO_DMADESC | A DMA descriptor could not be allocated |
Description
This function is used to configure the FPGA on a card from a buffer of SelectMap data, using DMA. Since there is no file I/O to be performed, this is a deterministic method of configuring the FPGA. As DMA is used to configure the FPGA, this method is also the fastest. This routine does not allow the FPGA to be partially configured on each call; all of the data necessary to configure the FPGA must be supplied in a single call.
Ensure that Buffer contains valid configuration data for the target FPGA, as data transferred this way to the FPGA's SelectMap port cannot be validated by the API. |
The card to be configured is specified by the Card parameter.
The Buffer parameter should point to a buffer containing the configuration data for the FPGA. The data must be supplied in a form directly writable to the FPGA's SelectMap port, and care should be taken to ensure that the bit-ordering of the data is correct. The functions ADMXRC_LoadFpgaFile, ADMXRC_FindImageOffset and ADMXRC_ReverseBytes can be used to obtain SelectMap data in the correct form.
The Length parameter specifies the number of bytes of configuration data to be written to the FPGA's SelectMap port.
The Channel parameter specifies which DMA channel should be used for the operation. If ADMXRC_DMACHAN_ANY is specified, the DMA transfer will be performed on the first available DMA channel. However, pending DMA transfers on a specific a DMA channel will always be given priority. It is possible for a DMA transfer that specifies ADMXRC_DMACHAN_ANY to be delayed indefinitely if all DMA channels are kept busy by other threads.
The Event parameter should be a pointer to a Win32 event handle. See multithreading issues for further information.