The processor system in this SoC application reads data from the external memory following a write from the FPGA to that memory. Since FPGA writes and interaction with external memory are asynchronous, the processor uses an event-driven task to read from memory. The software also manages a register on the FPGA that specifies a multiplication factor to be used in the FPGA algorithm.
Open a new Simulink® model. Save the model as
a new subfolder, named
processor, in the project folder. Add
soc_hwsw_proc.slx model to the project.
In Simulink, configure the
soc_hwsw_top.slx model to as an
SoC application. On the Apps tab, under Setup to
Run on Hardware, clickSystem on Chip
In the System on Chip (SoC) pop-up window, select Hardware Board > Xilinx Zynq ZC706 evaluation kit. Click Finish.
The processor model must use the same hardware board and solver configuration parameter settings as the top level model.
dataTask block dialog mask, check Signal Attributes > Output function call to expose a function call port on the outside model.
In the Asynchronous Task Specification block dialog mask, set
Task priority to
The task priority of the Asynchronous Task Specification block must match the priority of task in the Task Manager block driving this task.
Processor Algorithm Wrapper subsystem reads data from the
external memory only after each write to the external memory by the FPGA.
Processor Algorithm Wrapper block.
Open the Stream
Read block dialog mask. Set Number of buffers
Open the Data Type Conversion block
dialog mask and set Output data type to
Processor Algorithm subsystem serves as a base to
develop your own processing algorithm.
Register Channel Write subsystem block.
Add a Register Write block to create the following model.
Open the Register
Write block dialog mask. Set Device name to
/dev/mwsinewavegenerator_ip0 and Offset
In the project folder, open the model
Add a Subsystem block into the
Processor area and label the block
Open the Model block dialog mask and set
Model name to
Open the Task
Manager block dialog mask. Set the task Name to
dataReadTask and set the Priority to
50. In the Simulation tab, set the
Mean, Min, and