24.5.1 Behavioral Simulation
Use the following procedure to perform a behavioral simulation of a design using the ModelSim simulator. Type UNIX commands at the UNIX prompt. Type PC commands on the command line of the ModelSim Transcript window. The commands below are for PC. To make the commands work for UNIX, use forward slashes instead of back slashes.
- Invoke the simulator (PC only).
- Change the directory to your project
directory. This directory must include your Verilog design files and testbench. Type
the following command:
cd <project_dir> - Create a “work” directory. Type the
following command:
vlib workvmap work ./work - Compile your design source and
testbench file(s). Before simulating your design, you must compile the source files
and testbench. For hierarchical designs, compile the lower-level design blocks
before the higher-level design blocks. Type the following commands:
vlog <behavioral_design_file>.vvlog <test_bench>.v - Simulate your design. Type the
following command:
vsim <topmost_module_name>For example:
vsim test_adder_behaveThe module test_adder_behave in the testbench will be simulated.
If any Microchip cores are instantiated in your Verilog source, use the following command to simulate your design with the compiled Microchip Verilog library.
vsim -L $ALSDIR\lib\vlog\mti\<act_fam> <topmost_module_name>
