Resimulating a design from a VCD file
Note: The following methodology applies only to ModelSim versions 5.5c and later. See Resimulating a VHDL design from a VCD file for the methodology that applies to earlier versions.To resimulate with a VCD file, you capture the ports of a design unit instance within a testbench or design. The design may be VHDL, Verilog, or mixed HDL. You can resimulate only at the top level of the module for which you captured ports.
The general procedure for resimulating with a VCD file includes two steps:
- Create a VCD file using the vcd dumpports command.
- Rerun without the testbench, using the -vcdstim argument to vsim.
Example 1 - Verilog counter
First, create the VCD file using vcd dumpports:
% cd ~/modeltech/examples % vlib work % vlog counter.v tcounter.v % vsim test_counter VSIM 1> vcd dumpports -file counter.vcd /test_counter/dut/* VSIM 2> run VSIM 3> quit -fNext, rerun the counter without the testbench, using the -vcdstim argument:
% vsim -vcdstim counter.vcd counter VSIM 1> add wave /* VSIM 2> run 200Example 2 - VHDL adder
First, create the VCD file using vcd dumpports:
% cd ~/modeltech/examples % vlib work % vcom gates.vhd adder.vhd stimulus.vhd % vsim testbench VSIM 1> vcd dumpports -file addern.vcd /testbench/uut/* VSIM 2> run 1000 VSIM 3> quit -fNext, rerun the adder without the testbench, using the -vcdstim argument:
% vsim -vcdstim addern.vcd addern -gn=8 -do "add wave /*; run 1000"Example 3 - Mixed-HDL design
First, create three VCD files, one for each module:
% cd ~/modeltech/examples/mixedHDL % vlib work % vlog cache.v memory.v proc.v % vcom util.vhd set.vhd top.vhd % vsim top VSIM 1> vcd dumpports -file proc.vcd /top/p/* VSIM 2> vcd dumpports -file cache.vcd /top/c/* VSIM 3> vcd dumpports -file memory.vcd /top/m/* VSIM 4> run 1000 VSIM 5> quit -fNext, rerun each module separately, using the captured VCD stimulus:
% vsim -vcdstim proc.vcd proc -do "add wave /*; run 1000" VSIM 1> quit -f % vsim -vcdstim cache.vcd cache -do "add wave /*; run 1000" VSIM 1> quit -f % vsim -vcdstim memory.vcd memory -do "add wave /*; run 1000" VSIM 1> quit -f
Model Technology Incorporated Voice: (503) 641-1340 Fax: (503)526-5410 www.model.com sales@model.com |