资源简介
应用于FPGA的挖矿代码,没记错应该是Altera公司de DE2板子。
代码片段和文件信息
#!/usr/bin/env python
# by teknohog
# Python wrapper for Xilinx Serial Miner
user = “teknohog.spartan“
password = “nexys2“
host = “api2.bitcoin.cz“
http_port = “8332“
serial_port = “/dev/ttyS0“
askrate = 5
###############################################################################
from jsonrpc import ServiceProxy
from time import ctime sleep time
from serial import Serial
from threading import Thread Event
from Queue import Queue
def stats(count starttime):
# 2**32 hashes per share (difficulty 1)
mhshare = 4294.967296
s = sum(count)
tdelta = time() - starttime
rate = s * mhshare / tdelta
# This is only a rough estimate of the true hash rate
# particularly when the number of events is low. However since
# the events follow a Poisson distribution we can estimate the
# standard deviation (sqrt(n) for n events). Thus we get some idea
# on how rough an estimate this is.
# s should always be positive when this function is called but
# checking for robustness anyway
if s > 0:
stddev = rate / s**0.5
else:
stddev = 0
return “[%i accepted %i failed %.2f +/- %.2f Mhash/s]“ % (count[0] count[1] rate stddev)
class Reader(Thread):
def __init__(self):
Thread.__init__(self)
self.daemon = True
# flush the input buffer
ser.read(1000)
def run(self):
while True:
nonce = ser.read(4)
if len(nonce) == 4:
# Keep this order because writer.block will be
# updated due to the golden event.
submitter = Submitter(writer.block nonce)
submitter.start()
golden.set()
class Writer(Thread):
def __init__(self):
Thread.__init__(self)
# Keep something sensible available while waiting for the
# first getwork
self.block = “0“ * 256
self.midstate = “0“ * 64
self.daemon = True
def run(self):
while True:
try:
work = bitcoin.getwork()
self.block = work[‘data‘]
self.midstate = work[‘midstate‘]
except:
print(“RPC getwork error“)
# In this case keep crunching with the old data. It will get
# stale at some point but it‘s better than doing nothing.
# Just a reminder of how Python slices work in reverse
#rdata = self.block.decode(‘hex‘)[::-1]
#rdata2 = rdata[32:64]
rdata2 = self.block.decode(‘hex‘)[95:63:-1]
rmid = self.midstate.decode(‘hex‘)[::-1]
payload = rmid + rdata2
ser.write(payload)
result = golden.wait(askrate)
if result:
golden.clear()
class Submitter(Thread):
def __init__(self block nonce):
Thread.__init__(self)
self.block = block
self.nonce =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 224 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\.gitignore
....... 815 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\boards\DE2_115\DE2_115.qsf
....... 832 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\boards\DE2_115\DE2_115.sdc
....... 25 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\boards\README.md
....... 1099 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\crc\crc32.v
....... 783 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\crc\crc32_tb.v
....... 63 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\crc\simulate.sh
....... 3766 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\cyclone_iv_pll\hashing_pll.v
....... 33 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\README.md
....... 117 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\unoptimized\README.md
....... 1666 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\unoptimized\sha-256-functions.v
....... 5140 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\unoptimized\sha256_transform.v
....... 4855 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\unoptimized_virtual_wire_top.v
....... 1856 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\cores\virtual_wire\virtual_wire.v
....... 35147 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\LICENSE.txt
....... 1292 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\3C120_uart_comm_Test\3C120_uart_comm_Test.qpf
....... 11773 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\3C120_uart_comm_Test\3C120_uart_comm_Test.qsf
....... 106 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\3C120_uart_comm_Test\constraints\3C120.sdc
....... 337 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\3C120_uart_comm_Test\hdl\3C120_uart_comm_Test.v
....... 16055 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\3C120_uart_comm_Test\hdl\main_pll.v
....... 77 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\3C120_uart_comm_Test\README.md
....... 83008 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\3C120_uart_comm_Test\stp1.stp
....... 14 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\3C120_uart_comm_Test\working\.gitignore
....... 1248 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\BeMicro\fpgaminer.qpf
....... 4606 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\BeMicro\fpgaminer.qsf
....... 797 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\BeMicro\fpgaminer.sdc
....... 235 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\BeMicro\README.md
....... 5034 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\BeMicro\src\fpgaminer_top.v
....... 1248 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\DE2_115_makomk_mod\fpgaminer.qpf
....... 4469 2013-07-17 23:10 Open-Source-FPGA-Bitcoin-Miner-master\projects\DE2_115_makomk_mod\fpgaminer.qsf
............此处省略859个文件信息
相关资源
- 基于FPGA的单周期处理器设计MIPS指令集
- 黑金AX7102开发板Verilog教程.pdf
- 最全的FPGA俄罗斯方块包含5个版本的完
- 基于xapp1052pcie工程s6BMD.rar
- 谐波电能计量算法及其FPGA实现_毕明科
- [fpga][ax301][verilog]彩灯显示控制
- 基于FPGA的均值滤波本人上传所有资源
- 数字信号处理的FPGA实现第4版书内代码
- Xilinx FPGA开发实用教程 第2版(完整版
- FPGA设计的实战演练 高级技巧篇.zip
- 米联的FPGA开发例程很详细
- 基于verilog的亮度jpeg压缩算法
- 米联客FPGA教程 Miz702.zip
- FPGA设计 基于团队的最佳实践
- CORDIC算法
- 双AD采集存储到SD卡
- 基于VHDL的FPGA和NiosII精炼--pdf 全
- FPGA 快速系统原型设计权威指南_1348
- Xilinx Zynq SoC与嵌入式Linux设计实战指南
- QuartusII时序约束方法
- 大西瓜FPGA开发板例程源码
- Xilinx FPGA应用进阶 通用IP核详解和设
- 基于FPGA的LED显示装置控制板的设计
- 《HELLO+FPGA》-+书籍合辑
-
FPGA Design: Best Practices for Team-ba
sed - 基于VHDL的FPGA和Nios+II精炼_.pdf
- FPGA使用DDR 显示PAL图像
- 基于FPGA的FIR数字滤波器的实现
- 基于FPGA的数据实时无损压缩系统设计
- AC620 FPGA开发板用户手册V1.6
评论
共有 条评论