HDL Coder Error when converting AXI4 interface with different data rates
24 views (last 30 days)
Show older comments
I'm having trouble understanding this error from HDL coder:
Failed All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port "data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
Error using hdlturnkey.data.Channel/validateCodeGenPortRate
All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port
"data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
I want to read from a particular address in memory every 5 us. I don't want to read every 2e-7 seconds and flood the bus with uneeded read requests. I tried checking the timing legend and nothing even seems to be running at 2e-07 so i'm not sure where it is getting that rate from in the first place.
Am i approaching the sampling logic for this incorrectly? Instead of controlling when it performs a read by changing the execution time of the read-slave-to-master interface and Data signals, should i let the execution time be set to -1 (inherited) and control the read time by changing the rd_dvalid signal using temporal logic in my stateflow chart? Thanks for any help.
0 Comments
Accepted Answer
Wang Chen
on 4 Nov 2025 at 19:16
Hi John,
From the error message, it looks like you are using the "AXI4 Master" interface.
HDL Coder currently requires the DUT ports that map to the AXI4 Master interface run at the fastest rate of the design after HDL code generation. Please see following documentation for details:
Your understanding is correct: "Instead of controlling when it performs a read by changing the execution time of the read-slave-to-master interface and Data signals, should i let the execution time be set to -1 (inherited) and control the read time by changing the rd_dvalid signal using temporal logic in my stateflow chart? "
The DUT port and logic that mapped to AXI4 Master interfaces should run at the fastest rate in the DUT. The AXI protocol signals like rd_avalid should be used to control the read/write operation, so you can control the frequency of the read/write using these signals. The full protocol is defined in this document:
You can also refer to this example model where we perform both read/write DDR access using AXI4 Master interface.
Please also note, to use AXI4 Master interface, we should avoid the settings that will introduce oversampling. The oversampling will make the DUT port data rate slower compared to the fastest clock of the generated HDL code.
Thanks,
Wang
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!