Lab2 Synopsys DC
Lab2 Synopsys DC
Logic Synthesis
Optimization
Now you will need to setup your directory structure for this tutorial. Back in your terminal window type:
cd ece128
mkdir lab2
cd lab2
mkdir work
mkdir src
mkdir db
mkdir reports
Always create the work src db and reports directories in whatever directory you decide to work
under. In our case, our 'working' directory will be 'lab2'
Copy the AMI 0.5 standard cell library's verilog code into your src directory:
cp /apps/design_kits/osu_stdcells_v2p7/cadence/lib/ami05/lib/osu05_stdcells.v
~/ece128/lab2/src
3. Copy the verilog code you wish to synthesize into the src subdirectory:
In this lab, we want to use the fulladder & halfadder you created in lab1:
You may need to change the first part of the directory location to where your fulladder code is:
cp ~/ece128/lab1/fulladder.v ~/ece128/lab2/src
cp ~/ece128/lab1/halfadder.v ~/ece128/lab2/src
cp ~/ece128/lab1/fulladder_tb.v ~/ece128/lab2/src
The above three lines copy the fulladder halfadder and the test bench you created in lab1 into 'src'
directory underneath the lab2 directory you created in step 2.
Part III: Starting The Design Compiler, Analyzing and Elaborating your Design
All of the verilog code that you wish to 'synthesize' should now be under the 'src' directory in your 'working'
directory. In this tutorial: ~/ece128/lab2/src
Note: Before ever attempting to synthesize verilog code, you must ensure that it compiles properly (using a
verilog simulator) and its waveforms are as you expect (using simvision). Only after the code passes the
simulation phase can you move on to the synthesis phase of the ASIC design flow.
1. In a terminal window, login to hobbes
ssh -X hobbes
Note: For the spring 2010 semester, synopsys tools are only available on hobbes, in future semesters
this step may not be necessary
2. Change to your working directory
cd ~/ece128/lab2
3. Start the design compiler's GUI by typing
design_vision
(note: do NOT put an & after this command, it needs to run in the foreground)
Both the dc_shell and it's GUI will pop up and look something like this:
4) Click on File->Setup to verify that the parameters setup in the synopsys_dc.setup file have taken
effect (look through both tabs to see all the variables and parameters setup). You should see the
following in your screen:
5) Load all your verilog code (and its dependent files) by going to: File->Analyze
Click on the add button and click on the src sub-directory
Add fulladder.v and halfadder.v
Note : The analyze command will do syntax checking and create intermediate .syn files which will be
stored in the directory work, the defined design library. The elaborate command goes to the work
directory to pick up the .syn files and builds the design up to the Design Compiler memory.
6) Inspect the messages in the LOG window at the bottom, correct any syntax errors in your verilog files
and do the analyze again, otherwise, proceed.
Once you've succesfully analyzed the code, Select File->Elaborate. Your design is now translated to a
technology independent RTL model.
Elaboration brings all the associated lower level blocks into the Design Compiler automatically (by
following the dependency of the instantiations within the HDL code)
Instead of doing Analyze & Elaborate, you can also do just Read for a verilog design, the difference is
that you have a choice of design library to place the analyzed design when you do Analyze, whereas
with Read only the default library WORK is used.
You may see see warnings about the following: The File /apps/synopsys/B2008.09/synthesis/dw/dw5/ is not a symb file.. You can ignore these warnings.
Part IV: Viewing the schematic
You should notice your full adder and the half adder that it depends on is now loaded into the design compiler.
The logical heirarchy shows
1)
Click on Schematic New Design Schematic View and the following schematic should appear
2)
You can click on the ha1 or ha2 components to drill down further into the elaborated design.
As you drill down, various 'tabs' will open up. You can also use the icon on top of the menu bar to go back up
in the design hierarchy
Notice the basic gates, the OR gates, have the label GTECH this stands for 'generic' technology, meaning the
OR gates have no timing, power, or other realistic information contained within them. They are merely symbols.
The first step is to LINK your design, click File Link Design
The link command checks to make sure all parts in the current design are available in Design_Analyzer's
memory.
2.
In the Hierarchy window, click on the fulladder (the top most portion of your design).
Then from the file menu click on Hierarchy Uniquify Hierarchy
Choose the top most level of your design (in this case halfadder) in cell reference from the drop down
list menu that comes up. Do not adjust any other defaults, and press OK to allow the uniqufying
process to begin.
The command uniquify is used to make unique the instances of the same reference design during
synthesis.
Q: Why uniquify your design?
A: When 2 instances of the same reference design/cell are present in the design (like how the
halfadder module is used twice in our fulladder design, then different constraints will have to be
applied to the design; thus to resolve the multiple instances issue we use uniquify command.
If you were to now look at your schematic view, you'd notice that ha1 and ha2 have different internal
names. They now have the names: ha_1 and ha_0. Before they both had the same name: ha...this step
allows each half adder to be its own 'unique' module. We can now apply different 'constraints' to each
half adder, without affecting the other instance of it in the design.
3.
b) if your design DOES have a clock pin, follow this step. If it does not, skip this step, move onto the
next.
If your design is not purely combinational, and has some synchronous components (e.g. registers), you
must create a clock with the same name for the clock's pin that you used in your verilog code. In the
design_vision command window:
By default, the Design Compiler will model your system as if the signal arrives at the input ports at time
0. In most cases, input signals arrive at staggered times. Type the following command in the
design_vision command window:
set_input_delay 2.0 -clock clk [all_inputs]
This 'input_delay' will assume that your design is driven by the slowest DFF in the AMI 0.5 library. The
DFF has a clock-Q delay of 1.75ns. We add another 0.25ns for wiring delay. The overall delay will be
2ns 'relative' to the system clock that you setup in step 3.
Assume that your design is driving a DFF where the DFF has a setup time of 1.4ns and another 0.25ns
is for wiring delay. This command will set an 'output' delay on all the output pins of 1.65ns relative to the
system clock:
set_output_delay 1.65 -clock clk [all_outputs]
The following three commands will set realistic 'loads' on each output pin. The second and third
command sets 'maximum' fanin and fan-out for the input and output pins of your design. Type the
following three commands in the design_vision command windows:
set_load 0.1 [all_outputs]
set_max_fanout 1 [all_inputs]
set_fanout_load 8 [all_outputs]
5.
To set the overall set of constrains on all of your input and output ports, type the following command:
report_port
This command will display each input and output port and show the constraints you have set on them.
Check to ensure that each port has the constraints that you have set in the last 4 steps.
When the design_compiler synthesizes your design, it can attempt to minimize the 'area' of your design,
and sacrifice speed. Or it can attempt to maximize the speed of your design by sacrificing area.
To ask the design_compiler to synthesize for area, from the menu choose:
If you wish the design compiler to optimize for speed, clear the max area field and press OK
7. Once you are finished specifying all of the design constraings, from the menu choose:
Design Check Design, press OK
This step will check your design's netlist description for problems like connectivity, shorts, opens,
multiple instantiations. If your design passes this step, in the LOG window, you should see no errors.
8. You are now ready to have the design_compiler synthesize your design using the AMI 0.5 standard cell
library.
From the menu choose: Design Compile Design. You can ask the synthesizer to use 'low' 'medium'
or 'high' effort to achieve the constraints you have set. The higher the effort, the longer the synthesize
will take. If you design is large, this could mean several hours to days if you choose a 'high' effort.
For this exercise, 'medium' effort will be sufficient, that should be the default, press OK to being
synthesis
Your design will now be implemented using the AMI 0.5 standard cell library.
You may double click on the 'half adders' to see what is inside each of them. You should see that they
have been implemented using GATES from the standard cell library.
If you see components that don't map to a standardized cell, you may have done something in verilog
that cannot be synthesized. You must investigate the cell and your verilog code to see what you have
done incorrectly in verilog.
2. To view the critical path in your design, while in the schematic view, from the menu choose:
Select Paths From/Through/to
set the: delay type: max
The critical path will then be highlighted on the schematic window using a white line.
Alternatively, you can select Schematic Paths From/Through/to, and set the delay type to Max. A
new window will open up showing the entire critical path, gate by gate.
If you have setup a clock that is FAR to fast for your design, the design_compiler will synthesize
something, but it won't have met the constraint you have setup. Or if you set a fanin/fanout load that is
unreasonable, the same will occur. You need to check the results of the synthesis by checking the
synthesis reports.
A 'report' will be generated and printed the screen. It will show the timing for each cell in the
design as well as the entire design itself. If you have a clock in the system, it will show you
if your design has 'met' the clock constraint, or 'failed' the clock constraint.
This is a crucial report to check. If you have violated the timing requirements, you may need
to change the period of your clock, and then re-compile the design.
This next step is a crucial one. Now that your design has been synthesized, and your constaints have
been met, it is time to use your verilog test bench (for the fulladder) against the design synthesized by
the design compiler.
1. From the menu, choose: File->Save As
Navigate to your 'src' subfolder
Type in the name: fulladder_syn.v
Be sure not to call the file the same name as your original verilog file. If you do, it will overwrite your
original work!
2. You may now exit the design_vision compiler
3. In a terminal window (on the local workstation, NOT on hobbes), change into the 'src' directory and type:
Sim-nc osu05_stdcells.v fulladder_tb.v fulladder_syn.v
This will use verilog to 'simulate' using your previously written 'test bench' fulladder_tb.v with the synthesized
verilog code from the design_compiler: fulladder_syn.v
Open simvision and ensure the waveforms are correct. If they are not something has gone wrong during the
sythesis. If they have gone right, you should now see 'delays' in your designs, representing the realistic timing
characteristics of the AMI 0.5 standard cell library and the constraints you setup during the design_compiler
session.