yespower (MinGW32前提)と xilinx xdma(windowsのドライバ) を結合するためのメモ
1. ubuntu for windows の準備
(1) コントロールパネル - プログラムと機能 - Windows の機能の有効化または無効化
windows Sybsystem for Linux を入れる
(2) Microsoft Store から ubuntu を入れる
(3) ディレクトリ変更
/etc/passwd のユーザの ホームディレクトリを変更 /mnt/c/home/build とか
(4) パッケージ更新
apt update; apt upgrade
2. yespower の ビルド
README に書いてある通りに実行
Cross Compile for Windows 64bit, using Ubuntu
3. FPGAのXDMA 用DLLを準備
(1) MSVC 2015 で xilinx の xdma ソースをビルド
(2) xdma のドライバを呼び出すためのラッパ DLL 作成用プロジェクト追加
wrapper.def
LIBRARY WrapLib.dll
EXPORTS
init_xdma @1
exit_xdma @2
test_xdma @3
wrapper.h
#pragma once
extern "C" int __cdecl init_xdma();
extern "C" void __cdecl exit_xdma();
extern "C" void __cdecl test_xdma();
wrapper.cpp
simple_dma.c をほぼコピペ
(3) DLL プロジェクト修正
プロパティ キャラクタセットを Not Set
(4) buildしてコピー
完成した WrapLib.dll WrapLib.lib を cpuminer フォルダにコピー
4. yespower と結合
(1) makefile
LIBS = WrapLib.lib
(2) cpu-miner.c
__declspec(dllimport) int __cdecl init_xdma();
__declspec(dllimport) void __cdecl exit_xdma();
__declspec(dllimport) void __cdecl test_xdma();
以上