Digital Lab Manual New PDF
Digital Lab Manual New PDF
Digital Lab Manual New PDF
Digital Labs
Revision 2.0
Incisive Unified Simulator 9.2
RTL Compiler 9.1
Encounter Digital Implementation 9.1
Developed by,
University Support Team
Cadence, Bangalore
Table of Contents
General Notes...................................................................................................................... 3
Lab1: An Inverter ................................................................................................................ 4
Lab 2: A Buffer ................................................................................................................... 7
Lab 3: Transmission Gate ................................................................................................. 12
Lab 4: Basic / Universal Gates.......................................................................................... 19
Lab 5: Flip-Flops............................................................................................................... 25
Lab6: NCO(10 Bit number controlled oscillator) ............................................................. 30
mem.v mux_2to1.v phase_inc.v testbench.v top.v ............................................... 31
Lab7: Automatic layout generation followed by post layout extraction and simulation of
the circuit studied in Lab 6................................................................................................ 38
General Notes
There are a number of things to consider before beginning these lab exercises. Please
read through this section completely, and perform any needed steps in order to ensure a
successful workshop. These labs were designed for use with Incisive Unified Simulator.
Before running any of these labs, ensure that youve set up IUS correctly:
%> setenv IUSHOME <IUS-installation-home>
The Cadence_Digital_labs directory contains Solutions folder and also Work folder.
Inside Work folder you can make modifications of the code locally without affecting
your Source code present inside Solutions directory.
Lab directory details:
. /Solutions
. /Workarea
Lab1: An Inverter
In this lab we will simulate the inverter code modeled using switch level by the
help of Incisive unified simulator.In this lab we will see how to perform simulation in
command mode using testbench without using GUI window.
1. Change directory to Cadence_Digital_labs/Workarea/Inverter
2. You will need to copy each file present in solutions folder to Workarea/Inverter
location by using the below mentioned command :
cp -rf ../../Solutions/Inverter/* .
3. View the Code of Inverter and also the testbench for the same.
4. Compile the source Descriptions :
(i) Compile the Inverter description with the -messages option:
ncsim inv_test
The simulator displays results similar to the following:
Lab Summary:
In this lab we saw how to compile, elaborate and simulate the tesbench for Inverter
module.
Lab 2: A Buffer
In this lab, you will simulate a design using the Incisive simulator. You will:
* Create the cds.lib and hdl.var files
* Compile, elaborate, and simulate the design and testbench
Perform this lab in the Buffer directory. This directory contains the following files (which
you should briefly examine) describing a simple Buffer and its testbench:
File(s) Description
Buffer.v Buffer code
Buffer_test.v Testbench
cp -rf ../../Solutions/Buffer/* .
7
3. View the Code of Inverter and also the testbench for the same.
4
Using your favorite text editor, create the cds.lib file and make the following entries:
mkdir Buffer.lib
Create the hdl.var file and make the following entry:
ncelab buf_test
The elaborator places the buffer_test code and snapshot in the Buffer_lib library.
ncsim buf_test
The simulator displays results similar to the following:
Lab Summary
10
In this lab, you simulated a design using the Incisive simulator. You:
* Created the cds.lib and hdl.var files
* Compiled, elaborated, and simulated the design and testbench
11
cp -rf ../../Solutions/TG/* .
3. View the Code of tranmission gate and also the testbench for the same.
4. Set Up the Design Environment
Using your favorite text editor, create the cds.lib file and make the following entries:
mkdir tg.lib
Create the hdl.var file and make the following entry:
12
The compiler places the Transmission Gate description in the tg_lib library.
13
14
15
16
3. In the Source Browser window ensure that just the top-level scope is selected and send
it
tothe target Waveform window. As no such window yet exists, this opens a
Waveform window displaying the signals of the top-level unit, and makes it the default
Waveform target window.
a. In the left sidebar, select the Design Browser
display the embedded Design Browser.
--- Run the simulation until the next breakpoint, or for the
Duration entered in the time field (i.e 40ns).
--- Current Time range.
--- Move primary cursor to previous edge of select signal.
17
Once the simulation is done you can see the following waveform window and console
window with the outputs.
18
You will need to copy each file present in Solutions folder to Workarea/Gates
location by using the below mentioned command :
cp -rf ../../Solutions/Gates/* .
3
View the Code of AND gate and also the testbench for the same.
5. This procedure is same for all the other logic gates present inside Gates folder.
mkdir and.lib
Create the hdl.var file and make the following entry:
19
The compiler places the And Gate description in the and_lib library.
20
21
The -gui option opens the Console and Design Browser windows.
22
Selcet the input and output ports as shown above and click
waveform window.
Select in1 and go to Simulation tab and selcet Create Force option
23
Following Create force window comes up .Now apply binary input logic to in1from the
available binary logic 0,1,X,Z.Selcet any logic and click Ok.
Once the reset is done and want to perform simulation with another set of inputs ,then
follow the same procedure as mentioned ablove.
24
Lab 5: Flip-Flops
In this lab, you will simulate a design using the Incisive simulator. You will:
* Create the cds.lib and hdl.var files
* Compile, elaborate, and simulate the design and testbench
Perform this lab in the Flipflops directory. This directory contains the following files
(which you should briefly examine) describing a Flipflops and its testbenches:
File(s) Description:
SR_ff.v
d_ff.v
jk_ff.v
ms_ff.v
t_ff.v
cp -rf ../../Solutions/Flipflops/* .
3. View the Code of SR-Flipflop and also the testbench for the same.
4. This procedure is same for all the other flipflops present inside Flipflops folder.
5. Set Up the Design Environment
Using your favorite text editor, create the cds.lib file and make the following entries:
mkdir ff.lib
Create the hdl.var file and make the following entry:
25
nclaunch &
Following windows appears.This is the GUI of nclaunch.
Rightside of window has ff_lib (worklib ) and snapshots directories listed.
ff_lib is the directory where all the compiled codes are stored while snapshot will have
output of elaboration which in turn goes for simulation.
26
Once the above window appears select the flipflop of your choice for ex: I am selecting
SR-ff.v .Once the flipflop is selected click the following buttons shown below for
compilation, elaboration and simulation.
-- This Icon is for compiling the verilog code, once the compilation is done it
Creates VST and you can see SR_ff and SR_ff_test under ff_lib directory.
-- Select SR_ff_test Icon to elaborate the testbench ,once the elaboration is done
It creates snapshot and stores inside snapshots directory.
-- Select the snapshot ff_lib.SR_ff_test: module and click the following Icon to
Invoke the waveform window (Simvision) for performing the simulation.
27
Once the Design browser window ( i.e Simvision ) comesup select SR_ff_test also the
required inputs and outputs ports and click the
28
We will obtain the required output of SR Flip flop in the waveform window as shown
below:
The equivalent command terminal output can be observed in the Simvision console
window and also in the nclaunch console terminal.The o/p is as shown below:
29
There are a number of things to consider before beginning the lab exercises. Please
read through this section completely, and perform any needed steps in order to ensure a
successful workshop.
The NCO directory contains rclabs folder. Inside rclabs folder you will see many
other directories but for IUS, change the directory to Simulation and for Synthesis and
P&R select work directory
Lab directory details:
Simulation
work
30
In this lab, you will simulate the design using the Incisive simulator. You will Perform
this lab in the Simulation directory. This directory contains the following files (which you
should briefly examine) describing the NCO and its testbenches:
File(s) Description:
31
32
3. In the Source Browser window ensure that just the top-level scope is selected and send
tothe target Waveform window. As no such window yet exists, this opens a
it
Waveform window displaying the signals of the top-level unit, and makes it the default
Waveform target window.
a. In the left sidebar, select the Design Browser
display the embedded Design Browser.
--- Run the simulation until the next breakpoint, or for the
Duration entered in the time field (i.e 40ns).
--- Current Time range.
--- Move primary cursor to previous edge of select signal.
33
Once the simulation is done you can see the following waveform window and console
window with the outputs.
34
35
36
37
38
The terminal will look like the below image after the tool is invoked.
2. Give the path of the library w.r.t to the directory you are in using the command:
set_attribute lib_search_path ../library
39
3 Give the path of the RTL files with respect to the directory you are in using the below
command:
set_attribute hdl_search_path ../rtl
4 Read the library from the directory specified in giving the path for the library files in
step 2 using the command:
set_attribute library slow_normal.lib
slow_normal.lib is the name of the library file in the directory library. There is
another library there in that directory with name slow_highvt.lib. Any one of these
two libraries could be used at a time.
5 Read the RTL files from the directory specified in the path in step 3. The RTL files are
in the directory name rtl:
read_hdl {mem.v mux_2to1.v phase_inc.v top.v}.
6 Now Elaborate the design using elaboratecommand.
7 Give the command to see the circuit in Tool window:
The terminal window after the step 7 will look like
The Tool window looks like image on next page
40
41
42
10. Write the hdl code in terms of library components for the synthesized circuit using the
command:
write_hdl > nco.hdl
nco.hdl is the name of file in which the code gets write.
11. Similarly write the constraint file using
write_sdc > nco.sdc.
12. Timing could be check using report timing.
13. Similarly for Gates report gates.
14. Check area using report area.
15. Check Power dissipation using report power.
After the Synthesis Physical Design can be done by invoking the tool Encounter
Digital implementation.
16. Go to Directory /NCO/rclabs/work.
17. Invoke the tool using encounter or velocity.
The tool starts as below image:
The terminal window and tool window can be seens as similar to images on next page
43
44
18. Go the Tool window and click on the File and select Import Design. A new window
will open.
19. Select the verilog files using browse button. A new window Netlist files will open.
45
20. Click on the arrow button and select the verilog File NCO_gatelevel_uniq.v and
click the Add button and then click the close button.
46
25. In the Design Import window click on Advanced Tab. Select Power out of the list on
the left side of window. Enter the power nets as VDD and Ground nets as VSS.
47
26. Select OK. The tool window will look like image on next page.
48
The pink colour blocks are the standard cells. This is floorplan view of the design.
49
Select the Aspect Ratio as per the requirement. Give some dimension in Core to left,
Core to right, Core to top,Core to bottom. e.g. give 30 to each. This is to create the
space for Power rings which will be created in power planning. Click OK and the Tool
window will be look like as below.
50
30. Select the top and bottom layer as Metal5, Left and Right as Metal6. Set the width as
per the requirement and taking the space between core boundary and I/O pad
considerations. Select the option for offset as center in channel and click OK.
The power ring will get created in between the channel. The image on the next page is
showing the power ring created.
51
31. The next step in power planning is to create power strips. Select Power, click Power
Planning and click Add Stripe.
52
32. For adding the stripes, select metal layer as Metal 6 and chose direction as vertical(if
direction chosen is horizontal, chose metal layer as Metal 5). Click OK and the design
will get the vertical thin strips of type Metal 6.
53
33. After the power planning, go to Route and click Special Route. A new Window
Sroute will appear.
54
34. Click OK with all default settings. This is done to provide power to standard cells.
The horizontal blue coloured metal1 stripes created as a result of Special Route.
35. For placement, click on place and select place and click on Place Standard Cell.
55
36. Click OK on Place window and in physical view the blue coloured standard cells can
be seen as a result of placement of standard cells.
56
37. Before CTS, timing analysis has to be done for any setup violations. Click on Timing,
and select Report Timing. A Timing analysis window will get open. In the window
select the Pre-CTS as Design Stage and select the Setup as Analysis Type.
57
58
38. Click OK to complet the Timing analysis. The timing information will get display on
terminal in tabular form. In the table displayed on the terminal under timeDesign
Summary, check for any negative value under WNS(Worst Negative Slack) and
TNS(Total Negative Slack). The terminal will look as the image below and Tool
window as on next page.
59
The multi-coloured lines visible in the tool window are the connections between standard
cells using metal layers. If any part of this design is Zoom-in, metal layers can be viewed
easily.
60
61
In this case we did not get any negative slack, so this step is skipped here.
40. Go to Clock, click Synthesize Clock Tree, a new window Synthesize Clock Tree
will get open.
62
41. Click on Gen Spec and a new window Generate Clock Spec will open.
63
42. From Cells List, Select all clocks starting with CLK and click on Add button to add
them to the Selected Cells. Select a name for Output specification.
43. Click OK. Then specify a name for Results Directory. and click OK. The tool
window looks like the image below.
64
44. Again Perform the Timing by clicking on Timing and selecting Report Timing. Select
Post-CTS under Design Stage and do the select Set-up as Analysis Type.
65
45. Click Ok to perform the timing. The timing information will be displayed over the
terminal window. Again check for any negative slacks under WNS or TNS.
66
46. If there is any negative value found for either of WNS or TNS then perform the
Optimization Technique to reduce the negative slack. No negative slack is found in
the terminal image on previous page so this step is skipped here.
47. Timing Analysis for Setup as Analysis Type is done. Repeat Step 27 for performing
timing for Post CTS as Design Stage and Hold as Analysis Type. The tool will
show the timing results in the terminal window.
67
68
48. After Timing Analysis is performed, the timeDesign Summary is showing the
negative slack values for both TNS and WNS. Perform the Optimization. Go to
Optimize and click on Optimize Design. Select Post-CTS as and HOLD as the
Optimization Type
69
49. Click OK to perform the Optimization and Tool will perform the optimization and
displays the optimized results in the terminal window under timeDesign Summary.
The results of Optimization can be seen on the next page in tabular form for both
Setup and Hold mode. As compare to the Timng Results performed for Hold mode in
Step 30, the design has been optimized and tabular results shows that all slack values
are now positive values and no more negative values for slack.
70
50. Perform Routing by clicking Route, and select NanoRoute and then click Route. A
window NaoRoute will open.
71
51. Click Ok to Perform Routing. The tool will Perform the Routing and the Routing
statistics can be seen on terminal window including DRC violations.
72
52. After routing tool window looks like the below image.
73
53. Perform the timing again. Go to Timing, seelct Report Timing and a Timing Analysis
window will get open. Select Post-Route as the Design Stage and Setup as
Analysis Type. Click Ok. The timing results will be displayed in terminal window for
Set up mode.
74
Since there is no negative value of slack so design does not require optimization for Setup mode in Post-Route stage.
54. Repeat Step 36 for Post-Route as Design Stage and Hold as the Analysis Type.
Click OK. The timing results can be seen in the terminal window for hold mode.
75
As there is no negative value of slack, the optimization is not require to perform. The
final view of the circuit is as below:
76