Embedded2013. 3. 18. 10:47

Accelerated FIR with Built-In Direct Memory Access Example


http://www.altera.com/support/examples/nios2/exm-accelerated-fir.html


NIOS-II 프로세서에 FIR 필터를 연결하여 시스템을 처리하는 Example이다. 

전체적인 System 그림은 아래와 같다.





하드웨어의 사양은 아래와 같다.


  • Nios Development Board, Cyclone® II or Stratix® II FPGA Edition
  • Nios II core: Nios II/f debug-enabled, 4 KB I-cache, 2 KB D-cache
  • SSRAM: 2 MB
  • DDR SDRAM: 32 MB
  • Timestamp timer: 10 us resolution
  • JTAG UART
  • Phase-locked loop (PLL)
  • System ID
  • Custom FIR hardware accelerator with Avalon-MM masters
  • Also supports Embedded Systems Development Kit, Cyclone III Edition (3C120) and Nios II Embedded Evaluation Kit, Cyclone III Edition (3C25)


이번에는 튜토리얼 개념이 아니라 그냥 디자인 파일만 존재한다.

- 한편으로는 다행이다. 일일이 따라가면서 보는게 쉽지 않았다.


Design File


디자인은 아래 파일이다. 

Accelerated FIR with Built-In DMA Design Example (.zip file)


압축을 풀으면 아래와 같은 폴더들이 나온다.




Cyclone II/III Startix II 등에 맞게 디자인 되어 있다.


ReadMe.txt는 

- Custom Read-Write Masters Design v2.0 

을 제목으로 간단 간단한 설명을 한다.

내용 중에 Instruction으로 간단히 뭘 어떻게 해야 한다고 설명하는 부분이 있다.


Usage Instructions

-------------------------------------

To run the design on Cyclone II 2C35, Stratix II 2s60 RoHS Nios Development Board, Cyclone III Embedded Evaluation Kit (3c25), Cyclone III Embedded Development Kit (3C120).


1. Extract the archived contents to a location of your choice in harddrive, this is refered as <project_folder>

    압축을 잘(?) 풀고


2. Open Quartus II software. Click File -> Open Project. Browse to <project_folder> and select the custom_dma.qpf project file.

   - For 3C25 and 3C120, the file names are cycloneIII_3c25_niosII_standard.qpf and cycloneIII_3c120_niosII_video.qpf respectively

   Q-II에서 프로젝트를 연다 





3. Click Tools -> Programmer to bring up the Quartus II programmer utility. Make sure the custom_dma.sof file is selected. Click on Start to download the .sof 

    to FPGA. (Click on Add File if the sof is not selected)

   - For 3C25 and 3C120, the file names are cycloneIII_3c25_niosII_standard.sof and cycloneIII_3c120_niosII_video.sof respectively.

    다운로드에 대해서 이야기한다.


4. Open Nios II IDE software. Click File -> Import.




5. Expand Altera Nios II folder and select Existing Nios II IDE project into workspace, then click Next.





6. Browse to <project_folder>/software/custom_dma directory and click OK.



7. Click Finish after that is done.

8. Repeat steps 4 to 7 again for folder named custom_dma_syslib in the same software directory.

    Note: Please make sure the target ptf file is set to correct path and with correct cpu being selected.


9. Right click on the project and select Build Project.


10. Once the project is successfully built, right click the project again and select Run As -> Nios II Hardware. 

      Note: Please make sure the sof file is downloaded to FPGA before running the software. 

             If this is not done, please repeat step 3. (주의 깊게 다시 해보라는 말이다.)


For more information on the software code, please refer to the comments written in the source files.



컴파일을 하면 오류가 아래와 같이 나온다.

Symbol 'FIR_DMA_BASE' could not be resolved hw_fir.c /custom_dma line 24 Semantic Error


이렇게 하면 안되고...

프로젝트를 만들고, 여기에다가 제공된 S/W를 Update해야 한다.

(1) NIOS-II SBT 를 열고
여기에서 NIOS-II Application and BSP from Template를 선택




sopcinfo 파일을 불러들여서 Load를 한다.

적당하게 프로젝트 이름을 설정하면 된다.



(주) 위에서 Template는 Blank Project로 선택한다.


File->Import로 창을 띄우고



File System을 선택한다.


그리고 나타난 창에서 C/H/Dat 파일을 선택한다.




그러면 Project Explorer창에 아래와 같이 나온다.




이제 빌드를 해본다. 

 

Project -> Build All


오류가 발생한다.




alt_timestamp_freq 등의 함수가 오류가 난다.

대충 보면 알테라에서 제공하는 라이브러리 함수 같다.

bsp package에 포함되어 있을 것 같은데 링크가 안된다.


이전에 정리한 부분을 생각해보면 altera에서 제공하는 라이브러리를 줄일 수 있는 옵션이 있는 것으로 보아서 라이브러리를 필요에 따라서 선택할 수 있는 옵션이 있을 것이다.


bsp package를 확인


File->Properties->BSP Editor 선택



그러면 아래와 같은 창이 나타난다.





Setting->Common->hal->timestamp_timer


를 선택한다.


None으로 되어 있는 값을 sys_clk_timer 로 변경한다.






그리고 Generate를 선택하여 라이브러리 설정을 바꾼다


이제 OK를 눌러서 창을 닫고 다시 컴파일을 한다.


Project->Build all

을 하면 컴파일이 완료 된다.




이제 Quartus-II에서 Processing->Start Compilation 으로 하여서 컴파일 하면 

시간이 좀 흐른뒤에 컴파일이 끝난다.



 


대충은 된것을 확인했고 다음에는 이 것의 코드를 따라가 본다.


<NIOS-II> 사용 프로젝트는 중단되어서 다음 기회에 하기로 함.. 더이상 진행하지 않음..


'Embedded' 카테고리의 다른 글

freescale iMX.6  (4) 2013.05.09
오래간만의 Windows CE  (0) 2013.05.04
Altera NIOS-II (3)  (1) 2013.03.17
Altera NIOS-II (1)  (0) 2013.03.15
uC/GUI 데모 그림입니다.  (0) 2010.07.18
Posted by GUNDAM_IM