embeded/FPGA - ALTERA2018. 2. 28. 20:44

AVR 할때도 해봤던 예제인데..

이걸 하면 좀 이해가 될 듯?


FPGA를 통해서 UART를 구현하고 데이터를 내부적으로 받아서 다시 보내주는 역활을 하는데

대충 보니.. 결국은 state machine으로 구현되서 내부적으로

프로그램 로직이 작동을 해야만 하는 듯..

FPGA란게 원래 그런건가..?


[링크 : https://github.com/FPGAwars/FPGA-peripherals/tree/master/uart-rx/examples/echo]


Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 26. 16:26

SOPC Builder는 Qsys로 대체 되고

Qsys가 Platform Designer로 변신?


이미지로 검색해보면

Qsys나 Platform Designer나 거의 동일하고

SOPC Builder는 Qsys와 유사한데 XP 시절 그래픽 느낌?



SOPC Builder Support

Altera recommends using Qsys, the next-generation system integration tool, for new designs.

[링크 : https://www.altera.com/support/support-resources/design-software/sopc-builder.html]


Platform Designer (formerly Qsys) Support

The Qsys system integration tool in Quartus® Prime software saves time and effort in the FPGA design process by enabling faster system development and design reuse.

[링크 : https://www.altera.com/support/support-resources/design-software/qsys.html]

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

de0-nano virtual serial  (0) 2018.02.28
fpga uart echo  (0) 2018.02.28
Nios II / Floating Point Hardware 2  (0) 2018.02.26
quartus 2 Block Diagram/Schematic 으로 설계하기  (4) 2018.02.20
de0-nano communicate pc 로 검색결과  (0) 2018.02.14
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 26. 15:15

카페 질문이 있어서 찾아보니..

FPU 형태로 별도의 하드웨어로 구성되는 Floating Point Hardware라는 IP가 존재한다.


귀찮아서 custom으로 검색!

Hardware랑 Hardware 2가 있다.


2는 2 답게 +-*/(Arithmetic)과 추가적으로 다른 부동소수점 연산을 지원하는데

도표를 보면 성능이 참.. 자비가 없네 ㄷㄷ


Floating Point Hardware는 +-*는 기본으로 제공되고 /에 대해서는 별도 옵션으로 선택해야 한다.


음. VHDL only 라니.. verilog 프로젝트에서는 못쓰나? (먼가 경고 두개 뜨긴 하던데...)

그리고 2500 4-input LE 라는데 Nios2에 비하면 꽤나 큰 로직의 사용인거 같고,

4-input LE가 적은 시리즈라면 치명적일 수도 있겠다.

결정적으로(!) float 인거지 double은 미지원이다.


The characteristics of the FPH2 are:

  • Supports FPH1 operations (add, sub, multiply, divide) and adds support for square root, comparisons, integer conversions, minimum, maximum, negate, and absolute
  • Single-precision floating point values are stored in the Nios II general purpose registers
  • VHDL only
  • Platform Designer support only
  • Single-precision only
  • Optimized for FPGAs with 4-input LEs and 18-bit multipliers
  • GCC and Nios II SBT (Software Build Tools) software support
  • IEEE 754-2008 compliant except for:
    • Simplified rounding
    • Simplified NaN handling
    • No exceptions
    • No status flags
    • Subnormal supported on a subset of operations
  • Binary-compatibility with FPH1
    • FPH1 implements Round-To-Nearest rounding. Because FPH2 implements different rounding, results might be subtly different between the two generations
  • Resource consumption in a typical system:
    • Approximately 2500 4-input LEs
    • Nine 9-bit multipliers
    • Three M9K memories or larger

성능 테이블 8비트 연산

Specifies the 8 bit fixed custom instruction for the operation. 일 경우가 N인데

연산을 위해 8비트 사용자 명령어로 사용했다는 건가?

아무튼 극단적으로 230여배 성능 향상! 이라고 뻥칠 수 있다 ㅋㅋ

안정적으로는 50배 정도 성능향상이 있을 것으로 보인다.

(물론 별도 하드웨어로 통신을 하고 하면서 순수 연산 속도에는 조금 더 낮게 측정 되겠지만)


Table 15.  FPH2 Operation Summary
OperationNCyclesResultSubnormalRoundingGCC Inference
fdivs25516a/bflush-to-0Nearesta/b
fsubs2545a-bflush-to-0Faithfula-b
fadds2535a+bflush-to-0Faithfula+b
fmuls2524a*bflush-to-0Faithfula*b
fsqrts2518sqrt(a)flush-to-0Faithfulsqrtf()
floatis2504int_to_float(a)Does not applyDoes not applyCasting
fixsi2492float_to_int(a)flush-to-0TruncationCasting
round2482float_to_int(a)flush-to-0Nearestlroundf()11
reserved234 to 247Undefinedundefined   
fmins2331(a<b) ? a : bsupportedNonefminf()11
fmaxs2321(a<b) ? b : asupportedNonefmaxf()11
fcmplts2311(a<b) ? 1 : 0supportedNonea<b
fcmples2301(a≤b) ? 1 : 0supportedNonea<=b
fcmpgts2291(a>b) ? 1 : 0supportedNonea>b
fcmpges2281(a≥b) ? 1 : 0supportedNonea>=b
fcmpeqs2271(a=b) ? 1 : 0supportedNonea==b
fcmpnes2261(a≠b) ? 1 : 0supportedNonea!=b
fnegs2251-asupportedNone-a
fabss2241|a|supportedNonefabsf()

[링크 : https://www.altera.com/documentation/cru1439932898327.html]

[링크 : https://www.altera.com/documentation/cru1439932898327.html#lro1432145764151]

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

fpga uart echo  (0) 2018.02.28
sopc builder -> qsys -> platform designer  (2) 2018.02.26
quartus 2 Block Diagram/Schematic 으로 설계하기  (4) 2018.02.20
de0-nano communicate pc 로 검색결과  (0) 2018.02.14
Nios II 관련 링크  (0) 2018.02.13
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 20. 09:06

문득.. 프로젝트들 중에 Schematic으로 된 것을 본 기억이 있어서

New을 해보니 헉... 이렇게 가까운데 있었다니!!


먼가 많이 익숙해 보이는(?) 아이콘들 발견


AND 게이트 아이콘 누르면 심볼이 있는데 아쉽게도(?)

orcad로 설계하듯 막 먼가 멋진 애가 있는건 아니고

ALTERA megafunction과 같이 좀 큰(!) 기본 제공 기능들과

primitives에 아~~~~주 기초적인 and/or/not 등의 녀석들만 존재한다.


모르니 대충대충 눌러서 끄적끄적


저으자아아아앙~


이거 하면 빌드 한다는데

에러도 없이 끝나는거 보면 대충봐서 무언가 한 단계 빼먹은 듯 ㅠㅠ

[링크 : ftp://ftp.altera.com/up/pub/Tutorials/DE2/Digital_Logic/tut_quartus_intro_schem.pdf]


Nios 2 하던 애라 기본으로 설정안되 있어서 그런 듯

아무튼 Files에서 "Set as Top-Level Entity"로 설정해주고 빌드하니 티가 안나서

(무슨무슨 선을 사용하지 않는다고 경고 뿜뿜)


마지막 OR 게이트의 선을 끊고 빌드하니 에러 발생! 되긴 되는거였군!


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

sopc builder -> qsys -> platform designer  (2) 2018.02.26
Nios II / Floating Point Hardware 2  (0) 2018.02.26
de0-nano communicate pc 로 검색결과  (0) 2018.02.14
Nios II 관련 링크  (0) 2018.02.13
Nios II 안된 이유가.. 설마..  (0) 2018.02.04
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 14. 21:28

라즈베리랑 GPIO로 통신하고 그러는 건 보이는데..

고속으로 데이터를 주고 받을 다른 방법은 없나..

(PC뿐만 아니라 라즈베리라던가..)


The USB interface to the DE0-nano is a USB-Blaster.

You can communicate from the host via a couple of mechanisms;


1) SLD Virtual JTAG core, and quartus_stp Tcl procedures

2) JTAG-to-Avalon-MM master and SystemConsole

3) Direct access via FTDI drivers 

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


Altera Virtual JTAG (altera_virtual_jtag) IP Core User Guide

[링크 : https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/ug/ug_virtualjtag.pdf]


Bootable Embedded Systems for the DE0-Nano Board

[링크 : ftp://ftp.altera.com/up/pub/Intel_Material/16.0/Tutorials/DE0-Nano/Using_DE0-Nano_Flash.pdf]


Using the DE0-Nano ADC Controller - Using the ADC Controller with HAL 

[링크 : ftp://ftp.altera.com/.../12.1/Tutorials/DE0-Nano/Using_DE0-Nano_ADC.pdf]


DE0-Nano-SoC Computer System with Nios II

[링크 : ftp://ftp.altera.com/.../15.0/Computer_Systems/DE0-Nano-SoC/DE0-Nano-SoC_Computer_Nios.pdf]


Computer System for the Altera DE0-Nano Board

[링크 : ftp://ftp.altera.com/up/pub/Altera_Material/14.1/Computer_Systems/DE0-Nano/DE0-Nano_Computer.pdf]

[링크 : https://github.com/CatherineH/de0-nano-raspi-communication-demo]

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

Nios II / Floating Point Hardware 2  (0) 2018.02.26
quartus 2 Block Diagram/Schematic 으로 설계하기  (4) 2018.02.20
Nios II 관련 링크  (0) 2018.02.13
Nios II 안된 이유가.. 설마..  (0) 2018.02.04
clock bridge  (0) 2018.02.03
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 13. 10:59

e4ds 세미나 중에 얻은 링크

[링크 : https://www.altera.com/../nios2/edh_ed_handbook.pdf] 488페이지!

    [링크 : https://www.altera.com/documentation/iga1446487888057.html]

[링크 : https://www.altera.com/products/processors/support.html] 원클릭 다운로드

Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 4. 21:29

설마.. 리셋 안걸어 줘서 그런건 맞겠...지?!?!

QSYS와 SOPC 예제를 보니 이게 들어있네..

에이.. 설마.. 아니길 빌지만..

찔리는게 너무 많다...... ㅠㅠ


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

//  Structural coding

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


assign reset_n = 1'b1; 


sof + Run As로는 그럼 왜 돈거야?

자체적으로 리셋을 걸어주는건가?


2018.02.05

해보니.. 여전히 플래시 굽기는 실패..

도대체 머가 문제일까..


+

흐음.. 과연...?

You need change in Pin Planner:


DRAM_LDQM to DRAM_DQM[0]

DRAM_UDQM to DRAM_DQM[1]


and


DRAM_BA_0 to DRAM_BA[0]

DRAM_BA_1 to DRAM_BA[1]



And then, you can assign these pins to your Nios II as buses.


DRAM_DQM[1..0]

DRAM_BA[1..0]


You must do this because Nios II in SOPC Builder 9.1 SP2 has buses for these connections to the SDRAM  

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


+

전에 무시하고 지나간 사항인데..

플래시에 굽다 보니.. Run AS로 램에서 돌리는거랑은 다르게

reset vector가 EPCS로 되어 있어야 하는거 아닌가? 라는 생각이 드네

Nios® II Boot from EPCQ or EPCS in Quartus® II 13.1

Workaround/Fix

3.      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]


Nios II Processor Application Copied from EPCS Flash to RAM Using Boot Copier

The EPCS address space is not mapped into the Altera Avalon EPCS Flash Controller’s Avalon MM slaveinterface. Instead, read or write accesses are done through CSRs. Upon system reset, the EPCS device needs to be initialized before usage.

For these reasons, the EPCS controller-based boot copier is required for initializing the EPCS device and copying the Nios II application to RAM for execution.

The EPCS controller instantiates a block of boot ROM internally at its base address (offset 0x0, just before EPCS controller’s CSRs) for storing the boot copier. Nios II reset vector offset must set to EPCS controller base address, such that upon system reset the boot copier is executed first to initialize the EPCS controller and device.

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

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

de0-nano communicate pc 로 검색결과  (0) 2018.02.14
Nios II 관련 링크  (0) 2018.02.13
clock bridge  (0) 2018.02.03
끄아아아아아 EPCS 안돼 ㅠㅠ  (4) 2018.02.03
Nios II EPCS 및 SDRAM  (0) 2018.02.03
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 3. 16:08

Nios II에서 EPCS가 안되서 QSYS 버전의 예제를 보니

Clock Bridge라는게 있어서 검색해 보는데..

그냥 PLL에서 나오거나 50MHz 클럭 소스 바로 연결해주면 안되는 건가?


[링크 : https://www.altera.com.cn/zh_CN/pdfs/literature/hb/qts/qsys_system_components.pdf]

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

Nios II 관련 링크  (0) 2018.02.13
Nios II 안된 이유가.. 설마..  (0) 2018.02.04
끄아아아아아 EPCS 안돼 ㅠㅠ  (4) 2018.02.03
Nios II EPCS 및 SDRAM  (0) 2018.02.03
altera speed grade  (0) 2018.02.03
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 3. 14:03

머가 문제야 도대체 ㅠㅠ


처음 nios2를 올리면 EPCS의 시작 주소부터 검색을 하는데

유효한 레지스터는 찾았으나.. EPCS 서명과 식별자도 다 맞는데

EPCS layout data가 없다고.. 근데 레이아웃 데이터는 또 머야

Info: 2018. 2. 3 오후 1:47:39 - (정보) 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. 3 오후 1:47:39 - (미세) elf2flash: Starting

Info: 2018. 2. 3 오후 1:47:39 - (보다 미세) elf2flash: Program Record: 3964 bytes destined for 0x4008000

Info: 2018. 2. 3 오후 1:47:39 - (보다 미세) elf2flash: Program Record: 724 bytes destined for 0x4009250

Info: 2018. 2. 3 오후 1:47:39 - (보다 미세) elf2flash: Start Record: 4008020

Info: 2018. 2. 3 오후 1:47:39 - (미세) 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 0x04012030: 

Info: verified

Info: Processor data bus width is 32 bits

Info: Looking for EPCS registers at address 0x04011000 (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 0x04011100 (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 0x04011200 (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 0x04011300 (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 0x04011400 (with 32bit alignment)

Info:   Initial values: 00000000 00000000 00000260 00000000 00000000 00000001

Info:   Valid registers found

Info: EPCS signature is 0x16

Info: EPCS identifier is 0x010216

Info: Leaving target processor paused

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

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=0x4011000 --epcs --sidp=0x4012030 --id=0x0 --timestamp=1517632677 --device=1 --instance=0 '--cable=USB-Blaster on localhost [USB-0]' --program --verbose 


아무튼 한번더 Start 눌러서 굽기 시도 하면

0x0000 0000을 못 찾고는 바로 배를 짼다.. 도대체 머야 -_-

Info: 2018. 2. 3 오후 1:47:52 - (정보) 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. 3 오후 1:47:52 - (미세) elf2flash: Starting

Info: 2018. 2. 3 오후 1:47:52 - (보다 미세) elf2flash: Program Record: 3964 bytes destined for 0x4008000

Info: 2018. 2. 3 오후 1:47:52 - (보다 미세) elf2flash: Program Record: 724 bytes destined for 0x4009250

Info: 2018. 2. 3 오후 1:47:52 - (보다 미세) elf2flash: Start Record: 4008020

Info: 2018. 2. 3 오후 1:47:52 - (미세) 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 0x04012030: 

Info: verified

Info: Processor data bus width is 32 bits

Info: Looking for EPCS registers at address 0x04011000 (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 0x04011100 (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 0x04011200 (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 0x04011300 (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 0x04011400 (with 32bit alignment)

Info:   Initial values: 00000016 00000016 00000260 00000000 00000016 00000001

Info:   Not here: reserved fields are non-zero

Info: Leaving target processor paused

Error: No EPCS registers found: tried looking at addresses    

Error:  0x04011000,

Error:  0x04011100,

Error:  0x04011200,

Error:  0x04011300 and

Error:  0x04011400

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=0x4011000 --epcs --sidp=0x4012030 --id=0x0 --timestamp=1517632677 --device=1 --instance=0 '--cable=USB-Blaster on localhost [USB-0]' --program --verbose 

일단 EPCS 레지스터를 못 찾았다 에러를 보면


B.5 "No EPCS Registers Found" Error

When you run the flash programmer to program an EPCS device, you get the error:

"No EPCS registers found: tried looking at addresses...."

B.5.1 Probable Cause

The flash programmer can connect with a Nios II JTAG debug module in the FPGA, but it cannot successfully find an EPCS device located at the specified base address.

>> 플래시 프로그래머는 FPGA의 Nios II JTAG 디버그 모듈과 연결할 수 있지만, 지정된 base address에서 EPCS 장치를 발견하는데 성공하지 못했다.

B.5.2 Suggested Actions

• Reconfigure the FPGA with a valid target design via JTAG using the Intel Quartus Prime programmer. If the FPGA is configured by another method, such as by a configuration controller, the pins that connect to the EPCS device might be disabled.

>> 쿼터스 프로그래머를 이용해 JTAG으로 FPGA를 재설정하라. 만약에 FPGA가 configuration controller 와 같은 다른 방법으로 설정된다면 EPCS 장치와 연결되는 핀들이 비활성화 되었을 수 도 있다.

• If you are using quartus_pgm --nios2 from the command line, ensure you specified the correct base address for your EPCS device. You can find the flash memory's base address in Platform Designer.

>> 커맨드 라인에서 quartus_pgm --nios2 을 사용한다면, EPCS 장치에 올바른 base address가 지정되었다 확인하라. Platform Deisigner의 플래시 장치에서 base address를 찾을 수 있다.

• Ensure that the EPCS device is correctly connected to the FPGA on the board. Verify the EPCS connection by running the "Test EPCS" routine in the "Memory Test" software template provided by the Nios II EDS. If the test fails, there is a problem with your memory connection. There are two places to look for the problem:

>> EPCS가 FPGA 보드에 정상적으로 연결되었는지 확인하라. Nios II EDS에 소프트웨어 템플릿으로 제공된 "Memory Test"안의 "Test EPCS"를 실행함으로서 EPCS 연결을 확인하라.

— The physical connection on your target board

— The pin assignments on the top-level FPGA design

• Use the Intel Quartus Prime Programmer to program the EPCS device directly via a JTAG download cable, and verify that the EPCS device successfully configures the FPGA.

• Run quartus_pgm --nios2 from the command line with the --epcs parameter. This command displays information about the flash memory in the EPCS device. For more information, refer to the "Using the Flash Programmer from the Command Line" chapter.

Related Links

Using the Flash Programmer from the Command Line on page 16

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


New에서 BSP Template에서 생성으로 보니 존재는 하네

Memory Test Small은 Flash 부분이 빠진다.


그나저나 얘는 램에 올리나.. 찾아보니 이거 실행조차 안되면 램도 연결 제대로 안된거라네..

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

Resetting and pausing target processor: OK

Reading System ID at address 0x04012030: verified

Initializing CPU cache (if present)

OK


Downloading 02000000 ( 0%)

Downloading 02010000 (49%)

Downloading 020200A0 (94%)

Downloading 04008000 (99%)

Downloaded 129KB in 1.9s (67.8KB/s)


Verifying 02000000 ( 0%)

Verify failed between address 0x2000000 and 0x200FFFF

Leaving target processor paused


Downloading ELF Process failed 

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


My problem is resolved now, I just changed the clock source of the EPCS CONTROLLER. The clock was driven from the system clock using a CLOCK BRIDGE.

Now, the clock is driven from a PLL OUTPUT ( the system and the EPCS CONTROLLER clocks are now independent).

Thank you Daixiwen & dsl for helping me. 

[링크 : https://alteraforum.com/forum/showthread.php?t=49224&page=3]

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

Nios II 안된 이유가.. 설마..  (0) 2018.02.04
clock bridge  (0) 2018.02.03
Nios II EPCS 및 SDRAM  (0) 2018.02.03
altera speed grade  (0) 2018.02.03
Nios II 조금 감 잡은듯  (0) 2018.02.02
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 3. 10:11

EPCS도 안되는데 SDRAM은 뺄까...

Platform Designer에서 경고가 뜨는데

epcs_flash_controller에 conduit을 연결해야 한다고 한다.


그런데 EPCS/EPCQx1 에 대해서 Conduit은 필수는 아니라고 하는데 다른건가?

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


DE0_Nano_QSYS_DEMO

DE0_Nano.v

Platform Designer랑 내용이 많이 다른 느낌인데...

어느정도는 자동생성하고 나서 손으로 한땀한땀(?) 연결시켜주는 기분?

DE0_Nano_SOPC DE0_Nano_SOPC_inst(

                      // the_epcs

                       .data0_to_the_epcs(EPCS_DATA0), 

                       .dclk_from_the_epcs(EPCS_DCLK), 

                       .sce_from_the_epcs(EPCS_NCSO), 

                       .sdo_from_the_epcs(EPCS_ASDO), 


                      // the_sdram

                       .zs_addr_from_the_sdram(DRAM_ADDR),

                       .zs_ba_from_the_sdram(DRAM_BA),

                       .zs_cas_n_from_the_sdram(DRAM_CAS_N),

                       .zs_cke_from_the_sdram(DRAM_CKE),

                       .zs_cs_n_from_the_sdram(DRAM_CS_N),

                       .zs_dq_to_and_from_the_sdram(DRAM_DQ),

                       .zs_dqm_from_the_sdram(DRAM_DQM),

                       .zs_ras_n_from_the_sdram(DRAM_RAS_N),

                       .zs_we_n_from_the_sdram(DRAM_WE_N),

                    ); 


DE0_Nano_SOPC.v

module DE0_Nano_SOPC (

output wire [12:0] zs_addr_from_the_sdram,               //                         sdram_wire.addr

output wire [1:0]  zs_ba_from_the_sdram,                 //                                   .ba

output wire        zs_cas_n_from_the_sdram,              //                                   .cas_n

output wire        zs_cke_from_the_sdram,                //                                   .cke

output wire        zs_cs_n_from_the_sdram,               //                                   .cs_n

inout  wire [15:0] zs_dq_to_and_from_the_sdram,          //                                   .dq

output wire [1:0]  zs_dqm_from_the_sdram,                //                                   .dqm

output wire        zs_ras_n_from_the_sdram,              //                                   .ras_n

output wire        zs_we_n_from_the_sdram,               //                                   .we_n

output wire        altpll_sys,                           //                         c0_out_clk.clk

output wire        altpll_sdram,                         //                      altpll_sys_c1.clk

output wire        altpll_io,                            //                         c2_out_clk.clk

output wire        altpll_sys_c3_out,                    //                      altpll_sys_c3.clk

output wire        altpll_adc,                           //                         c4_out_clk.clk

output wire        locked_from_the_altpll_sys,           //          altpll_sys_locked_conduit.export

output wire        phasedone_from_the_altpll_sys,        //       altpll_sys_phasedone_conduit.export

input  wire        in_port_to_the_g_sensor_int,          //   g_sensor_int_external_connection.export


output wire        dclk_from_the_epcs,                   //                      epcs_external.dclk

output wire        sce_from_the_epcs,                    //                                   .sce

output wire        sdo_from_the_epcs,                    //                                   .sdo

input  wire        data0_to_the_epcs,                    //                                   .data0

); 


DE0_Nano_SOPC_sdram sdram (

.clk            (altpll_sys),                                            //   clk.clk

.reset_n        (~rst_controller_002_reset_out_reset),                   // reset.reset_n

.az_addr        (sdram_s1_translator_avalon_anti_slave_0_address),       //    s1.address

.az_be_n        (~sdram_s1_translator_avalon_anti_slave_0_byteenable),   //      .byteenable_n

.az_cs          (sdram_s1_translator_avalon_anti_slave_0_chipselect),    //      .chipselect

.az_data        (sdram_s1_translator_avalon_anti_slave_0_writedata),     //      .writedata

.az_rd_n        (~sdram_s1_translator_avalon_anti_slave_0_read),         //      .read_n

.az_wr_n        (~sdram_s1_translator_avalon_anti_slave_0_write),        //      .write_n

.za_data        (sdram_s1_translator_avalon_anti_slave_0_readdata),      //      .readdata

.za_valid       (sdram_s1_translator_avalon_anti_slave_0_readdatavalid), //      .readdatavalid

.za_waitrequest (sdram_s1_translator_avalon_anti_slave_0_waitrequest),   //      .waitrequest

.zs_addr        (zs_addr_from_the_sdram),                                //  wire.export

.zs_ba          (zs_ba_from_the_sdram),                                  //      .export

.zs_cas_n       (zs_cas_n_from_the_sdram),                               //      .export

.zs_cke         (zs_cke_from_the_sdram),                                 //      .export

.zs_cs_n        (zs_cs_n_from_the_sdram),                                //      .export

.zs_dq          (zs_dq_to_and_from_the_sdram),                           //      .export

.zs_dqm         (zs_dqm_from_the_sdram),                                 //      .export

.zs_ras_n       (zs_ras_n_from_the_sdram),                               //      .export

.zs_we_n        (zs_we_n_from_the_sdram)                                 //      .export

);


DE0_Nano_SOPC_epcs epcs (

.clk           (clk_50),                                                           //               clk.clk

.reset_n       (~rst_controller_001_reset_out_reset),                              //             reset.reset_n

.address       (epcs_epcs_control_port_translator_avalon_anti_slave_0_address),    // epcs_control_port.address

.chipselect    (epcs_epcs_control_port_translator_avalon_anti_slave_0_chipselect), //                  .chipselect

.dataavailable (),                                                                 //                  .dataavailable

.endofpacket   (),                                                                 //                  .endofpacket

.read_n        (~epcs_epcs_control_port_translator_avalon_anti_slave_0_read),      //                  .read_n

.readdata      (epcs_epcs_control_port_translator_avalon_anti_slave_0_readdata),   //                  .readdata

.readyfordata  (),                                                                 //                  .readyfordata

.write_n       (~epcs_epcs_control_port_translator_avalon_anti_slave_0_write),     //                  .write_n

.writedata     (epcs_epcs_control_port_translator_avalon_anti_slave_0_writedata),  //                  .writedata

.irq           (irq_synchronizer_004_receiver_irq),                                //               irq.irq

.dclk          (dclk_from_the_epcs),                                               //          external.export

.sce           (sce_from_the_epcs),                                                //                  .export

.sdo           (sdo_from_the_epcs),                                                //                  .export

.data0         (data0_to_the_epcs)                                                 //                  .export

);


DE0_NANO_SDRAM_Nios_Test

altpll에서  한개를 분기해서 쓰는데 정작 altpll_sdram이라고 이름지어준 애는 안쓰냐 -ㅁ-?


기본값은 width 32/row 12/col 8인데

width 16/ row 13/col 9으로 해주면 32MB로 생성 되는 듯


이건.. 데이터시트 보고 씨름해야 하니 패스


sdram에는 클럭이 연결 되어야 하는구나..


일단 c0는 100MHz로 2배 뻥튀기 해서 제공된다.



---

내가 생성한 파일에는 export 부분에 변수가 연결이 없다.

unsaved_epcs_flash_controller_0 epcs_flash_controller_0 (

.clk        (clk_clk),                                                                //               clk.clk

.reset_n    (~rst_controller_reset_out_reset),                                        //             reset.reset_n

.reset_req  (rst_controller_reset_out_reset_req),                                     //                  .reset_req

.address    (mm_interconnect_0_epcs_flash_controller_0_epcs_control_port_address),    // epcs_control_port.address

.chipselect (mm_interconnect_0_epcs_flash_controller_0_epcs_control_port_chipselect), //                  .chipselect

.read_n     (~mm_interconnect_0_epcs_flash_controller_0_epcs_control_port_read),      //                  .read_n

.readdata   (mm_interconnect_0_epcs_flash_controller_0_epcs_control_port_readdata),   //                  .readdata

.write_n    (~mm_interconnect_0_epcs_flash_controller_0_epcs_control_port_write),     //                  .write_n

.writedata  (mm_interconnect_0_epcs_flash_controller_0_epcs_control_port_writedata),  //                  .writedata

.irq        (irq_mapper_receiver1_irq),                                               //               irq.irq

.dclk       (),                                                                       //          external.export

.sce        (),                                                                       //                  .export

.sdo        (),                                                                       //                  .export

.data0      ()                                                                        //                  .export

);

 


+

conduit 추가하니까

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

); 

그와 연결된 핀들도 추가된다. 신기하네..

module unsaved (

input  wire        clk_clk,                          //                       clk.clk

output wire        epcs_dclk,                        //                      epcs.dclk

output wire        epcs_sce,                         //                          .sce

output wire        epcs_sdo,                         //                          .sdo

input  wire        epcs_data0,                       //                          .data0

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

input  wire        reset_reset_n,                    //                     reset.reset_n

output wire [12:0] sdram_addr,                       //                     sdram.addr

output wire [1:0]  sdram_ba,                         //                          .ba

output wire        sdram_cas_n,                      //                          .cas_n

output wire        sdram_cke,                        //                          .cke

output wire        sdram_cs_n,                       //                          .cs_n

inout  wire [31:0] sdram_dq,                         //                          .dq

output wire [3:0]  sdram_dqm,                        //                          .dqm

output wire        sdram_ras_n,                      //                          .ras_n

output wire        sdram_we_n                        //                          .we_n

);



+

SDRAM bit width와 row, column이 안 맞으면 요런에러가 뜬다

Error (13076): The node has multiple drivers due to the always-enabled I/O buffer 

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


ftp://ftp.altera.com/up/pub/Altera_Material/13.1/Tutorials/DE0-Nano/Using_DE0-Nano_Flash.pdf

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

clock bridge  (0) 2018.02.03
끄아아아아아 EPCS 안돼 ㅠㅠ  (4) 2018.02.03
altera speed grade  (0) 2018.02.03
Nios II 조금 감 잡은듯  (0) 2018.02.02
xilinx easypath / Altera hardcopy  (0) 2018.02.02
Posted by 구차니