MATLAB Answers

0

HDL Coder, Bus and Black Box

Asked by Jonathan Drolet on 10 Jan 2017
Latest activity Edited by Jonathan Drolet on 10 Jan 2017
I have a model I use with HDL coder, I have a Referenced Model in it called "AGC".
With the default options, the AGC model has it's code generated in a library called "work_agc" and all its files are mangled to start with the prefix "agc_". This doesn't work for me, so I generate the code for the AGC separately and refer to it as a black box in the parent model.
However, I now want to use Simulink Bus to tidy up the parent model, and I am not allowed to have a Bus comming out of a black box subsystem.
Is there a way I can have:
- The name I want for the AGC, i.e. library name agc and no prefix for the generated files. - Bus coming out of the toplevel.
Thanks,
Jonathan

  0 Comments

Sign in to comment.

1 Answer

Answer by Tim McBrayer on 10 Jan 2017
 Accepted Answer

HDL Coder gained bus support for black box HDL architectures in R2015b. Is there a chance you can update your MATLAB release?

  1 Comment

I use R2016b.
I manage to confirm that Bus and Black Box subsystem work fine, as you said.
However, Bus and Black Box Referenced Model fails for me with :
Port in1 on Model Reference block black_box_test/agc is a Bus type. This is not supported for a Black Box HDL implementation. Either change the HDL Architecture for the block, or expand the bus to its component signals.
I can put a Black Box subsystem over my referenced model to fix the issue.

Sign in to comment.