Main Page | Modules | File List | Globals | Related Pages

XSVF Executor



Programmable devices like CPLDs and FPGAs are in-system programmable, typically via JTAG. An embedded microcontroller may be used to program these chips without any special programming adapter.

SVF (Serial Vector Format) is a de-facto standard for describing JTAG operations and can be created by several programming applications like Xilinx' Impact. However, the size of SVF files is far too large for tiny embedded systems. A compressed format, named XSVF, has been introduced. The reduced size allows downloading the contents to an embedded system and the compact binary format can be interpreted by a small C program.

Xilinx published an application note (XAPP058), which demonstates this technique. The compiled code for Atmel's ATmega 128 microcontroller requires about 4.8 kBytes program space. Note, that this figure considers application code only, but no runtime or library code.

Analyzing the code shows, that far more optimizations are possible.

The XSVF Executor emerged from a complete re-design of the original Xilinx code, occupying just 3.3 kBytes of the ATmega's flash and probably far less variable space (RAM) as well.

As far as possible, the code has been kept portable. Platform dependant changes should be limited to two files, host.c and host.h. For demonstration purposes the code also compiles with MSC 6.0, leaving the JTAG hardware access routines blank.

XSVF Executor has been successfully tested with the Ethernut 2 board, programming the on-board XC9536XL. Ethernut uses the CPLD for

This release is intended to run on the Ethernut 2 board under the Nut/OS operating system, which provides a simple file system and standard file I/O operations to store and access XSVF formatted files.

The size of the downloadable binary is 50 kBytes, including 38.6 kBytes for the file system and the XSVF file itself. About 8 kBytes are used by the RTOS, which provides formatted output with standard printf and XSVF file open, read and close operations. Total RAM usage is less than 800 Bytes for static variables and about 1 kByte dynamically allocated by the RTOS.

In a very limited system all RTOS functions can be easily replaced by native routines of just a few hundred bytes. In addition, the XSVF data needs not to be placed in microcontroller memory, but can be loaded at runtime through an RS232 port or any similar interface.


Schematics and board layouts of the Ethernut 2 hardware as well as the latest Nut/OS releases are available at

This document has been automatically generated by Doxygen, a great tool created by Dimitri van Heesch.

Contact Information

If you would like to contact us regarding Ethernut, please email info at egnite dot de

For updated information you may regularily visit

Bare Ethernut boards as well as assembled and tested Ethernuts may be ordered from

© 2004 by egnite Software GmbH - visit