SpyGlass_AreaRules_Reference
SpyGlass_AreaRules_Reference
Disclaimer
SYNOPSYS, INC., AND ITS LICENSORS MAKE NO WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
Trademarks
Synopsys and certain Synopsys product names are trademarks of Synopsys, as set forth
at http://www.synopsys.com/Company/Pages/Trademarks.aspx.
All other product or company names may be trademarks of their respective owners.
Third-Party Links
Any links to third-party websites included in this document are for your convenience
only. Synopsys does not endorse and is not responsible for such websites and their
practices, including privacy practices, availability, and content.
Synopsys, Inc.
690 E. Middlefield Road
Mountain View, CA 94043
www.synopsys.com
Report an Error
The SpyGlass Technical Publications team welcomes your feedback and suggestions on
this publication. Please provide specific feedback and, if possible, attach a snapshot.
Send your feedback to [email protected].
Table of Contents
Preface..........................................................................................7
About This Book ...................................................................................... 7
Contents of This Book ............................................................................. 8
Typographical Conventions ..................................................................... 9
v
Synopsys, Inc.
Table of Contents
vi
Synopsys, Inc.
Preface
7
Synopsys, Inc.
Preface
Chapter Describes...
Using the Rules in the SpyGlass Describes how to use the rules in
area Product the SpyGlass area product
Rules in SpyGlass area Describes the rules in the SpyGlass
area product
8
Synopsys, Inc.
Preface
Typographical Conventions
Typographical Conventions
This document uses the following typographical conventions:
Syntax Description
[ ] (Square brackets) An optional entry
{ } (Curly braces) An entry that can be specified once or multiple
times
| (Vertical bar) A list of choices out of which you can choose
one
... (Horizontal Other options that you can specify
ellipsis)
9
Synopsys, Inc.
Preface
Typographical Conventions
10
Synopsys, Inc.
Using the Rules in the
SpyGlass area Product
11
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
12
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
area_Factor
(Optional) Specifies the area factor for the GateCount rule.
The default value of the area factor is 1.0.
Use the area_Factor rule parameter as follows:
set_parameter area_Factor <num>
Where, <num> is a double number.
Used by GateCount
Options Double number specifying the area factor
Default value 1.0
Example
Console/Tcl-based set_parameter area_Factor 1.5
usage
Usage in goal/source -area_Factor=1.5
files
audit_cell_details
(Optional) Specifies the absolute or relative path of the file.
By default, the value of the audit_cell_details parameter is set to
13
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
_null_.
You can specify the absolute or relative path of the file in the
audit_cell_details parameter. The file should contain information in
the following format:
<cell_type> <cell_type value1> <cell_blocktype
value2> <cell_blockgroup value3>
For example, a file may contain the following information, based on the
above format:
MEMORY_Cell storage primitive block
AMS_Cell analog primitive block
Eswitch_Cell routing primitive block
DRAM_Fuse_Cell storage hardmacro block
FuncIO_Cell interface primitive periphery
NonFuncIO_Cell routing primitive periphery
If you specify a file in the audit_cell_details parameter, all the cell
types and their related attribute combination from the file are read by the
GateCount rule.
Used by GateCount
Options Absolute or relative path of the file
Default value _null_
Example
Console/Tcl-based set_parameter audit_cell_details "a.txt"
usage
Usage in goal/source -audit_cell_details="a.txt"
files
14
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
blackbox
(Optional) Specifies the gate count of black box modules for the GateCount
rule.
Use the blackbox rule parameter as follows:
set_parameter blackbox <name>=<num>,[{<name>=<num>},]
Where, <name> is the name of the black box module and <num> is an
integer number.
Used by GateCount
Options Name and gate count of black box modules
Default value Empty string
Example
Console/Tcl-based set_parameter blackbox 'AN2=100'
usage
Usage in goal/source -blackbox='AN2=100'
files
greybox
(Optional) Specifies the name and gate count of grey box design unit for
the GateCount rule.
By default, this parameter is set to an empty string.
Set this parameter to a comma-separated list of pairs, with each pair
specifying the grey box name and its corresponding gate count.
Use the greybox rule parameter as follows:
set_parameter blackbox
'name1=num1,name2=num2,name3=num3,...',
Where, <name> is the name of the grey box design unit and <num> is an
integer number representing the gate count.
Used by GateCount
Options Name and gate count of grey box modules
15
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
proto_2_Nand
(Optional) Specifies the name of the NAND gate to be used by the
GateCount rule as reference for computing the area in terms of NAND2
equivalent gates.
By default, the name of the reference gate is assumed to be RTL_NAND2
(for originally RTL description that was synthesized by SpyGlass). For
originally structured netlists, the reference is the average of all NAND2
equivalents found in the technology library.
Use the proto_2_Nand rule parameter as follows:
set_parameter proto_2_Nand <name>
Where, <name> is the name of an NAND2 gate macro.
Used by GateCount
Options Name of the NAND gate
Default value RTL_NAND2
Example
Console/Tcl-based set_parameter proto_2_Nand RTL_NAND
usage
Usage in goal/source -proto_2_Nand=RTL_NAND
files
16
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
report_all_cells
(Optional) Extracts the information regarding some special cells, such as
memory cells, used in the design.
By default, the report_all_cells parameter is set to no.
If the report_all_cells parameter is set to yes then the GateCount
rule will not consider these cells for calculating the gate count of a module.
NOTE: To use this feature, customer must have the license feature, sgm.
Used by GateCount
Options yes, no
Default value no
Example
Console/Tcl-based set_parameter report_all_cells yes
usage
Usage in goal/source -report_all_cells=yes
files
rptallmodulegatecount
(Optional) Specifies whether the GateCount rule should report gate count of
all modules.
By default, the rptallmodulegatecount rule parameter is set to no
and the GateCount rule dumps the gate count of the top-level modules and
complete design in the vdb file.
Set the rptallmodulegatecount rule parameter to yes to dump the
gate count of all the modules in the vdb file.
Used by GateCount
Options yes, no
Default value no
Default Value in yes
GuideWare2.0
17
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
Example
Console/Tcl-based set_parameter rptallmodulegatecount yes
usage
Usage in goal/source -rptallmodulegatecount=yes
files
rtl_Nand_Area
(Optional) Specifies that prototype NAND2 cells will be used by the
GateCount rule for SpyGlass synthesized instances.
Used by GateCount
Options Positive integer value
Default value 1.0
Example
Console/Tcl-based set_parameter rtl_Nand_Area 2.0
usage
Usage in goal/source -rtl_Nand_Area=2.0
files
size_*
(Optional) These rule parameters are used to specify the area of different
gate macros used in the design.
The GateCount rule calculates the size of each gate type based on the area
value in the associated library (specified by the read_file -type
gateslib <file> command in a project file, and/or the SpyGlass
default gates library). However, SpyGlass may create gate macros to
18
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
19
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
20
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
size_Buf
(Optional) Specifies the buffer size (two input NAND equivalents) to
consider.
By default, the value of the size_Buf parameter is set to 1.
21
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
You can set the value of the size_Buf parameter to any positive real
value or zero.
Used by GateCount
Options <positive real value or zero>
Default value 1
Example
Console/Tcl-based set_parameter size_Buf 1.0
usage
Usage in goal/source -size_Buf=1.0
files
22
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
Product Reports
Product Reports
The GateCount rule of the SpyGlass area product generates the following
two reports:
diff
The GateCount rule generates a report named diff that you can view in the
Atrenta Console GUI. The diff report compares the results of two SpyGlass
Analysis runs (one before modifications and the second after modifications)
to generate area-related differences in the two runs. The diff report has the
percentage change in the area estimate of each design unit with respect to
the current area estimate and its earlier area estimate of the complete
design. Therefore, you can ascertain the impact of your changes on the
area estimate of your design.
The procedure to generate the diff report in the batch mode is as follows:
1. Analyze your design by running a goal containing the GateCount rule.
This step creates a violation database file (say spyglass.vdb) in the
current working directory.
2. Rename spyglass.vdb to say first.vdb.
3. Modify the design as required.
4. Reanalyze your design with the GateCount rule, other commands as
required, and the following additional project file commands:
set_option report diff
23
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
Product Reports
24
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
Product Reports
The procedure to generate the diff report in the Atrenta Console GUI is as
follows:
1. Analyze your design in the Atrenta Console GUI by selecting the
GateCount rule and other settings as required.
This step creates a violation database file (say spyglass.vdb) in the
current working directory.
2. Rename the violation database file spyglass.vdb to say first.vdb.
3. Modify the design as required.
4. Reanalyze your design in the Atrenta Console GUI with the GateCount
rule and other settings as required.
5. Generate the diff report by selecting it from the Tools -> Report menu
option.
You are asked to enter the name of the original violation database file.
Enter or select the violation database file of the earlier run (first.vdb) and
click OK.
This step creates and displays the diff report.
GateCountReport
The GateCount rule generates a report named GateCountReport that
contains module-wise gate count information. In addition, this report
contains the information, such as area factor, prototype NAND gate name,
prototype NAND gate area, gate count, and instance count of the complete
design.
NOTE: You can also access the GateCountReport report at the consolidated_reports
directory.
A sample GateCountReport is as given below:
Area Factor: 1.000000
Prototype NAND Gate Name: RTL_NAND2
Prototype NAND Gate Area: 1.000000
25
Synopsys, Inc.
Using the Rules in the SpyGlass area Product
Product Reports
Gate Count: 27
Instance Count: 26
==============================
S. No. Module Name Instance Count Gate Count
------------------------------------------------------
1. WORK_reorder_bits_15_4 16 16
2. WORK_reorder_bits_7_2 8 8
------------------------------------------------------
26
Synopsys, Inc.
Rules in SpyGlass area
Overview
The SpyGlass area product provides the following rules for checking the
area-related design issues:
Rule Description
GateCount Gate and instance counts for the complete hierarchy of
design
ResourceShar Sub-expressions in RTL that can be shared to minimize
e area
27
Synopsys, Inc.
Rules in SpyGlass area
Overview
GateCount
Reports gate and instance counts for the complete hierarchy of
design
When to Use
Use this rule to report the gate count of a design.
Description
The GateCount rule reports the total estimated number of gates and
instances in the whole design and in the individual modules or
architectures. The gate count is reported in terms of the number of
two-input NAND gates equivalent. This rule reports each gate or macro in
the design as one instance but reports its gate count depending on the size
of the gate or macro.
The following lists the gate count of different gates or macros:
1. For inverters, the gate count is less than 1.
2. For NAND2 and NOR2 gates, the gate count is 1.
3. For AND2 gates and flip-flops, the gate count is more than 1.
The GateCount rule uses the area of the NAND2 gate in a specific gate
library to calculate the area of other gates in the same library. If the
specific library does not have a NAND2 gate, this rule attempts to search
for a NAND2 gate in other specified gate libraries. This rule uses the
minimum-sized NAND2 gate found in these libraries. When a NAND2 gate
is not found, the area of other gates is calculated assuming the area of a
virtual NAND2 gate as 1.
Customizing the GateCount Rule
Input to the GateCount rule can be any one of the following design types:
RTL design
Netlist design + library
Mixed (RTL + netlist) design + library
Depending upon the type of input, the GateCount rule can be customized.
To customize the rule behavior, refer to the Parameters section.
28
Synopsys, Inc.
Rules in SpyGlass area
Overview
Prerequisites
The GateCount rule uses the NAND2 gate with the minimum area to
calculate the gate count if more than one NAND2 gates are found in the
SpyGlass-compiled gates library specified with the read_file -type
sourcelist <file-name>.f command in a project file.
Parameters
area_Factor: Default value is 1.0. Set this parameter to a double number
that specifies the area factor.
The area_Factor parameter is applicable for all design types (RTL,
netlist, and mixed). Use this parameter to map the gate count
calculated by the rule into another form of representation, such as
reporting physical area or transistor count. Apply this parameter on
complete module gate count, not on individual instance gate count.
If you want to report the transistor count, set the value of the
area_Factor parameter to 4. Similarly, if you want to report physical
area, specify the actual physical area of a NAND gate to the area_Factor
rule parameter.
blackbox: Default value is an empty string. Set this parameter to a
comma-separated list of pairs, with each pair specifying the black box
name and its corresponding gate count.
greybox: Default value is an empty string. Set this parameter to a
comma-separated list of pairs, with each pair specifying the grey box
name and its corresponding gate count.
proto_2_Nand: Default value is RTL_NAND2. Set this parameter to name
of the NAND gate to be used as a reference for computing the area in
terms of NAND2 equivalent gates.
size_*: Use this parameter to specify the area of gate macros used in the
design. The GateCount rule calculates the size of each gate type based
on the area value in the associated library (specified by using the
read_file -type gateslib <file> command in a project file,
and/or the SpyGlass default gates library).
audit_cell_details: Default value is _null_. Set this parameter to
absolute or relative path of the file. This enables the GateCount rule to
read all the cell types and their related attribute combination from the
file.
29
Synopsys, Inc.
Rules in SpyGlass area
Overview
Constraints
None
Messages and
Suggested Fix
Message 1
The following message appears for each top design unit <du-name> in the
design:
[INFO] <du-name> : GateCount : <num1> InstanceCount : <num2>
Where, <num1> is the estimated number of gates and <num2> is the
number of gate-level instances in the top design unit.
30
Synopsys, Inc.
Rules in SpyGlass area
Overview
31
Synopsys, Inc.
Rules in SpyGlass area
Overview
None
32
Synopsys, Inc.
Rules in SpyGlass area
Overview
Example Code
and/or Schematic
Example 1
Consider the following VHDL example:
entity top is
port (in1, in2 : inout integer; out1 : out integer);
end entity;
33
Synopsys, Inc.
Rules in SpyGlass area
Overview
input a;
output z;
assign z = ~a;
endmodule
input a, b;
output z;
assign z = a & b;
endmodule
Default Severity
Label
Info
Rule Group
None
Reports and
Related Files
diff, GateCountReport
34
Synopsys, Inc.
Rules in SpyGlass area
Overview
ResourceShare
Reports sub-expressions in RTL that can be shared to minimize
area
Rule Description
The ResourceShare rule reports sharable sub-expressions in the design.
While the RTL description may have many candidates of sharable
sub-expressions, some of them are optimized out during synthesis. The
ResourceShare rule attempts to locate remaining sharable resources in a
flattened netlist.
Message Details
The following message appears at a location where a sharable sub-
expression <expr> is found in the design:
Expression <expr> can be shared: ({File: <file-name> Line:
<num> , })
For every other occurrence of the sharable sub-expression <expr>, the
message provides the source file name <file-name> and the line
number <num>.
Rule Severity
Information
Examples
Consider the following Verilog example:
1: // file : tests.v
2: module top (in1, in2, out1, out2);
3: input [31:0] in1, in2;
4: output [31:0] out1, out2;
5:
6: assign out1 = in1 + in2;
7: assign out2 = in1 + in2;
8: endmodule
SpyGlass finds a sharable sub-expression — (in1 + in2) and generates
35
Synopsys, Inc.
Rules in SpyGlass area
Overview
36
Synopsys, Inc.
List of Topics
List of Topics
About This Book ............................................................................................. 7
area_Factor ................................................................................................. 13
audit_cell_details ......................................................................................... 13
blackbox ..................................................................................................... 15
Contents of This Book ..................................................................................... 8
diff ............................................................................................................. 23
GateCountReport.......................................................................................... 25
greybox ...................................................................................................... 15
Overview..................................................................................................... 27
Product Reports ........................................................................................... 23
proto_2_Nand.............................................................................................. 16
report_all_cells ............................................................................................ 17
rptallmodulegatecount .................................................................................. 17
rtl_Nand_Area ............................................................................................. 18
Running the SpyGlass area Product................................................................. 12
size_*......................................................................................................... 18
size_Buf ...................................................................................................... 21
SpyGlass area Rule Parameters ...................................................................... 13
Typographical Conventions .............................................................................. 9
37
Synopsys, Inc.
List of Topics
38
Synopsys, Inc.