원문: http://warpproject.org/trac/wiki/Exercises/13_4/IntroToSDK


Introduction to the Xilinx Software Development Kit (SDK)

(compatible with WARP v3)


In this exercise, users will be introduced to a tool that is used heavily in WARP development: the Xilinx Software Development Kit (SDK). Users will use these tools to construct a simple "Hello World" software project that prints messages via UART to a terminal running on the user's PC and controls the User I/O on the board to run on and off LEDs and display numbers on the hexadecimal displays.


유저는 SDK를 사용하여서 (간단한 example 을 구현한다.) 헬로월드 따위를 PC로 전송하여 터미널에 디스플레이 할 수 있고 몇가지 I/O 포트 제어 및 LED 제어가 가능할 것이다. SDK는 이클립스의 IDE와 유사하며, 그리고 주로 사용하는 언어는 C와 C++ 이다. 이를 통하여 마이크로 블레이즈 CPU를 제어한다. 



The SDK will look very familiar to users who are comfortable with the Eclipse IDE. Basically, the SDK allows users to write custom C or C++ code to execute on the MicroBlaze processor. Furthermore, it natively supports step-by-step debugging of code as well as code profiling.


Prerequisites

필요한 준비물은 아래와 같다. PC와 연결한 와프 보드와 인터페이스 JTAG이 필요하다. +정전기 방지에 대한 숙지.

보드만 구매하면 낭패를 볼수있으니, 반드시 호환되는 JTAG 케이블도 함께 구매하길 바란다. 

  • You have a WARP v3 board
  • ESD protection for the WARP board (wrist strap, etc)
  • External USB JTAG cable and a micro USB cable for UART
  • Complete installation of ISE System Edition 13.4
  • Set up a terminal on your computer using PuTTY or an alternative. Instructions to do this are available instructions here.



Instructions

매우 간단한 예제를 따라하면서, 새프로젝트의 생성 및 디버거 툴을 사용해보면서 익숙해지는 과정을 상세히 설명하고 있습니다. 주석이 필요한 부분만 달고 나머지 부분은 직접 따라해보길 권장합니다.


  1. Download the WARP v3 Template Project. Note: any template for your version of the hardware will work fine for this exercise as only the SDK is necessary. In general, when FPGA hardware designs must be generated, the "lite" template will build the quickest, but it lacks peripherals like Ethernet that may be necessary for designs other than this simple Introduction to the SDK exercise.

    앞서 이야기한 예제를 실행하기 위해서, 위의 링크의 프로젝트를 다운로드 합니다. 이는 섹션4의 마지막 파트에서 설명하게되는 프로젝트 예시파일과 같습니다. (* Template Projects) 실행을 위해서는 SDK가 반드시 필요합니다. 일단적으로 FPGA 하드웨어 디자인들이 생성될때, lite 버전의 템플릿들은 빠르게 생성되지만 그것은 이더넷과 같은 주변장치를 제외하기 때문에 초기 학습에 적합하지 않습니다.


  2. Extract the archive into a folder on your hard drive. Note: this folder must not contain any spaces in the path (this includes folders such as "My Documents" in Windows; Please note that in Windows 7, the Desktop folder can be used, "C:\Users\<username>\Desktop", whereas in previous versions of Windows the Desktop folder was under the "Documents and Settings" directory and could not be used).

    어쨌거나 템플릿 프로젝트 파일의 압축을 풀고, 해당폴더는 최상위 폴더여야 합니다. 

  3. Launch the Xilinx SDK from the Start Menu. It will ask you to select a workspace. Click "Browse ..." and navigate to the "SDK_workspace" folder in the archive you just extracted. Do not check the box for "Use this as the default and do not ask again." We recommend the convention of using a single workspace per hardware project; checking this box will make this difficult. More useful tips for using the SDK are available here. Click OK.

    시작메뉴의 자일링스 SDK를 실행시킨다. SDK작업폴더로 이동한다. default 설정을 유지한다. 이 옵션을 선택하지 않으면 귀찮아 진다. 더 많은 정보는 here 링크를 참조하세요.

  4. Rather strangely, the Xilinx SDK does not automatically know about software drivers to custom peripherals in your XPS project. You have to explicitly tell the SDK where to find your hardware project. This is a step you have to do with every new SDK workspace. In this exercise, we do not have any custom peripherals, but it is still a good habit to get into. Click on the "Xilinx Tools" menu item and select "Repositories." Here, you want to ensure two things:
    • In Local Repositories, you want to point the SDK to the folder that contains the XPS project system.xmp file. Click on "New..." and navigate to and select this folder.
    • In Global Repositories, you want the SDK to point to the edk_user_repository folder on your hard drive. Unlike the local repositories, the SDK does remember this setting across workspaces. You'll only need to manually add the edk_user_repository the first time you run the SDK.

      자일링스 SDK는 자동적으로 소프트웨어 드라이버를 찾거나 알지 못합니다. 따라서 당신이 명확하게 지정해주어야 합니다. 이는 새로운 SDK workspace를 생성할때마다 반복해야 합니다. 실질적인 SDK와 XPS의 사용법은 직접 실행을 통하여 익숙해지길 권합니다.


  5. In the template project you downloaded, we have provided a template software project. We now need to add it to the workspace. Click on File→Import...

    다운로드한 템플릿 프로젝트는 현재의 작업영엑 추가해야한다. 클릭후 파일메뉴에서 불러오기 선택.
    (이제부터 아래의 메뉴얼의 내용대로 진행하세요. 앞으로 추가설명이 필요한 부분만 주석처리 하겠습니다.)

  6. Click the + next to "General" and select "Existing Projects into Workspace." Then click "Next."

  7. In the "Select root directory:" click "Browse..." Then, navigate to the "SDK_workspace" folder in the extracted archive and click "OK"

  8. Three projects have now been populated in the "Projects" area of the import window. Make sure all of these are checked. Do not check "Copy projects into workspace" because these projects are already in the SDK_workspace folder. Click "Finish."


  9. The three projects now appear in the "Project Explorer" on the left of the screen:

    세개의 프로젝트에 대한 정보를 이름과 관련된 파일들로 분류하여 설명합니다. 

    • The "*_hw_platform" contains all of the necessary hardware-specific information for the project. This includes any custom FPGA cores that the project may have. This comes from the Xilinx Platform Studio (XPS) tool. Instructions for using this tool to generate hardware platform information for the SDK is available in the Introduction to XPS exercise.
    • The "*_bsp" is a "Board Support Package" and it contains the software drivers for the peripherals contained in the hardware platform.
    • The "*_example" project is the top-level software project that you will modify to add a print of "Hello World" to the UART.

  10. Click the + button next to the "*_example" project. Then open the "src" folder by clicking the + button next to it. Finally, double click the "*_example.c" file to open it in the editor. At this point, you can look through this source code and see that it will print some messages to the terminal and will count upwards, displaying the current count on the hexadecimal displays on the WARP board and the LEDs.

  11. Right click on the "*_example" software project in the Project Explorer and click "Generate Linker Script." Here, we will assign instruction and data pieces of our code to various pieces of memory in our XPS hardware project. Assign the following:
    • The code sections to "ilmb_cntrl_dlmb_cntlr"
    • The data sections to "xps_bram_if_cntlr_0"
    • The heap and stack to "xps_bram_if_cntlr_1"

  12. Click "Generate" and then "Yes" to the message that says you are going to overwrite an existing linker script. The console will print messages and end with "Finished building: *_example.elf.elfcheck"

  13. Make sure your WARP hardware is powered on (fan should be running). Also make sure the WARP hardware is connected via JTAG (for programming) and connected via micro USB (for terminal communication) to your computer.

  14. Click the "Xilinx Tools" menu item and then "Program FPGA." Then click Program. This will load the hardware design onto the board. It will not load the software project.

  15. Open up a terminal emulator on your computer and configure it to accept your COM port with speed 57600 baud.

  16. The SDK is somewhat sensitive on what project has "focus" when you tell it to do something like load a design onto the board. Make sure the "*_example" project is highlighted. If it is not, click on it so that it will be.

  17. Click the menu item "Run" and then click "Run." A window will pop up asking you to select a way to run your "*_example" program. Click "Launch on Hardware" and then okay.

  18. The project is now running! You should see the LEDs and hexadecimal displays on the board incrementing twice a second. Furthermore, your terminal should be printing.

  19. Try to modify any of the prints in the code with your own custom strings. Click save. The SDK will automatically recompile the project. Download it again through the "run" menu.

  20. Also, find the usleep(250000) line inside the userio_example() function. This line is telling the processor to wait for half a second before incrementing the displays upwards. Replace this with usleep(500000) and you should see the board count half as fast.


Discussion

The purpose of this exercise was to take you through the whole process of writing software for an existing hardware project. In the System Generator Peripheral Export exercise, you will develop a custom FPGA peripheral core and control it via custom software.


Additional Questions and Feedback

If you have any additional questions about this exercise or other feedback, please post to the ​WARP Forums.




원문: http://warpproject.org/trac/wiki/GettingStarted/WARPv3/IntroToTools




WARP v3 Getting Started Exercises

Developing custom applications on WARP requires using design tools from Xilinx. These tools are sophisticated (i.e. they're complicated) and can be daunting to a new user. We've created some simple exercises that introduce the core tools most WARP users will use.


WARP에서 어떠한 사용자정의의 어플리케이션을 개발하기 위해서는 자일링스에서 제공하는 디자인툴을 사용해야 합니다. 이러한 툴은 매우 정교하지만 복잡하지는 않으며, 우리는 몇가지의 간단한 예제들을 제공합니다. 이 예제들은 핵심적인 툴들을 소개하면서 동시에 WARP 유저들이 빈번하게 사용하고 스터디 하게 될 것입니다.



Basic Design Structure


All WARP reference designs are built using the Xilinx Embedded Development Kit (EDK). The EDK enables construction of designs with both a processor, for running custom software, and custom hardware cores for real-time processing and connecting to off-chip hardware.


모든 WARP 레퍼런스 디자인은 자일링사의 내장 개발키드 (EDK)를 통해서 빌드됩니다. EDK는 사용자 정의 소프트웨어의 동작을 위한 절차와 사용자 정의형 하드웨어 기술들(실시간 처리 및 확장 하드웨어 연결) 등을 가능하게 해줍니다. 


그래서 EDK는 2가지의 주요 툴을 포함하는데, 

The EDK includes two primary tools:


- Xilinx Platform Studio (XPS): integrates the hardware cores for a design, including the MicroBlaze processor, memory, peripherals and interfaces for off-chip hardware

- Xilinx Software Development Kit (SDK): a full suite of software compilation and debugging tools for the MicroBlaze processor

자일링스 플랫폼 스튜디오 (XPS) 와 자일링스 소프트웨어 개발 키트 (SDK) 이다. 
XPS는 MCU와 메모리 주변 I/O 디자인을 위한 소트프웨어, SDK는 컴파일 및 디버깅 도구.


The basic structure of WARP reference designs is illustrated below.






WARP 레퍼런스 디자인의 기본적인 구조는 위의 그림과 같다.



The major components of this architecture are:


MicroBlaze soft processor: The MicroBlaze is a processor core implemented in the FPGA fabric and is supplied by Xilinx as part of the EDK. This processor replaces the hard PPC405 core familiar to users of WARP v1 and v2. WARP보드는 Virtex-6 FPGA 보드(마이크로 블레이즈를 사용하는)위에 올라가서 구동된다. 즉 상위 어플레케이션 단은 WARP (FPGA를 제어한다) 지만 실질적인 구현은 FPGA를 통해서 실행된다. 여기선 1세대 2세대 와프의 CPU 코어 패밀리에 대해서 간략히 이야기 한다.


Memories: the Virtex-6 FPGA includes a large number of "block RAMs", or internal RAM blocks which can be interconnected to form arbitrarily sized memory areas accessible to the MicroBlaze. These block RAMs are used for cache, instruction and data storage. 사용되는 메모리는 블락 타입의 램 또는 내부 메모리를 마이크로 블레이즈 CPU를 구동 및 돕기 위해서 사용된다. 블락 메모리는 주로 명령구문 처리와 데이터 저장/캐시 를 위해서 사용된다.


Processor bus: a standard bus connects the MicroBlaze to each core in the system. Current reference designs use a bus called PLB; future designs will migrate to the newer AXI standard. 프로세서 명령어들이 이동하는 통로인 버스는 시스템안에서 각각의 코어와 CPU에 연렬된다. 이러한 버스는 PLB로 불리우며 현재 데이터 및 명령등이 이동하는 통로로 사용된다.


Peripheral cores: a collection of peripheral cores compose every hardware design. Some are provided by Xilinx (like the UART and Ethernet MAC). We have designed others (like the WARP v3 user I/O and radio interface cores).병렬 코어들은 모든 하드웨어를 구성하는 디자인으로 사용됐다. 유아트나 이더넷 맥이 제공되었다.


Off-chip resources: these blocks represent the other hardware on WARP v3 besides the FPGA, like the radio interfaces, FTDI USB-UART transceiver and Marvell Ethernet PHYs Off 칩은 기존의 통합 MCU에서 많이 쓰던 온칩과는 반대로 칩안에 모든 연산 입출력 저장장치가 모두 들어있는 형태가 아니라 따로 구성되어있는 형태를 의미한다. 따라서 이들은 다른 보드에 올려져있고 이는 어떠한 연결된 버스에 의해서 제어되고 해당 버스는 USB형 변환된 유아트나 이더넷등으로 명령어가 이동하여 제어된다.


The MicroBlaze processor and connected cores are all implemented in the FPGA fabric using XPS. The output of the XPS flow is a "bitstream" with the fully synthesized and implemented hardware design. This bitstream integrates the MicroBlaze, the standard peripheral cores, your custom cores, I/O assignments and clock configurations. However the MicroBlaze instruction and data memories are blank in this bitstream.

The XPS-generated bitstream (and its associated hardware specification) is the starting point for an SDK project. The SDK compiles custom code for the MicroBlaze, along with drivers for the various cores included in the XPS hardware design. The output of this process is an "elf" file, the software binary ready for execution by the MicroBlaze. The elf binary is combined with the XPS-generated bitstream to program the FPGA with the final hardware+software design.


지금까지 기본적인 소프트웨어와 와프의 구조 및 제어방식에 대해서 설명하였다, 이제는 실질적인 연습코드를 사용하여 제어를 진행해보자. 앞서 이야기 했듯이 와프의 제어를 위해서는 자일링스에서 제공하는 개발툴이 필요하다. 이것이 자일링스 플랫폼 스튜디오 XPS이고, 이안에 자일링스 SDK가 설치되어서 와프와 연결되어 효과적으로 제어할 수가 있게 된다







원문: http://warpproject.org/trac/wiki/GettingStarted/WARPv3/Tools


본 페이지는, 두번째로 WARP를 잘 사용하기 위한 툴들과 장비들에 대해서 설명한다. 간단히 말하자면 WARP에서 사용되는 여러 칩셋들과 표준 프로토콜을 구동하기 위한 소프트웨어들에 대한 설명이다. 


    OS

We recommend Windows 7, 64-bit for all WARP development. That said, the Xilinx tools also support:

  • Red Hat Enterprise 5 Workstation
  • Red Hat Enterprise 4 Workstation
  • SUSE Linux Enterprise

So, these OS choices should also be okay. However, many of the other tools listed here rely on Windows, so appropriate replacements must be found.

OS는 윈도우 7을 추천한다.


    Xilinx Tools

A full installation of the Xilinx tools (System Edition), fulfilling all Xilinx licensing requirements, is necessary for building custom FPGA designs (i.e. hardware). An SDK-only installation (with less stringent licensing requirements) is also available and can be used if the user only wants to update software designs. For example, this reduced installation would be appropriate for customizing the MAC behavior of our 802.11 Reference Design.

커스톰 FPGA 디자인의 구성을 위해서 자일링스 full 인스톨은 필수적으로 요구된다.

하지만 SDK만을 설치해도 소프트웨어 디자인 업데이트가 가능하다. 예를들면, SDK만 설치해도 

802.11 레퍼런스 디자인의 MAC 동작을 사용자 정의형태로 구성 및 실행이 가능하다.   

    Matlab

Matlab is required for Xilinx System Generator and also for the WARPLab design flow.

매트랩도 자일링스 시스템의 생성을 위해서 요구된다. 



WARPLab은 싱글 또는 다중 안테나의 메세지 전송 및 컨트롤을 위한 빠른 프레임 워크로 사용될수 있다. (확장성을 가지는 장점) WARPLab 레퍼런스 디자인은 많은 통신물리계층의 구현 및 테스트를 가능토록 하는  프레임 워크입니다. 그리고 이 레퍼런스 디자인은 여러대의 WARP 노드를 이더넷 연결을 통하여 매트랩으로 제어 및 신호처리 할수 있도록 도와줍니다. 

The WARPLab reference design is an implementation of the WARPLab framework that allows many physical layer designs to be constructed and tested. The reference design combines MATLAB and FPGA implementations of the WARPLab framework modules that allow for easy extensibility and customization. While the reference design uses MATLAB to control nodes and perform signal processing, it also allows applications with strict latency requirements to move time critical processing in to the FPGA. The latest WARPLab 7 reference design runs on both WARP v2 and WARP v3 hardware. Users with WARP v1 hardware should use WARPLab 6.


WARPLab 7 is a complete rewrite of the original WARPLab framework. This rewrite was created and is maintained by engineers at ​Mango Communications.


**WARPLab 7에 대한 포스팅은 방대해서 나중에 따로 추가할 예정**

    TortoiseSVN

Any SVN client can be used, but we recommend TortoiseSVN if the user is using the Windows operating system. Instructions for downloading the WARP SVN repository are available here.

TortoiseSVN 의 사용을 권장합니다.

이 SVN이 무엇인지 알기 원한다면 아래의 링크를 열어보시기를 추천합니다.

https://tortoisesvn.net/about.html

TortoiseSVN은 GPL 기반으로 개발되었습니다. (비상업적 목적의 라이선스; 누구든지 수정 및 배포가능) 자유로운 개발 및 수정/ 업그레이드가 가능합니다. 





    PuTTY ¶

PuTTY is used to communicate with the WARP board via UART. Instructions for setting up PuTTY are here.

PuTTY는 PC-WARP간의 통신을 위해서 사용되는 통신 프로토콜입니다. 자세한 내용은 링크 "here" 를 눌러서 확인하세요. 


    Wireshark

Wireshark is a network protocol analyzer. It will show you, at the Ethernet link level, the packets entering and leaving your PC. This can be very useful for debugging interactions between your computer and a WARP node.

와이어샤크는 매우 유명한 네트워크 프로토콜 분석기이다. WARP는 이더넷 링크를 사용하기 때문에 PC와 WARP간의 디버깅을 위해서 유용하게 사용될 수 있다.

     WinDD

WinDD is a port of Unix's 'dd' command. This is used for writing SD cards with your hardware/software designs for running on WARP v3. This allows a WARP v3 node to load a design without downloading over JTAG (very useful for larger deployments). Details of this process are provided here.

SD카드를 구동하기 위한 소프트웨어.

     FTDI Drivers

WARP v3 uses an FTDI usb chip to provide UART connectivity. These drivers create a virtual COM port on your computer that PuTTY can open. More details are available in the user guide and USB UART howto.

     Visual C++ 2010 Express

The WARPLab design flow currently uses a user-compiled library for Matlab to speak to the boards using UDP. Visual C++ 2010 Express is required by Matlab to compile this library.

     Windows SDK

The Windows SDK is also required for compiling Mex functions in Matlab.



   Recommended Equipment for WARP

When using WARP, there are a couple of pieces of equipment that you may find useful to have in your lab space.

    Computer

  • The Xilinx design tools can be very demanding. Depending on how complex the design is that you are building, Xilinx estimates RAM usage for building for the XC6VLX240T FPGA that is in WARP v3 to be typically 3.7GB and as much as 6.5GB (source). Further discussion of system requirements are available here on page 53.
  • It is very useful to have a computer that contains two Network Interface Cards (NICs). For example, you may want one Ethernet card to accessing your computer network or internet, and another card to communicating to the WARP boards over Ethernet.

    효과적인 실험셋팅을 위하여 PC에 2개의 이더넷 카드가 있다면 "WARP-이더넷(PC)" "인터넷-이더넷(PC)"로 구성하여 인터넷사용과 동시에 WARP 연결이 가능하다. 

     Other Useful Accessories

  • Gigabit Ethernet Switch
  • Ethernet cables
  • Micro USB cables


+ Recent posts