フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

question about HDL Coder

5 ビュー (過去 30 日間)
SARA
SARA 2014 年 6 月 26 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello, I have a question about the HDL coder. I noticed that the code generated depend on the test bench. Is it normal? Thanks. Sara.

回答 (2 件)

Tim McBrayer
Tim McBrayer 2014 年 6 月 26 日
The short answer is "yes". This is normal, expected, and desired.
I assume that by 'test bench' you are referring to the portion of the design outside the portion of the design being converted to HDL code. For Simulink, this is the model outside the DUT subsystem. For MATLAB, this is the testbench file supplied.
In either a MATLAB or a Simulink design, the data types may be supplied by the modeled test bench. For a simple case, consider the identical design, with one copy fed with int32 inputs and the other fed by int8 inputs. You would expect the the int 8 design to have, for example, 8-bit x 8-bit = 16 bit multipliers, while the design with larger inputs requires 32x32 = 64 bit multipliers.
With a MATLAB design, the test bench is also used during fixed point conversion to determine the fixed point data types to be used internally. If one test bench has inputs that range only from e.g. 1 to 7, and a second test bench has inputs that range from -1023 to +1023, the generated code will be quite different, as the data path needs to be 11 bits wide instead of 3.
  1 件のコメント
SARA
SARA 2014 年 6 月 27 日
Thanks for your response, but is there an option to don't do it.

Bharath Venkataraman
Bharath Venkataraman 2014 年 6 月 27 日
I assume that you are talking about the generation of the testbench itself?
In Simulink, there is an option under Configuration Parameters (Ctrl+E) to disable generation of the testbench under HDL Code Generation - Test Bench (the option is HDL test bench).
In MATLAB, the testbench is generated in the HDL Verification step, so running till the HDL Code Generation step will lead to just the HDL code for the design.

製品

Community Treasure Hunt

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

Start Hunting!

Translated by