HDL Coder doesn't complete Testbench Generation
30 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am working with the SquareJacobiSVDWithCovarianceMatModel example provided in MATLAB HDL Coder. When I open the Simulink model and generate Verilog code, the code generation completes successfully.
However, even though all input ports have proper input stimuli and the “Square Jacobi HDL Optimized” block is selected as the DUT, the testbench generation does not finish. Matlab version is R2025b.
Observed Behavior:
The process gets stuck at the Collecting data... stage, and MATLAB shows the following output for a long time:
### Code Generation for 'SquareJacobiSVDWithCovarianceMatModel' completed.
### Generating HTML files for code generation report at index.html
### Creating HDL Code Generation Check Report Square_Jacobi_SVD_HDL_Optimized_report.html
### HDL check for 'SquareJacobiSVDWithCovarianceMatModel' complete with 0 errors, 7 warnings, and 3 messages.
### HDL code generation complete.
### Begin compilation of the model 'SquareJacobiSVDWithCovarianceMatModel'...
### Begin compilation of the model 'gm_SquareJacobiSVDWithCovarianceMatModel'...
### Begin simulation of the model 'gm_SquareJacobiSVDWithCovarianceMatModel'...
.
### Collecting data...
After this point, the process does not continue, and the testbench generation never completes. Model file is compressed and attached.
2 Commenti
vidyesh
il 27 Ott 2025
Which version of MATLAB are you using? Updating to latest version may resolve the issue.
Risposta accettata
BA
il 30 Ott 2025 alle 21:05
Hi Albs975,
I did run the test bench generation and timed it. It took 62 minutes to finish. Depending on your PC perfomacnce this might be a bit longer or shorter. Please try to run this and give it time to finish and let me know. After opening the model, the command I used was:
tic;makehdltb('SquareJacobiSVDWithCovarianceMatModel/Square Jacobi SVD HDL Optimized');toc
As I mentioned earlier, this is due to the number of *.dat files that has to be written on hard-drive which is time consuming.
For example the data for input A which is an 8x8 matrix will result in 64 .dat files with each of them having 12000 values (64 bits each) for the duration of simulation. At the end the total size of all data files (.dat files) was 41.3 MB which is not a lot but the time was mainly spent writing those 202 *.dat files.
Please let me know how long time it takes for you to generate HDL testbench once you wait for it to finish.
Thanks.
BA
Più risposte (1)
BA
il 29 Ott 2025 alle 22:02
Hi albs975,
The model attached has 12000 seconds of simulation time. During hdl testbench generation, HDL Coder will simulate the model and collects the input data and output data of the DUT and saves them in *.dat files. This is a large amount of data that is collected and written into *.dat file for this model which is a memory and time consuming process (collecting and writing on the hard drive files). That is why it is taking a long time to collect data and it 'seems' it is not ending.
To confirm this for testing, reduce the simulation time to a smaller number (I did this test in 12 seconds, but I tihnk you can run a longer test) and see this process to the end. This is only for testing since we do want to run things for 12000 seconds of simulation.
I will run the 12000 second hdl test bench generation over night to see how it finishes and how long it takes and how large are the *.dat files are and let you know here.
One way to do this, is to run HDL Verifier cosimulation of the generated HDL code and use Simulink to feed the input to the DUT running on HDL Simulator.
Here are a few links about HDL Verifier cosimulation:
I just wanted to provide you with explanation of what is happening, however, I will run the cosimulation version of this model and provide you with the steps.
Talk to you soon.
Regards,
BA
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!