FPGA-README 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. This README contains extended details about FPGA mining with BFGMiner
  2. ModMinerQuad (MMQ)
  3. ------------------
  4. The mining bitstream does not survive a power cycle, so BFGMiner will upload
  5. it, if it needs to, before it starts mining (approx 3min)
  6. The red LED also flashes while it is uploading the bitstream
  7. -
  8. If the MMQ doesn't respond to cgminer at all, or the red LED isn't flashing
  9. then you will need to reset the MMQ
  10. The red LED should always be flashing when it is mining or ready to mine
  11. To reset the MMQ, you are best to press the left "RESET" button on the
  12. backplane, then unplug and replug the USB cable
  13. If your MMQ doesn't have a button on the "RESET" pad, you need to join
  14. the two left pads of the "RESET" pad with conductive wire to reset it.
  15. Cutting a small (metal) paper-clip in half works well for this
  16. Then unplug the USB cable, wait for 5 seconds, then plug it back in
  17. After you press reset, the red LED near the USB port should blink continuously
  18. If it still wont work, power off, wait for 5 seconds, then power on the MMQ
  19. This of course means it will upload the bitstream again when you start cgminer
  20. -
  21. Device 0 is on the power end of the board
  22. -
  23. You must make sure you have an approriate firmware in your MMQ
  24. Read here for official details of changing the firmware:
  25. http://wiki.btcfpga.com/index.php?title=Firmware
  26. The basics of changing the firmware are:
  27. You need two short pieces of conductive wire if your MMQ doesn't have
  28. buttons on the "RESET" and "ISP" pads on the backplane board
  29. Cutting a small (metal) paper-clip in half works well for this
  30. Join the 2 left pads of the "RESET" pad with wire and the led will dim
  31. Without disconnecting the "RESET", join the 2 left pads of the "ISP" pad
  32. with a wire and it will stay dim
  33. Release "RESET" then release "ISP" and is should still be dim
  34. Unplug the USB and when you plug it back in it will show up as a mass
  35. storage device
  36. Linux: (as one single line):
  37. mcopy -i /dev/disk/by-id/usb-NXP_LPC134X_IFLASH_ISP000000000-0:0
  38. modminer091012.bin ::/firmware.bin
  39. Windows: delete the MSD device file firmware.bin and copy in the new one
  40. rename the new file and put it under the same name 'firmware.bin'
  41. Disconnect the USB correctly (so writes are flushed first)
  42. Join and then disconnect "RESET" and then plug the USB back in and it's done
  43. Best to update to one of the latest 2 listed below if you don't already
  44. have one of them in your MMQ
  45. The current latest different firmware are:
  46. Latest for support of normal or TLM bitstream:
  47. http://btcfpga.com/files/firmware/modminer092612-TLM.bin
  48. Latest with only normal bitstream support (Temps/HW Fix):
  49. http://btcfpga.com/files/firmware/modminer091012.bin
  50. The code is currently tested on the modminer091012.bin firmware.
  51. This comment will be updated when others have been tested
  52. -
  53. On many linux distributions there is an app called modem-manager that
  54. may cause problems when it is enabled, due to opening the MMQ device
  55. and writing to it
  56. The problem will typically present itself by the flashing led on the
  57. backplane going out (no longer flashing) and it takes a power cycle to
  58. re-enable the MMQ firmware - which then can lead to the problem happening
  59. again
  60. You can either disable/uninstall modem-manager if you don't need it or:
  61. a (hack) solution to this is to blacklist the MMQ USB device in
  62. /lib/udev/rules.d/77-mm-usb-device-blacklist.rules
  63. Adding 2 lines like this (just above APC) should help
  64. # MMQ
  65. ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0003", ENV{ID_MM_DEVICE_IGNORE}="1"
  66. The change will be lost and need to be re-done, next time you update the
  67. modem-manager software
  68. TODO: check that all MMQ's have the same product ID
  69. Bitforce (BFL)
  70. --------------
  71. --bfl-range Use nonce range on bitforce devices if supported
  72. This option is only for bitforce devices. Earlier devices such as the single
  73. did not have any way of doing small amounts of work which meant that a lot of
  74. work could be lost across block changes. Some of the "minirigs" have support
  75. for doing this, so less work is lost across a longpoll. However, it comes at
  76. a cost of 1% in overall hashrate so this feature is disabled by default. It
  77. is only recommended you enable this if you are mining with a minirig on
  78. p2pool.
  79. BFGMiner also bundles a bitforce-firmware-flash utility on Linux. Using this,
  80. you can change the bitstream firmware on BitFORCE Singles. It is untested with
  81. other devices. Use at your own risk! Windows users may use Butterfly Labs
  82. EasyMiner to change firmware.
  83. To compile:
  84. make bitforce-firmware-flash
  85. To flash your BFL, specify the BFL port and the flash file e.g.:
  86. sudo ./bitforce-firmware-flash /dev/ttyUSB0 alphaminer_832.bfl
  87. It takes a bit under 3 minutes to flash a BFL and shows a progress % counter
  88. Once it completes, you may also need to wait about 15 seconds,
  89. then power the BFL off and on again
  90. If you get an error at the end of the BFL flash process stating:
  91. "Error reading response from ZBX"
  92. it may have worked successfully anyway.
  93. Test mining on it to be sure if it worked or not.
  94. You need to give BFGMiner about 10 minutes mining with the BFL to be sure of
  95. the MH/s value reported with the changed firmware - and the MH/s reported
  96. will be less than the firmware speed since you lose work on every block change.
  97. Icarus (ICA)
  98. ------------
  99. There are two hidden options in BFGMiner when Icarus support is compiled in:
  100. --icarus-options <arg> Set specific FPGA board configurations - one set of values for all or comma separated
  101. baud:work_division:fpga_count:quirks
  102. baud The Serial/USB baud rate - 115200 or 57600 only - default 115200
  103. work_division The fraction of work divided up for each FPGA chip - 1, 2, 4 or 8
  104. e.g. 2 means each FPGA does half the nonce range - default 2
  105. fpga_count The actual number of FPGA working - this would normally be the same
  106. as work_division - range is from 1 up to 'work_division'
  107. It defaults to the value of work_division - or 2 if you don't specify
  108. work_division
  109. quirks List of quirks to enable and disable (after a minus sign):
  110. r Reopen device regularly to workaround buggy Icarus USB chipset
  111. (enabled by default)
  112. If you define fewer comma seperated values than Icarus devices, the last values will be used
  113. for all extra devices
  114. An example would be: --icarus-options 57600:2:1:-r
  115. This would mean: use 57600 baud, the FPGA board divides the work in half however
  116. only 1 FPGA actually runs on the board, and don't reopen the device (e.g. like
  117. an early CM1 Icarus copy bitstream)
  118. --icarus-timing <arg> Set how the Icarus timing is calculated - one setting/value for all or comma separated
  119. default[=N] Use the default Icarus hash time (2.6316ns)
  120. short Calculate the hash time and stop adjusting it at ~315 difficulty 1 shares (~1hr)
  121. long Re-calculate the hash time continuously
  122. value[=N] Specify the hash time in nanoseconds (e.g. 2.6316) and abort time (e.g. 2.6316=80)
  123. If you define fewer comma seperated values than Icarus devices, the last values will be used
  124. for all extra devices
  125. Icarus timing is required for devices that do not exactly match a default Icarus Rev3 in
  126. processing speed
  127. If you have an Icarus Rev3 you should not normally need to use --icarus-timing since the
  128. default values will maximise the MH/s and display it correctly
  129. Icarus timing is used to determine the number of hashes that have been checked when it aborts
  130. a nonce range (including on a LongPoll)
  131. It is also used to determine the elapsed time when it should abort a nonce range to avoid
  132. letting the Icarus go idle, but also to safely maximise that time
  133. 'short' or 'long' mode should only be used on a computer that has enough CPU available to run
  134. BFGMiner without any CPU delays (an active desktop or swapping computer would not be stable enough)
  135. Any CPU delays while calculating the hash time will affect the result
  136. 'short' mode only requires the computer to be stable until it has completed ~315 difficulty 1 shares
  137. 'long' mode requires it to always be stable to ensure accuracy, however, over time it continually
  138. corrects itself
  139. When in 'short' or 'long' mode, it will report the hash time value each time it is re-calculated
  140. In 'short' or 'long' mode, the scan abort time starts at 5 seconds and uses the default 2.6316ns
  141. scan hash time, for the first 5 nonce's or one minute (whichever is longer)
  142. In 'default' or 'value' mode the 'constants' are calculated once at the start, based on the default
  143. value or the value specified
  144. The optional additional =N specifies to set the default abort at N 1/10ths of a second, not the
  145. calculated value, which is 112 for 2.6316ns
  146. To determine the hash time value for a non Icarus Rev3 device or an Icarus Rev3 with a different
  147. bitstream to the default one, use 'long' mode and give it at least a few hundred shares, or use
  148. 'short' mode and take note of the final hash time value (Hs) calculated
  149. You can also use the RPC API 'stats' command to see the current hash time (Hs) at any time
  150. The Icarus code currently only works with an FPGA device that supports the same commands as
  151. Icarus Rev3 requires and also is less than ~840MH/s and greater than 2MH/s
  152. If an FPGA device does hash faster than ~840MH/s it should work correctly if you supply the
  153. correct hash time nanoseconds value
  154. The timing code itself will affect the Icarus performance since it increases the delay after
  155. work is completed or aborted until it starts again
  156. The increase is, however, extremely small and the actual increase is reported with the
  157. RPC API 'stats' command (a very slow CPU will make it more noticeable)
  158. Using the 'short' mode will remove this delay after 'short' mode completes
  159. The delay doesn't affect the calculation of the correct hash time
  160. X6500
  161. Since X6500 FPGAs do not use serial ports for communication, the --scan-serial
  162. option instead works with product serial numbers. By default, any devices with
  163. the X6500 USB product id will be used, but some X6500s may have shipped without
  164. this product id being configured. If you have any of these, you will need to
  165. specify their serial numbers explicitly, and also add -S x6500:auto if you
  166. still want to use the autodetection for other properly-configured FPGAs.
  167. The serial number of X6500s is usually found on a label applied to the ATX
  168. power connector slot. If yours is missing, devices seen by the system can be
  169. displayed by starting bfgminer in debug mode. To get a simple list of devices,
  170. with the debug output shown, you can use: bfgminer -D -d? -T