![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1374744/image.png)
How to generate testbench for a model whose input signals come from matlab workspace?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Zora Aria Jade
am 4 Mai 2023
Bearbeitet: Kiran Kintali
am 8 Mai 2023
My model has implemented correct function.However, because all the model has generated HDL code,the "generate testbench" button is unable.So,how could I write a testbench for it? The model just need to input 8 channels of data from matlab workspace.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1374074/image.png)
0 Kommentare
Akzeptierte Antwort
Kiran Kintali
am 4 Mai 2023
Bearbeitet: Kiran Kintali
am 8 Mai 2023
"Generate HDL Testbench" works on a subsystem with some stimulus and response and not the whole model.
Mark the DUT "model/subsystem" to enable the test bench generation.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1374744/image.png)
The HDL Test bench generation inserts logging elements on the inputs and outputs of the subsystem, captures the stimulus and resposne and uses it in the generated HDL testbench.
If you select the "Code for" as the whole model, HDL Coder would not be able to figure out the inputs and the outputs to the DUT and hence the testbench button is disabled in such scenerio. In your case you need to select DUT as "PIB_1/PI model"
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!