embeded/FPGA - ALTERA2018. 1. 9. 10:03

소스를 다운 받고 압축을 풀고

[링크 : https://github.com/kramble/DE0-Nano-BitCoin-Miner]


de0-nano용이라고 하긴 했는데 다른 제품들도 추가된 듯

아무튼 EP4C 사용하니까 EP4CE10 폴더 가서 EP4CE10_miner.qpf 를 눌러 qurartus를 실행!


귀찮으니 그냥 합성 시작! 2분 50초에 완료!


메뉴의 Assignment - Assignment Editor가 있어서 눌러보니 Pin Planner 비슷하게 나오네?


먼가 많이 보여서 이름으로 정렬하니, 같은 핀에 대한 설정이 여러가지 였네..

Assignment - Pin Planner 를 실행하니.. 오히려 에디터보다 설정된 핀의 갯수가 줄었다?

아무튼 쓰는법은 나중에 좀 봐야 할 거 같고..


main_pll.v 에서 보니.. DE0-nano가 50MHz 클럭을 사용중이고

이걸 DIV/2 해서 쓰도록 설정 되어 있는 것으로 예상된다.(ALTPLL 아직 쓸줄 모름 ㅠㅠ)

defparam

// NB Uncomment BOTH divide, multiply and frequency settings according to osc speed

// Also change clock period in fpgaminer.sdc

// -------------------------------------------------------------------------------

// altpll_component.clk0_divide_by = 1, // 5 MHz osc

// altpll_component.clk0_divide_by = 1, // 10MHz osc

altpll_component.clk0_divide_by = 2, // 20MHz osc [IN USE]

altpll_component.clk0_duty_cycle = 50,

// altpll_component.clk0_multiply_by = `SPEED_MHZ * 2, // 5MHz osc

// altpll_component.clk0_multiply_by = `SPEED_MHZ, // 10MHz osc

altpll_component.clk0_multiply_by = `SPEED_MHZ, // 20MHz osc  [IN USE]

altpll_component.clk0_phase_shift = "0",

altpll_component.compensate_clock = "CLK0",

// NB inclk0_input_frequency is actually the clock PERIOD in picoseconds 

// altpll_component.inclk0_input_frequency = 200000, // 5 MHz osc

// altpll_component.inclk0_input_frequency = 100000, // 10 MHz osc

altpll_component.inclk0_input_frequency = 50000, // 20 MHz osc [IN USE]

altpll_component.intended_device_family = "Cyclone IV E", 


프로젝트 구성인데..

SHA256 계산하는데 거의 모든 능력치가 몰빵 되었네..

이 패널 보는 법을 좀 찾아 봐야겠네.. 로직셀이 여유가 있다면 이걸 여러개 생성해서

라즈베리 1대에 여러개의 시리얼 포트 구성하고 멀티코어(?)로 돌릴 수 있을 것 같으니..


git의 readme.txt 을 보면

아래꺼랑 내용을 합쳐보면.. 50Mhz / 디바이더(2) * SPEED_MHZ(14) 니까 350MHz로 작동하는건가?

으으으.. 공부할 게 넘쳐나네.. ㅠㅠ


문제는 1MHz당 10mA 전력 소비가 증가되고

40MHz로 돌린게 USB 전원으로 공급되는 500mA 제한 때문인지라 그 이상을 쓰려면

외부 전원을 공급 해주어야 한다. 그럼..3.5A * 5V = 17.5W 가 되는건가.. ㄷㄷ

(그러니까 잘 꽁수를 부려서 쿼드 코어를 구성해야... 40Mhz * 4 ㅋㅋㅋ)

그리고 80MHz 이상은 별도의 냉각이 필요하다고 한다.


처음 굽고 나서 켜면 halt 상태라 KEY0을 눌러서 켜줘야 한다고 한다. KEY1은 다시 죽임.

(근데 핀 플래너에 KEY0,KEY1에 대한 할당이 없었는데?


The PLL clock speed is set by the parameter (Verilog macro) SPEED_MHZ in units of 10MHz,

eg SPEED_MHZ=4 runs at 40MHz, which is the default setting. This gives 6.67MHash/s

throughput. This is the fastest that I recommend running an unmodified DE0-Nano. You may

clock faster at your own risk, but you should monitor the temperature of the the onboard

regulator chips as these will get VERY hot unless additional cooling is applied (eg fan

blown air). The fpga chip may also need cooling. BEWARE, you risk destroying your board

due to overheating if you increase SPEED_MHZ, and the actual speed in MHz is 10 times the

value set for SPEED_MHZ.


Current draw is approx 10mA per MHz (eg 40MHz will draw approx 400mA). Beware that a

typical USB port may only be able to supply 500mA so a 5.0 Volt external power supply

connected to the DE0-Nano white PSU header (JP4) is advised if overclocking. I have not

myself run this configuration any faster than 80MHz (SPEED_MHZ=8), and fan cooling was

essential.


After programming, the miner starts up in a halted state (it does NOT mine in this state)

Pressing the KEY0 pushbutton on the DE0-Nano board will start the miner (and reset the

nonce). Pressing KEY1 will halt it. This allows some control of power and thermal

management as the halted state draws considerably less current from the power supply.

This was of importance when extreme overclocking was applied to the Hashers22_serial

version as follows. 


SPEED_MHZ가 값으로 주어진다는데 한참을 찾았네 -_-

파일로 검색하니 qsf 확장자에서 설정되어 있어서, 프로젝트 설정을 찾아 보니

Compiler Setting의 Verilog HDL input에

Existing Verilog HDL macro settings:에 존재한다.


[링크 : https://www.rs-online.com/designspark/bitcoin-mining-with-a-raspberry-pi-and-de0-nano]

2017/12/29 - [embeded/FPGA] - de0-nano + rpi = 채굴머신..



+

DE2-115와 같은 패밀리의 DE-Nano는 생각외로 저조하네..

어떤 설정인지 모르겠으나.. 머 Cyclone IV가 그리 고성능은 아니니까..


[링크 : https://en.bitcoin.it/wiki/Mining_hardware_comparison]

    [링크 : http://bitpeople.kr/bbs/board.php?bo_table=Mining&wr_id=6]


DE2-115도 클럭 이빠이~ 끌어 올려서 80MH/s 도달한거 같은데

40Mhz로 작동하면 16.78MH/s 라고 하니 200MHz로 작동시킨 듯?

(그러니까 쿼드로 작동시키고 라즈베리에 시리얼 여러개 달고 전원 뻥튀기 하면...)

You will then be prompted to select a SOF to program, best to start with DE0_Nano_serial-40MHz.sof

Programming should only take a second or two. The blinkenlights demo should now change to a simple binary

count. This is the top byte of the nonce and gives a good indication of the hash speed (its 2^32 divided

by the time in seconds for a complete cycle, or roughly one increment per second translates to 16.78MH/s). 


GTX1050이 동났던걸로 기억하면 GTX1080이 AntMiner의 절반에 근접한다고 해도

여러가지 면에서 GPU 채굴의 효율이 높지는 않은데..

AntMiner가 1000W 이상을 쳐먹쳐먹 하는 입장에서 보면.. 무시무시 하네..

[링크 : http://jse.or.kr/AJMAHS/papers/v7n5/76.pdf]


다만.. 단순 산술로 해보면

GTX1080 기준 160W max 정도 소비하고

[링크 : http://www.hwbattle.com/chart/chart_vgapw.php]


12.5TH(=12500 GH)를 1200W에 처리하는 AntMiner S9를 기준으로 계산해보면

7.5개 분량의 전력을 소비하고

GTX1080이 4500MH니까 4.5GH/s 이고 7개 하면 31.5GH/s

403배 ASIC 쪽이 우월한 성능을 낸다.. ㄷㄷ

[링크 : https://shop.bitmain.com/specifications.htm?name=antminer_s9_asic_bitcoin_miner]

[링크 : https://shop.bitmain.com/productDetail.htm?pid=0002018010817075487815N912ME05E5]


아무튼... 내가 가진 염가형 FPGA로는 GTX 700 시리즈에는 비벼볼만 하나

GTX 900 시리즈에 발리기 시작하고, 소비전력 대비로든 딱히 ASIC이 나온 시점에서는 장점이 없다.

물론.. 돈 버는게 목적이 아니라 시스템 구축하고 Verilog 공부하는 목적으로는 해볼만 할거 같은데

한번.. 돌려는 봐야겠다



목표는..

로직이 허용하는 한도 내에서 최대한의 모듈을 생성하고 RX를 할당해서 멀티 코어 구성하고

라즈베리에서 USB 시리얼등을 이용해서 다 채널로 구성해서 돌려보는 걸로...?



+

코드를 보는데..

EP4CE22F17C6 가 DE0-Nano 껀데.. 이걸로 설정된 녀석이

Hashers22

Hashers22_serial

Makomk_Hashers_32_Serial

이 세녀석이다. 다시 봐야하나?


+

2018.01.10

Hashers22_serial 이 폴더에 있는 소스가 DE0-Nano에 가장 적절한 녀석으로 보인다.

'embeded > FPGA - ALTERA' 카테고리의 다른 글

de0-nano + rpi2 채굴?  (0) 2018.01.10
DE0-Nano 핀헤더 관련  (0) 2018.01.10
DE0-Nano와 이더넷 실드..  (0) 2018.01.04
altera AS(Active Serial) / PS(Passive Serial) ?  (0) 2018.01.03
fpga를 이용한 VGA(D-SUB 15pin) 출력  (0) 2018.01.03
Posted by 구차니