How to use the Unit Delay for HDL-Coder on Zedboard Zynq-7000?
3 次查看(过去 30 天)
显示 更早的评论
We'd like to use the standard Unit Delay block in the Simulink HDL-Coder. As a minimal example we created an Atomic Subsystem, only consisting of a single Unit Delay block.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153543/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153544/image.png)
The simulation worked as expected: The input signal was delayed by one time step.
The model was tested on our Zedboard Zynq-7000. The subsystem ran on the FPGA. However, in contrast to the simulation, the unit delay did not seem to do anything at all, as the output signal was exactly the same as the input signal.
We use Matlab R2015b with Vivado 2014.4.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153545/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153546/image.png)
The Simulink model was attached.
0 个评论
采纳的回答
Wang Chen
2016-1-25
Hi Jan, when you run the model on Zynq board, the FPGA part of the design is running at a fast frequency (50MHz). When you are using external mode to monitor the output, the ARM processor is running at a much slower sample rate (e.g. 10KHz), the delay in FPGA happens so fast that ARM cannot see it.
You can try the coprocessing Processor FPGA synchronization mode, where the FPGA is slowed down to be locked step with ARM sample time, so you can see the delay effect. http://www.mathworks.com/help/hdlcoder/ug/processor-and-fpga-synchronization.html
Or you can build a small counter using the unit delay, and observe that the counter counts at fast frequency in the FPGA.
Or you can use following example to save the fast FPGA signal in a FIFO, and then bring the data back to ARM to see the delay result. http://www.mathworks.com/help/hdlcoder/examples/debug-a-zynq-design-using-hdl-coder-and-embedded-coder.html
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!