To get xc3sprog, first download the source code from SourceForge:
svn co https://xc3sprog.svn.sourceforge.net/svnroot/xc3sprog/trunk xc3sprog
Then compile and install the program:
Plug the JTAG cable in the computer and connect it to a suitable board.
Run xc3sprog and verify that it detects the JTAG chain.
The type of JTAG cable must be specified via a command-line option.
See the supported hardware table to find the label for your cable type.
In this example, we use a parallel port JTAG cable:
xc3sprog -c pp
The next example shows how to program an FPGA.
The board in the example has an XCF PROM in position 0 and a Xilinx FPGA in position 1.
We specify chain position 1 to program the FPGA directly.
The new program takes effect immediately, but lasts only until power is removed from the board.
To reprogram the board permanently, we could have programmed the flash PROM instead by selecting position 0.
xc3sprog -c pp -v -p 1 filename.bit
xc3sprog supports many other board setups and different programming actions. See the manual page for more examples.