Xcell journal issue 86

Page 58

TOOLS OF XCELLENCE

want to run RTL simulation. After completion, XPS will create an *.xml file that describes the hardware to the SDK. This file is normally created in the <project_ working_directory>/ SDK/SDK_Export/hw folder.

Figure 7 – Clock and reset port connections inserted in the *.mhs file

Figure 8 – Project setup to generate the testbench template and behavioral simulation model

the correct base and high address values are available. XPS will open the “Instantiate and Connect IP” GUI. You can direct the tool to automatically link the peripheral to the interconnect bus driven by an available processor, or you may choose to manually connect the peripheral. Once the connection is complete, you will see the interface connection shown in Figure 6. Cross-check that the AXI4-Lite related clock and reset are connected in the bus interface connection in the Graphical Design View tab. If they are not automatically connected, edit the microprocessor hardware specifica58

Xcell Journal

tion file <project_name>.mhs in the <project_working_directory>. Figure 7 shows the *.mhs file with the clock and reset ports added. Next, connect the non-AXI4-Lite ports of the design using the Ports tab of the System Assembly View window. In the Addresses tab of the System Assembly View, ensure that the peripheral address space is visible and the address range is locked. Now, export the hardware to the Xilinx Software Development Kit by selecting the “Export hardware design to SDK” option in the Project category of the XPS GUI. You need not generate the bitstream if you just

STEP 3: DEVELOP SOFTWARE DRIVER USING XILINX SDK The next step in the integration is to develop the software driver using the Xilinx SDK. Launch SDK and create a hardware platform specification project to source the *.xml file. If you have selected the “Export and Launch” option in EDK, the project is created automatically and the IP blocks and address map information in XPS is now available in the SDK project. Before creating the board support package (BSP), you must create driver files for your peripheral. A typical driver header file must define the memory-mapped register offset address and the prototype to read and write to those registers. Copy the driver files to the SDK project repository to identity the driver and then create the BSP project. Open a new, blank application project to create software to read and write data from the peripheral. In this project, specify the hardware target platform that was created as the first task in this step and the BSP that you have just created. In the BSP settings window, see the peripheral driver core for the design. The application project includes a main.cc file where the software code is written for the application. Once this file is created, the SDK automatically compiles the code and creates an *.elf file that is used to simulate the software code in the RTL simulation environment. The application project includes a main.cc file where the software code for the application is written. A simple example is a program that writes values into the first two registers of the memory map (the Status_register and the Control_register). Once this file is created, the SDF automatically compiles the code and creates an *.elf file that is used to simulate the software code in the RTL simulation enviFirst Quarter 2014


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.