When I fix inputs in the matlab testbench (for hdl code conversion) , is the hdl code generated based on those inputs only?
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
priya agarwal
il 21 Gen 2014
Commentato: Tim McBrayer
il 22 Gen 2014
I am converting a matlab code to hdl. For that I have to give a testbench and thus my input values become fixed. Suppose I have an AND gate as my matlab function and in the testbench I put one of the inputs as 0. Will the generated HDL Code have an AND gate or it will wipe off the logic based on the inputs.
0 Commenti
Risposta accettata
Tim McBrayer
il 21 Gen 2014
HDL Coder will generate your DUT as stand-alone from the test bench. It will not fold the constant values from the testbench into the DUT. It will fold constants within your DUT as much as possible during the optimization process.
A testbench that provides constant inputs is not a best practice, particularly if you are using float to fixed-point conversion. F2F can use the range of supplied testbench values as data to determine the desired data types for the inputs. It will propagate the type data throughout the design as well. If your testbench does not cover the full range of values that you expect your hardware to be able to handle, HDL Coder cannot create HDL code that will accurately respond to the full desired range of inputs.
2 Commenti
Tim McBrayer
il 22 Gen 2014
The most obvious way is to call your function repeatedly in a loop. There is a lot of HDL Coder documentation that discusses this point. For a succinct discussion on creating a helpful testbench, see this answer.
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!