CGMiner 4.3.5 with Scrypt and support for Gridseed and Zeus ASICs
#42 Compare This branch is 116 commits ahead, 958 commits behind ckolivas:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bitstreams Remove modminer bitstreams from distribution and replace with a READM… Feb 15, 2014
ccan Provide a ccan variant OPT_WITH_CBARG that assigns the arguments pass… Apr 3, 2014
compat Use the active contents lock and safe list iteration within the linux… May 24, 2014
lib Compile CPU mining for win32 and win64 Apr 4, 2013
m4 Mingw suseconds_t and sigaction fixes. Jul 14, 2011
.gitignore ignore file that is generated on Macs Jun 13, 2013
01-cgminer.rules Add Zeus miners to udev rules Jun 28, 2014
A1-board-selector-CCD.c A1: add support for updated product variants, small fixes Jun 3, 2014
A1-board-selector-CCR.c A1: add support for updated product variants, small fixes Jun 3, 2014
A1-board-selector.h A1: add support for updated product variants, small fixes Jun 3, 2014
A1-common.h A1: add support for updated product variants, small fixes Jun 3, 2014
A1-desk-board-selector.c A1: CoinCraft-Desk driver variant Feb 19, 2014
A1-trimpot-mcp4x.c A1: modularize board selector / add initial CCR support Apr 22, 2014
A1-trimpot-mcp4x.h A1: modularize board selector / add initial CCR support Apr 22, 2014
API-README Merge pull request #607 from kanoi/s2 Jun 9, 2014
API.class API.java allow partial reads Feb 14, 2013
API.java basic copyright statement in API.java Jun 3, 2013
ASIC-README minion - chip ghs reporting and chip/core validation in nonce processing May 16, 2014
AUTHORS Update authors for removal of gpu/scrypt. Feb 4, 2014
COPYING Update licensing to GPL V3. Feb 21, 2012
ChangeLog ChangeLog refer to NEWS Dec 12, 2012
FPGA-README ICA optional limit timing with short=N or long=N Aug 31, 2013
LICENSE Update licensing to GPL V3. Feb 21, 2012
MCast.class Compile MCast.java with an old java Aug 23, 2013
MCast.java API Multicast sample MCast.java+MCast.class Aug 23, 2013
Makefile.am Link against libudev for easier Zeus device detection. Jun 21, 2014
NEWS Add cointerra driver to news Jun 10, 2014
README minion - chip ghs reporting and chip/core validation in nonce processing May 16, 2014
README.md Update documentation Jan 23, 2015
api-example.c Update api example compilation instructions. Nov 17, 2013
api-example.php JSON reply to JSON request Dec 20, 2011
api-example.py Change mode on python file. Jun 24, 2013
api-example.rb Add Ruby Api Example May 23, 2014
api.c Make API device status commands also call driver's get_api_stats call… Jun 18, 2014
arg-nonnull.h Added previously missing gnulib files. Jul 4, 2011
autogen.sh Only run ./configure with autogen.sh if extra parameters are passed t… Feb 17, 2014
bench_block.h Fix comment May 10, 2014
bitforce-firmware-flash.c Remove compile errors/warnings and document compile/usage in FPGA-README Aug 23, 2012
c++defs.h Added previously missing gnulib files. Jul 4, 2011
cgminer.c Cleanup indentation Jan 21, 2015
compat.h Use cgtime in compat.h Apr 21, 2013
configure.ac Add a distinguishing version suffix Jan 20, 2015
crc.h Add Avalon2 (2U size machine) support Feb 11, 2014
crc16.c Add Avalon2 (2U size machine) support Feb 11, 2014
driver-SPI-bitmine-A1.c A1: add support for updated product variants, small fixes Jun 3, 2014
driver-avalon.c avalon, bab, drillbit, klondike use more screen space rather than tru… Feb 19, 2014
driver-avalon.h Update various copyright dates Feb 13, 2014
driver-avalon2.c Minor changes May 19, 2014
driver-avalon2.h Minor changes May 19, 2014
driver-bab.c bab - missed a few 'DEAD's in last commit Feb 20, 2014
driver-bflsc.c Move driver statline padding to cgminer.c, expanding width of maximum… Feb 18, 2014
driver-bflsc.h Set bflsc cutoff temperature to 85 degrees and throttle 3 degrees bel… Dec 9, 2013
driver-bitforce.c Move driver statline padding to cgminer.c, expanding width of maximum… Feb 18, 2014
driver-bitfury.c Add basic API stats for nfu drivers to see how many submits each chip… May 5, 2014
driver-bitfury.h Support power management optimisations in newer nf* firmware May 5, 2014
driver-bitmain.c ants2 - beeper fix, max 4k chip diff, libm test/fail May 21, 2014
driver-bitmain.h Merge pull request #607 from kanoi/s2 Jun 9, 2014
driver-cointerra.c Cointerra driver updates Jun 10, 2014
driver-cointerra.h Cointerra driver updates Jun 10, 2014
driver-drillbit.c Drillbit: Fix for underestimating hash rate from Bitfury devices Mar 14, 2014
driver-drillbit.h Drillbit: --drillbit-auto parameter for tweakable custom tuning of AS… Mar 12, 2014
driver-gridseed.c Standardize device ID used in command line options. Sep 20, 2014
driver-gridseed.h Gridseed: use port name as ID in serial I/O mode Jul 16, 2014
driver-hashfast.c Avoid dereference on getting API stats on partially initialised HFA i… Jun 4, 2014
driver-hashfast.h Add an hfa-options command line that allows the clockspeed to be chos… Mar 8, 2014
driver-icarus.c Silence harmless warning. Mar 18, 2014
driver-klondike.c klondike ensure stats type matches Feb 19, 2014
driver-knc-spi-fpga.c Fix trivial warnings in knc driver. Dec 23, 2013
driver-minion.c minion - count force use reread May 30, 2014
driver-modminer.c Move driver statline padding to cgminer.c, expanding width of maximum… Feb 18, 2014
driver-spondoolies.c Add support for 2 nonces per block in spond driver May 24, 2014
driver-spondoolies.h Fix typo Apr 18, 2014
driver-zeus.c Fix libusb support for non-Blizzard Zeusminers. Jan 20, 2015
driver-zeus.h Fix libusb support for non-Blizzard Zeusminers. Jan 20, 2015
elist.h Compile CPU mining for win32 and win64 Apr 4, 2013
example.conf Update example.conf Nov 11, 2013
fpgautils.c Silence compiler warning Sep 20, 2014
fpgautils.h Add overlapped I/O option to serial_open_ex, silence compiler warnings Jul 13, 2014
hexdump.c Fix compilation error with two avalon types. Feb 21, 2014
hf_protocol.h Updated hf protocol Feb 23, 2014
hf_protocol_be.h Updated BE hf protocol header. Feb 21, 2014
i2c-context.c A1: add support for updated product variants, small fixes Jun 3, 2014
i2c-context.h A1: add support for updated product variants, small fixes Jun 3, 2014
klist.c AntS2 code conversion and addition of optional noncedup check May 20, 2014
klist.h AntS2 code conversion and addition of optional noncedup check May 20, 2014
libbitfury.c Add basic API stats for nfu drivers to see how many submits each chip… May 5, 2014
libbitfury.h Do a shutdown routine on bxm close. Mar 5, 2014
linux-usb-cgminer Include HDD install details and related changes Jan 21, 2012
logging.c syslog requires a facility ... in more than one place Apr 16, 2014
logging.h Use an early_quit function for shutting down when we have not success… Feb 28, 2014
mcp2210.c Set the mcp2210 transfer setting only when it changes. Jan 9, 2014
mcp2210.h Set the mcp2210 transfer setting only when it changes. Jan 9, 2014
mg_proto_parser.c Trivial style changes to mg proto parser Apr 10, 2014
mg_proto_parser.h Add support for 2 nonces per block in spond driver May 24, 2014
miner.h Enable subscribe extranonce function by adding #xnsub to pool url's t… Jan 21, 2015
miner.php miner.php fix single rig summary/config field formatting May 2, 2014
mknsis.sh Windows build tweaks. Nov 27, 2010
noncedup.c AntS2 code conversion and addition of optional noncedup check May 20, 2014
scrypt.c Add scrypt support based on cgminer 3.7.2 Apr 22, 2014
scrypt.h Add scrypt support based on cgminer 3.7.2 Apr 22, 2014
sha2.c sha2 allow external access to some macros and the K array Nov 10, 2013
sha2.h sha2 allow external access to some macros and the K array Nov 10, 2013
spi-context.c Fix missing include Feb 20, 2014
spi-context.h Initial import of Bitmine.ch A1 SPI driver Feb 19, 2014
usbtest.py simple serial-USB python test script May 17, 2013
usbutils.c Add autodetection for newer Zeus miners using FTDI USB chip Jun 28, 2014
usbutils.h Add Zeus FTDI USB initialization Jun 29, 2014
uthash.h Update uthash to latest. Nov 2, 2013
util.c Prevent potential buffer overflow Jan 21, 2015
util.h Enable subscribe extranonce function by adding #xnsub to pool url's t… Jan 21, 2015
warn-on-use.h Added previously missing gnulib files. Jul 4, 2011
windows-build.txt Add clarification on Windows cross-build, out of tree is possible Nov 19, 2013

README.md

cgminer-scrypt

CGMiner 4.3.5 with GridSeed and Zeus scrypt ASIC support.

This file describes Scrypt-specific settings and options. For general CGMiner information refer to README. Scrypt algorithm code was ported from CGMiner version 3.7.2.

Zeus

./autogen.sh
./configure --enable-scrypt --enable-zeus
make

Option Summary

  --zeus-chips <chips>   Default number of chips per device
  --zeus-clock <clock>   Default chip clock speed (MHz)

  --zeus-options <ID>,<chips>,<clock>[;<ID>,<chips>,<clock>...]
                         Set chips and clock speed for individual devices

  --zeus-nocheck-golden  Skip golden nonce verification during initialization (serial mode only)
  --zeus-debug           Enable extra Zeus driver debugging output in verbose mode

The zeus-chips and zeus-clock options apply to every device unless overridden on a per-device basis using zeus-options. The ID values to use with that option depend on how CGMiner is communicating with the miners, explained in the next section.

Device Selection

The driver supports using either libusb or directly reading/writing to the serial port to communicate with the miner. Libusb is generally more convenient on Linux while Windows users may prefer serial to bypass the requirement of installing special libusb drivers. Mode selection depends on the scan-serial option:

  • By default with no --scan-serial options the driver will use libusb to autodetect any connected miners and to perform all device I/O operations. In this mode the ID assigned to each miner for use with --zeus-options will be the miner's serial number (except for Blizzard models, see note below).

  • For serial I/O each miner must be specified manually using --scan-serial zeus:<PORT> and providing the path to the serial port (i.e. /dev/ttyUSBx on Linux or \\.\COMx on Windows). The prefix "zeus:" is optional if CGMiner has been compiled with only the Zeus driver enabled, otherwise it is required. In this mode the ID assigned to each miner for use with --zeus-options will be the final part of the port (i.e. ttyUSBx or COMx). Note that autodetection is not supported in this mode.

  • On Linux systems only it is possible to use serial I/O and still have autodetection by specifying --scan-serial zeus:auto. In this mode the driver will use libudev to identify which USB-serial ports are from a Zeus miner. All I/O will still be done using direct serial reads and writes (not through libusb) and the ID for each miner will still be the final part of the port (ttyUSBx). This method is not recommended if multiple drivers are compiled in as autodetection can be quirky in those cases.

The following three examples are equivalent assuming three miners are connected:

# Using libusb
./cgminer --scrypt --zeus-chips 96 --zeus-clock 328

# Direct serial I/O, manual port specification
./cgminer --scrypt --zeus-chips 96 --zeus-clock 328 --scan-serial /dev/ttyUSB0 \
	--scan-serial /dev/ttyUSB1 --scan-serial /dev/ttyUSB2

# Direct serial I/O, auto-detect ports (Linux only)
./cgminer --scrypt --zeus-chips 96 --zeus-clock 328 --scan-serial zeus:auto

Notes

Blizzard ID note: Blizzard models use a different USB-Serial chip which does not provide a valid serial number. When using libusb mode with one of these the ID shown in CGMiner and used with --zeus-options is the USB bus and device address in this format: <bus number>:<device address>

Chip count for different models: Blizzard: 6, Hurricane X2: 48, Hurricane X3: 64, Thunder X2: 96, Thunder X3: 128

The model name displayed in the CGMiner UI depends on the chip count being specified correctly. It is not auto-determined.

Zeus driver is based on documentation and the official reference implementation. Many thanks also to sling00 and LinuxETC for providing access to test hardware.


Gridseed

./autogen.sh
./configure --enable-scrypt --enable-gridseed
make

GC3355-specific options can be specified via --gridseed-options or "gridseed-options" in the configuration file as a comma-separated list of sub-options:

  • baud - miner baud rate (default 115200)
  • freq - any frequency multiple of 12.5 MHz, non-integer frequencies rounded up (default 600)
  • pll_r, pll_f, pll_od - fine-grained frequency tuning; see below
  • chips - number of chips per device (default 5)
  • per_chip_stats - print per-chip nonce generations and hardware failures (only for 5-chip models)
  • start_port - first port number for scrypt proxy mode (default 3350); see below
  • voltage - switch the voltage to the GC3355 chips; see below
  • led_off - turn off the LEDs on the Gridseed miner

When mining scrypt-only this version of cgminer does not initialize the SHA cores so that power usage is low. On a 5-chip USB miner, power usage is around 10 W.

Gridseed support is based largely on the original Gridseed CGMiner and dtbartle's scrypt modifications.

Frequency Tuning

If pll_r/pll_f/pll_od are specified, freq is ignored, and calculated as follows:

  • Fin = 25
  • Fref = int(Fin / (pll_r + 1))
  • Fvco = int(Fref * (pll_f + 1))
  • Fout = int(Fvco / (1 << pll_od))
  • freq = Fout

Dual Mining

When dual-mining start_port will set the listening proxy port of the first gridseed device on the SHA256 instance of cgminer, with additional miners using successive ports. The scrypt instance of cgminer will attempt to connect starting at this port.

When dual mining, start the SHA mining instance of cgminer first, wait for it to begin mining and then start the scrypt version. The second instance will detect that the USB ports are in use and will attempt to connect to the first via UDP.

If everything is working the same devices will appear in both cgminer windows.

Voltage Modding

If voltage=1 is set the gridseed chips will be switched to an alternate voltage. Specifically, this flag will cause the MCU to assert the VID0 input to the voltage regulator. This requires a voltmodded miner. On a stock unit this will actually reduce the regulator's output voltage.

More Complex Options

The options can also be specified for each device individually by serial number via --gridseed-freq or --gridseed-override or their configuration file equivalents. --gridseed-freq takes a comma-separated list of serial number to frequency mappings while --gridseed-override takes the same format as --gridseed-options:

--gridseed-freq "<SERIAL>=<FREQ>[,...]"

--gridseed-override "<SERIAL>:freq=<FREQ>,voltage=<0/1>[,...];<SERIAL>:freq=<FREQ>[,...[;...]]"