embeded/FPGA - ALTERA2018. 3. 3. 13:20

Quartus 2에 내장된 기능으로

미리 만들어 진 템플릿을 통해 더 효율적으로 HDL을 생성할 수 있다고 한다.

문서 편집기의 아무곳에서 우클릭을 하면 "Insert Template" 를 볼 수 있는데


모듈 단위로 미리 짜여진 코드들이 쭈루룩 뜨게 된다.


그나저나 못보던 문법들이 보이네.. ㅠㅠ


12 Recommended HDL Coding Styles

[링크 : https://www.altera.com/en_US/pdfs/literature/hb/qts/qts-qps-5v1.pdf] 810page 

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

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

fpga clocked video  (0) 2018.03.19
multiport memory controller  (0) 2018.03.19
de0-nano virtual serial  (0) 2018.02.28
fpga uart echo  (0) 2018.02.28
sopc builder -> qsys -> platform designer  (2) 2018.02.26
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 28. 20:53

quartus_stp를 이용해

USB Blaster의 JTAG 시리얼을 이더넷을 통해 볼 수 있도록 하는 내용


verilog 코드는 좀 분석을 해봐야 겠다.

[링크 : http://idlelogiclabs.com/2014/07/12/virtual-com-port-connection-de0-nano-vj-uart/]


+

2018.03.03

내부적으로 vtag모듈은 sld_virtual_jtag 이라는 모듈을 사용하는데

검색을 해보니 altera megafunction 이네..

sld_virtual_jtag sld_virtual_jtag_component (

.ir_out (ir_out),

.tdo (tdo),

.virtual_state_cir (sub_wire0),

.virtual_state_pdr (sub_wire1),

.ir_in (sub_wire2),

.tdi (sub_wire3),

.virtual_state_udr (sub_wire4),

.tck (sub_wire5),

.virtual_state_e1dr (sub_wire6),

.virtual_state_uir (sub_wire7),

.virtual_state_cdr (sub_wire8),

.virtual_state_e2dr (sub_wire9),

.virtual_state_sdr (sub_wire10)

// synopsys translate_off

,

.jtag_state_cdr (),

.jtag_state_cir (),

.jtag_state_e1dr (),

.jtag_state_e1ir (),

.jtag_state_e2dr (),

.jtag_state_e2ir (),

.jtag_state_pdr (),

.jtag_state_pir (),

.jtag_state_rti (),

.jtag_state_sdr (),

.jtag_state_sdrs (),

.jtag_state_sir (),

.jtag_state_sirs (),

.jtag_state_tlr (),

.jtag_state_udr (),

.jtag_state_uir (),

.tms ()

// synopsys translate_on

); 


[링크 : https://www.altera.com.cn/content/dam/altera-www/global/zh_CN/pdfs/literature/ug/ug_virtual_jtag.pdf]

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

multiport memory controller  (0) 2018.03.19
quartus 2 insert template  (0) 2018.03.03
fpga uart echo  (0) 2018.02.28
sopc builder -> qsys -> platform designer  (2) 2018.02.26
Nios II / Floating Point Hardware 2  (0) 2018.02.26
Posted by 구차니
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 구차니