Generic port length when integrating existing HDL code with Simulink model using BlackBox

7 次查看(过去 30 天)
When I integrate existing HDL code with Simulink model (as Black Box), how can I create a component declaration with generic ports length?
For example:
component my_component
generic(GENERIC_OUTPUT_LENGTH: natural := 8)
port (
A, B: in STD_LOGIC;
F : out STD_LOGIC_VECTOR(GENERIC_OUTPUT_LENGTH - 1 downto 0));
end component;
When i use the HDL coder to generate a VHDL code, (GENERIC_OUTPUT_LENGTH - 1 ) is replaced with the specific output port length. However bacuse I use 2 different instantiation (with different ports length) of the same block - the generated code require some correction before it can be synthesized.

采纳的回答

Kiran Kintali
Kiran Kintali 2021-5-1
The problem was reproduced and reported to the development team.
HDL Coder currently supports value generics (generic values that can be specificed and used as gain and constant values). HDL Coder does not support generics to be used to customize input and output types of a VHDL entity or Verilog module.
This limitation pertains to blackbox GenericList parameter and mask parameter as generics feature during HDL Code generation.
We are hoping to enhance the product and address this limtiation in HDL Coder in the upcoming releases.
  2 个评论
Lars Willeboordse
Lars Willeboordse 2021-8-19
编辑:Lars Willeboordse 2021-8-19
Hi Kiran,
I'm running into the same issue. Is there by any chance any update on this matter? maybe a timeframe for implementation?
additionally i would like to point out that it seems that passing strings in that same GenericList does not seem to be supported. Simply put it is missing the "" characters after rtl generation.
Best regards lars
Uday Kumar Gutta
Uday Kumar Gutta 2021-8-23
Hi Lars,
We are actively working in this area; As of now, using generics to specify port length is only supported for RAM instantiations. we would like to connect with you on the usecases. Can you reach out to local support team at MathWorks and connect with us in the development team about next steps?
Thanks

请先登录,再进行评论。

更多回答(1 个)

Kiran Kintali
Kiran Kintali 2020-1-18
Have you used the GenericList parameter in HDLCoder?
Thanks
bbox_interface.png
GenericList
Pass a cell array variable that contains cell arrays each with two or three strings, or enter a cell array of cell arrays that each contain two or three strings. The strings represent the name, value, and optional data type of a VHDL generic or Verilog parameter. The default data type is integer.
Default: none
Specifies a list of VHDL generic or Verilog parameter name-value pairs, each with an optional data type specification, to pass to a subsystem with a BlackBox implementation.
For example, in the HDL Block Properties dialog box, enter {'name','value','type'}, or, if the data type is integer, enter {'name','value'}.
To set GenericList using hdlset_param, at the command line, enter:
hdlset_param (blockname,'GenericList','{''name'',''value'',''type''}');
If the data type is integer, at the command line, enter:
hdlset_param (blockname,'GenericList','{''name'',''value''}');
  4 个评论
Erdinc Atilgan
Erdinc Atilgan 2021-5-1
移动:Stefanie Schwarz 2023-5-31
Actually, the problem has been stated quite clearly. Despite this, I think the things are made difficult by you. You did not make any effort to create the problem mentioned, dear Kiran. The problem mentioned by evyatar is actually a serious problem. However, as staff, you did not understand the problem, and we will be waiting for a solution. I ran into the same problem and, like evyatar, I wrote a code that fixes the code created by HDL Coder. Could it be a more logical solution for us customers, dear Kiran, to direct the matter to someone who has a better understanding of the subject?
Kiran Kintali
Kiran Kintali 2023-5-31
Hi Erdinc, If you have already tried the GenericList parameter and it did not meet your requirements, can you reach out to MathWorks tech support for additional support specific to your usecase? Thanks.

请先登录,再进行评论。

产品

Community Treasure Hunt

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

Start Hunting!

Translated by