embeded/openRISC2018. 1. 29. 18:31

'embeded > openRISC' 카테고리의 다른 글

or32 컴파일러.. 삽질  (0) 2015.12.14
openRISC OR1k(1000) OR1200  (0) 2015.12.11
openrisc 어셈블리  (0) 2015.12.10
openRISC chaintool  (0) 2015.11.27
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 29. 14:09

일단 필요로 하는 녀석은 아래 경로에 존재하는데

path가 설정안되어 있으면 에러가 날테니 적당히~ 사용

C:\intelFPGA_lite\17.1\nios2eds\bin

C:\intelFPGA_lite\17.1\nios2eds\bin\gnu\H-x86_64-mingw32\bin 


D:\>C:\intelFPGA_lite\17.1\nios2eds\bin\elf2flash.exe --input=hello_world_0.elf --output=swimage.flash --epcs

D:\>dir

2018-01-27  오후 01:19               946 hello_world.c

2018-01-27  오후 01:20           319,239 hello_world_0.elf

2018-01-27  오후 01:20            86,021 hello_world_0.map

2018-01-29  오후 01:53            11,824 swimage.flash


D:\>C:\intelFPGA_lite\17.1\nios2eds\bin\gnu\H-x86_64-mingw32\bin\nios2-elf-objcopy.exe -I srec -O ihex swimage.flash  swimage.hex

D:\>dir

2018-01-27  오후 01:19               946 hello_world.c

2018-01-27  오후 01:20           319,239 hello_world_0.elf

2018-01-27  오후 01:20            86,021 hello_world_0.map

2018-01-29  오후 01:53            11,824 swimage.flash

2018-01-29  오후 01:57            13,272 swimage.hex 


도대체 무슨 마법이냐.. 312KB 짜리가 12KB가 되다니.. -_-?

ELF에 이것저것 디버그 정보도 들어가서 커졌을수는 있지만 이해할수 없는 용량 감소네..

아무튼 위는 flash 파일 아래는 hex 파일 내용이다.

flash는 intel HEX 포맷이랑 비슷한거 같네.. 아무튼 덕분에(?) flash에서 hex로의 변환에서

용량 차이는 크게 나타나지 않는다.

S00600002D454C3B

S325000000007C0F00000000010074004000140840083A6800080000000000000000000000008C

S3250000002000000000000000007400C0061400E0DE74008006148CA4D67400800014498510B4

S325000000407400C000144DC5182603C010150000100401801036FDFF10C0251000C03310003B

:100000007C0F00000000010074004000140840084C

:100010003A68000800000000000000000000000036

:1000200000000000000000007400C0061400E0DEC4

:1000300074008006148CA4D67400800014498510C6


아무튼 변경후에는...  SOF 추가하고

HEX도 추가했는데 시작주소가 auto라니 찜찜(?) 해서


Properties 에서 시작주소를 0x0 으로 해주니 정상대로 나온다.


췟.. 플래시 로더 안 넣었다고 못 만드네 아무튼 넣고 만드니 8MB 자리 jic 통~


구워는봤는데 안되네..

귀찮아서.. (!) Nios II 이미지인 sof를 그냥 jic에 넣어서 그런가.. 똑같이 hex로 변환해서 넣어야 하나?


sof는 jic로 변환한 내용 처음에 0xff로 시작한다.

합친건데.. 이미지 순서가 아마 반대로 들어온 듯 하다..


프로그램이 앞에 들어가있고 그 이후에 sof 내용이 들어있다.

(쭈욱 내려보면 sof파일의 내용이 시작하는 부분이 보인다)



---

sof2flash --input=<hwimage>.sof --output=hwimage.flash --epcs --verbose

elf2flash --input=<elf file>.elf --output=swimage.flash --epcs --after=hwimage.flash --verbose


nios2-elf-objcopy -I srec -O ihex hwimage.flash  hwimage.hex

nios2-elf-objcopy -I srec -O ihex swimage.flash  swimage.hex 

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

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

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

altera Nios II, epcs controller  (0) 2018.01.29
Nios II / Nios II Classic 차이점  (0) 2018.01.29
Nios II 이미지 합치기 (조사)  (0) 2018.01.27
Nios II 프로그램 빌드..  (0) 2018.01.27
Nios II 명령어 관련 조사  (0) 2018.01.26
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 27. 22:36

elf로 뱉어 내는거 같은데

일단.. Add Hex 하면서 Relative로 0x00 이 기본인거 같긴한데

map 파일에서 Page_0의 시작 주소를 확인하라고 되어있네


The method used to create a .jic file with a Nios® II hardware and software image is as follows.

1. Create a flash file from a .sof file: sof2flash --input=<hwimage>.sof --output=hwimage.flash --epcs --verbose

2. Create a flash file from a ,elf file: elf2flash --input=<elf file>.elf --output=swimage.flash --epcs --after=hwimage.flash --verbose

3. Convert the .flash image into a.hex file: nios2-elf-objcopy --input-target srec --output-target ihex mysw.flash mysw.hex

4. In the Quartus® II software, open File > Convert Programming Files > Set the programming file as JTAG Indirect Configuration File (.jic).


6. Select the correct size EPCS device in the Configuration pull-down

7. Name your output .jic file

8. Click Flash Loader below, and select Add Device on the right hand side

9. Select your FPGA device from the list

10. Click SOF Data, and select Add File, and select your .sof file

11. Click Add Hex data, select Relative addressing, and select your .hex file created above

12. Now push generate. You should verify that the generated .map file has Page_0 at a start address of 0x0, and the hex file at a start address 1 after the end address of Page_0

13. Now in the Quartus II Programmer, select Add File and select your .jic file. Check the Program box next to the .jic file, and push Start 

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


The method used to create a .jic file with a Nios® II hardware and software image is as follows.

1.      Create a flash file for the hardware and software image
sof2flash --input=<hwimage>.sof --output=hwimage.flash --epcs --verbose
elf2flash --input=<elf file>.elf --output=swimage.flash --epcs --after=hwimage.flash --verbose

Note: When creating the software flash image, there is no need to add a boot srec (this is located in the EPCS Controller), the --after option ensures the software image starts immediately after the hardware image.

2.      Convert the flash images into Hex files

nios2-elf-objcopy -I srec -O ihex hwimage.flash  hwimage.hex
nios2-elf-objcopy -I srec -O ihex swimage.flash  swimage.hex

3.      When creating your jic file using Quartus® II Convert Programming File tool, add the Flash Loader and both hex files with absolute addressing option selected.

Note: You do not need to add the .sof file to the jic image.  This is because you created a hardware hex image.  Using the hardware hex image ensures the software hex image is at the proper offset in the EPCS. 

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


+

[링크 : https://www.altera.com/en_US/pdfs/literature/ug/ug_nios2_flash_programmer.pdf]

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

Nios II / Nios II Classic 차이점  (0) 2018.01.29
elf2flash와 nios2-elf-objcopy 사용하기  (0) 2018.01.29
Nios II 프로그램 빌드..  (0) 2018.01.27
Nios II 명령어 관련 조사  (0) 2018.01.26
nios2 /e /f 별 설정  (0) 2018.01.25
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 27. 12:48

먼가 반갑도고 징글징글 한 eclipse mars.2?

아무튼 얘가 Nios II 용 프로그램을 빌드해주실 분이다.


File - New - Nios II Application and BSP from Template를 하라고 하는데


sopcinfo 파일을 지정하라고 한다.


아놔.. 망할 공백 -_ㅠ 일단 다른데로 저장해서 진행 ㄱㄱ


일단 파일을 지정하고 나면 약간의 시간 후에 cpu 이름이 뜬다.


프로젝트 이름은 대충 일단 쳐넣어 보고


기본 소스는 있으니까(머 printf("Hello from Nios II!\n"); 뿐이지만)

Run 눌러서 빌드+실행!

실행시에는 Nios II Hardware로 하라고 하는데


안되잖아 -ㅁ-?

일단 원인 검색중..

nios2-elf-g++  -T'../hello_world_0_bsp//linker.x' -msys-crt0='../hello_world_0_bsp//obj/HAL/src/crt0.o' -msys-lib=hal_bsp -L../hello_world_0_bsp/   -Wl,-Map=hello_world_0.map   -O0 -g -Wall   -mno-hw-div -mno-hw-mul -mno-hw-mulx -mgpopt=global  -o hello_world_0.elf obj/default/hello_world.o -lm -msys-lib=m

c:/intelfpga_lite/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x18dc0 of hello_world_0.elf section `.bss' is not within region `onchip_memory2_0'

c:/intelfpga_lite/17.1/nios2eds/bin/gnu/h-x86_64-mingw32/bin/../lib/gcc/nios2-elf/5.3.0/../../../../../H-x86_64-mingw32/nios2-elf/bin/ld.exe: address 0x18dc0 of hello_world_0.elf section `.bss' is not within region `onchip_memory2_0'

collect2.exe: error: ld returned 1 exit status

make: *** [hello_world_0.elf] Error 1


메모리가 부족해요 부터 이상한 소리들이 많은데 결국 도움 받은 글은 이것 하나네

프로젝트 중 _bsp로 끝나는 것에서 우클릭 Proeprties


Nios II BSP Properties 에서, 조금 기다리면 비활성화 된 내용들이 풀리는데


Reduced device drivers는 필수는 아니고

Optimization level로 필수는 아니지만

Small C library 는 필수로 해주어야 한다고 한다.

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


일단 소스를 변경하고 했는데 PIO_0_BASE로 된건 조금 헤매게 되네..

system.h 에 PIO로 검색해서 나오는 건데, pdf 파일의 버전과 달라서 그런지 생성되는 명칭이 다르다.

/*

 * "Hello World" example.

 *

 * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on

 * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example

 * designs. It runs with or without the MicroC/OS-II RTOS and requires a STDOUT

 * device in your system's hardware.

 * The memory footprint of this hosted application is ~69 kbytes by default

 * using the standard reference design.

 *

 * For a reduced footprint version of this template, and an explanation of how

 * to reduce the memory footprint for a given application, see the

 * "small_hello_world" template.

 *

 */


#include <stdio.h>

#include "system.h"

#include "altera_avalon_pio_regs.h"


int main() {

printf("Hello from Nios II!\n");

int count = 0;

int delay;

while (1) {

IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, count & 0x01);

delay = 0;

while (delay < 1000000) {

delay++;

}

count++;

}

return 0;


Run Configurations 에

Nios II Hardware 에서 Target Connection 오른쪽에 Refresh Connections가 창이 작아서 안보였는데

아무튼 이걸 눌러줘야 프로세서가 뜨고 프로그램이 정상적으로 작동하게 된다.

망할 -_- 자동 탐지 되는줄 알았는데 ㅠㅠ


아무튼 먼가 열심히 빌드하고 먼가 열심히 올리더니


printf()로 출력한거 나오고 LED가 깜박깜박 한다.


이제 남은건.. 바이너리 통합하기?

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

elf2flash와 nios2-elf-objcopy 사용하기  (0) 2018.01.29
Nios II 이미지 합치기 (조사)  (0) 2018.01.27
Nios II 명령어 관련 조사  (0) 2018.01.26
nios2 /e /f 별 설정  (0) 2018.01.25
my first Nios II with DE0-nano  (0) 2018.01.25
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 26. 16:08

Nios II 코어 생성하다 보니 명령어별 cycle이 나와서 한번 어떤 명령어 인가 조사를 해보는데..

관건은.. 1 cycle이냐 2 cycle 이냐로 갈리는 Multiply Extended 명령어들!


일단 일반적인 곱셈은

MUL

Multiplies rA times rB and stores the 32 low-order bits of the product to rC. The result is the same whether the operands are treated as signed or unsigned integers.

Operation에 rC <- (rA x rB)31...0 인데.. 32비트 연산이라는 의미 같고


MULXSS

Treating rA and rB as signed integers, mulxss multiplies rA times rB, and stores the 32 high-order bits of the product to rC.

Operation 에서 rC <- ((singed)rA) x ((signed)rB))63..32

32비트를 초과하는 상위 비트에 대해서 계산을 한다는 건가?

아무튼 확장 곱셈 명령으로는 세가지가 있는데 로직을 얼마나 사용할 진 모르겠지만

Big integer 계산하는게 아니라면 2 cycle로 처리가 가능하니 굳이 안하는게 이득일 것으로 보인다.

mulxss multiply extended signed/signed

mulxsu multiply extended signed/unsigned

mulxuu multiply extended unsigned/unsigned 

[링크 : https://www.altera.com/en_US/pdfs/literature/hb/nios2/n2cpu_nii51017.pdf]



+

어라.. Nios II (Classic) Processor 를 선택하니 Nios II/s가 보이네?


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

Nios II 이미지 합치기 (조사)  (0) 2018.01.27
Nios II 프로그램 빌드..  (0) 2018.01.27
nios2 /e /f 별 설정  (0) 2018.01.25
my first Nios II with DE0-nano  (0) 2018.01.25
Quartus 2 Programmer Mode 조사  (0) 2018.01.23
Posted by 구차니
embeded2018. 1. 26. 16:00

아는 프로세서는 없지만.. 8051이 저~~~기 구석에 쳐박히는데

문제는 DMIPS 0.1의 1/10쯤 될까 말까? 혹은 측정 불가라는 수준 아닌가 싶다.

[링크 : http://www.ensilica.com/pdfs/White_Paper_The_right_Microcontroller_for_low-power_apps.pdf]


일단.. Cortex-m3일 것으로 보이는 STM32F4랑 비교하면 gcc-arm/gcc-avr로 약 4배 정도 성능 차이가 발생한다.

(검색해보니 cortex-m4 계열)

STM32F4:            902,       gcc-arm

AVR90USB1286:  237,       gcc-avr 

[링크 : https://www.eevblog.com/forum/microcontrollers/dhrystone-2-1-on-mcus/]



AVR쪽은 데이터시트 상으로 DMIPS 수치가 없다. 일단 MIPS뿐.. 정량적 비교는 무리

AT90USB 1MIPS/1MHz

[링크 : http://ww1.microchip.com/downloads/en/DeviceDoc/doc7707.pdf]



Dhrystone 계산법을 모르겠네.. 첫줄에서 둘째줄로 가는데

반대로 계산해보면 70Mhz 정도 되는 것 같은데 40MHz TSMC process...???

내가 아는 반올림이랑 방법이 다른가?

[링크 : https://www.eembc.org/techlit/datasheets/dhrystone_wp.pdf]



x86과 arm의 DMIPS인데.. 단위가 훅 커지네..

 Raspberry Pi           Linux                   

  ARM  1176      700     3.6.11      847          

  ARM  1176     1000     3.6.11     1226          


  Raspberry Pi 2                                  

  ARM V7A       900      3.18.5     1538          

  ARM v7A      1000      3.18.5     1694          

 gcc 4.8                                        

  ARM V7A       900      3.18.5     1667          

  ARM V7A      1000      3.18.5     1852          


  Raspberry Pi 3, 32 Bit                          

  ARM v8-A53   1200      4.1.19     2201          

  gcc 4.8                                         

  ARM v8-A53   1200      4.1.19     2469          


  Raspberry Pi 3, 64 Bit                          

  OpenSuse                                        

  ARM v8-A53   1200      4.4.36     3536          

  Gentoo                                          

  ARM v8-A53   1200      4.10.0     3475           

[링크 : http://www.roylongbottom.org.uk/dhrystone%20results.htm]


'embeded' 카테고리의 다른 글

udoo 보드  (0) 2018.11.29
아싸~ 득템  (7) 2018.07.16
프로그램 영역(code) 변수 저장하기  (0) 2018.01.15
USB UART - CH340  (2) 2017.10.30
nuvoton cortex-m0 ISD9160 LDROM  (0) 2017.10.17
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 25. 22:52

Nios 2 core 설정을 하는데

economic과 fast 두 가지가 가능하다.


일단 e는 LE를 최소화 하는 녀석이라 그런지 performance 항목이 참.. 암울하게 나온다.


fast로 설정하면 multiplier 정도는 추가가 되는지 1 클럭이 끝나고 shift와 rotate도 1 클럭에 끝난다.


곱셈 구현을 32bit 멀티플라이어로 선택하면 1클럭에 끝나서 가장 빠르긴 한데


Cyclone 4 E 에서는 32bit multiplier를 구현 할 수 없는지 경고가 뜬다.


아무튼 Auto 보다 Manual로 선택해서 이것저것 넣으면 곱셈 확장 2클럭까지 올라는 가는데

저 명령어들이 얼마나 쓰일려나?



+

nios 2/e는 캐쉬 자체가 지원하지 않는다. 그래서 경고가 하나 줄었던 거군


nios 2/f는 캐쉬 설정이 가능한데

기본값으로 i-cache가 4k d-cache가 2k 라 에러가 발생한다.


i-cache를 4k로 하면 해결될 것 같으나, 메모리 공간이 안 맞대서 일단 2k 2k로 설정하면 해결


Posted by 구차니
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 구차니
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 구차니