Program Standalone Xilinx FPGA Development Board from Simulink
This example shows how to target a Xilinx® FPGA development board for synthesis using the FPGA Turnkey workflow.
Before You Begin
To run this example, you must have your synthesis tool set up. To learn how to set up your synthesis tool, see Synthesis Tool Path Setup.
This example uses the Xilinx Virtex®-5 ML506 development board. You can try this example with a different board, and specify the target interface according to that board’s interface definition. To see a list of boards supported for the FPGA Turnkey workflow, see Supported EDA Tools and Hardware.
If you want to download the programming file, you must first connect the target device. However, if the target device is not connected, you can still generate the programming file.
FPGA Servomotor Controller with UART interface for Xilinx Board
This example uses
hdlcoderUARTServoControllerExampleXilinx model that is designed to work with a Xilinx Virtex-5 ML506 development board.
UART_Servo_on_FPGA subsystem receives commands through UART ports. The subsystem generates a pulse-width modulation (PWM) waveform to control a servomotor.
Select the Target Device
UART_Servo_on_FPGAsubsystem and select HDL Code > HDL Workflow Advisor.
In the HDL Workflow Advisor, select the Set Target > Set Target Device and Synthesis Tool task.
For Target workflow, select FPGA Turnkey.
For Target platform, select Xilinx Virtex-5 ML506 development board.
If the board does not automatically appear in the list, select Get more boards to download the Xilinx FPGA Boards support package.
The HDL Workflow Advisor automatically sets the synthesis tool based on your board selection.
Click Run This Task.
Set Target Interface and Target Frequency
In the left pane of the HDL Workflow Advisor, select the Set Target Interface task.
For each port, select an option from the Target Platform Interfaces menu as shown in the following figure, and click Apply.
Each port is allocated to a specified bit position
[or range of bit positions
[. The width of the specification, in bits, must equal the width of the port on the DUT. When you select options, the HDL Workflow Advisor automatically allocates a bit range. You can double-click in the Bit Range / Address / FPGA Pin column to edit the value.
For detailed information on each Target Platform Interfaces option, see your Xilinx Virtex-5 ML506 development board documentation.
You must allocate at least one output port must to the target device. If you do not allocate any ports, the Set Target Interface task displays an error and terminates.
Click Run This Task.
In the Set Target Frequency task, set FPGA system clock frequency to 100 MHz, then click Run This Task.
In this example, the target frequency must be set to 100MHz (the default) due to the fixed UART baud rate.
Generate Code, Synthesize, and Program Target Device
After selecting the target device and configuring its port interface, the HDL Workflow Advisor can perform the next sequence of tasks automatically. These tasks include:
Prepare Model For HDL Code Generation: Checking the model for HDL code generation compatibility.
HDL Code Generation: Setting HDL-related options of the Model Configuration Parameters dialog box and generating HDL code.
FPGA Synthesis and Analysis: Executing synthesis and timing analysis in Xilinx ISE. Back-annotating the model with critical path information obtained during synthesis.
Download to Target has two subtasks:
Generate Programming File: Generating an FPGA programming file.
Program Target Device: Downloading the programming file to the board.
Before executing the Program Target Device task, make sure that your host PC is properly connected to the Xilinx Virtex-5 ML506 development board via a JTAG programming cable.
To run this sequence of tasks automatically:
Open the Download to Target task group.
Right-click Program Target device and select Run to Selected Task.
The task sequence concludes by programming your target board with the generated programming file. You can then read the code generation and synthesis log files.