EDT PDV SDK Documentation 6.2.0
|
#include "edt_os_utils.h"
Data Structures | |
struct | EdtBitfileHeader |
struct | EdtBitfile |
struct | _bitfile_list |
struct | EdtBoardFpgas |
Macros | |
#define | BFH_EXTRASIZE 128 |
#define | BITLOAD_FLAGS_OVR 0x2 |
#define | BITLOAD_FLAGS_CH1 0x8 |
#define | BITLOAD_FLAGS_MEZZANINE 0x4 |
#define | _DEPRECATED_BITLOAD_FLAGS_OCM 0x4 |
#define | _DEPRECATED_BITLOAD_FLAGS_SRXL 0x10 |
Typedefs | |
typedef struct EdtBitfile | EdtBitfile |
typedef struct _bitfile_list | EdtBitfileList |
Functions | |
void | bf_init (EdtBitfileList *bf) |
Initialize a bitfile list to zero. More... | |
void | bf_destroy (EdtBitfileList *bf) |
Frees the memory for a list of bitfiles. More... | |
void | bf_add_entry (EdtBitfileList *bf, EdtBitfileHeader *bfh) |
Adds a bitfile header to a list of bitfiles. More... | |
void | bf_check_and_add (EdtBitfileList *bf, const char *fname) |
Checks if a bitfile exists and adds it to the bitfile list if it does. More... | |
int | bf_allocate_max_buffer (EdtBitfileList *bf, EdtBitfile *data) |
Allocates data to the largest bitfile size found in the bf list. More... | |
EDT_LIB_LOCAL const char * | edt_bitload_basedir (EdtDev edt_p, const char *in, char *out) |
Gets the base directory based on the device type (PDV vs. PCD). More... | |
int | edt_get_bitfile_list (const char *basedir, const char *devdir, const char *fname, EdtBoardFpgas *fpga_list, int id, int channel, EdtBitfileList *bf, char *fpga_hint) |
Gets all possible bitfiles with name fname and stores them in list bf . If fpga_hint is present, it will be first in the list. More... | |
int | edt_load_mezzfile (EdtDev edt_p, const char *basedir, const char *bitname, int bitload_flags, int skip_load, int channel) |
Loads a mezzanine bitfile. More... | |
int | edt_get_bitfile_header (EdtBitfile *bp, EdtBitfileHeader *bfh) |
Extract the FPGA header (Xilinx, OR faked one for Altera, etc.) More... | |
int | edt_program_mezzanine (EdtDev edt_p, const uint8_t *buf, uint32_t size, int channel) |
Program the mezzanine bitfile. Wraps edt_program_mezzanine_direct(). More... | |
EDT_LIB_LOCAL int | edt_program_flash_direct (EdtDev edt_p, const uint8_t *buf, int size, int do_sleep) |
Program the interface FPGA. Typically only called by edt_bitload. More... | |
EDT_LIB_LOCAL int | edt_program_mezzanine_direct (EdtDev edt_p, const uint8_t *buf, int size, int channel) |
Program the mezzanine bitfile. More... | |
int | edt_bitload (EdtDev edt_p, const char *basedir, const char *fname, int flags, int skip) |
int | edt_bitfile_load_file (EdtBitfile *bfd, const char *name) |
Opens a bitfile and populates the bfd structure. More... | |
void | edt_bitfile_init (EdtBitfile *bitfile) |
Initialize an EdtBitfile data structure. More... | |
void | edt_bitfile_destroy (EdtBitfile *bfd) |
Closes the associated file handle, zeros fields, and frees allocated memory for the given EdtBitfile structure. More... | |
void | ensure_bitfile_name (const char *name, char *bitname) |
int | edt_get_x_array_header (uint8_t *ba, char *header, int *size) |
Get the FPGA header from an array, typically as read out from an FPGA. More... | |
Header file for declarations & defines related to loading the Xilinx bitfile.
#define BFH_EXTRASIZE 128 |
Number of bytes to read in for bitfile preamble.
#define BITLOAD_FLAGS_OVR 0x2 |
Override GS/SS bitfile size constraint
#define BITLOAD_FLAGS_CH1 0x8 |
Program OCM channel 1 if BITLOAD_FLAGS_OCM is set
#define BITLOAD_FLAGS_MEZZANINE 0x4 |
Changes programming algorithm to program mezzanine boards.
#define _DEPRECATED_BITLOAD_FLAGS_OCM 0x4 |
#define _DEPRECATED_BITLOAD_FLAGS_SRXL 0x10 |
typedef struct EdtBitfile EdtBitfile |
Structure used to access UI bitfile.
typedef struct _bitfile_list EdtBitfileList |
Structure describing a list of bitfiles and their associated headers.
void bf_init | ( | EdtBitfileList * | bf | ) |
Initialize a bitfile list to zero.
bf | Pointer to the bitfile list to initialize. |
void bf_destroy | ( | EdtBitfileList * | bf | ) |
Frees the memory for a list of bitfiles.
bf | Pointer to the bitfile list to destroy. |
void bf_add_entry | ( | EdtBitfileList * | bf, |
EdtBitfileHeader * | bfh | ||
) |
Adds a bitfile header to a list of bitfiles.
bf | Pointer to the bitfile list to add to. |
bfh | Pointer to the bitfile header to add. |
void bf_check_and_add | ( | EdtBitfileList * | bf, |
const char * | fname | ||
) |
Checks if a bitfile exists and adds it to the bitfile list if it does.
bf | Pointer to the bitfile list to add to. |
fname | Name of the bitfile to check for. |
int bf_allocate_max_buffer | ( | EdtBitfileList * | bf, |
EdtBitfile * | data | ||
) |
Allocates data
to the largest bitfile size found in the bf
list.
Deallocate with edt_bitfile_destroy()
bf | Pointer to the bitfile list to read. | |
[out] | data | Bitfile struct with EdtBitfile.full_buffer set to an allocated array of size EdtBitfile.buffer_allocated bytes. |
EDT_LIB_LOCAL const char * edt_bitload_basedir | ( | EdtDev | edt_p, |
const char * | in, | ||
char * | out | ||
) |
Gets the base directory based on the device type (PDV vs. PCD).
edt_p | The open EDT device handle. |
in | The name of the directory. Optional, if set, it will be returned. |
out | The resulting directory. Optional, if set, will overwritten with the home directory value and returned. |
int edt_get_bitfile_list | ( | const char * | basedir, |
const char * | devdir, | ||
const char * | fname, | ||
EdtBoardFpgas * | fpga_list, | ||
int | id, | ||
int | channel, | ||
EdtBitfileList * | bf, | ||
char * | fpga_hint | ||
) |
Gets all possible bitfiles with name fname and stores them in list bf
. If fpga_hint
is present, it will be first in the list.
basedir | The base directory to look for the bitfile in. |
devdir | The device directory to look for the bitfile in. |
fname | The name of the bitfile. |
fpga_list | The list of available FPGAs. |
id | Either a board id or a mezzanine id, which is used to look up FPGA type(s) in the fpga_list . |
channel | Index into the mezz_chips array. |
bf | The list of bitfiles to add to. |
fpga_hint | The name of the fpga to check for. |
Assumes bf has been initialized
int edt_load_mezzfile | ( | EdtDev | edt_p, |
const char * | basedir, | ||
const char * | bitname, | ||
int | bitload_flags, | ||
int | skip_load, | ||
int | channel | ||
) |
Loads a mezzanine bitfile.
edt_p | The open EDT device handle. |
basedir | The base directory to look for the bitfile in. |
bitname | The name of the bitfile. |
bitload_flags | Flags to use when loading the bitfile. |
skip_load | Currently not used. |
channel | Index into the mezz_chips array. |
int edt_get_bitfile_header | ( | EdtBitfile * | bp, |
EdtBitfileHeader * | bfh | ||
) |
Extract the FPGA header (Xilinx, OR faked one for Altera, etc.)
bp | Struct that will be populated with the FPGA file information. |
bfh | Struct that will be populated with the FPGA file header information. |
int edt_program_mezzanine | ( | EdtDev | edt_p, |
const uint8_t * | buf, | ||
uint32_t | size, | ||
int | channel | ||
) |
Program the mezzanine bitfile. Wraps edt_program_mezzanine_direct().
edt_p | The open EDT device handle. |
buf | Pointer to the bitfile data. |
size | Size of the bitfile data. |
channel | Which channel the data is directed to. |
EDT_LIB_LOCAL int edt_program_flash_direct | ( | EdtDev | edt_p, |
const uint8_t * | buf, | ||
int | size, | ||
int | do_sleep | ||
) |
Program the interface FPGA. Typically only called by edt_bitload.
edt_p | The open EDT device handle. |
buf | Buffer containing the data to be loaded. |
size | Number of bytes to load from buffer. |
do_sleep | Enable (1) or disable (0) delays to slow flashing down in case of host speed issues. |
EDT_LIB_LOCAL int edt_program_mezzanine_direct | ( | EdtDev | edt_p, |
const uint8_t * | buf, | ||
int | size, | ||
int | channel | ||
) |
Program the mezzanine bitfile.
edt_p | Pointer to the device structure. |
buf | Pointer to the bitfile data. |
size | Size of the bitfile data. |
channel | Which channel the data is directed to. |
int edt_bitfile_load_file | ( | EdtBitfile * | bfd, |
const char * | name | ||
) |
Opens a bitfile and populates the bfd structure.
bfd | The structure to be populated. |
name | The path of the file to open. |
void edt_bitfile_init | ( | EdtBitfile * | bitfile | ) |
Initialize an EdtBitfile data structure.
bitfile | The structure to be initialized. |
void edt_bitfile_destroy | ( | EdtBitfile * | bfd | ) |
Closes the associated file handle, zeros fields, and frees allocated memory for the given EdtBitfile structure.
bfd | The bitfile to be destroyed. |
void ensure_bitfile_name | ( | const char * | name, |
char * | bitname | ||
) |
Normalizes a bitfile name to ensure it is valid.
name | Name of bitfile before normalization. |
bitname | The normalized bitfile name. |
int edt_get_x_array_header | ( | uint8_t * | ba, |
char * | header, | ||
int * | size | ||
) |
Get the FPGA header from an array, typically as read out from an FPGA.
ba | Array containing data bytes presumably read from the FPGA. |
header | String that will be populated with the header info in a printable format. |
size | Size of the formatted header string. |