This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Verify Viterbi Decoder Using HDL Cosimulation

This example shows how to use HDL Verifier™ in conjunction with Mentor Graphics ModelSim®/QuestaSim® or Cadence Incisive®/Xcelium® to verify HDL code for a fixed-point Viterbi decoder.

1. Open the Simulink Model

If you are using ModelSim/QuestaSim, open the model viterbi_modelsim.slx.

If you are using Incisive/Xcelium, open the model viterbi_incisive.slx.

2. Launch HDL Simulator

2.1 Launch ModelSim/QuestaSim

Before launching ModelSim, make sure that the ModelSim executables are on the MATLAB® system path.

Launch ModelSim by double-clicking the "ModelSim Startup Command" block in the Simulink model, or by executing the following command in your MATLAB console:

vsim('tclstart',viterbi_tclcmds_modelsim('vsimulink'));

2.2 Launch Incisive/Xcelium

Before launching Incisive, make sure that the Incisive executables are on the MATLAB® system path.

Launch Incisive by double-clicking the "Incisive Startup Command" block in the Simulink model, or by executing the following command in your MATLAB console:

nclaunch('tclstart',viterbi_tclcmds_incisive('hdlsimulink'));

3. Run Simulation

When HDL simulator has finished compiling the VHDL files and loading the simulation, the text "Ready for cosimulation ..." is displayed in the HDL simulator command window. After you see this text, start Simulink simulation from the open model.

When the simulation stops, observe the bit error rate displayed at the "BER Display" block.

4. Rerun Simulation with Different Parameters.

There are two parameters that control the behavior of this model. The first is the frame size and the other is the Es/No used for simulation. You can change those parameters in the MATLAB console. For example,

FrameSize = 10;
EsNo      = 5;

Then you can rerun the cosimulation with updated parameters by starting the simulation again from the model.

5. Finish Simulation

Close the ModelSim or Incisive session. Then return to Simulink and close the model.

close_system('viterbi_modelsim');
close_system('viterbi_incisive');