#MODELSIM PE VS SE VS DE CODE#
% Commands to compile and invoke Incisive with code coverage enabled. Then the HDL simulator advances its time by 40 ns to apply the reset, clock, and clk_enable signals before the cosimulation starts. When running each testcase, the "Pre-simulation Tcl commands" are applied in the HDL simulator first. This is to match the behavioral block, which updates its internal states right after the simulation starts.īased on the above considerations, the option "Time to run HDL simulator before cosimulation starts" is set to 40 ns. We also want to run the HDL design past reset, but stop before the first active clock edge enabled by clk_enable. Therefore, the value of this parameter should be an integer multiple of the 10 ns clock period. The cosimulation starting time should be aligned with the falling edge of the HDL clock to avoid a race condition since the HDL signals change their values at the rising edge of the HDL clock. The reset signal is asserted from 0 to 27 ns. The clock enable signal is active at 37 ns. Make sure that your version of ModelSim has the proper code coverage license to run this example. Note that the code coverage function is an optional feature in ModelSim PE. If you are using Incisive or Xcelium, close the ModelSim model and open the model cruise_control_incisive.slx. If you are using ModelSim or QuestaSim, the model cruise_control_modelsim.slx should be open. You do not need Simulink Design Verifier installed to run this example. This example shows that those automatically generated testcases also achieve complete HDL code coverage.
The testcases in the test bench model are generated through Simulink Design Verifier™ from the original behavioral model for achieving complete model coverage. A test bench model is provided to verify the correctness of the HDL code by comparing the output of the HDL cosimulation block with that of the original behavioral block. The HDL code associated with this model is generated via HDL Coder™ from a Simulink behavioral model of the cruise controller.