Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Projects you are planning or working on with the Mojo
MacAttak
Posts: 72
Joined: April 28th, 2013, 1:27 am
Location: Atlanta, GA
Contact:

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by MacAttak » June 21st, 2013, 2:01 pm

Hmm, the 50MHz version seems to work fine for me. Though, yes, it is pretty slow. The 100 MHz version does not appear to work though. The miner script sends it data, but it never finds any shares (not even the test data), and the LEDs do not ever light up like they do with the 50MHz build.

Anything special need to be done?

I won't be getting rich from this anytime soon, just curious about it and digging through the source has been very interesting.

mredraider
Posts: 2
Joined: June 18th, 2013, 12:32 pm

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by mredraider » June 21st, 2013, 6:45 pm

Try erasing and reflashing. Mine failed validation the first two times I tried to flash it, then on the third try worked fine. it's been running for about 24 hours Averaging about 5MH/s according to btcguild.com

MacAttak
Posts: 72
Joined: April 28th, 2013, 1:27 am
Location: Atlanta, GA
Contact:

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by MacAttak » June 22nd, 2013, 12:11 am

It seems like OS X just doesn't like to play nicely with the Mojo... running the 100MHz bin is working fine as long as I run the miner.py script from within Windows (in a VM) rather than running the script from OS X. Yes, I set the com port name properly for each OS, and yes I know how to tell Parallels which OS should have access to the port.

I had noticed similar misbehavior under my Ubuntu virtual machine where as soon as I try to start using the device it seemed to shut it down... the DONE led would darken immediately. Same thing in OS X. As soon as I try to access the com port, the DONE led darkens and it just seems to hang there. In Windows though, the DONE led stays lit and everything runs as expected.

Odd. But I don't really need to access the Mojo from OS X anyways (at least not for now).

kramble
Posts: 9
Joined: June 8th, 2013, 5:52 pm

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by kramble » June 22nd, 2013, 6:26 am

Thanks for all the feedback, its nice to know its working.

I've just put up a new version of the code which supports the original teknohog/icarus protocol. Its disabled by default but you can enable it via the parameter ICARUS in mojo_top.v (just change from 0 to 1). You will need to use miner_icarus.py as the packet size differs from that in miner.py. As a bonus the test nonce now returns almost instantly (be prepared to kill the script quickly as it will spam the mining pool with invalid shares!)

The icarus version may work with cgminer version 3.1.1 (not newer versions as they do not support the -S option to select the serial port, using a direct USB driver instead). I did test with a hacked version (since I run at 4800 baud which is unsupported), but it needed an additional hack to send the detection work packet twice. This may be a quirk of my raspberry pi physical serial port, or a problem with my fpga serial interface code. Any feedback would be appreciated.

Have fun with it (it won't mine you much coin, but who cares, its mojo-mining) :lol:

User avatar
forum2005
Posts: 8
Joined: June 8th, 2013, 5:42 am

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by forum2005 » June 22nd, 2013, 10:32 am

Excellent job kramble.

I wish test icarus protocol, but I can not compile using ISE 14.5..., don't end. I put variable at environment, but nothing. Can you help me ?

Image

kramble
Posts: 9
Joined: June 8th, 2013, 5:52 pm

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by kramble » June 22nd, 2013, 1:14 pm

forum2005 wrote:Excellent job kramble.
I wish test icarus protocol, but I can not compile using ISE 14.5..., don't end. I put variable at environment, but nothing. Can you help me ?
You're right, I've been running the build for well over an hour now and its still got 6696 unrouted. It seems that the Xilinx PAR is extremely sensitive to tiny tweaks in the design (eg the same build parameters but for 4800 baud compiled in less than an hour, and that design is slightly larger. It also tested out fine on my homebrew LX9 board). I'll have a play with it and see if I can get it to build, though this could take a while. You could try dropping the clock speed slightly, say to 80MHz (or even increasing to 120MHz). Perhaps one of the experts could make some suggestions (I'm just a newbie with the Xilinx toolset, an not much better on Altera's Quartus II either).

PS Now at 5796 unrouted, at 100 minutes into the build.
PPS I gave up after six hours. See below for a tiny change I made which compiled in 20 minutes.
Last edited by kramble on June 23rd, 2013, 1:43 am, edited 1 time in total.

Pacemk
Posts: 8
Joined: May 18th, 2013, 10:49 am
Location: Montréal,QC,Canada

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by Pacemk » June 22nd, 2013, 6:53 pm

Thanks a lot Kramble for all this work ! Excellent job.

I tried to build the news version, but, like you, it's seem to be stuck, even after +100 min into the build

I also tried to build the "old" and new version at higher speed, but more than 115 Mhz seems to too high : 120 Mhz builds with warning about delay.

kramble
Posts: 9
Joined: June 8th, 2013, 5:52 pm

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by kramble » June 23rd, 2013, 1:42 am

forum2005 wrote:Excellent job kramble.
I wish test icarus protocol, but I can not compile using ISE 14.5..., don't end. I put variable at environment, but nothing. Can you help me ?
I made a tiny, tiny change, making led_match/led3 into an 8 bit counter in fpgaminer_top.v, and assigning 7 bits to led, together with the led1 nonce[24] indicator in mojo_top.v ...

assign led = { led3[6:0], led1 };

it compiled in just 20 minutes! I've pushed this up onto github as mojo_top_hashers6_100MHz_icarus.bin.

It seems Xilinx PAR is really quirky. I'm not going to push this code change up as it could well break the compilation for a different parameter configuration, but I'll amend the README to suggest some hints on compilation.

User avatar
forum2005
Posts: 8
Joined: June 8th, 2013, 5:42 am

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by forum2005 » June 23rd, 2013, 1:20 pm

kramble wrote:
forum2005 wrote:Excellent job kramble.
I wish test icarus protocol, but I can not compile using ISE 14.5..., don't end. I put variable at environment, but nothing. Can you help me ?
[...]
it compiled in just 20 minutes! I've pushed this up onto github as mojo_top_hashers6_100MHz_icarus.bin.
[...]
I test your bin compilation, but i've bad news.. in my system has not been running.
cgminer says: Icarus detect (1:6) failed to initialised (incorrect device?)

kramble
Posts: 9
Joined: June 8th, 2013, 5:52 pm

Re: Possible to get Open-Source-FPGA-Bitcoin-Miner running?

Post by kramble » June 23rd, 2013, 3:34 pm

forum2005 wrote: I test your bin compilation, but i've bad news.. in my system has not been running.
cgminer says: Icarus detect (1:6) failed to initialised (incorrect device?)
That message comes from the usbutils.c module, which means that you've not supplied the -S parameter on the command line (instead its trying to find the icarus USB device, which you don't have as its a mojo). You need to run it like this...

cgminer --icarus-options 115200:1:1 -S COM1 --url http://btcguild.com:8332 --userpass mojotest_1:x

Put your com port number rather than COM1 (I use -S /dev/ttyAMA0 on raspberry pi). You might need \\.\COM1 or //./COM1 (just from googling it, I don't run it on windows myself).

You MUST use cgminer version 3.1.1 as the newer versions do not take the -S parameter.

If you do that, and it then fails with something like "Icarus Detect: Test failed at COM1: get 00000000, should 000187a2", then its running the correct driver, but the fpga is not responding. I had that problem initially with cgminer and had to hack the source code to fix it (it needs to send the test twice). I'm hoping that was just a quirk with my raspberry pi, but it may happen with the mojo too. Its fixable by hacking the driver-icarus.c module, but building cgminer on windows is much more difficult than on linux. Anyway, check out the fpga using miner_icarus.py first with the test payload to check the bitstream is working.

Post Reply