2008-12-11, SK 2010-06-09, SK modified: 'read file from memory-mode' implemented //----------------------------------------------------------------------------- // API //----------------------------------------------------------------------------- /** * Usage : * * The struct playArgs contains the parameters passed to the the programming function. * It contains the struct pzInfo, which holds information on the programming process * during and after programming * * Therefore do: * * #include "micro.h" * * playArgs* a = initialize_xsvf(); * * a.verbosity = my_verbosity; * a.jtagTarget = "/dev/jtag" * * To make the library open and close the xsvf file, set filename accordingly * * a.xsvf_filename = "/dcsnfs/my_file.xsvf" * * If the file has already been opened, the pointer to the open file can be passed to * the player. Of course, the library does not take care of closing the file. * * a.xsvf_filepointer = my_file_pointer; * * It is also possible to pass a pointer to a buffer containing the contents of the * .xsvf file. In this case you must supply a pointer to the start of the memory * region _and_ its size * * a.xsvf_buffer = my_xsvf_buffer; * a.xsvf_buffer_size = my_xsvf_buffer_size; * * Note on verbosity: * This is meant for debugging or command line use only. The debugging messages will be * printed to stdout. Therefore, the verbosity should normally be 0. Make sure 'DEBUG_MODE' * is enabled at compile time. * * If the current programming process is to be shown, register a callback function and * set the update interval (in ms, minimum is 200ms) * * a.callback_progress = &my_callback; * a.callback_udp = 1000; * * If no progress is to be displayed, do * * a.callback_progress = NULL; * * to prevent the progress thread from being started. * Now start the programming with * * program_xsvf(&a); * * To evaluate the outcome use * * my_error = a.ti->errorCode; * * or * * char* result = get_xsvf_errorName( a.ti->errorCode ); * * For filesize, execution time, TCK clocking frequency, consult pzInfo * * int my_filesize = a.i->filesize; * float my_exec_time = a.i->execTime; * float my_exec_freq = a.i->execFreq; * * To get library version information use * * char* libinfo; * get_svn_info(&libinfo); * printf("%s\n", libinfo; * free(libinfo); * * Make sure to call * * cleanup_xsvf(pa); * * to free all resources. */ //----------------------------------------------------------------------------- // API end //----------------------------------------------------------------------------- Changes: Removed many printf from the player in order to convert it into a library Introduced programm thread and progress thread Introduced playxsvf.c for standalone program Switched to getopt for command line parsing Minor changes in command line options //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- 2006-09-25, SK Xilinx Serial Vector Format Player tested with: XC4VFX6_FF1152 XCF32P USAGE ----- playxsvf processes xsvf file and writes output data to /dev/jtag. Data transfer to /dev/jtag is buffered, so assure that the corresponding kernel module's BUFSIZE is greater than SENDBUF_SIZE. play xsvf file: playxsvf additional debugging output: playxsvf -v <#> with: # verbose level EXAMPLES -------- Read xsvf file from stdin an process it: playxsvf /dev/stdin < in.xsvf playxsvf stdin < in.xsvf Reads xsvf file (e.g. from nfs mount), showing level 1+2 debug messages: playxsvf -v 2 /mnt/nfs/in.xsvf Usage via ssh (file stored on remote host) ssh root@hostname '/path/to/bin/playxsvf /path/to/in.xsvf' Usage via ssh (file stored on localhost) ssh root@hostname '/path/to/bin/playxsvf /dev/stdin' < /path/to/local/in.xsvf KNOWN LIMITATIONS / PROBLEMS ---------------------------- - Problems occurred when programming an xcf32p prom Device was configured, but FPGA could get new configuration only after a complete power reset. SVF files had been generated with Impact 8.1.03i, then converted to XSVF with 'svf2xsvf502 -d -r 0 -extensions -s -i infile -o outfile'. When generating SVF files with Impact 8.1i, no problems occurred. -> different command sequences are issued when using different Impact versions workaroud: send extra 'XSC_CONFIG' instruction to prom after programming, to force FPGA reconfiguration.