Dobrica Pavlinušić's random unstructured stuff
Spartan 3A: Revision 7

ISE IMPACT

USB driver

http://rmdir.de/~michael/xilinx/

dpavlin@blue:/blue-zfs/FPGA/S3A$ git clone git://git.zerfleddert.de/usb-driver
dpavlin@blue:/blue-zfs/FPGA/S3A$ cd usb-driver/
dpavlin@blue:/blue-zfs/FPGA/S3A/usb-driver$ make
cc -Wall -fPIC -DUSB_DRIVER_VERSION="\"2013-06-18 23:37:15\""  -DJTAGKEY usb-driver.c xpcu.c parport.c config.c jtagmon.c jtagkey.c -o libusb-driver.so -ldl -lusb -lpthread -L/usr/lib/x86_64-linux-gnu -lftdi -lusb -shared
parport.c: In function ‘parport_transfer’:
parport.c:21:23: warning: variable ‘last_pp_write’ set but not used [-Wunused-but-set-variable]
  static unsigned char last_pp_write = 0;
                       ^
cc -DDEBUG -Wall -fPIC -DUSB_DRIVER_VERSION="\"2013-06-18 23:37:15\""  -DJTAGKEY usb-driver.c xpcu.c parport.c config.c jtagmon.c jtagkey.c -o libusb-driver-DEBUG.so -ldl -lusb -lpthread -L/usr/lib/x86_64-linux-gnu -lftdi -lusb -shared
Built library is 64 bit. Run `make lib32' to build a 32 bit version
dpavlin@blue:/blue-zfs/FPGA/S3A/usb-driver$ ./setup_pcusb /blue-zfs/Xilinx/14.5/ISE_DS/ISE/
You are not root, trying sudo...
Looking for USB cable files: /blue-zfs/Xilinx/14.5/ISE_DS/ISE//bin/lin64
Copying firmware to /usr/share:
‘/blue-zfs/Xilinx/14.5/ISE_DS/ISE//bin/lin64/xusbdfwu.hex’ -> ‘/usr/share/xusbdfwu.hex’
‘/blue-zfs/Xilinx/14.5/ISE_DS/ISE//bin/lin64/xusb_emb.hex’ -> ‘/usr/share/xusb_emb.hex’
‘/blue-zfs/Xilinx/14.5/ISE_DS/ISE//bin/lin64/xusb_xlp.hex’ -> ‘/usr/share/xusb_xlp.hex’
‘/blue-zfs/Xilinx/14.5/ISE_DS/ISE//bin/lin64/xusb_xp2.hex’ -> ‘/usr/share/xusb_xp2.hex’
‘/blue-zfs/Xilinx/14.5/ISE_DS/ISE//bin/lin64/xusb_xpr.hex’ -> ‘/usr/share/xusb_xpr.hex’
‘/blue-zfs/Xilinx/14.5/ISE_DS/ISE//bin/lin64/xusb_xse.hex’ -> ‘/usr/share/xusb_xse.hex’
‘/blue-zfs/Xilinx/14.5/ISE_DS/ISE//bin/lin64/xusb_xup.hex’ -> ‘/usr/share/xusb_xup.hex’
Installing udev rules:
done

# install fxload
sudo apt-get install fxload

boundary scan

GUI --- Auto connect to cable...
INFO:iMPACT - Connecting to TCF agent...
AutoDetecting cable. Please wait.
*** WARNING ***: When port is set to auto detect mode, cable speed is set to default 6 MHz regardless of explicit arguments supplied for setting the baud rates
PROGRESS_START - Starting Operation.
 Using windrvr6 driver.
Connecting to cable (Usb Port - USB21).
Checking cable driver.
File version of /blue-zfs/Xilinx/14.5/ISE_DS/ISE/bin/lin64/xusbdfwu.hex = 1030.
File version of /usr/share/xusbdfwu.hex = 1030.
 libusb-driver.so version: 2013-06-18 23:37:15.
 Cable PID = 0008.
 Max current requested during enumeration is 74 mA.
Type = 0x0004.
 Cable Type = 3, Revision = 0.
 Setting cable speed to 6 MHz.
Cable connection established.
Firmware version = 1303.
File version of /blue-zfs/Xilinx/14.5/ISE_DS/ISE/data/xusb_xlp.hex = 1303.
Firmware hex file version = 1303.
PLD file version = 0012h.
 PLD version = 0012h.
PROGRESS_END - End Operation.
Elapsed time =      0 sec.
Type = 0x0004.
 ESN device is not available for this cable.
Attempting to identify devices in the boundary-scan chain configuration...
INFO:iMPACT - Current time: 6/22/13 4:27 PM
PROGRESS_START - Starting Operation.
Identifying chain contents...'0': : Manufacturer's ID = Xilinx xcf04s, Version : 15
INFO:iMPACT:1777 - 
Reading /blue-zfs/Xilinx/14.5/ISE_DS/ISE/xcf/data/xcf04s.bsd...
INFO:iMPACT:501 - '1': Added Device xcf04s successfully.
----------------------------------------------------------------------
----------------------------------------------------------------------
'1': : Manufacturer's ID = Xilinx xc3s700a, Version : 2
INFO:iMPACT:1777 - 
Reading /blue-zfs/Xilinx/14.5/ISE_DS/ISE/spartan3a/data/xc3s700a.bsd...
INFO:iMPACT:501 - '1': Added Device xc3s700a successfully.
----------------------------------------------------------------------
----------------------------------------------------------------------
done.
PROGRESS_END - End Operation.
Elapsed time =      0 sec.
Attempting to identify devices in the boundary-scan chain configuration...
INFO:iMPACT - Current time: 6/22/13 5:44 PM
PROGRESS_START - Starting Operation.
----------------------------------------------------------------------
----------------------------------------------------------------------
Identifying chain contents...'0': : Manufacturer's ID = Xilinx xcf04s, Version : 15
INFO:iMPACT:1777 - 
Reading /blue-zfs/Xilinx/14.5/ISE_DS/ISE/xcf/data/xcf04s.bsd...
INFO:iMPACT:501 - '1': Added Device xcf04s successfully.
----------------------------------------------------------------------
----------------------------------------------------------------------
'1': : Manufacturer's ID = Xilinx xc3s700a, Version : 2
INFO:iMPACT:1777 - 
Reading /blue-zfs/Xilinx/14.5/ISE_DS/ISE/spartan3a/data/xc3s700a.bsd...
INFO:iMPACT:501 - '1': Added Device xc3s700a successfully.
----------------------------------------------------------------------
----------------------------------------------------------------------
done.
PROGRESS_END - End Operation.
Elapsed time =      0 sec.
'1': Loading file '/blue-zfs/FPGA/S3A/Open-Source-FPGA-Bitcoin-Miner/projects/Verilog_Xilinx_Port/S3A/top/fpgaminer_top.bit' ...
done.
INFO:iMPACT:2257 - Startup Clock has been changed to 'JtagClk' in the bitstream stored in memory,
but the original bitstream file remains unchanged.
UserID read from the bitstream file = 0xFFFFFFFF.
----------------------------------------------------------------------
INFO:iMPACT:501 - '1': Added Device xc3s700a successfully.
----------------------------------------------------------------------

Get Device ID

INFO:iMPACT - Current time: 6/22/13 5:45 PM
Maximum TCK operating frequency for this device chain: 10000000.
Validating chain...
Boundary-scan chain validated successfully.
'1': IDCODE is '00100010001000101000000010010011'
'1': IDCODE is '22228093' (in hex).
'1': : Manufacturer's ID = Xilinx xc3s700a, Version : 2

get device status

INFO:iMPACT - Current time: 6/22/13 5:48 PM
Maximum TCK operating frequency for this device chain: 10000000.
Validating chain...
Boundary-scan chain validated successfully.
'1': Reading status register contents...
CRC error                                                                  :         0
IDCODE not validated while writing FDRI                                    :         0
DCM Locked                                                                 :         1
status of GTS_CFG_B                                                        :         1
status of GWE                                                              :         1
status of GHIGH                                                            :         1
value of VSEL pin 0                                                        :         1
value of VSEL pin 1                                                        :         1
value of VSEL pin 2                                                        :         1
value of MODE pin M0                                                       :         1
value of MODE pin M1                                                       :         0
value of MODE pin M2                                                       :         0
value of CFG_RDY (INIT_B)                                                  :         1
DONEIN input from Done Pin                                                 :         1
SYNC word not found                                                        :         0

Get Device Signature/Usercode

INFO:iMPACT - Current time: 6/22/13 5:50 PM
Maximum TCK operating frequency for this device chain: 10000000.
Validating chain...
Boundary-scan chain validated successfully.
'1': Usercode is 'ffffffff'

program

Load FPGA bitstream, don't update flash

INFO:iMPACT - Current time: 6/22/13 5:51 PM
PROGRESS_START - Starting Operation.
Maximum TCK operating frequency for this device chain: 10000000.
Validating chain...
Boundary-scan chain validated successfully.
'1': Programming device...
 LCK_cycle = NoWait.
LCK cycle: NoWait
done.
'1': Reading status register contents...
CRC error                                                                  :         0
IDCODE not validated while writing FDRI                                    :         0
DCM Locked                                                                 :         1
status of GTS_CFG_B                                                        :         1
status of GWE                                                              :         1
status of GHIGH                                                            :         1
value of VSEL pin 0                                                        :         1
value of VSEL pin 1                                                        :         1
value of VSEL pin 2                                                        :         1
value of MODE pin M0                                                       :         1
value of MODE pin M1                                                       :         0
value of MODE pin M2                                                       :         0
value of CFG_RDY (INIT_B)                                                  :         1
DONEIN input from Done Pin                                                 :         1
SYNC word not found                                                        :         0
INFO:iMPACT:2219 - Status register values:
INFO:iMPACT - 0011 1111 1100 1100 
INFO:iMPACT:579 - '1': Completed downloading bit file to device.
INFO:iMPACT:188 - '1': Programming completed successfully.
 LCK_cycle = NoWait.
LCK cycle: NoWait
INFO:iMPACT - '1': Checking done pin....done.
'1': Programmed successfully.
PROGRESS_END - End Operation.
Elapsed time =      1 sec.

FPGA bitcoin mining

http://github.com/sfo/Open-Source-FPGA-Bitcoin-Miner