Lab 01 Basic
Lab 01 Basic
Learning Objectives
15 minutes
UNIT
Unit 1
Getting Started
You will be using the following carry-select 8-bit adder for this lab:
add8.v
cin
a[7:0]
add4.v sum[7:0]
b[7:0]
a[0]
b[0] fa.v 1
a[1]
b[1] fa.v 1
a[2]
b[2] fa.v 1
a[3]
b[3] fa.v 1
0
a[7:4]
b[7:4] add4.v 0
1 4
1
add4.v
0
cout
1
1
Our goal is to use this simple design to take you through the fundamentals of the
two-step VCS simulation process. This lab is divided into three parts. Each part
has its own associated tasks. Here's a preview of what you will be doing:
Run simulation by
executing simv
Interpret simulation
results
1. shell> cd vcs/lab1/parta
You should see four files: fa.v, add4.v, add8.v, and addertb.v.
2. shell> ls
fa.v, add4.v and add8.v are the Verilog source files for the blocks shown in
Figure 1-1. addertb.v is the testbench used to check the funtionality of the
adder.
Compile the Verilog files and generate the simv simulation binary executatble.
1. shell> simv
…
*** Testbench Successfully completed! ***
…
This verification run was successful! In Lab 2 we will see how to generate
messages to help us debug code errors.
Recompile the adder design, this time, generate a simulation executable called
addertest.
Compile the Verilog files and generate the simv simulation binary executatble.
(please note that the switch is the letter “o” not the number “0”)
2. shell> ls
You should see 6 files including the simulation binary executable addertest.
Execute this simulation binary to make sure that the simulation results remain the
same.
3. shell> addertest
You should once again, see the following print out generated by the testbench.
…
*** Testbench Successfully completed! ***
$finish at simulation time 13107200
V C S S i m u l a t i o n R e p o r t
Time: 13107200
CPU Time: 0.490 seconds; Data structure size: 0.0 Mb
Mon May 22 10:08:21 2000
…
User_login_directory
… vcs
… lab1 lib
addertb.v add8.v
The fa.v and add4.v modules are now modules within the library directory
lib.
1. shell> cd ../partb
2. shell> ls
You now should only see two files: add8.v, and addertb.v.
Compile the design again. Only, this time, we need to reference the library
directory file.
You will also use the –R switch as a shorthand to execute simulation immediately
after compilation.
Notice that because our library files have the .v extension, the +libext switch
is required to get vcs to search the .v extension files.
—
The source file contents have not changed, only the physical placement of the file
has changed, you should see identical simulation results as in part A.
引
1. Use any editor you are comfortable with and create the file “adder.f”
containing the following:
addertb.v
add8.v
-y ../../lib +libext+.v
The source file contents have not changed, only the physical placement of the file
has changed, you should see identical simulation results as in part A and part B.
You are done! Compilation and simluation using VCS is very simple.
Try out some of what you’ve learned by answering the following questions.
Can you use the –v switch instead of the –y switch? How? .................................