HDL Coder Flatten Hierachy does not work with masked library block

1 次查看(过去 30 天)
In order to balance (delays, pipelining) my feedback-loops, a subsystem with "Flatten Hierachy" enabled is positioned above the blocks of the feedback-loop. Because this will make the generated model very messy, another "normal" subsystem is inserted above. This works fine and makes the generated model readable.
The Problem appears, when I convert this whole set to a custom library block. Whenever the mask of the library-block contains some parameter (under Parameters & Dialog) or anything under Documentation, the model won't compile and the error I get complains about not beeing able to balance the feedback-loop. Even dummy-parameters cause an error, although they are invisible, disabled and don't get evaluated.
This causes the following issues:
  • The sublibrary containing the block does not appeare correctly inside the library browser (drop-down-arrow).
  • I can not use parameters with the library block.
Is there a reason for this behavior?
  1 个评论
Manuel K
Manuel K 2020-8-29
I just want to add that masking a subsystem (with parameters or documentation) also affects other settings like "streaming" and "sharing". In order to let the Workflow Advisor apply these principles correctly I yet again had to delete the masking or at least the "parameters" and "documentation" section.
By "streaming and sharing correctly" I mean that no new base model-rate gets produced if not needed. Why is there not at least a warning, when your generated model requires a faster clock-rate than you specified e.g. in the Target Frequency section? There is missing a feature to control this behavior: when a subsystem gets sampled at a sample rate f_s1 < than clock rate f_clk, the latency introduced by "sharing" or "streaming" is no problem (when clock-rate pipelining gets applied). But sometimes HDL coder will nevertheless introduce a new rate f_s2 locally which will be faster than the sample rate f_s1 by the specified streaming or sharing factor which can cause the problem that this cannot be done with the clock rate f_clk of the model because it is not an integer multiple. Therefore HDL Coder just introduces a new higher clock_rate which just ignores your hardware-specification.

请先登录,再进行评论。

回答(1 个)

Kiran Kintali
Kiran Kintali 2020-8-4
Will you be able to provide a model with reproduction steps?
I suspect this is related to failure to do delay balancing due to feedback loop and not related to FlattenHierarchy. If that is the case either eliminating the need for delay balancing the feedback loop or using ClockRatePipelining would be your two options.
Reproduction model can help in providing better workaround if any.
  1 个评论
Manuel K
Manuel K 2020-8-4
编辑:Manuel K 2020-8-4
I'll upload a simplified model tomorrow, however the delay balancing and pipeling both work fine and only throw an error, when the subsystem above the subsystem with the option "Flatten Hierarchy" set, has a mask with parameters.
My structure from top to bottom looks like this:
1: masked subsystem which should become the library block (only when it has parameters or a documentation, the error appears)
2: subsystem with option "Flatten Hierarchy" set
3: blocks that form a feedback loop

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Create Large-Scale Model Components 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by