sampling time mismatch in simulink and harware

29 views (last 30 days)
Priyanka
Priyanka on 17 Nov 2025 at 4:17
Edited: Kiran Kintali on 24 Nov 2025 at 13:03
i am having a simulink model in matlab which is running on sampling time of 5e-6 second now i want to run my matlab file in zedboard which has sampling time of 1e-8 second so both the clock frequency are mismatching.is there any option is available so that i dont need to change the simulink sampling to 1e-8 seconds because my simulink model will not run properly in 1e-8 second

Answers (2)

Leepakshi
Leepakshi on 21 Nov 2025 at 5:23
Hi Priyanka,
You don’t need to change your Simulink model to a 1e-8 s sample time. When deploying to ZedBoard using HDL Coder or SoC Blockset, the FPGA runs at its own clock rate, and your Simulink sample time is mapped to hardware through "oversampling" or "rate transition logic".
Options:
  • Use "HDL Coder oversampling" factor to match FPGA clock without altering the Simulink design.
  • Configure "SoC Blockset task rates" so your algorithm runs at 5e-6 s while the FPGA clock stays at 1e-8 s.
  • Avoid forcing the entire model to 1e-8 s; instead, let the tool insert rate converters.
Refer to below links for documentation on Oversampling Factor:
Hope it helps!

Kiran Kintali
Kiran Kintali on 21 Nov 2025 at 17:24
Edited: Kiran Kintali on 24 Nov 2025 at 13:03
You do not have to model at the FPGA clock rate in the Simulink model. There are several strategies possible.
HDL Coder Evaluation Reference Guide section 2.1 covers notion of FPGA/ASIC clock rate, Simulink sample time and Simulink rate related insights.
In addition the following links might be helpful as well.
HDL Coder and RTL Generation:
Hardware Targeting:

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!