Bitcoin Forum
May 08, 2024, 07:57:13 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: [1] 2 »  All
  Print  
Author Topic: Bitcoin/Litecoin FPGA question for project  (Read 3123 times)
jasinlee (OP)
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


Its as easy as 0, 1, 1, 2, 3


View Profile
December 26, 2012, 04:02:35 PM
 #1

How would a person in theory interface a fpga board into the ltc/btc network? I have a friend who works on vhdl and is toying with making his own fpga and we cant seem to figure out how to get his cyclone III dev kit to interface on the network.

BTC 1JASiNZxmAN1WBS4dmGEDoPpzN3GV7dnjX DVC 1CxxZzqcy7YEVXfCn5KvgRxjeWvPpniK3                     Earn Devcoins Devtome.com
1715198233
Hero Member
*
Offline Offline

Posts: 1715198233

View Profile Personal Message (Offline)

Ignore
1715198233
Reply with quote  #2

1715198233
Report to moderator
The block chain is the main innovation of Bitcoin. It is the first distributed timestamping system.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
mitty
Sr. Member
****
Offline Offline

Activity: 359
Merit: 250



View Profile
December 26, 2012, 04:15:40 PM
 #2

I don't really know anything about the design of FPGA miners, but I know most (all?) of the existing ones plug into a host computer via USB and the host takes care of connecting to the network/mining pool and just sends the FPGA the data to be hashed.
jasinlee (OP)
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


Its as easy as 0, 1, 1, 2, 3


View Profile
December 26, 2012, 05:14:38 PM
 #3

Would it be easier to do via ethernet?

BTC 1JASiNZxmAN1WBS4dmGEDoPpzN3GV7dnjX DVC 1CxxZzqcy7YEVXfCn5KvgRxjeWvPpniK3                     Earn Devcoins Devtome.com
Photon939
Sr. Member
****
Offline Offline

Activity: 452
Merit: 250



View Profile
December 26, 2012, 09:05:32 PM
 #4

Would it be easier to do via ethernet?

It takes a fair bit more work to add direct ethernet capability (although certainly possible).

You'll need a microcontroller to handle the IP/TCP/DHCP configuration and shuttle data to and from the FPGA along with processing work from a pool and submitting completed work. It's a fair bit of overhead (for a uC) normally done by the CPU on the host computer.

Also you'll  need some way to configure it for debugging, changing pools, static IPs, etc.
pieppiep
Hero Member
*****
Offline Offline

Activity: 1596
Merit: 502


View Profile
December 26, 2012, 09:36:56 PM
 #5

The easiest way would probably be to use pins from your fpga to make a RS232 (serialport) interface.
Then look in the source code of a miner that can use fpga's or find on the web or this forum what bytes you can send/receive and use that.

The difference between bitcoin and litecoin is very small (looked at from the mining software/hardware side), both have a 80 bytes block you have to hash, both have a 32bits nonce at the same place, the only difference is a method used for hashing.
jasinlee (OP)
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


Its as easy as 0, 1, 1, 2, 3


View Profile
December 27, 2012, 12:37:03 PM
 #6

Would RS232 be too slow?

BTC 1JASiNZxmAN1WBS4dmGEDoPpzN3GV7dnjX DVC 1CxxZzqcy7YEVXfCn5KvgRxjeWvPpniK3                     Earn Devcoins Devtome.com
pieppiep
Hero Member
*****
Offline Offline

Activity: 1596
Merit: 502


View Profile
December 27, 2012, 12:52:45 PM
 #7

The block to hash is just 80 bytes with an average of 1 4 byte nonce for 2^32 hashes.
With a little protocol overhead, lets say 115 bytes/block, you can do 1000 blocks/second.
2^32 * 1000 = 4.2 THash/s.
mrb
Legendary
*
Offline Offline

Activity: 1512
Merit: 1027


View Profile WWW
December 27, 2012, 07:04:59 PM
Last edit: December 27, 2012, 07:45:58 PM by mrb
 #8

The block to hash is just 80 bytes with an average of 1 4 byte nonce for 2^32 hashes.
With a little protocol overhead, lets say 115 bytes/block, you can do 1000 blocks/second.
2^32 * 1000 = 4.2 THash/s.

No, RS-232 is typically 115 kbit/s, not kByte/s. Therefore: 125 blocks/s.

You could also implement roll-n-time on the device, and return to the host shares with difficulty > 1. So, all in all, it is hard to put an exact number on what is doable on RS-232, but it would be sufficient for many tens of TH/s.

But seriously guys, I don't see the point in using RS-232. USB is trivial to implement with supporting microcontrollers. Which is why ALL FPGA miners use it. The Altera Cyclone III dev kit supports USB if I am not mistaken.
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1068



View Profile
December 27, 2012, 07:32:17 PM
 #9

The Altera Cyclone III dev kit supports USB if I am not mistaken.
It has two USB ports, but in a really sucky configuration. One is FTDI and one Cypress; and they cannot be operated at the same time. FTDI is used almost exclusively because it is the easiest supported way to tap JTAG.

There are some serial-over-JTAG drivers available in the NIOS II development kit, so it is doable. But it is a great PITA. Or one could use external JTAG, but this is also a PITA.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
jasinlee (OP)
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


Its as easy as 0, 1, 1, 2, 3


View Profile
December 28, 2012, 02:39:40 PM
 #10

How would the USB implemented on the  FPGA? Are there any good free USB cores on the net?

BTC 1JASiNZxmAN1WBS4dmGEDoPpzN3GV7dnjX DVC 1CxxZzqcy7YEVXfCn5KvgRxjeWvPpniK3                     Earn Devcoins Devtome.com
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1068



View Profile
December 28, 2012, 03:15:56 PM
Last edit: December 28, 2012, 04:00:04 PM by 2112
 #11

How would the USB implemented on the  FPGA? Are there any good free USB cores on the net?
I think it is too complex and would require soldering. If soldering is acceptable then just solder in any USB-RS232 serial cable.

In my limited experience UDP broadcast over Ethernet would be easier, simpler to debug and use less logic resources than instantiating some USB device core.

Personally, I would use external USB-serial cable connected with 3 bent paper-clips to the appropriate header. Looks hilariously ugly, but works quite reliably. All my desktop machines have serial ports, either on the motherboard or expansion board, because I haven't yet met a device I couldn't tap some UART via bent paper clips or wires wrapped around needles or by hacking some cables.

Edit: I suddenly realised that the above may be read by some absolute beginners. In that case: please remember to watch the voltages. RS-232 default voltages may fry your expensive development kit if improperly connected. Be mindful of that. Cheapest multimeter and RS-232 - TTL level shifter is all you need to avoid releasing the expensive magic smoke from your FPGA.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
jasinlee (OP)
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


Its as easy as 0, 1, 1, 2, 3


View Profile
December 28, 2012, 03:43:55 PM
Last edit: December 28, 2012, 04:02:57 PM by jasinlee
 #12

where is the part in the code of one of the miners that can be changed for rs232 communication instead of starting processing on cpu/gpu? if anyone knows....

BTC 1JASiNZxmAN1WBS4dmGEDoPpzN3GV7dnjX DVC 1CxxZzqcy7YEVXfCn5KvgRxjeWvPpniK3                     Earn Devcoins Devtome.com
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1068



View Profile
December 28, 2012, 04:12:56 PM
 #13

where is the part in the code of one of the miners that can be changed for rs232 communication instead of starting processing on cpu/gpu?
The production mining software changes too rapidly for me to understand. You'll probably have to look at some previous version of CGminer or BFGminer, when they were still using serial ports instead of raw USB devices.

Besides, the above software is just too complex.

Start with something simple like ZTEX's miner or jgarzik's/pooler's cpuminer. Or hack out the signcryption out of eldentyrell's miner working through the JTAG taps. You'll initially want to mine on the CPU in parallel to be able to quicky compare the output from your FPGA with known good results from another source.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
Bogart
Legendary
*
Offline Offline

Activity: 966
Merit: 1000


View Profile
December 28, 2012, 04:29:49 PM
 #14

I would really recommend writing your own CPU miner first, to get a better idea of how mining works.

Shouldn't be more'n a few dozen lines in a decently high-level language.

"All safe deposit boxes in banks or financial institutions have been sealed... and may only be opened in the presence of an agent of the I.R.S." - President F.D. Roosevelt, 1933
jasinlee (OP)
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


Its as easy as 0, 1, 1, 2, 3


View Profile
December 28, 2012, 05:10:37 PM
 #15

where is the part in the code of one of the miners that can be changed for rs232 communication instead of starting processing on cpu/gpu?
The production mining software changes too rapidly for me to understand. You'll probably have to look at some previous version of CGminer or BFGminer, when they were still using serial ports instead of raw USB devices.

Besides, the above software is just too complex.

Start with something simple like ZTEX's miner or jgarzik's/pooler's cpuminer. Or hack out the signcryption out of eldentyrell's miner working through the JTAG taps. You'll initially want to mine on the CPU in parallel to be able to quicky compare the output from your FPGA with known good results from another source.


The running in parallel is a good idea, thanks.

BTC 1JASiNZxmAN1WBS4dmGEDoPpzN3GV7dnjX DVC 1CxxZzqcy7YEVXfCn5KvgRxjeWvPpniK3                     Earn Devcoins Devtome.com
jasinlee (OP)
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


Its as easy as 0, 1, 1, 2, 3


View Profile
December 28, 2012, 05:16:08 PM
 #16

which fpga miner used rs232 or uart for communication with the pc?

BTC 1JASiNZxmAN1WBS4dmGEDoPpzN3GV7dnjX DVC 1CxxZzqcy7YEVXfCn5KvgRxjeWvPpniK3                     Earn Devcoins Devtome.com
loshia
Legendary
*
Offline Offline

Activity: 1610
Merit: 1000


View Profile
December 28, 2012, 09:19:41 PM
 #17

Guy's,
I am complete newbie, so please excuse me in advance if this sounds stupid but…Is there any way to use PC RAM via USB at 115200 with FPGA and appropriate bitstream/miner combination?  As long RAM is the “bottle neck” for most FPGA boards now which are used for bitcoin mining. If yes MAX USB speed of some boards is  115200 only. Can this be a second bottle neck also? Probably yes but any comment is welcome
10X

Please help the Led Boy aka Bicknellski to make us a nice Christmas led tree and pay WASP membership fee here:
https://bitcointalk.org/index.php?topic=643999.msg7191563#msg7191563
And remember Bicknellski is not collecting money from community;D
Bogart
Legendary
*
Offline Offline

Activity: 966
Merit: 1000


View Profile
December 29, 2012, 12:03:13 AM
 #18

Guy's,
I am complete newbie, so please excuse me in advance if this sounds stupid but…Is there any way to use PC RAM via USB at 115200 with FPGA and appropriate bitstream/miner combination?  As long RAM is the “bottle neck” for most FPGA boards now which are used for bitcoin mining. If yes MAX USB speed of some boards is  115200 only. Can this be a second bottle neck also? Probably yes but any comment is welcome
10X

Well, there may be ways to make it work like that, but 115,200 bps is really incredibly slow, and would not likely be fast enough to be useful for Scrypt-based mining.

A more proper approach would be to use a memory controller, with a high speed interface of some kind back to the FPGA.  Have a look at these links:

http://www.avnet-israel.co.il/download/downloadPresentations/Presentations/xfest07_GD_memory.pdf
http://www.xilinx.com/products/technology/memory-interfacing/index.htm
http://www.xilinx.com/products/intellectual-property/MIG.htm

"All safe deposit boxes in banks or financial institutions have been sealed... and may only be opened in the presence of an agent of the I.R.S." - President F.D. Roosevelt, 1933
jasinlee (OP)
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


Its as easy as 0, 1, 1, 2, 3


View Profile
December 29, 2012, 05:55:18 PM
 #19

Not sure if this would fall under the miner software section, so going to put a copy of the question there also.

Where can I locate the function in one of the old miners source code to add interface to fpga processing? It would not really matter which one I guess.

BTC 1JASiNZxmAN1WBS4dmGEDoPpzN3GV7dnjX DVC 1CxxZzqcy7YEVXfCn5KvgRxjeWvPpniK3                     Earn Devcoins Devtome.com
Bogart
Legendary
*
Offline Offline

Activity: 966
Merit: 1000


View Profile
December 29, 2012, 08:06:46 PM
 #20

Looking at this thread, and also at the protocol discussion going on over on BFL forums, I sense the need for a single standard open protocol that can be used for all communication between host-side miner software, and external miner devices (FPGAs, ASICs, etc).

Once hashed out (pun intended), a standard set of libraries could be made and maintained that implemented the protocol in popular languages (C, Java, Python, Ruby, what-have-you), with proper unit tests and all.

There could even be a standards body formed, that would issue certifications of conformity to specific devices running specific firmwares, for those vendors who desired such a thing, and issue cute holographic stickers displaying the certified product's name and firmware hash.

https://forums.butterflylabs.com/announcements/597-bitforce-sc-communication-protocol-draft.html

If only someone who wasn't me would head up the effort...

"All safe deposit boxes in banks or financial institutions have been sealed... and may only be opened in the presence of an agent of the I.R.S." - President F.D. Roosevelt, 1933
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!