embeded/FPGA - ALTERA2018. 1. 23. 16:21

보안관련 내용을 뒤지다 보니.. xilinx 쪽도 좀더 찾아봐야겠다는 생각만 드네..

일단 모든 제품 군에서 보안기능이 제공되는 것은 아니고

Arria와 Stratix 제품군 그리고 Cyclone 3 LS 제품군에 대해서만 보안을 제공한다.

AES로 암호화 해서 비트스트림을 저장하는 방법인데.

내가 가진 DE0-nano의 cyclone IV E 는 지원하지 않는 것으로 보인다.


MAX 제품군이야 내부에 저장공간을 갖춘 녀석이니, Security Bit를 통해서 보안을 제공하는 것 같다.


Altera's FPGAs use the advanced encryption standard (AES) and a 128-bit or 256-bit key for configuration bitstream encryption.

[링크 : https://www.altera.com/products/general/devices/stratix-fpgas/about/security.html]


Cyclone III LS: Lowest power FPGA with security

[링크 : https://www.altera.com/products/fpga/cyclone-series/cyclone-iii/overview.html]


Stratix II Military Anti-Tampering Solution

Anti-Tampering with Configuration Bitstream Encryption

[링크 : https://www.altera.com/products/fpga/stratix-series/stratix-ii/stratix-ii/features/st2-security-anti-tamper.html]


Device Family: MAX II, MAX V, MAX 7000B, MAX 7000S

Which security bit option in the Quartus II software should be used to program the security bit in my Altera device?

[링크 : https://www.altera.com/support/support-resources/knowledge-base/solutions/rd07212010_295.html]



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

Quartus 2 Programmer Mode 조사  (0) 2018.01.23
quartus programmer Mode별 파일 확장자 지원 차이  (0) 2018.01.23
risc-v fpga  (0) 2018.01.20
RNG using fpga race condition  (0) 2018.01.20
여러개의 Nios 구동하기  (0) 2018.01.16
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 20. 23:41

risc-v 라는 오픈소스 프로세서 프로젝트가 있는데

그걸 altera와 xilinx용으로 포팅(?)한 HDL 및 툴체인


[링크 : https://www.alteraforum.com/forum/showthread.php?t=55227]

   [링크 : https://github.com/cliffordwolf/picorv32]

   [링크 : https://github.com/VectorBlox/orca]

Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 20. 08:31

FPGA 에서 <=와 =의 설명을 듣다 보니..

어? 이거 어떻게 튈지 모르는 애니까 랜덤으로 쓰면 좋겠네? 하고

검색해보니 2012년 정도에 나온 논문들이...

큭.... 아쉽다 ㅠㅠ


MD5와 결합해서 랜덤값을 한번더 꼬아주고 그걸 시드로 사용하면 어떨까 생각은 드네


[링크 : https://www.researchgate.net/...Software_Random_Number_Generation_Based_on_Race_Conditions]

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

ALTERA 비트스트림 암호화 관련 조사  (0) 2018.01.23
risc-v fpga  (0) 2018.01.20
여러개의 Nios 구동하기  (0) 2018.01.16
de0-nano-soc 와 de10-nano 비교  (0) 2018.01.16
아 몰라 fpga/bitcoin 포기  (0) 2018.01.12
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 16. 12:34

DE1-SoC 이긴 한데 LE가 충분하다면야 몇개 한번 생성해서 따라봐야겠다.


[링크 : https://www.youtube.com/watch?v=O54sJjSjq60]


+

Hardware Design Specifications

Board support

Altera Cyclone® III 3C120 FPGA development board

Nios II/f processor cores, debug-enabled, with 4-KB instruction cache and 2-KB data cache: 6

System timers: 6

On-chip RAM: 64 KB

JTAG UART peripherals: 6

Mutex peripherals: 5

System ID peripheral: 1 


Cyclone 3에 Nios2/f를 6개 박아 넣네.. 공부하기 좋은 예제일듯


[링크 : https://www.altera.com/.../embedded/nios-ii/exm-multi-nios2-hardware.html]

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

risc-v fpga  (0) 2018.01.20
RNG using fpga race condition  (0) 2018.01.20
de0-nano-soc 와 de10-nano 비교  (0) 2018.01.16
아 몰라 fpga/bitcoin 포기  (0) 2018.01.12
de0-nano + rpi2 채굴?  (0) 2018.01.10
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 16. 11:55

Cyclone V로 보다 보니 두개가 끌리네

약간의 트레이드 오프가 있는 모델

성능과 HDMI를 교환해야 함


DE0-Nano-SoC Kit/Atlas-SoC Kit

99$ / 90$

[링크 : http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&No=941]


DE10-Nano Kit

130$ / 99$

[링크 : http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&No=1046]



DE0-Nano-Soc

925MHz


DE10-Nano

800MHz + HDMI


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

RNG using fpga race condition  (0) 2018.01.20
여러개의 Nios 구동하기  (0) 2018.01.16
아 몰라 fpga/bitcoin 포기  (0) 2018.01.12
de0-nano + rpi2 채굴?  (0) 2018.01.10
DE0-Nano 핀헤더 관련  (0) 2018.01.10
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 12. 11:32

라즈베리랑 DE0-nano 연결해서 해보려고 했는데

넘어야 할 프로토콜의 산이 많아서 포기


stratus proxy 부터 supernova(testnet) 해보려고 했더니

머가 이리 안되는게 많아!!! ㅠㅠ


단순하게 데이터를 시리얼 4800bps로 던져주면 SHA-256 해시를 던져주는게 아니었나?


btc guild 2015년 이후로 사이트 폐쇄..

[링크 : https://bitcointalk.org/index.php?topic=49417.msg11628010#msg11628010]



일단 진정(?)하고 정리하면

1. 라즈베리 USB 전력으로는 DE0-nano 못켠다.

2. ttyAMA0는 offline이라고 뜨는데 통신이 된다.. (머지?)

3. btcguild는 폐쇄되었다.

4. supernova.cc는 어떻게 돌아가는지 모르겠다.

5. 만사 귀찮다 안하고 말지 -_-

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

여러개의 Nios 구동하기  (0) 2018.01.16
de0-nano-soc 와 de10-nano 비교  (0) 2018.01.16
de0-nano + rpi2 채굴?  (0) 2018.01.10
DE0-Nano 핀헤더 관련  (0) 2018.01.10
심심해서(?) 비트코인 FPGA 빌드  (2) 2018.01.09
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 10. 15:11

rpi2의 핀 아웃


DE0-nano의 핀아웃


DE0-Nano miner쪽 설정


라즈베리 8번 핀이 UART0-TX(회색) / 10번 핀이 UART0-RX(보라)

DE0-nano 2번 핀이 RX(회색), 4번 핀이 TX(보라)


1. Hashers22_serial 에서 qpf를 열어 합성하고 구으면 되고

2. serial_solo를 라즈베리에서 실행하면 되는 것 같은데

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


해봐야 알 듯..

그나저나 저거 하려고 비트코인 코어 설치하면 알아서(?) 통장을 생성하는거 같은데

이거 값을 이용하는건 또 어떻게 해야하나...


2018/01/10 - [embeded/FPGA] - DE0-Nano 핀헤더 관련

2017/03/25 - [embeded/raspberry pi] - 라즈베리 파이 포트 요약

2018/01/09 - [embeded/FPGA] - 심심해서(?) 비트코인 FPGA 빌드


+

목표로 하던 여러개의 인스턴스를 생성하여 2개나 3개 돌리는건 LE의 부족으로 무리인걸로 판명..

SHA256 부분을 최적화 해보는것도 방법일 거 같은데

이걸 하기에는 아직 실력 부족이고 -_ㅠ

Revision Name fpgaminer

Top-level Entity Name fpgaminer_top

Family Cyclone IV E

Device EP4CE22F17C6

Timing Models Final

Total logic elements 17,503 / 22,320 ( 78 % )

Total registers 11388

Total pins 19 / 154 ( 12 % )

Total virtual pins 0

Total memory bits 5,696 / 608,256 ( < 1 % )

Embedded Multiplier 9-bit elements 0 / 132 ( 0 % )

Total PLLs 1 / 4 ( 25 % )


채굴은 일단 무기한 연기...?


pc 클라이언트를 보니 단순하게  44바이트 보내고 160바이트 받는 구조인듯

[링크 : https://github.com/kramble/DE0-Nano-BitCoin-Miner/blob/master/serial_solo/mine.c#L716]

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

de0-nano-soc 와 de10-nano 비교  (0) 2018.01.16
아 몰라 fpga/bitcoin 포기  (0) 2018.01.12
DE0-Nano 핀헤더 관련  (0) 2018.01.10
심심해서(?) 비트코인 FPGA 빌드  (2) 2018.01.09
DE0-Nano와 이더넷 실드..  (0) 2018.01.04
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 10. 13:13

DE0_Nano_User_Manual.pdf 참조하여

FPGA GPIO랑 2.54 핀헤더랑 매핑된게 안보여서 일단 정리


+

de0-nano_pinout_rev1.0_180530.xlsx


de0-nano_pinout.xlsx



VSYS는 3.6~5.6V 사이

V3P3는 VSYS에서 LDO를 통해 3.3V를 생성한 녀석이다.


그러니까.. 

5V 쓸일 있으면 VSYS에

3.3V 쓸일 있으면 V3P3에 연결하면 된다.

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

아 몰라 fpga/bitcoin 포기  (0) 2018.01.12
de0-nano + rpi2 채굴?  (0) 2018.01.10
심심해서(?) 비트코인 FPGA 빌드  (2) 2018.01.09
DE0-Nano와 이더넷 실드..  (0) 2018.01.04
altera AS(Active Serial) / PS(Passive Serial) ?  (0) 2018.01.03
Posted by 구차니
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 구차니
embeded/FPGA - ALTERA2018. 1. 4. 21:33

크기가 안 맞네?

딱 한개 핀헤더 2.54mm 만큼 부족한 듯


DE0-Nano-Soc 모델은 아두이노 자체가 핀 헤더가 존재한다.

[링크 : http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&No=941]



+

2018.01.08


Posted by 구차니