Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
New driver: BTCFPGA ModMiner
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Jun 12, 2012
1 parent d3fa59d commit 76f96f4
Show file tree
Hide file tree
Showing 8 changed files with 583 additions and 7 deletions.
6 changes: 6 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ if HAS_ICARUS
cgminer_SOURCES += driver-icarus.c
endif

if HAS_MODMINER
cgminer_SOURCES += driver-modminer.c
bitstreamsdir = $(bindir)/bitstreams
dist_bitstreams_DATA = bitstreams/*
endif

if HAS_ZTEX
cgminer_SOURCES += driver-ztex.c libztex.c libztex.h
bitstreamsdir = $(bindir)/bitstreams
Expand Down
23 changes: 23 additions & 0 deletions bitstreams/COPYING_fpgaminer
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
All the bitstream files included in this directory that follow the name pattern fpgaminer_*.ncd are:

----

Copyright (c) 2011-2012 fpgaminer@bitcoin-mining.com

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

----

You can find the original sources at the Open Source FPGA Bitcoin Miner project GitHub repository:
https://github.com/progranism/Open-Source-FPGA-Bitcoin-Miner/tree/master/projects/X6000_ztex_comm4/hdl
File renamed without changes.
Binary file added bitstreams/fpgaminer_top_fixed7_197MHz.ncd
Binary file not shown.
19 changes: 17 additions & 2 deletions cgminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,12 @@ static void load_temp_cutoffs()
devices[device]->cutofftemp = val;
}
}
else
val = opt_cutofftemp;
else {
for (i = device; i < total_devices; ++i)
if (!devices[i]->cutofftemp)
devices[i]->cutofftemp = opt_cutofftemp;
return;
}
if (device <= 1) {
for (i = device; i < total_devices; ++i)
devices[i]->cutofftemp = val;
Expand Down Expand Up @@ -1137,6 +1141,9 @@ static char *opt_verusage_and_exit(const char *extra)
#ifdef USE_ICARUS
"icarus "
#endif
#ifdef USE_MODMINER
"modminer "
#endif
#ifdef USE_ZTEX
"ztex "
#endif
Expand Down Expand Up @@ -4730,6 +4737,10 @@ extern struct device_api bitforce_api;
extern struct device_api icarus_api;
#endif

#ifdef USE_MODMINER
extern struct device_api modminer_api;
#endif

#ifdef USE_ZTEX
extern struct device_api ztex_api;
#endif
Expand Down Expand Up @@ -4972,6 +4983,10 @@ int main(int argc, char *argv[])
bitforce_api.api_detect();
#endif

#ifdef USE_MODMINER
modminer_api.api_detect();
#endif

#ifdef USE_ZTEX
ztex_api.api_detect();
#endif
Expand Down
27 changes: 22 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,17 @@ if test "x$icarus" = xyes; then
fi
AM_CONDITIONAL([HAS_ICARUS], [test x$icarus = xyes])

modminer="no"

AC_ARG_ENABLE([modminer],
[AC_HELP_STRING([--enable-modminer],[Compile support for ModMiner FPGAs(default disabled)])],
[modminer=$enableval]
)
if test "x$modminer" = xyes; then
AC_DEFINE([USE_MODMINER], [1], [Defined to 1 if ModMiner support is wanted])
fi
AM_CONDITIONAL([HAS_MODMINER], [test x$modminer = xyes])

ztex="no"

AC_ARG_ENABLE([ztex],
Expand Down Expand Up @@ -245,7 +256,7 @@ else
fi


AM_CONDITIONAL([NEED_FPGAUTILS], [test x$icarus$bitforce$ztex != xnonono])
AM_CONDITIONAL([NEED_FPGAUTILS], [test x$icarus$bitforce$modminer$ztex != xnononono])
AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
AM_CONDITIONAL([WANT_JANSSON], [test x$request_jansson = xtrue])
AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
Expand Down Expand Up @@ -294,7 +305,7 @@ fi

AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])

if test "x$bitforce" != xno; then
if test "x$bitforce$modminer" != xnono; then
AC_ARG_WITH([libudev], [AC_HELP_STRING([--without-libudev], [Autodetect FPGAs using libudev (default enabled)])],
[libudev=$withval],
[libudev=auto]
Expand Down Expand Up @@ -416,13 +427,13 @@ if test "x$opencl" != xno; then
echo " OpenCL...............: FOUND. GPU mining support enabled"
else
echo " OpenCL...............: NOT FOUND. GPU mining support DISABLED"
if test "x$cpumining$bitforce$icarus$ztex" = xnononono; then
if test "x$cpumining$bitforce$icarus$ztex$modminer" = xnonononono; then
AC_MSG_ERROR([No mining configured in])
fi
fi
else
echo " OpenCL...............: Detection overrided. GPU mining support DISABLED"
if test "x$cpumining$bitforce$icarus$ztex" = xnononono; then
if test "x$cpumining$bitforce$icarus$ztex$modminer" = xnonononono; then
AC_MSG_ERROR([No mining configured in])
fi
fi
Expand Down Expand Up @@ -450,13 +461,19 @@ else
echo " Icarus.FPGAs.........: Disabled"
fi

if test "x$modminer" = xyes; then
echo " ModMiner.FPGAs.......: Enabled"
else
echo " ModMiner.FPGAs.......: Disabled"
fi

if test "x$ztex" = xyes; then
echo " Ztex.FPGAs...........: Enabled"
else
echo " Ztex.FPGAs...........: Disabled"
fi

if test "x$bitforce" != xno; then
if test "x$bitforce$modminer" != xnono; then
echo " libudev.detection....: $libudev"
fi

Expand Down
Loading

0 comments on commit 76f96f4

Please sign in to comment.