HDL-Coder Delay Balancing in Feedback-Loop workaround

23 vues (au cours des 30 derniers jours)
Niklas Weis
Niklas Weis le 26 Jan 2021
Commenté : Steven Hatcher le 19 Jan 2023
Hi,
I am trying to generate HDL-Code from a Subsystem that looks like this:
Inside Subsystem 2 and 3 there is some combinatorial logic with multipliers, adders etc. that need Delay-Balancing and Pipelining to achieve the desired Clock-Frequency.
Unfortunately hdlcoder refuses to perform delay-balancing and pipelining. It tells me:
"Delay balancing unsuccessful because Delay introduced in feedback loop cannot be path balanced"
"Unable to insert required number of pipeline registers because the Block is in a feedback path"
Is there a way to perform these optimizations in Subsystem 2 and 3 as if there was no Feedback-Loop involved?
Kind regards
Niklas

Réponse acceptée

Steven Hatcher
Steven Hatcher le 19 Jan 2023
Hi Niklas,
There is an optimization that can leverage a faster clock in regions of logic running at a slower rate. It looks like your model's clock rate is 100 MHz, and subsystems 2 and 3 leverage 10x and 100x slower rates, respectively. If you are clocking these with a single clock (which generates a timing controller), then HDL Coder can optimize your slower rate logic in the feedback loop by upsampling it to 100 MHz and introducing latency from optimizations at the clock rate while leveraging any existing slower rate state/delays to avoid adding any data rate latency. This optimization is called Clock-Rate Pipelining. The extra data rate latency in the loop is the reason for the delay balancing errors you are experiencing.
Since this feedback loop contains multiple data rates, you will need to use the latest version of HDL Coder (R2022b) which adds support to Clock-Rate Pipelining for multi-rate designs which use Rate Transition, Downsample, and Repeat blocks. I also believe there is no need to request any oversampling by HDL Coder on your design since the faster 100 MHz rate should let Clock-Rate Pipelining know it has an opportunity to optimize the slower logic in subsystems 2 and 3.
If you are still experiencing delay balancing errors after following this suggestion, then you will need to look into the highlightClockRatePipelining.m file which is generated to help identify any obstacles to Clock-Rate Pipelining that may exist in your model.
Feel free to share any more findings or questions you may have.
Steven
  1 commentaire
Steven Hatcher
Steven Hatcher le 19 Jan 2023
In general, we've made a lot of improvements to Clock-Rate Pipelining in R2022a and R2022b, as well as many other optimizations (you can check the release notes). I would highly recommend using a newer release if you are experiencing issues with delay balancing and feedback loops.

Connectez-vous pour commenter.

Plus de réponses (1)

Alan Moses
Alan Moses le 29 Jan 2021
In some cases, when you have blocks inside a feedback loop, adaptive pipelining is unable to insert the required number of pipeline registers at the output. Delay balancing can then fail.
You may have to manually add/balance the delays in the loop. Refer this link for a similar explanation.

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by