How to solve "unsupported unbounded loop structure" error when generate hdl code from stateflow

1 view (last 30 days)
The error information is :
Found an unsupported unbounded loop structure. This loop may be user
written or automatically generated due to the use of specific vector
expressions or functions. For more information on unsupported loop
structures, please refer to the documentation.
I have encountered this problem once, and I followed this solution How can I work around unbounded loops when .... It worked!
But recently I encountered again. This time it differs from the previous. The error information doesn't give the error poistion such as "transmission xxx". I have checked, the stateflow doesn't have an loop condition contains two variables. So I think the problem is "automatically generated due to the use of specific vector expressions or functions".
I deleted something and generated again. By repeat this action, I targeted the error in a array inside a loop.
As the image show, when I delete the "mf_pool[mf_num]=MFT[i]", the error disappeared. After some further test, I found it is because the use of array in the left of "=".
Now, how can I solve problem? I don't found many information on the internet, neither does the matlab help doc. Any information is appreciate!

Answers (2)

Huang
Huang on 18 May 2014
is anybody know something

Tim McBrayer
Tim McBrayer on 19 May 2014
How many times is your loop going to execute? If you can't answer that by examining the state chart (and you can't), then the loop is unbounded. Your conditional transition [MFT(i) > 0] is likely the problem one. Loops are turned into repeated sets of hardware; if the loop is unbounded, HDL Coder can't determine how many times to repeat the hardware.
  1 Comment
Huang
Huang on 20 May 2014
This one is too complex. I simplified it to an easy model. You can see and download it here . In the easy model, it is certained that it loops 5 times at most, but it still report the same error "unsupported unbounded loop structure". I do some test further. There are two variable in the model, one local, one output. when i delete the output one, the error disappear. This is the most weird thing.

Sign in to comment.

Categories

Find more on Code Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!