Introduction to the Xilinx Platform Studio (XPS)

(compatible with WARP v3)


In this exercise, users will be introduced to the Xilinx Platform Studio (XPS). This tool is used by designers to build complete systems out of separate peripheral cores known as "pcores." In this exercise, user's will extend a provided template project by adding a custom pcore that implements a pseudorandom number generator (PRNG) directly in the FPGA. This core is then connected to the template project's User I/O core so it can drive random values out to LEDs and hexadecimal displays.


본 예제에서는, 자일링스 플랫폼 스튜디오 XPS를 소개합니다. 본 툴은 사용자에 의해서 pcores 로써 주변 cores와는 분리된 형태로 완벽한 시스템을 빌드 할수가 있다. 따라서 본 예제에서 사용자는 직접적으로 FPGA에서 제공하는 PRNG을 실행하여 의사난수를 생성 할수가 있다. 이는 생성된 난수값을 16진수 LED 세그먼트로 디스플레이 하는 예제 샘플이다. 


Prerequisites

    • 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
    • Checked out a local copy of the WARP Repository
    • Set up a terminal on your computer using PuTTY or an alternative.
    • Familiarity with the Xilinx SDK. Make sure you have completed the Introduction to the SDK exercise.

XPS를 실행하기 위해서는 WARP 보드와 정전기 방지대책, JTAG 케이블, ISE 시스템 에디션의 설치, WARP 저장소의 Local 백업, PuTTY를 통한 터미널연결, 마지막으로 SDK에 대한 숙지가 필요합니다. 


Overview







In this exercise, we provide users with a custom peripheral core: the prng_useriosrc. This core is a pseudorandom number generator with ports that are meant to be connected to the User I/O core that is present in the template WARP design. The above figure describes is a simplified diagram of the final after adding the custom pcore. Inside the custom core there is a Linear Feedback Shift Register (LFSR) that produces a sequence of pseudorandom values. These values are then latched by a counter circuit to slow them down and make their changes visible to the naked eye when observing a board. The output of this latch is sliced up and connected to output ports on the core. All pcores have two distinct ways of getting information into and out of the peripheral:


간략한 시스템 블록 다이어그램에 대한 소개와 본 예제에 대한 설명이 명시되어있다.

prng_useriosrc 라는 메인 블록 (소스예제) 는 LFSR 선형 피드백 시프트 레지스터를 사용하여 의사난수를 생성하여 Segment를 제어하는 프로그램이다. 프로그램의 시작은 유저의 Push 버튼으로 짐작되며, 랜덤 시퀀스를 LFSR에서 생성하면 이를 래치하여 해당 출력의 MSB 나 LSB를 Hex Display 와 LEDs로 출력시킨다. 


Ports: Shown in yellow in the above figure, ports allow direct connectivity between peripherals. They can serve as inputs or outputs of the design.

Registers: Shown in red in the above figure, registers allow peripherals to be controlled by software running in a Microblaze soft processor. Registers allow the core to hang off a bus such as the Processor Local Bus (PLB) and allow custom C-code to read or write memory addresses to control the core.

The prng_useriosrc pcore has the following inputs and outputs:



포트는 내부포트(노랑)와 외부포트(초록)으로 구분되며, 하드웨어적으로 직접 연결이 가능한 핀(포트) 이다. 또한 붉은색 블락의 레지스터는 Microblaze CPU를 사용하여 소프트웨어를 통하여 제어가 가능하다. 레지스터는 PLBs 버스를 통하여 제어 및 데이터의 송수신이 이루어진다. 


Inputs


User I/O Pushbutton Port: This port is connected directly to the User I/O "up" pushbutton port. When the user presses the button on the board, the latch inside the prng_useriosrc core will stop updating the outputs. This will effectively "pause" the core and allow the user to read the current set of outputs from the LEDs and other display elements.

Capture Period Register: This register attaches to the bus and allows C-code executing inside the MicroBlaze to control how often the latch on the LFSR triggers. In effect, this is a way for C-code to control how fast the output updates occur. Note: even though we have listed this as an input to the core, this register can also be read by the C-code in order to check and see what it had been set to.


2개의 입력 포트 및 레지스터가 존재한다. 푸쉬버튼이 연결된 포트는 코어 내부의 래치 출력 업데이트를 제어할수 가 있다. (노파심에 설명을 해보자면,) 사실 이런류의 임베디트 프로그래밍을 진행해본 사람들은 잘 알겠지만, 무작정 해당버튼을 누른다고 정말 래치가 동작을 하다가 중단되고 하지는 않는다. 이는 모두다 메인 프로그램 코드에서 위와 같이 동작하도록 사전이 코딩을 해놓았기에 푸쉬 버튼을 누르면 해당 기능이 수행되는 것이다. 따라서 이와 같은 예제들을 많이 접해보고 따라해보되, 어떻게 코딩을 했으며 내가 정의하고자 하는 프로그램은 어떤 기능이 필요하고 어떻게 동작되었으면 좋을지 그리고 그런 프로그램을 코딩하기 위해서 어떤식으로 프로그램 구조를 짜야하는지를 미리 경험하는 시간이 되길 바란다. 


Outputs


Left/Right Hex Display Ports: The left and right hexadecimal displays contain seven individual on/off segments. These output ports drive 7-bit wide random numbers to the equivalent input ports on the User I/O core.

Red/Green LED Ports: The banks of red and green LEDs each contain 4 elements. These 4-bit wide random numbers drive the equivalent input ports on the User I/O core.

Captured Output Register: This register attaches to the bus and allows C-code executing inside the MicroBlaze to read the current latched output of the LFSR.

You will also notice in the diagram the green "FPGA Pins" ports. These are top-level ports that are routed out to physical pins on the FPGA. These pins are connected to other components on the WARP board. For the purpose of this exercise, we have provided this pcore as an example of a hardware peripheral you may want to integrate into your design. The Exporting pcores from System Generator exercise covers how this pcore was created.

출력 레지스트리를 통하여 FPGA 핀에 물리적인 값이 전달됩니다. 이 핀은 WARP의 다른 구성요소와 연결되어서 사용자의 목적에 맞게 제어 및 디자인 될수가 있습니다. 


Instructions

일단 여기 포스팅에서 다루는 것은 템플릿 프로젝트 (Not lite ver.) 이며, lite 버전으로 가볍게 시작하기를 권한다. FPGA의 특성상 빌드시간이 꽤 오래걸리기 때문이다.

아래의 예제 실행순서는 별것 없다. 예제 소스코드를 루트폴더에 다운로드 후 XPS에서 open하여 아래의 순서대로 빌드하면 실행이 된다. 


  1. Download either the WARP v3 Template Project. Note: We recommend using the "lite" template for this exercise as it will build the quickest.
  2. Extract the archive into a folder on your hard drive. Note: this folder must not contain any spaces in the path (this includes the the Windows desktop, as that lives in a folder known as "Documents and Settings").
  3. Navigate to this folder in Windows Explorer. Go into the SDK_workspace folder. These are the default SDK projects used in the Introduction to SDK exercise. We do not need them for this exercise. Delete the three folders in SDK_workspace (but do not delete SDK_workspace itself).
  4. Download the provided pcore. Unzip the archive and place the "prng_useriosrc_plbw_v1_02_a" folder inside the "pcores" folder in the extracted template project.
  5. Launch XPS from the Start menu. Click "Open project" and navigate to the system.xmp file from the template project. Click Open.
    • If this is the first time you have run XPS, you will receive a number of error messages saying that cores cannot be found. XPS must be told where to find the WARP SVN repository in order for it to find these files. In XPS, click Edit→Preferences. Then, under the "Application" category, click "Browse ..." under the "Global Peripheral Repository Search Path." Navigate to and select the "edk_user_repository" folder on your hard drive. If you do not have an "edk_user_repository" SVN working copy, please see our SVN documentation. After making this selection, close and reopen XPS. This step of adding the global repository path only needs to be done once per installation of the Xilinx tools.
  6. To connect the new pcore to the system, we will modify the Microprocessor Hardware Specification "system.mhs" You can find this file in the "Project" tab under "Project Files." Double-click this file to open it.

프로그램의 실행을 위해서는 아래의 자일링스사의 ISE 소프트웨어 다운로드 링크로 가서 설치를 진행하도록 하자.

생각보다 용량이 많기 때문에 시간이 많이 소요 된다. 



+ Recent posts