Run a Modelsim Testbench

Evaluate a module correctness by running its testbench

Open the Modelsim project

Consider the testbench unit's name to be "testbench" as depicted in the figure.

Start simulation

In the Transcript window execute the following command:
vsim work.testbench
Importnat: For different testbench modules the name of the testbench module needs to be replaced in the above command with the correct one.

Run the testbench

In the newly opened simulation layout (which usually include some new windows such as sim, Objects, Processes), execute the following command in the Transcript window:
run

Analize testbench result

Provided that the testbench was written correspondingly, the simulation output will indicate the number of passed and failed test cases.

Close simulation

Important: Before modifying any of the source files, close the simulation!
Close simulation by executing the following command in the Transcript window:
quit -sim