embeded/FPGA - ALTERA2018. 1. 25. 22:42

My_First_NiosII_Qsys.pdf

인데 이름이 바뀌었으니 다른 걸로 ㅋㅋ


Tools - Platform Designer 실행


그럼 아래와 같은 화면이 뜨는데 먼지.. 모르겠다 -ㅁ-


추가할게 nois 2 니까 좌측의 IP catalog 에서 검색을 하거나

Processors and Peripherals - Embedded Processors - Nios II Processor를 선택


설정 마법사 비스므리한게 뜨는데 귀찮으니 Finish! 

(아니 설명서에 그렇게 써있다고...)


먼가 에러 뿜뿜하는데 일단 무시하고 우클릭 rename으로 이름을 바꾸어 보고


핀을 어따 꽂아야 할지 모르겠지만 아무튼 JTAG을 연결하라네?

Interface Protocols - Serial - JTAG UART 를 골라서 추가!


먼진 모르겠다 ㅋㅋ 경고 하나 뜨는데 일단 무시하고 Finish!


으으 에러 뿜뿜


무시하고 지나갔는데 선을 점을 찍으면 선이 연결된다고 써있네?

아무튼 회로에서 점을 찍으면 연결된다. clk 끼리 연결해주면 일단 장치가 작동되도록 연결되고

에러나 경고가 하나씩 숑숑 사라진다.

11. Connect the clk and clk_reset as shown in Figure 1-20. (clicking the hollow dots on the
connection line. The dots become solid indicatingthe ports are connected.)
 


에러가 안사라져서 보니.. I-Cache / D-Cache 나오길래

오른쪽의 Hierachy 에서 내가 생성했던 nios 2를 우클릭해서 Edit를 눌러 처음에 추가할때 뜨던

설치 마법사(?)를 띄운다음에 하나하나 보니..

"Caches and Memory Interfaces" 에 Instruction Cache가 4K Data Cache가 2K 로 설정이 되어있어서 그런건가 보네

(귀찮으면 nios 2/e로 설정! 캐쉬가 없어서 성능도 하락! LE도 조금 쓴다!)


연산자 가속 관련인데.. 그래도 하드웨어 multiplier는 존재해서 1클럭에 끝난다.

이것저것 설정하면 다른 명령어들도 빠르게 가능하지만.. multiplier가 divider랑 같은 하드웨어 로직 쓰는게 아니었나?


On-Chip Memory (RAM or ROM)을 추가하라는데 위치가 바뀌었다.

Basic Fuctions - On Chip Memory - On-Chip Memory (RAM or ROM)


졸리고 잘 시간이라 일단 여기 까지 하고 Finish!


+

2018.01.26

하라는대로 이것저것 다 추가하는데 overlap 어쩌구 에러가 뿜뿜!


System - Assign Base Addresses 를 실행하면


장치들의 중복되었던 MMIO들이 정리 되면서 에러 해결!


+

2018.01.26


위에서 unsaved.qsys로 저장을 하면 모듈 이름은 파일 이름으로 생성된다.

qpf가 있던 곳에 파일명 폴더가 생기고(unsaved로 했으니 폴더도 unsaved)

그 아래의 synthesis 폴더에 qip 확장자를 프로젝트에 추가해주면 해당 모듈을 사용할 수 있게 된다.


그런데...

export 상에 변수들이 생성되는데 이거랑 영 다른 이름으로 생성이 된다.. 원인은 좀 나중에 찾아보고..

그리고 기본으로 눌러서 생성하면 reset의 export가 비어있게 되니

필요하다면 더블클릭해서 reset으로 생성하게 해주어야 한다.


아무튼 생성된 파일을 보면 이렇게 세개의 외부 입력이 존재하게 되고

module unsaved (

input  wire       clk_clk,                          //                       clk.clk

output wire [7:0] pio_0_external_connection_export, // pio_0_external_connection.export

input  wire       reset_reset_n                     //                     reset.reset_n

);


메인 코드에 이렇게 넣어 주면 생성이 되어야 하는데..

//=======================================================

//  Structural coding

//=======================================================

unsaved nios2_inst(.clk_clk (CLOCK_50), .pio_0_external_connection_export(LED), .reset_reset_n(1'b1)); 


멀 잘못했나 제대로 컴파일이 안되네 ㅠㅠ

음.. 메시지를 잘 보니. 웬지.. 64KB RAM 생성해서 그런 듯.. 그래서 예제에서 32KB로 생성했나 보다.

Error (170040): Can't place all RAM cells in design

Info (170034): Selected device has 66 memory locations of type M9K. The current design requires 69 memory locations of type M9K to successfully fit.

Info (170033): Memory usage required for the design in the current device: 105% M9K memory block locations required

Info (170190): Fitter placement preparation operations ending: elapsed time is 00:00:00

Info (11888): Total time spent on timing analysis during the Fitter is 0.04 seconds.

Error (171000): Can't fit design in device


아무튼 플랫폼 빌더를 통해서 Nios II 코어 생성까지는 완료!

이제 eclipse를 통해서 여기 들어갈 프로그램 작성하는 것과 jic 파일에 통합하는 것

그리고 다른 예제로 보이던 아두이노 처럼 쓰는 방법까지 해보면 될 듯!


먼가 쓸데없이 간지나는(?) Chip Planner 사진으로 Chapter 1 끝!



+

여러개 생성을 해보려는데 처음에는 LED가 복수로 사용될 수 없다고 해서 삭제하고

다시 빌드해보니

unsaved nios2_inst0(.clk_clk (CLOCK_50), .pio_0_external_connection_export(LED), .reset_reset_n(1'b1));

unsaved nios2_inst1(.clk_clk (CLOCK_50), .reset_reset_n(1'b1));

unsaved nios2_inst2(.clk_clk (CLOCK_50), .reset_reset_n(1'b1));

unsaved nios2_inst3(.clk_clk (CLOCK_50), .reset_reset_n(1'b1)); 


아까랑 비슷하면서도 먼가 다른 에러가 뜬다.

웬지.. 32K가 한계라서 4개 생성해보려면.. 8K로 더 줄여야 하려나?

그리고.. RAM은 말그대로 FPGA 내부에 있는 HW IP로 구성된 SRAM을 사용하나보네..

Error (170048): Selected device has 66 RAM location(s) of type M9K.  However, the current design needs more than 66 to successfully fit

Info (170057): List of RAM cells constrained to M9K locations

Info (170190): Fitter placement preparation operations ending: elapsed time is 00:00:00

Info (11888): Total time spent on timing analysis during the Fitter is 0.17 seconds.

Error (171000): Can't fit design in device


The embedded memory structure consists of columns of M9K memory blocks that you can configure to provide various memory functions, such as RAM, shift registers, ROM, and FIFO buffers.

[링크 : https://www.altera.com/en_US/pdfs/literature/hb/cyclone-iv/cyiv-51003.pdf]

Posted by 구차니
Programming/Verilog2018. 1. 25. 22:02

module에 변수(?) 선언하는 방법으로 두가지가 존재한다.

하나는 C언어 함수 처럼, 방향과 변수명을 지정해주는 것이고

다른 하나는 모듈에 사용할 핀 이름만 선언하고 방향을 지정해주는 것이다.


개인적으로는 C 스타일의 모듈 변수 선언에 방향을 넣는게 나을 것으로 보인다.


module DE0_NANO(

input CLOCK_50

);

endmodule


module DE0_NANO(

CLOCK_50

);

input           CLOCK_50;

endmodule


'Programming > Verilog' 카테고리의 다른 글

encrypted Verilog  (0) 2018.02.03
verilog module instantiate  (0) 2018.01.26
verilog 모델링 유형  (0) 2018.01.20
verilog Concatenation, Replication operator  (0) 2018.01.19
verilog unary reduction operator와 bitwise operator  (0) 2018.01.19
Posted by 구차니
개소리 왈왈/블로그2018. 1. 24. 19:04

이상하게 비공개가 자꾸 풀리는 듯한 문제가 있어서 문의했는데

일단.. 이런 경우가 가능하다고 하니 조금은 더 지켜 봐야 할 듯.


참고로 카테고리를 특정 주제로 발행하도록 연결해둔 경우 

연결된 카테고리를 선택하면 주제가 선택되면서 공개 상태로 전환되는 점 알려 드립니다. 



근데 일단 비공개로 쓰여지고 수정하면 바뀌어 버리는거라

조금은 더 주의깊게 봐야겠네..

'개소리 왈왈 > 블로그' 카테고리의 다른 글

어? 티스토리 이상하다?  (0) 2018.02.08
구글 애널리틱스 - 유입 키워드  (0) 2018.02.06
네이버 기부  (0) 2018.01.22
티스토리 희한한 버그 발견  (0) 2018.01.14
블로그 무슨일 났나 -ㅁ-?  (0) 2018.01.06
Posted by 구차니
Microsoft/Office2018. 1. 24. 13:29

ctrl-alt-v


단축키 드럽다...

근데 우클릭 - 선택하여 붙여넣기 보다는 조금 편하긴 한데

미묘한 수준이라 이거 참...


[링크 : https://support.office.com/ko-kr/article/선택하여-붙여넣기-옵션의-바로-가기-키...c]

Posted by 구차니

제목만 보고 중국인가.. 생각했는데 실제로도 중국...

역시 대륙의 기상.. ㄷㄷㄷ



근데 배터리 물면 LG던 파나소닉이던 산요던 다 터지는건 같은데 무슨 개소리인지..

[링크 : http://v.media.daum.net/v/20180124075901378]

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

사회의 패러다임이 변한건가?  (0) 2018.02.07
신용카드 어렵다..  (0) 2018.01.31
피곤타  (0) 2018.01.17
요즘 회사일..  (0) 2018.01.14
올해의 할 일 목록..  (0) 2018.01.14
Posted by 구차니
개소리 왈왈/독서2018. 1. 23. 16:50

애 키우는게 이렇게 힘드니 힘냅시다 토닥토닥 이라는 포근한 느낌의 책

솔찍히 몇권은 빌려다가 난 나쁜 아빠인가

결국은 군비(?)경쟁이 답인거냐? 라는 생각에 읽다가 반납한 육아책들도 있는데


일단 원칙은..

아이가 자라는 만큼 엄마 아빠도 변해서 따라가자 였지만

현실은 등짝 자진모리 장단으로 후드리찹찹 -_ㅠ


그래서 이 책이 더 포근하게 느껴진것 같다.


[링크 : http://www.kyobobook.co.kr/product/detailViewKor.laf?barcode=9791159875939]

Posted by 구차니
embeded/FPGA - XILINX2018. 1. 23. 16:49

artix는 지원하나 모르겠네..



Virtex-6 and 7-Series devices support the use of both HMAC and AES keys. 

Spartan devices only have the AES key option. 

[링크 : https://www.xilinx.com/support/answers/52881.html]

[링크 : https://www.xilinx.com/support/documentation/application_notes/xapp1239-fpga-bitstream-encryption.pdf]


7 시리즈는 모두 지원을 하는 것으로 근래 변경된 듯?

The original plan was the smaller Artix would not have the AES/HMAC and XADC blocks.

This was changed pretty recently - now all 7 series devices will be uniform in the support of these features. 

[링크 : https://forums.xilinx.com/t5/7-Series-FPGAs/AES-encryption-in-Artix-7/td-p/156150]


표에 의하면 Spartan-7중 XC7S6 XC7S15는 제외 나머지 전 모델은 AES/HMAC을 지원하는 것으로 보인다.

[링크 : https://www.xilinx.com/support/documentation/selection-guides/7-series-product-selection-guide.pdf]


Encryption, Readback, and Partial Reconfiguration

In all 7 series FPGAs (except XC7S6 and XC7S15), the FPGA bitstream, which contains sensitive customer IP, can be protected with 256-bit AES encryption and HMAC/SHA-256 authentication to prevent unauthorized copying of the design. The FPGA performs decryption on the fly during configuration using an internally stored 256-bit key. This key can reside in battery-backed RAM or in nonvolatile eFUSE bits. Most configuration data can be read back without affecting the system's operation. Typically, configuration is an all-or-nothing operation, but Xilinx 7 series FPGAs support partial reconfiguration. This is an extremely powerful and flexible feature that allows the user to change portions of the FPGA while other portions remain static. Users can time-slice these portions to fit more IP into smaller devices, saving cost and power. Where applicable in certain designs, partial reconfiguration can greatly improve the versatility of the FPGA. 

[링크 : https://www.xilinx.com/support/documentation/data_sheets/ds180_7Series_Overview.pdf]

Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 23. 16:45

DE0-Nano-SoC는 Cyclone V라 HPS 떄문에 조금 다른거 같은데

아무튼 기본적으로는 AS 모드로 굽게 되어 있는 것 같다.


[링크 : https://www.terasic.com.tw/attachment/archive/941/DE0-Nano-SoC_User_manual.pdf]


USB Blaster의 설명서

In-Socket Programming은 미지원이고

PS 모드는 MAX 시리즈를 달아서 얘가 플래시를 제어하는 것 같고

AS 모드는 EPCS 쪽에는 되는 것 같네

[링크 : https://www.terasic.com.tw/cgi-bin/page/archive_download.pl?...FID=2f5906c1ffce76384d6564a1c75b959c]

2018/01/03 - [embeded/FPGA] - altera AS(Active Serial) / PS(Passive Serial) ?


+

간단하게 요약하면.. PS는 FPGA가 플래시에 클럭을 제공하지 않고 외부에 의해서 제공되고

AS는 FPGA가 플래시에 클럭을 제공하여 스스로를 설정한다는 차이.

JTAG이나 PS/FPP 등은 당연히(!) 외부 클럭에 의해서 플래시에 클럭을 제공할 것으로 보인다.



FPP 약어는 Fast Passive Parallel... AS/PS/AP/PP 구분으로 일단 보면 편할 듯

For Cyclone IV GX devices to meet the PCIe 100 ms wake-up time requirement, you must use passive serial (PS) configuration mode for the EP4CGX15/22/30 devices and use fast passive parallel (FPP) configuration mode for the EP4CGX30F484 and EP4CGX50/75/110/150 devices.

[링크 : https://www.altera.com/en_US/pdfs/literature/hb/cyclone-iv/cyiv-51001.pdf] 10p


AS Configuration (Serial Configuration Devices)

In the AS configuration scheme, Cyclone IV devices are configured with a serial configuration device. These configuration devices are low-cost devices with non-volatile memories that feature a simple four-pin interface and a small form factor. These features make serial configuration devices the ideal low-cost configuration solution.


PS Configuration

You can perform PS configuration on Cyclone IV devices with an external intelligent host, such as a MAX® II device, microprocessor with flash memory, or a download cable. In the PS scheme, an external host controls the configuration. Configuration data is clocked into the target Cyclone IV device through DATA[0] at each rising edge of DCLK.

Cyclone IV devices do not support enhanced configuration devices for PS configuration

[링크 : https://www.altera.com/en_US/pdfs/literature/hb/cyclone-iv/cyiv-51008.pdf]


configuration 관련 clock 등을 누가 만들어 주느냐에 따라 FPGA 기준으로해서 active & passive 로 나뉩니다

AS(Active Serial) 의 경우 FPGA 가 clock 및 address 를 내보내서 EPCS ROM 에 있는 이미지를 configuration 하게 됩니다

FPGA 가 active 하게 동작하는 경우입니다

PS(Passive Serial) 의 경우 FPGA 는 가만히 있고 외부 cpu 등이 flash 등에 저장된 이미지를 가지고 coniguration 하게됩니다

FPGA 가 passive 하게 동작하는 경우입니다

JTAG 은 sof 이미지 등을 direct 로 FPGA 에 프로그래밍 할때 사용합니다

다운로드 속도가 빠르기 때문에 보통 개발시에 많이 사용됩니다

[출처] AS . PS. FPP. jtag 동작원리와 차이점 (Altera Town) |작성자 kmky

[링크 : http://cafe.naver.com/alteratown/3523]

[링크 : http://cafe.naver.com/alteratown/5785]

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

nios2 /e /f 별 설정  (0) 2018.01.25
my first Nios II with DE0-nano  (0) 2018.01.25
quartus programmer Mode별 파일 확장자 지원 차이  (0) 2018.01.23
ALTERA 비트스트림 암호화 관련 조사  (0) 2018.01.23
risc-v fpga  (0) 2018.01.20
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 23. 16:32

프로그래머에서 모드별로 설정가능한 파일이 달라지네..


그나저나.. jtag에 ekp가 있다.. 

이 암호화된 녀석은 어떻게 생성하지 -ㅁ-?

JTAG


In-Socket Programming


Passive Serial

Active Serial Programming

AS 에서만 POF가 지원된다.



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

my first Nios II with DE0-nano  (0) 2018.01.25
Quartus 2 Programmer Mode 조사  (0) 2018.01.23
ALTERA 비트스트림 암호화 관련 조사  (0) 2018.01.23
risc-v fpga  (0) 2018.01.20
RNG using fpga race condition  (0) 2018.01.20
Posted by 구차니
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 구차니