Get Started with Embedded Coder Support Package for AMD SoC Devices
This example shows how to generate code from a Simulink® model and run the executable on an AMD Zynq® board.
Introduction
The Embedded Coder® Support Package for AMD SoC Devices enables you to generate code from Simulink models. You can compile and load the generated code as an executable on an AMD Zynq board. Then, you can run the executable on an AMD Soc device on the board.
Requirements
Configure Model for Code Generation
Open the Zynq Getting Started model.
On the Apps tab in the Simulink Toolstrip, under Setup to Run on Hardware, click Run on Hardware Board.
In the Run on Hardware Board dialog box, set Hardware Board to your Zynq board, such as
AMD Zynq ZC702 evaluation kit
, and click Finish.
In the Simulink Toolstrip, the new Hardware tab enables you to run and interact with the connected hardware board.
Build, Deploy, and Start Executable
The Embedded Coder software, using the AMD Software Development Kit, can build a binary executable by compiling and linking the generated code on your host computer. Then, you can deploy and run the executable on a Zynq board. On the Hardware tab, click Build, Deploy & Start to run your model as a binary executable on the connected Zynq board.
After the model launches on the hardware, a command window opens and shows that the executable is running on the Zynq board.
To stop the model running on the hardware, use the zynq
function and stop functions by entering this code at the MATLAB® command window.
zynqObj = zynq();
stop(zynqObj,'zynq_gettingstarted');
Other Things to Try
You can interact with the code running on the Zynq board by using external mode or PIL. For more information on external mode and PIL with the Zynq board, see Parameter Tuning with External Mode Simulation and Processor-in-the-Loop Verification of Simulink Models.