FPGA-README 9.5 KB

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