Failed Generated HDL code, testbench.
Ältere Kommentare anzeigen
Hi guys.
I tried to generate my project using HDL coder. However, it failed to generate the testbench. The error is "Cannot Generate test bench code for the entire model. Please specify a simulatable subsystem in your model"
Do you know what the problem? Thanks in advance.

Akzeptierte Antwort
Weitere Antworten (1)
Kiran Kintali
am 8 Mai 2024
Bearbeitet: Kiran Kintali
am 8 Mai 2024

The model on the left has root ports; no stimulus/source blocks in the Simulink. The model on the right has valid sources/stimulus (in this case random noise signal and valid filter coefficients). Both models generate HDL for the middle DUT block.
Generating HDL Test Bench Code from the the left model does not make sense.
makehdl(<modelName>) % should work with only root ports
makehdltb(<modelName>) % should not work and produces the error asking you to choose a subsystem
makehdl(<modelName/SubsystemName>) % should work similarly
makehdltb(<modelName/SubsystemName>) % should work technically; but apart form feeding zeros the simulation does not do much on this model; hence the generate RTL testbench is not very meaningful
Generating HDL Test Bench Code from the the right model is the recommended best practise when using HDL Coder.
makehdl(<modelName/SubsystemName>); % same as above usecase; generate RTL from the Subsystem
makehdltb(<modelName/SubsystemName>); % the model simulates with stimulus; input signals and output signals are logged and captured in the generated RTL testbench
The same reasoning applies when you choose "Generate HDL For" in the Toolstrip GUI or Worfklow Advisor and generate HDL.
Summary: Choosing model name or a subsystem name with no meaningful stimulus is not useful workflow when generating the RTL testbench using HDL Coder.
Kategorien
Mehr zu Code Generation finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!