Icarus
Icarus is a FPGA development/bitcoin mining board, it's a 6 layers PCB. has 2 XC6SLX150 -2FGG484I on it. there are100+ GPIOs on this board and plenty(50+) of interconnect wires between the 2 FPGAs. most of them are routed as diff-pairs. generates about ~360MH/s hashing power. 19.5W on wall power consuming.
Contents |
Pictures
Without FAN and cooling plate: front, back
Power supply
- Input: 100-240V~, 50-60Hz, 1A Max
- Output : 12v, 2A
- Connector: 5.5mm OD, 2.5mm ID
- ATX powe. connect 20 Icarus to one 650W ATX power is better. evenly distributed Icarus to your 12V yellow cables. don't put all Icarus to only one. xiangfu have tried connect 10 Icarus to ANTEC VP 650PM ATX Power, it give ~235W in power meter.
- If you have more Icarus like 40. don't power on all at same time. power on them 10 by 10 is better.
- Cables link: ATX cable 1 ATX cable 2 Power cable 5.5*2.5
- Burned bad quality cable, it should be 4 yellow cables and 4 black cables. after burned all became black
- Burned power adapter, the case became uneven. no power output at all. the Icarus connect to this power adapter not broken.
LEDs
- PWR_OK: power modules output are all in good voltage.
- TXD1 and RXD1: for display transport on the USB UART bridge, but by a design miss, they are difficult to discriminate, and this function is also implemented on other LEDs, so will be removed in the future.
- LED1: FPGA1 is busy, in the origin bitsteam, light means FPGA is working, but it changed to opposite.
- LED2: TXD for FPGA1
- LED3: RXD for FPGA1
- LED4: valid nonce found by FPGA1. will light and fade out in 4 seconds.
- LED5: FPGA2 is busy.
- LED6: TXD for FPGA2
- LED7: RXD for FPGA2
- LED8: valid nonce found by FPGA2.
Communication protocol V3
The FPGAs on board or even in chain mode (under development) , act as a single miner to the uart port. when the board connect to a PC, it recognized as a ttyUSB device or COM on windows PC.
Operation
- No detection is needed (no special command for this).
- Wait work data: each data packet is 512bit (64 byte) length. the format is : 256bits MIDSTATE + 160bits fill bits(can be any value) + 96bits data (last 12 bytes of block header).
- Send back the results if the fpga found a valid nonce, they will send back the 32bits nonce result immediately. no any query protocol is implemented here.
Simple work process is described
- Send a work pass the COM port, start a timer and a listener on the COM port.
- If any data send back by the COM port, then this is a valid nonce. push a new work to the FPGA and send the result back to the pool.
- If no data send back in 11.3 seconds (a full cover time on 32bit nonce range by 380MH/s speed, maybe increase so a shorter time is suggested, like 8s ), send another work.
Info
- FPGA will start the calculate when you push a work to them, even they are busy. that means if a block has been found, the miner could push a new immediately to overlap the old work in the fpga.
- The 2 FPGAs on one board will distribute the 32bit nonce to calculate. one will calculate the 0 ~ 7FFFFFFF and the other will cover the 80000000 ~ FFFFFFFF. so if you want to do any performance measure on this device, please notice this feature.
- FPGA will stop work when: a valid nonce has been found or 32 bits nonce range is completely calculated. notice that it's possible for 2 FPGA both find valid nonce in the meantime, the 2 valid nonce will all be send back.
Improve
- Return nonce=0 once it gets to the end! so we know when it is finished - in V4, if we get a nonce=0 VERY quickly we know it is a real nonce or if the FPGA can send back a "I'm done" message, it would probably make it easier to do more efficiently.
- Detection via the USB product/device ids is crucial to automatically adding it to Miner Software like(miner.py or CGminer).
- Normal error rate is less than 0.1%, if the error rate goes high, that means something goes wrong. like FPGA too hot. needs additional fan, V3 bitstream got 0x08% under abcpool.co for 24 hours. tested by ngzhang
- In case you (or someone else) produces protocol-compatible devices in the future, you may wish to provide a way to probe the number of FPGAs on the board and their speeds.
- It would be good to have the ability to specify exact nonce ranges, so cgminer (or another miner) can support the noncerange extension in the future, or even split up work internally (a single work is sufficient for up to 4 GH/s). need change on HDL code
- Reporting temperature/safety measurements can allows cgminer to shut off the FPGA if it gets too hot, need additional hardware.
Mining software
Cgminer
- Written with C, support long polling and rolling time.
- Icarus in cgminer should give Utility: ~5.20/m, if the Utility is not around 5. there is something wrong.
- Install cgminer in your PC:
$ git clone git://github.com/xiangfu/cgminer.git $ cd cgminer $ git checkout -b icarus origin/icarus $ ./autogen.sh && ./configure --enable-icarus --disable-opencl --disable-adl && make $ sudo make install
- Setup with Icarus, connect Icarus to your PC. it will shows as /dev/ttyUSB0, running cgminer by:
$ cgminer -S /dev/ttyUSB0 -o http://pool.ABCPool.co -O xiangfu.0:x
- If you have more Icarus connected. you may needs this little scrip file, it assume all /dev/ttyUSB* is Icarus, --api-network --api-listen is for API access for miner.php like this one:
#!/bin/sh DEVS=`find /dev/ -type c -name "ttyUSB*" | sed 's/^/-S/' | sed ':a;N;$!ba;s/\n/ /g'` cgminer $@ --api-network --api-listen -o http://pool.ABCPool.co -O xiangfu.0:x ${DEVS}
Mining pool
- Recommend: http://ozco.in/ (Support long polling and rolling time) or http://www.abcpool.co/ (Suppoy long polling), when you running cgminer with more then 10 Icarus. you better choose a rolling time mining pool.
- DeepBit does not pay well
- EclipseMC seems to have lots of problems cause he changes stuff often
- P2Pool is no good with FPGA coz of 10s LP, check out those 1 2 for more detail.
- ABCpool.co is a proxy (Their pool is actually an Amazon EC2)
- ARS is going broke fast
- More: https://en.bitcoin.it/wiki/Comparison_of_mining_pools
Using TP-LINK TL-WR703N as host
Setup cgminer
- Connect your laptop to the LAN/WAN port of the TL-WR703ND and acquire an IP address via DHCP. It should come up under the 192.168.1.0/24 network then open http://192.168.1.1
- Install OpenWrt (use Xiangfu's build trunk 30834 image, with cgminer v2.4.1 pre-installled), latest image(16-May-2012, MD5: 7b02262...) support hotplug Icarus, it will automatic restart cgminer service.
- This OpenWrt image using 192.168.42.1/24 network, after ~2 minutes, open http://192.168.42.1
- Setup password for further SSH connect
- Configure WiFi: Network -> WIFI -> Scan(select your WIFI network) -> Join Network -> WPA passphrase -> Submit -> Save & Apply for connect to WIFI Internet
- Make sure WR703N can access Internet, ssh to your WR703N enable cgminer service follow:
- vim /etc/init.d/cgminer # update the POOL1/POOL2/POOL3
- /etc/init.d/cgminer stop
- /etc/init.d/cgminer start #or re-plug Icarus
- cgminer-api # wait 5 seconds for cgminer start the API thread. without any parameter it will give cgminer summary, the Utility should be ~5.2 or MHS should be ~380 for each Icarus after hours running
- cgminer-api pgacount # get Icarus count, if the Icarus count is not correct, you can restart he service again. this is a known pl2303 bug
- There is a x86_64 Linux version cgminer-api, you can use that on you PC:
./cgminer-api summary 192.168.0.192 # 192.168.0.192: your 704N ip address, check RPC API document under cgminer README for more information
- There are maybe some problems happen(like the Utility give 0, didn't upload works to pool.), you can try add a USB HUB between 703N and Icarus or use a different power adapter like 5V,2A or 5V,4A. that may fix the problem.
- A 13 ports usb-hub, you will need that when you connect more Icarus. I am connect 703N to this usb-hub for power supply(5V,4A), works really great. it's better then the original power adapter(5V,1A)
Wi-Fi connection for Milkymist One
- We can direct plug the power cable of WR703N into Milkymist One any usb port
- Connect your laptop to the LAN/WAN port of the TL-WR703ND and acquire an IP address via DHCP. It should come up under the 192.168.42.0/24 network then open http://192.168.42.1
- Network -> WIFI -> Scan(select your WIFI network) -> Join Network -> WPA passphrase -> Submit -> Save & Apply for connect to WIFI Internet
- Connect Milkymist One to WR703N LAN/WAN port
- Test connection by Web update -> Check versions
FPGA core
Modify base on ZTEX's miner core. it needs ISE 13.2 and Synplify E-2011.03-SP2 for get the final result.
- First synthesize the stuff under ./miner_core by click Process->Implement Top Module, then you got a NGC file, named sha256_top.ngc.
- Put sha256_top.ngc to ./miner , than run the flow by using Synplify E-2011.03-SP2 as synthesizer and ./src/miner_top.ncd as smartguide file(already setup by default. ise_p_using_smartguide), then synthesize the miner by click Process->Implement Top Module
- about Smartguile file: execate smartXplorer500 times, use the best one as smartguild file
Verify FPGA core
- Use this payload.py. just download it and running it like ./pyload.py -s /dev/ttyUSB0
PCB
1. Open ./AD10Project/S6.PrjPCB by Altium designer 10 to browse. also you can review the PDF file: ./SCHinPDF/Icarus.pdf.
2. Make sure total 15 libraries are imported, see compiled libraries and S61.PcbLib PCB library
Install Xilinx ISE
Download the Xilinux ISE webpack 13.2, I am using 'Xilinx_ISE_DS_Lin_13.2_O.61xd.0.0.tar', extact it and run xsetup
Install Xilinx cable driver
- Checkout: cable driver manual, http://www.xilinx.com/support/answers/29310.htm
How To Flash
Flash by using iMPACT
You need install the ISE 13.2. then connect the Xilinx Cable Jtag to Icarus. open iMPACT. it should auto detect your Icarus two FPGAs. right click the FPGA. select Assign New Configuration File .... checkout this Picture.
Using Milkymist One JTAG/Serial duaghter board
Flash Chip
W25Q64CV: 64M-bit Serial Flash Memory with uniform 4KB sectors and Dual/Quad SPI, datasheet
BOM
BOM for v2.1a schematic but pcb buttom side rev. marked as v1.0a.
- U3, U4 footprint does not coincide with Winbond W25Q64CVSSIG's 8-SOIC.
mForce 200
- Taobao link: http://item.taobao.com/item.htm?id=14590459436
- Design files: http://code.google.com/p/homenas/downloads/list
Links
- https://bitcointalk.org/index.php?topic=51371.0;all
- https://github.com/ngzhang/Icarus
- https://en.bitcoin.it/wiki/Main_Page
- https://en.bitcoin.it/wiki/Mining_hardware_comparison#FPGA_Devices
- USB to Serial PL2303: http://www.prolific.com.tw/eng/downloads.asp?id=31
- http://bitcoin.stackexchange.com/questions/1290/when-a-block-is-discovered-how-is-the-nonce-determined
- Print the current status of of you account for the deepbit.net miner pool using Python, change the API_KEY to your API


