embeded/FPGA - ALTERA2018. 2. 1. 11:43

eclipse 에서 Nios II - Flash Programmer 혹은 Ctrl-7 단축키로 하면 아래 녀석이 실행되는데

File - New에서 요구하는 파일을 열어준다.


BSP는 hello_world_0_bsp 아래에 있는 파일이고

sopc야 적당히 찾으면 될꺼고..


아무튼 부르면 저렇게 UI가 바뀌는데, 중간에 Add에서 빌드한 elf를 넣어주면


이렇게 바뀐다. 가장 아래 Start 누르면 변환하고 알아서 굽는데


머가 문제라 안될까...

Info: 2018. 2. 1 오전 11:40:05 - (정보) elf2flash: args = --input=D:/Download/DE0_NANO/software/hello_world_0/hello_world_0.elf --output=D:/Download/DE0_NANO/software/hello_world_0_bsp/flash/hello_world_0_epcs_flash_controller_0.flash --epcs --verbose

Info: 2018. 2. 1 오전 11:40:05 - (미세) elf2flash: Starting

Info: 2018. 2. 1 오전 11:40:05 - (보다 미세) elf2flash: Program Record: 3964 bytes destined for 0x8000

Info: 2018. 2. 1 오전 11:40:05 - (보다 미세) elf2flash: Program Record: 724 bytes destined for 0x9250

Info: 2018. 2. 1 오전 11:40:05 - (보다 미세) elf2flash: Start Record: 8020

Info: 2018. 2. 1 오전 11:40:05 - (미세) elf2flash: Done

Info: Using cable "USB-Blaster [USB-0]", device 1, instance 0x00

Info: Resetting and pausing target processor: 

Info: OK

Info: Reading System ID at address 0x00012030: 

Info: verified

Info: Processor data bus width is 32 bits

Info: Looking for EPCS registers at address 0x00011000 (with 32bit alignment)

Info:   Initial values: 0001703A 04C00074 9801483A 9CFFF804 983FFD1E 0000203A

Info:   Not here: reserved fields are non-zero

Info: Looking for EPCS registers at address 0x00011100 (with 32bit alignment)

Info:   Initial values: 93000237 6300080C 603FFD26 90000335 A8000C26 03010004

Info:   Not here: reserved fields are non-zero

Info: Looking for EPCS registers at address 0x00011200 (with 32bit alignment)

Info:   Initial values: 02C02004 002EE03A 00000F06 90000335 4000683A 0017883A

Info:   Not here: reserved fields are non-zero

Info: Looking for EPCS registers at address 0x00011300 (with 32bit alignment)

Info:   Initial values: 003FD006 5280040C 501496FA 701CD07A 729CB03A 843FFFC4

Info:   Not here: reserved fields are non-zero

Info: Looking for EPCS registers at address 0x00011400 (with 32bit alignment)

Info:   Initial values: 00000000 00000000 00000260 00000000 00000000 00000001

Info:   Valid registers found

Info: EPCS signature is 0x00

Info: EPCS identifier is 0x000000

Info: Leaving target processor paused

Error: No EPCS layout data - looking for section [EPCS-000000]

Error: Unable to use EPCS device

Error: Error code: 8 for command: nios2-flash-programmer "D:/Download/DE0_NANO/software/hello_world_0_bsp/flash/hello_world_0_epcs_flash_controller_0.flash" --base=0x11000 --epcs --sidp=0x12030 --id=0x0 --timestamp=1517370555 --device=1 --instance=0 '--cable=USB-Blaster on localhost [USB-0]' --program --verbose  



+

요건 이미 초기에 조치한 내용이고..

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


흐음.. 이 설정이 문제인가?

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


qsys예제에는 아래처럼 되어 있어서 별 문제 없을거 같은데..


음.. 리셋벡터가 문제인가?

[링크 : http://www.heijin.org/forum.php?mod=viewthread&tid=30351]


일단.. qsys 예제 열어 보는데, 전부 선을 연결안하는 식으로 구성고...

epcs 라는 이름에 epcs_external 이라고 변수명 붙여줘야 하나?

epcs의 주소는 0x000으로 고정했고.. 

cpu 리셋벡터는 sdram으로 되어있어서 문제 될 건 없어 보이는데..



생각해보니 epcs를 net로 연결안해줘서 발생하는 문제인듯 하다

[링크 : https://www.emb4fun.de/fpga/nutos1/]

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

Nios II 조금 감 잡은듯  (0) 2018.02.02
xilinx easypath / Altera hardcopy  (0) 2018.02.02
de0-nano SDRAM with Nios II  (0) 2018.01.31
EPCS Controller 추가 및 jic 통합하기.. 실패중  (0) 2018.01.31
Nios II BSP 빌드관련  (0) 2018.01.31
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 31. 19:27

32MB 짜리 SDRAM이 달려있는데

Nios II 여러개 생성할 때 분할해서 쓸 수 있을려나?


It is organized as 4M x 16 bits x 4 banks.

[링크 : ftp://ftp.altera.com/up/pub/Altera_Material/11.0/Tutorials/Verilog/DE0-Nano/Using_the_SDRAM.pdf]


on-chip memory로 부족한 메모리라 못했던걸, 이걸 이용하면 가능할거 같네?


메모리 관리문제로 hw mutex도 추가하라네?

[링크 : http://jjackson.eng.ua.edu/courses/ece680/lectures/Creating Multiprocessor Nios II Systems Tutorial.pdf]

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

xilinx easypath / Altera hardcopy  (0) 2018.02.02
Nios II Flash Programmer  (0) 2018.02.01
EPCS Controller 추가 및 jic 통합하기.. 실패중  (0) 2018.01.31
Nios II BSP 빌드관련  (0) 2018.01.31
SREC - SRECord  (0) 2018.01.30
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 31. 13:23

그래도 안되네 ㅠㅠ


설정 가능한 내용으로는 딱히 눈에 띄는건 없네


심심해서 SDRAM은 어떻게 추가하나했는데.. university program에 DE 보드 관련 SDRAM PLL은 존재하고

SDRAM은 별도로 추가를 해주어야 한다. (ISSI 칩 기본 프리셋 존재하지 않음)


이제 남은건.. sof 파일을 hex로 바꾸는건가...


sof를 시작주소 줄 수 있었군..

최소한 이렇게 하면, Nios II 자체는 구동하는걸로 보인다(LED 불 전부 꺼짐)

eclipse에서 테스트 해보니 장치 인식을 하는 것 봐서 정상적으로 Nios II는 들어간 듯


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


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]


Creating the .jic file:


In Quartus, open the Convert "Programming File..." utility

Set the "Programming file type:" to "JTAG Indirect Configuration File (.jic)"

In "Input files to convert" select "Flash Loader", click "Add Device..." and choose your target FPGA device

If you are configuring the FPGA from the serial flash:

In "Input files to convert" select "SOF Data", click "Add File..." and select your FPGA .sof file

-With "SOF Data" selected, click "Properties", in the "SOF Data Properies dialogue box:

-Set "Address mode for selected pages to" to "Start"

Set "Start address (32-bit hexidecimal:) to 0x0.

In "Input files to convert" click "Add Hex Data", in the "Add Hex Data" dialogue box:

Set "Addressing mode" to "Absolute addressing"

Select your hex file using the "..." button next to the "Hex file" field

Click "OK"

Check "Create Memory Map File". This is useful for debugging.

Generate the .jic file and program it into the serial flash with the Quartus Programmer 

[링크 : http://www.alterawiki.com/wiki/Booting_Nios_from_Serial_Flash_with_the_new_Altera_Serial_Flash_Controller]


그나저나 빌드 메시지를 보니..

13:50:21 **** Build of configuration Nios II for project hello_world_0 ****

make mem_init_generate 

Info: Building ../hello_world_0_bsp/

C:/intelFPGA_lite/17.1/nios2eds/bin/gnu/H-x86_64-mingw32/bin/make --no-print-directory -C ../hello_world_0_bsp/

[BSP build complete]

Post-processing to create mem_init/hdl_sim/unsaved_epcs_flash_controller_0_boot_rom.hex...

elf2hex hello_world_0.elf 0x00011000 0x000117ff --width=32 --little-endian-mem --create-lanes=0 --no-zero-fill mem_init/hdl_sim/unsaved_epcs_flash_controller_0_boot_rom.hex

Post-processing to create mem_init/unsaved_onchip_memory2_0.hex...

elf2hex hello_world_0.elf 0x00008000 0x0000ffff --width=32 --little-endian-mem --create-lanes=0 mem_init/unsaved_onchip_memory2_0.hex

Post-processing to create mem_init/hdl_sim/unsaved_epcs_flash_controller_0_boot_rom.dat...

elf2dat --infile=hello_world_0.elf --outfile=mem_init/hdl_sim/unsaved_epcs_flash_controller_0_boot_rom.dat \

--base=0x00011000 --end=0x000117ff --width=32 \

--little-endian-mem --create-lanes=0 

Post-processing to create mem_init/hdl_sim/unsaved_onchip_memory2_0.dat...

elf2dat --infile=hello_world_0.elf --outfile=mem_init/hdl_sim/unsaved_onchip_memory2_0.dat \

--base=0x00008000 --end=0x0000ffff --width=32 \

--little-endian-mem --create-lanes=0 

Post-processing to create mem_init/hdl_sim/unsaved_epcs_flash_controller_0_boot_rom.sym...

nios2-elf-nm -n hello_world_0.elf > mem_init/hdl_sim/unsaved_epcs_flash_controller_0_boot_rom.sym

Post-processing to create mem_init/hdl_sim/unsaved_onchip_memory2_0.sym...

nios2-elf-nm -n hello_world_0.elf > mem_init/hdl_sim/unsaved_onchip_memory2_0.sym

Post-processing to create unsaved_epcs_flash_controller_0_boot_rom.flash...

elf2flash --input=hello_world_0.elf --outfile=unsaved_epcs_flash_controller_0_boot_rom.flash --sim_optimize=0 --little-endian-mem \

 --epcs 

Post-processing to create mem_init/meminit.spd...

Post-processing to create mem_init/meminit.qip...


13:50:26 Build Finished (took 4s.961ms) 



+

귀찮아서(!) 안하려고 했던 sof2flash를 꼭 거쳐야 하나보다.. 나처럼 EPCS에 구우려면..

3.3.1.3 EPCS Parameters

3.3.2 Programming Both Hardware and Software into an EPCS/EPCQ

Device

The --base parameter is not available for EPCS/EPCQ devices, because in EPCS/EPCQ devices, FPGA configuration data must start at address 0x0. However, if you are programming both an FPGA configuration and a Nios II software executable in the EPCS/EPCQ device, the --after parameter lets you position the software executable directly after the FPGA configuration data.

Convert the FPGA configuration file first using sof2flash. When converting the Nios II software executable, use the --after parameter, and specify the FPGA configuration S-record file. The S-record output for the software executable starts at the first address unused by the FPGA configuration. Refer to the second example under the “elf2flash Command-Line Examples” chapter.

Note: elf2flash does not insert the FPGA configuration into the output file. It simply leaves space, starting at offset 0x0, that is large enough for the configuration data.

Note: In Intel Quartus Prime software version 13.1 and onwards, the -epcs/--epcq option in sof2flash generates .flash file with a SOF header, which contains the SOF length.

This change is required for V-series devices and above for new SOF format, and to allow for future SOF format variations. The Nios II bootcopier loads the Nios II software executable from EPCS/EPCQ devices based on the SOF length. For more information about how to program EPCS/EPCQ devices, refer to the "KDB Solution rd11192013_118" webpage.

Related Links

• elf2flash Command-Line Examples on page 25

• KDB Solution rd11192013_118 

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



+

카페 자료 뒤지다 보니,

Eclipse에 Flash Programmer가 있대서 보니 오.. 이런게 있네..

그런데 프로젝트도 안 부르고 그냥 실했더니 먼가 에러뿜뿜


아무튼 이걸 이용하면 굳이 jic 안만들어도 EPCS controller가 있으면 EPCS에 쓸 수 있다고 한다. 

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

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

Nios II Flash Programmer  (0) 2018.02.01
de0-nano SDRAM with Nios II  (0) 2018.01.31
Nios II BSP 빌드관련  (0) 2018.01.31
SREC - SRECord  (0) 2018.01.30
altera Nios II, epcs controller  (0) 2018.01.29
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 31. 13:04

아무생각 없이(!) 전체 프로젝트를 Clean 했더니 아래와 같은 에러를 뱉어 주신다.

별거 없고 bsp 프로젝트 우클릭후 Nios II 에서 Generate BSP 해준다음

전체 프로젝트 빌드 하면된다.

13:01:21 **** Incremental Build of configuration Nios II for project hello_world_0_bsp ****

make all 

Makefile not up to date.

../../unsaved.sopcinfo has been modified since the BSP was generated.


Generate the BSP to update the Makefile, and then build again.


To generate from Eclipse:

 1. Right-click the BSP project.

 2. In the Nios II Menu, click Generate BSP.


To generate from the command line:

 nios2-bsp-generate-files --settings=<settings file> --bsp-dir=<target bsp files directory>


make: *** [public.mk] Error 1


13:01:22 Build Finished (took 946ms)


Run Configuration 에서

Download에 Start Processor와 Reset the selected target system을 해주면

다운로드 후 리셋을 걸고 시작하도록 하여 작동되는걸 바로 볼 수 있다

(먼가 이상하게 늦게 실행되는 느낌이 들어서 그거 없애는 용도)


이전글을 비교해보니.. 실수로 Start Processor의 체크를 꺼서 그런 듯

2018/01/27 - [embeded/FPGA] - Nios II 프로그램 빌드..


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

de0-nano SDRAM with Nios II  (0) 2018.01.31
EPCS Controller 추가 및 jic 통합하기.. 실패중  (0) 2018.01.31
SREC - SRECord  (0) 2018.01.30
altera Nios II, epcs controller  (0) 2018.01.29
Nios II / Nios II Classic 차이점  (0) 2018.01.29
Posted by 구차니
embeded/FPGA - XILINX2018. 1. 30. 23:50

altera와 비교되는 용어를 찾아 보는중


Processing System (PS)

Programmable Logic (PL)

[링크 : https://www.xilinx.com/support/documentation/data_sheets/ds190-Zynq-7000-Overview.pdf]


HPS에 대응하는게 PS 라는것 정도?

PL에 대응하는 용어는 FPGA나 LE 정도?


Cyclone V SoC Hard Processor System

[링크 : https://www.altera.com/products/fpga/features/cyv-soc-hps.html]

[링크 : https://www.altera.com/products/soc/portfolio/arria-10-soc/arria10-soc-hps.html]

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

vivado language template  (0) 2018.03.20
xilinx 고속 시리얼 인터페이스  (0) 2018.03.15
xilinx bitstram ecryption  (0) 2018.01.23
xilinx artix-7 프로젝트 빌드해봄  (0) 2018.01.07
xilinx vivado / ISE 라이센스 관련  (0) 2017.12.19
Posted by 구차니
embeded/ARM2018. 1. 30. 16:04

Advanced Microcontroller Bus Architecture

Advanced eXtensible Interface (AXI)


[링크 : https://en.wikipedia.org/wiki/Advanced_Microcontroller_Bus_Architecture]

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

keil window 버전별 지원버전  (0) 2018.07.19
ARM MPMC(multiport memory controller)  (0) 2018.03.19
keil build 관련 검색  (0) 2017.12.06
카드크기 컴퓨터 벤치마크  (0) 2016.09.04
JTAG ETM  (0) 2016.09.02
Posted by 구차니
embeded/80512018. 1. 30. 09:08

문득 생각나서 Branch prediction을 8051에서 지원하나 찾아보다가 발견

다르게 보면.. ARM 계열의 성능이 좋긴 좋은거였구나..(Cortex-M3,M4)라는 생각이 든다.


  • A Dhrystone 2.1 performance rating of 0.252 DMIPS/MHz yields an unmatched 26.85 times speed up over the original 80C51 chip operating at the same frequency.
  • Maximum CPU frequency exceeds 500 MHz for a class-leading effective increase of more than 1,000 times over 80C51 chips (40nm G process) 

[링크 : https://www.design-reuse.com/news/33780/8051-microcontroller-ip-core.html]

[링크 : http://www.cast-inc.com/ip-cores/8051s/s8051xc3/index.html]

Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 30. 07:48

ALTERA에서 Nios II 용 바이너리를 변환하는 녀석으로

확장자가 flash가 튀어 나오는데, 내부 포맷은 SREC 라고 한다.

Motorola에서 개발했으니.. 원래는 PowerPC 계열에서 쓰던 걸려나?

아무튼 기본 포맷 유형은 intel HEX와 유사하다.


[링크 : https://en.wikipedia.org/wiki/SREC_(file_format)]


EPCS Controller-Based Boot Copier

EPCS controller-based boot copier supports EPCS memory only. Boot copier is stored in the ROM within

the EPCS flash controller. The boot copier is included during Qsys and Quartus Prime project compila‐

tion time.

The next stage boot image is located in the EPCS memory flash. The EPCS controller-based boot copier is

automatically appended into the SREC image (*.flash) file during the elf2flash utility execution in the

Nios II Flash Programming flow method.

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

Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 29. 20:47

생각을 해보니.. jic는 문제없이 만들어 진건데...

platform designer에서 EPCS Controller를 추가하지 않아서 작동하지 않는게 아닌가? 라는 생각이 든다.

다시 추가해서 시도해봐야겠다.


EPCS Controller-Based Boot Copier

EPCS controller-based boot copier supports EPCS memory only. Boot copier is stored in the ROM within

the EPCS flash controller. The boot copier is included during Qsys and Quartus Prime project compila‐

tion time.

The next stage boot image is located in the EPCS memory flash. The EPCS controller-based boot copier is

automatically appended into the SREC image (*.flash) file during the elf2flash utility execution in the

Nios II Flash Programming flow method. 


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


My first Nios II 문서에 있는거랑 구성이 거의 비슷한데 EPCS와 SDRAM Controller가 추가되어 있다.

My application contains:


1. Clock Source

2. Nios II Processor

3. System ID

4. JTAG UART

5. EPCS Serial Flash Controller

6. PIO

7. SDRAM Controller

[링크 : https://alteraforum.com/forum/archive/index.php/t-49224.html]


음.. 리셋 벡터까지 EPCS Controller로 해주어야 하나?

Make sure the Nios II’s Reset Vector is pointing at EPCS/EPCQ Controller. 

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

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

Nios II BSP 빌드관련  (0) 2018.01.31
SREC - SRECord  (0) 2018.01.30
Nios II / Nios II Classic 차이점  (0) 2018.01.29
elf2flash와 nios2-elf-objcopy 사용하기  (0) 2018.01.29
Nios II 이미지 합치기 (조사)  (0) 2018.01.27
Posted by 구차니
embeded/FPGA - ALTERA2018. 1. 29. 19:07

Nios II Classic에 구분되도록

Nios II Gen2라고 부르는 듯


아무튼.. Nios II Classic의 /e는 Nios II Gen2의 /e와 다른 물건이 되어버린듯 하다.

Nios II Gen2 Processor Feature Enhancements

The Nios II Gen2 processor family consists of /e and /f cores. It offers improvements over the Nios II Classic processor cores:

• Optional full 32-bit address space 

• Optional user-defined Peripheral address region for data cache bypass 

• Improved Qsys interface

The Nios II Gen2 /e core is completely backwards compatible with the Nios II Classic /s core. The Nios II Classic /s core has no direct equivalent in the Nios II Gen 2 family, however the Nios II Gen2 /f processor (as it has a more flexible configuration capability) can be configured to have the same feature set as the Nios II Classic /s core.


The Nios II Gen2 /f core offers the following feature enhancements over the Nios II Classic /f core: 

• Optional full ECC support, including data cache and TCMs (Tightly-coupled Memories) 

• Optional static branch prediction 

• Higher performance multiplier

• Improved and more deterministic divider 

• 64-bit multiply supported on all devices 

• Improved low-cost shifter implementation up to 4 bits/cycle 

• Instruction cache is now optional even when JTAG debug is present 

• New system interface for system trace 

[링크 : https://www.altera.com/en_US/pdfs/literature/an/an748.pdf]

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

SREC - SRECord  (0) 2018.01.30
altera Nios II, epcs controller  (0) 2018.01.29
elf2flash와 nios2-elf-objcopy 사용하기  (0) 2018.01.29
Nios II 이미지 합치기 (조사)  (0) 2018.01.27
Nios II 프로그램 빌드..  (0) 2018.01.27
Posted by 구차니