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 구차니
embeded/FPGA - ALTERA2018. 2. 3. 07:39

PLL 보다 보니 speed grade 라는게 보여서 검색해보았는데

DE0-Nano 내꺼에 박힌 녀석은

EP4CE22F17C6

Commercial 등급에 가장 빠른 녀석이다.


Operating Conditions

When Cyclone IV devices are implemented in a system, they are rated according to a set of defined parameters. To maintain the highest possible performance and reliability of Cyclone IV devices, you must consider the operating requirements described in this chapter. Cyclone IV devices are offered in commercial, industrial, extended industrial and, automotive grades. Cyclone IV E devices offer –6 (fastest), –7, –8, –8L, and –9L speed grades for commercial devices, –8L speed grades for industrial devices, and –7 speed grade for extended industrial and automotive devices. Cyclone IV GX devices offer –6 (fastest), –7, and –8 speed grades for commercial devices and –7 speed grade for industrial devices. 

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


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

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

끄아아아아아 EPCS 안돼 ㅠㅠ  (4) 2018.02.03
Nios II EPCS 및 SDRAM  (0) 2018.02.03
Nios II 조금 감 잡은듯  (0) 2018.02.02
xilinx easypath / Altera hardcopy  (0) 2018.02.02
Nios II Flash Programmer  (0) 2018.02.01
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 2. 16:40

잘 된다고는 안했음 ㅋㅋㅋ


Step 1. Quartus 2

일단은 사용할 FPGA 종류 설정 그리고 핀 이름들 할당을 해줌

(귀찮으니 terasic에서 제공하는 유틸리티로 프로젝트 생성)


Step 2. Platform Designer

Nios II 구성

각종 장치를 붙이고 Nios II 내장 장치가 아닌 EPCS나 SDRAM은

Quartus 2 에서 지정한 핀 이름에 연결을 해주도록 해야 함(export 항목)


Step 3. Quartus 2

Platform Designer 에서 export로 지정한 외부 장치들과 실제 장치를 FPGA 핀을 이용하여 연결.

(말이 거창한데 on-chip memory를 제외하고는 CLK나 RESET 같이 외부와 연결되어야 할 net을 연결하란 의미)

Nios II의 instance를 생성하고 합성하여 sof를 만듦. 취향(?)에 따라 jic나 pof 등으로 변환


Step 4. Eclipse for Nios II

생성했던 Nios의 bsp와 sopc 파일을 연결하여 Nios를 구동하는데 쓰일 프로그램을 작성

Eclipse와 연결된 Flash Programmer로 굽거나

콘솔에서 SOF와 ELF를 FLASH로 변환(SREC 포맷) 후 intel HEX로 다시 변환하여

JIC나 POF로 합쳐서 FPGA에 프로그래밍 함.


한곳에서 한큐에 끝나는게 아니고 3개의 프로그램에서 아래의 3가지를 설정해야 한다.

  • FPGA 주변부 하드웨어와 (SDRAM, EPCS 등)
  • Nios 소프트웨어 (elf 확장자로 나오는)
  • 프로세서 (Nios II 설정과 입출력 포트)

설정해야 할 것이 방대한 만큼 알아야 할 게 많아서 , 제대로 다룰 수 있는 사람이 적을 수 밖에 없을 듯..


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

Nios II EPCS 및 SDRAM  (0) 2018.02.03
altera speed grade  (0) 2018.02.03
xilinx easypath / Altera hardcopy  (0) 2018.02.02
Nios II Flash Programmer  (0) 2018.02.01
de0-nano SDRAM with Nios II  (0) 2018.01.31
Posted by 구차니
embeded/FPGA - ALTERA2018. 2. 2. 16:19

ASIC 까진 아니더라도, FPGA를 PLD로 양산해주는거

대신 수량이 좀 되어야 하는 듯?


[링크 : https://www.xilinx.com/products/silicon-devices/fpga/easypath.html]

[링크 : https://www.altera.com/support/support-resources/operation-and-testing/dev-hardcopyii.html]


아래 내용들을 찾아보는데 정확하게 어떤 제품군인지 모르겠네?

그냥 대신 구워주는 서비스 이런걸 생각했는데 

그런류가 아니라 실제 ASIC에 준하는 반도체로 뽑아내긴 하나보다 ㄷㄷ


자일링스의 이지패스 솔루션은 FPGA에서 디자인한 반도체를 주문형반도체(ASIC)로 만드는 대신, 저가의 프로그래머블 반도체를 통해 양산해주는 것이다. 이를 통해 시스템업체 및 반도체 업체들은 반도체 소량 양산할 경우 ASIC 과정을 거칠 필요가 없어 시스템 설계 시간을 줄이고 테스트 비용을 줄일 수 있다. 

[링크 : http://www.etnews.com/200410310006?m=1]


대부분의 비용 절감 요소가 디자인 옵션을 제한하고 최적화되지 않은 부품이나 패키지를 고객에게 과도하게 강요한다. 반면, 이지패스-6 FPGA는 기본 제품군의 모든 디바이스, 패키지, 모든 속도 및 온도 등급을 지원하는 유일한 FPGA 절감 솔루션이라는 점에서 유례 없는 제품이다. 이는 고객이 디자인을 구현하고 비용을 절감 하기 위해 모든 버텍스®-6 LX, LXT, SXT 및 HXT 디바이스를 선택할 수 있게 되었음을 의미하는 것이다.

기타 다른 방식과는 달리, 이지패스-6 FPGA는 ASIC 컨버전이나 라우팅 강화(routing-hardened) FPGA가 아니다. 버텍스-6에서 이지패스-6 디바이스로 마이그레이션 할 때 추가적인 디자인 제약이 따르지 않는다. 또한 FPGA 디자인을 재 작업하거나 다시 최적화할 필요도 없으며, 회로보드를 다시 레이아웃 할 필요도 없다. 고객이 자일링스에 디자인파일을 제공하면, 실리콘 웨이퍼를 표준 FPGA와 동일한 전기적 파라미터로 테스트하여 고객 디자인에 사용되는 특정 리소스에 대해 저장한다. 그 후 6주 내에 파생 다이가 조립 및 표시되고 최종 테스트를 거쳐 그 기능과 성능을 확인한다. 자일링스에서 최초로 단 기간 내에 프로토타입에서 즉시 양산이 가능한 디바이스를 제공하는 FPGA 비용 절감 솔루션을 선보이게 된 것이다.

[링크 : https://pldworld.blogspot.com/2009/11/1117-6-fpga-6-fpga.html]


5) CPLD(Complex Programmable Logic Device)
CPLD는 Altera에서 상업용으로 제품화되어 쓰이고 있으며, 이런한 구조를 보면 메모리와 특별한 로직함수를 구현하기 위해 Embedded Array가 있고 이 내부에는 여러 개의 Embedded Array Block이 있다. 각각의 Embedded Array Block은 2,048Bit가 있으며 이것은 RAM, ROM, FIFO, Dual-port RAM등을 구현할 수 있다. 또한 하나의 Embedded Array Block 내부에는 8개의 Logic Element(LE)와 Local interconnection 으로 구성된다. 이러한 Logic Element에는 8-Bit Counter,

Address decoder, State machine과 같은 중규모(Medium size)의 Logic block을 만들 수 있다. 외부와 인터페이스 되는 Pin 으로는 I/O Element가 있고 이는 양방향의 I/O Buffer와 전용(Dedicated)의 Pin들로 구성된다. 아울러 CPLD의 구조는 빠른 성능이나 정확한 타이밍의 예측이 필요로 하는 곳에 적합한 구조이며, FPGA의 구조는 많은 플립플롭(Flip-Flop)을 사용하는 순차 회로나 대용량이 필요한 곳에 적합한 것이기 때문에 서로 응용 분야에 따라 선택하여 적용하는

것이 좋다.



6) FPGA(Field Programmable Gate Array)
FPGA는 CPLD와 달리 PLD의 블록간의 연결을 Array 구조와 행(Row)구조의 형태를 이용하여 연결을 하는 2가지의 형태로 나누어진다. 각각의 SPLD 블록간에는 나누어진 segmented Interconnect를 쓰기 때문에 연결 상태에 따라 내부의 연결 길이가 변경 될 수가 있다. 그러므로 연결 상태에 따라 라우팅 딜레이가 다르게 되어 타이밍의 예측이 어렵고 논리 소자의 성능 또한 CPLD의 구조에 비해 떨어진다. 그러나 사용자가 사용할 수 있는 게이트의 용량은 CPLD 보다는 많다는 장점을 가지고 있는데, 이것은 각각의 구조가 나쁘다는 것보다는 사용자의 응용 부분에 따라서 특성화 할 수 있다는 방향으로 보는 것이 정확할 것이다.

3. PLD의 특징
한국의 PLD 시장은 급속히 해마다 증가하고 있다. 그리고 Altera, Xilinx, Lattice, Actel과 Quick Logic등의 미국 반도체 회사들이 한국에 프로그램형 디바이스를 제공하고 있다. Quick Logic의 Device는 많은 Flip-Flop이 내장되어 있고, P&R(Place and Route)의 성능이 우수하고 고속인 반면, 1회의 Program만 허용하기 때문에 반복해서 프로그램 하는 실험용으로는 비 적합하고, 또한 고가이기 때문에 사용상의 제약이 따른다. 여기에서는 교육용으로 제공하고 있는 Altera를 중심으로 디지털 설계 방법 및 Tools사용법을 설명하기로 한다. 또한 Altera사에서 제공하는 디바이스들은 한국에서 시장 점유율이 가장 높은 프로그램형 디바이스이고, 소프트웨어의 사용도 상당히 쉽다는 장점이 있다. 아울러 ALTERA사에서 제공하는 프로그램형 디바이스의 구조에 관하여 설명을 하고 디지털 회로를 설계하는 방법에 관하여 설명을 하겠다. 디지털 설계와 하드웨어의 구현은 AX+plus II라는 Altera 사에서 제공하는 소프트웨어를 이용하여 설명한다. 

[링크 : http://egloos.zum.com/lhh1914/v/8831239]

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

altera speed grade  (0) 2018.02.03
Nios II 조금 감 잡은듯  (0) 2018.02.02
Nios II Flash Programmer  (0) 2018.02.01
de0-nano SDRAM with Nios II  (0) 2018.01.31
EPCS Controller 추가 및 jic 통합하기.. 실패중  (0) 2018.01.31
Posted by 구차니
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 - 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 구차니