Modelsim Installation Steps: Center of Advance Studies in Engineering, Islamabad
Modelsim Installation Steps: Center of Advance Studies in Engineering, Islamabad
7. Now there shall be this dialog box. If you want to enter more file then repeat the above
explained procedure otherwise click on close.
8. Now you can see that you entered file has been added in the workspace (as shown in the
above figure). As we are using pirated edition of the software, there is a small problem. That
problem is that we cannot compile our file at this
level. To do that you have to perform the following
steps as well.
Right click on the file name in the workspace.
Click on the “Remove from project”.
Another dialogue box, shown on right shall appear.
10. Double click on the file name in the workspace a window shall be open in the work area. You
can enter your any verilog code here. For example I have entered the code of an AND gate.
module my_and(a,b,c);
input a, b;
output c;
and a1 (c,a,b);
endmodule
Now you need to create stimulus/ test bench in order to simulate the main module, For this,
create another file and file and write the following code of test bench in it:
module test;
reg a, b;
wire c;
my_and m (c,a,b);
endmodule
For the sake of practice you can simply past this code in your program because it is error free.
15. Now the window like this shall appear there. Here right
click on the test, in the submenu go to add and click on
add to wave.
In the above figure click on the encircled arrow. This will start simulation and you will get final
picture as shown bellow.
Now try to do something yourself. All the steps for simulation are same only your logic shall be
different.