Why do I get output of all zero values from my generated model using HDL Coder R2017b?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 26 Dez. 2017
Beantwortet: MathWorks Support Team
am 11 Jan. 2018
I generate VHDL code from a subsystem that contains only an input port, exponential block and output port. This model outputs the expected value of "exp(1)" or 2.7183 for each time step. The generated model, however, only outputs zeros for each time step. Why is this happening?
Akzeptierte Antwort
MathWorks Support Team
am 26 Dez. 2017
This is typical behavior when generating VHDL code for a subsystem. By default, the generated model inserts delays in the model to account for hardware implementation on an FPGA. Notice the output in the Command Window upon generating code from such a subsystem:
### Starting HDL check.
### The code generation and optimization options you have chosen have introduced additional pipeline delays.
### The delay balancing feature has automatically inserted matching delays for compensation.
### The DUT requires an initial pipeline setup latency. Each output port experiences these additional delays.
### Output port 0: 23 cycles.
When the HDL code is implemented in hardware, we cannot expect correctly computed values until after a certain amount of time steps. In the attached example, notice that increasing the simulation time to 50 seconds and then generating HDL code will result in a generated model that will show the expected output after 23 cycles have elapsed.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Speed Optimization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!