HDL Code Analysis For ASICs in Mobile Systems
HDL Code Analysis For ASICs in Mobile Systems
Fredrik Wickberg
LiTH-ISY-EX--07/3924--SE
Linköping 2007
HDL code analysis of ASICs in mobile systems
Master thesis performed in electronic systems at
Linköpings tekniska högskola
by
Fredrik Wickberg
LiTH-ISY-EX--07/3924--SE
There are a couple of tools in the market that performs static HDL analysis
and they vary in both price and functionality. In this project mainly Atrenta
Spyglass was evaluated but similar tools were also evaluated for comparison
purpose.
The purpose of this master thesis was to evaluate the need of implementing a
rule checking tool in the design flow at the Digital ASIC department PDU Base
Station development in Kista, who also was the commissioner for this project.
Based on the findings in this project it is recommended that a static rule
checking tool is introduced in the design flow at the ASIC department.
However, in order to determine which of the different tools the following
pointers should be regarded:
• If the tool is only going to be used as for lint checks (elementary structure
and code checks) on RTL, then the implementation of Mentors Design
Checker is advised.
The areas regarding checks that could be of interest for Ericsson is believed
to be regular lint checks for RTL (naming, code and basic structure),
clock/reset tree propagation (netlist and RTL), constraints and functional DFT
checks (netlist and RTL).
Acknowledgements
Björn Fjellborg (Ericsson) - for great guidance during the entire project which
helped me a lot in many areas and kept me from slipping out of focus.
Ericsson Mobile Platform in Lund (EMP) – everybody I have had contact with
for being very helpful.
Table of Tables
Table 2 Explanation to the commands and switches used in the evaluation. 8
Table 3 Number of licenses needed, based on spyglass runtime, calculated for design teams
containing 10, 15, 20 and 25 designers. 14
Table 4 Spreadsheet over differences between the evaluated tools. 35
Table of Equations
FF Flip Flop.
HW Hardware
IP Intellectual Property
MUX Multiplexer.
Policy A policy is a collection of similar rules. E.g.
the Constraints policy consists of rules that
check the SDC file for correctness and
coverage.
Table 1 Abbreviations.
1 Introduction
1.1 Background
The netlist delivery process between the design teams at Ericsson and the
chip vendor is iterative. The process consists of a number of scheduled
deliveries. In each of these deliveries the netlist must have reached an agreed
maturity degree in terms of implemented functionality and structure, this
scheduled delivery is referred to as a drop. The problem is that the number of
undesired iterations has increased. These iterations (revisions of a drop) are
caused by errors that prevent the netlist to reach the agreed maturity degree.
A consequence is that the engineers have to put more work and time into
correcting errors than before. In these days, when time to market and design
cost have to be shortened, the extra work generated from these extra
iterations is greatly undesired. One of the main objectives for the evaluation
was therefore to check whether the use of Spyglass on gate-level netlists, can
reduce or eliminate the number of undesired iterations between Ericsson and
the chip vendor. An illustration of this is shown in Figure 1 (the dotted arrows
on the left symbolise the undesired iterations and would preferably be
replaced by the dotted arrows on the right).
1
Ericsson Specification
RTL-coding
VHDL
(Sys. Verilog)
RTL-code Testbenches
Verilog Synthesis
Other objectives were to see if the errors found at gate level could have been
prevented if Spyglass had been used on RTL and hence cut off the iterations
completely. The type of rules that could be of interest in an eventual future
purchase of the tool was also investigated.
1.2 Method
Anna was the design used as test platform on which the evaluated tools was
applied upon (Anna is a pseudonym, since the actual name is classified).
Anna was a design in 65 nm technology and contains several cores
(Phoenix), a Common Memory Controller (CMC), several hardware
accelerators (Hwacc), a block containing test/clock/reset/timer interfaces
(MISC), external IO interfaces (eIO) among others. The project was divided
into three parts.
2
1.3 Project goals
2. Which rule packages are the most interesting for the ASIC department at
Ericsson?
3. How well would a static HDL-code analysis tool fit into the current design
flow?
7. What gain are there to be seen for the use of the static rule checking tool
on design in 65 nm technology?
3
1.4 Introduction to Spyglass
Spyglass is a tool that performs a static and/or dynamic analysis of RTL code
or gate level netlists in the purpose to find structural, coding, consistency
and/or functional problems with the help of rules. A common
misunderstanding is that Spyglass is a regular static lint checking tool. Even
though this is one of the tools main fields of application, much more can be
performed than just checking that e.g. a “_n” has been used after the name of
an active low reset signal can be performed. One of the more advanced
checks Spyglass can perform is analysing whether the data signal in a clock
domain crossing protocol is stable during request. Spyglass has a number of
rules in different areas and below is a short summary.
• Code structure – For example, if flip flops have reset, reset is used both
synchronously and asynchronously, shift overflow etc.
• Structural checks – For example, if flip flop has the specified reset,
combinational loops, long logic path, redundant logic e.g.
y <= not (not X) etc.
The rules in the first two points above are often referred to as lint rules. To
analyse these types of rules Spyglass only investigates the source code and
no synthesis is needed. This is also the case for checking if a flip flop has a
reset. But if a rule that checks whether this reset is the one specified in the
Spyglass Design Constraints (SGDC) file (explained later), then Spyglass
must synthesise the design. The rules that are run depend on the templates
that are selected. A template in Spyglass is a set of rules. The user can use
the templates that are shipped with the tool or put together a new one
containing already existing or custom made rules. Putting together a custom
template is done by browsing and selecting rules in the policies. A policy is a
set of similar rules and distinguishes from a template in the way that a
template can contain rules from many different policies. A visualisation of this
is shown in Figure 2.
4
Figure 2 The policy template relation.
Spyglass can either run in batch mode or interactively using the GUI (shown
in Figure 3). A typical run is done in batch mode. The reports Spyglass
generates are then used to correct the errors. If there are problems that
require more information than the reports can offer, the GUI is brought up. In
the GUI the user can open the schematic view (the “AND” gate symbol
button) or the incremental schematic (the IS button). The difference between
these two is that the incremental schematic shows the user structures
correlated to the selected violation, while the schematic view shows the entire
block. When structural and functional rules are run Spyglass must be supplied
with an SGDC (SpyGlass Design Constraints) file. This file contains
information regarding clocks, resets, test mode signals, additional Synopsys
Design Constraints (SDC) files etc. An example is the specification of the
master clock. In order to check clock tree propagation Spyglass needs
information regarding where to start the checking. Below is a typical clock
specification in the SGDC file:
The line provides Spyglass with information regarding clock source, domain (if
there are several clock domains), if the clock returns to zero or one and if the
specified clock is a system clock or a test clock. The information the SGDC
file must contain depends on the types of checks that are to be run, but
typically clock and reset information are mandatory for most checks. For more
information regarding Spyglass in general or how to define signals in the
SGDC file, the reader is refered to [Atrenta 2, 2006].
5
Figure 3 Spyglass GUI.
Even though Spyglass’ main contribution is when run at RTL the tool has
functionality to check netlists as well. Different types of rules are often run at
different stages in the design flow. Many of the DFT checks are meant to be
run at gate level, namely because typically the implementation of the scan
chain is done after synthesis. Therefore is there no point in checking all the
DFT rules at an early RTL stage, but instead use a subset containing checks
for clock and reset propagation. There is also no point in checking rules
regarding internal company naming conventions and code structure at the
gate level. Here it is more useful to check naming conventions desired by the
chip vendor to check that the synthesis tool has not named IPs and similar
according to a forbidden style. An example of how Spyglass can be used in
the design flow is shown in Figure 4. The versions of Spyglass that have been
evaluated are 3.8.0.3 for the netlist level checks in part I and 3.8.1 for the rest
of the evaluation.
6
Fast RTL
Naming checks RTL block code
Sensitivity lists
FSM structures
Block integration
Fast RTL
RTL block signoff CDC checks
Light DFT checks
Pre synthesis checks
Chip integration
Fast RTL
CDC chip checks RTL chip signoff
DFT Ready checks
Pre synthesis checks
Synthesis
Figure 4 Example of how the usage of Spyglass in the design flow could be.
Starting Spyglass is done with the spyglass command. There are a number
of switches to be used depending on the type of evaluation the user desires.
Table 2 shows the switches and commands that were used during this
evaluation. Below is a typical start up command.
7
-policy=<policy name> Specifies the desired policy to be
run.
Or
8
2 Part I – Spyglass used on netlist level
In this chapter the method and summary from the netlist evaluation is
presented. The results from the evaluation is found in chapter 5.1.
2.1 Method
Netlist versions
Time
TTM loss
Project starts
Figure 5 Visualisation of a typical netlist flow between Ericsson and the chip
manufacturer. The black clouds represent the time cost of correcting an
error. In the evaluation immediate related netlists were evaluated and
compared in order to determine what could have caused the undesired
iteration.
9
The method used to identify causes to the undesired iterations was more or
less a heuristic model in the sense that it did not guarantee an optimal result.
The problem was that there were too many violations to examine from a run
and the work of exhaustively going through them all would have been
impossible. The method model that was developed and used in this part of
the evaluation is described in the following section.
The Spyglass GUI was used to examine the selected violations. Violations
obviously not being the cause to the undesired iteration were disregarded.
The remaining violations were taken into further account and discussed with a
designer. If a violation, in consent with a designer, had a high probability of
being the cause of an undesired iteration, unnecessary design time had been
found. The time was then added to the final equation, used to compare cost
against earnings of the tool (explained more later). The procedure described
was applied to a selected set of different drops on both block and chip level.
10
When all the selected drops had been evaluated (see Appendix A for the drop
selection procedure), the cost of the extra work the undesired iterations
produced were then calculated by multiplying the estimated time it took to
correct the identified bug (Eh), with the cost of one engineering hour (Ec).
This was then added with the lead time delay (Ch) multiplied with the lead
time cost (Cc). The Ch x Cc factor was very hard to estimate and varies a lot
between projects. The result from the addition makes the left side of Equation
1. On the right side the cost of introducing Spyglass in the design flow was
calculated. The number of required licenses (Li) was multiplied by the yearly
cost of a license (Lc). The initial cost of introducing Spyglass in the design
flow was then added (Ic), which will contain factors like estimated cost of
changing the flow, time costs for educating R&D people in the use of
Spyglass. The sum was divided by the number of projects during a year (P).
The use of Spyglass in the flow will also consume extra engineering hours.
But with respect to that one of the main reasons for using Spyglass in the flow
is to save rather than causing longer developing time (finding errors quicker,
easier debugging etc.), these two factors is assumed in this part to take each
other out.
When the rule InferredBlackBoxes was violated and flagged a black box it
provided both the instance name as well as the expected module/cell name.
An example of black box detection is shown in Figure 7.
11
Figure 7 Example of black box detection.
The libraries are usually compiled into a common directory in the working
area. For this evaluation a directory called “sglibs/” was created, into which all
the necessary libraries were compiled. The compilation was performed by the
command spyglass_lc –gateslib <library file path>. When
Spyglass was run, pointers to the libraries that were compiled had to be
provided in the start up command. The switch –sglib <spyglass
library path>, did this. Typically when there were a lot of libraries all the
pointers could be collected in a file. The -f command was then used to
include the file at start up.
When correcting errors using the Spyglass GUI, the user browses through the
violations in the “Msg Tree” tab. By default, the messages were sorted by the
severity levels “INFO”, “WARNING”, “ERROR” and “FATAL”. A more
preferred order was to sort by policy. This was done by selecting “Window” ->
“Preferences” -> “Misc” and then selecting “Group by policy” under “Tree
Selection”. The user is also able to specify a preferred editor. This was done
in the same tab as for the sort order mentioned above but under “Specify
Editor program”. To bring up the editor when correcting and analysing the
results, the user only highlights a row in the “code window” and presses the
“e” button. This started the editor and a cross reference makes the editor
automatically to show the part with the selected row.
The aim of part I in this evaluation was to simulate the typical procedure the
ASIC vendor follows when they receive a new netlist version from Ericsson.
Later it was learned from the ASIC vendor that they had not used Spyglass on
Annas netlist, but an internal hand-off kit instead. The ASIC vendor gave the
explanation that Spyglass was not able to substitute their current hand-off kit
for implementation. This meant a set back in precision regarding recognising
the causes to the undesired iterations.
Even though Spyglass was not used on Anna, they confirmed that they
usually use the RTL-Signoff template, which can be used for both RTL and
netlist checks. The ASIC vendor’s add-on consists of the following two
policies.
• Set one, various rules for poorly implemented design (contains the RTL-
Signoff template).
12
2.4 Estimated number of licenses required based on Spyglass run
time
Calculating the number of licenses is very hard and the results given in this
chapter is only giving a ruff pointer to how many licenses that would be
necessary to satisfy the need. In order to make this calculation the following
assumptions were made.
• The greatest need for a large quantity of licenses will be when RTL block
delivery takes place before a scheduled netlist delivery. Ericsson Mobile
Platform (EMP) made the same assumption.
10 1.25
15 1.875
20 2.5
25 3.125
13
Table 3 Number of licenses needed, based on spyglass runtime,
calculated for design teams containing 10, 15, 20 and 25 designers.
2.5 Rules
As mentioned in chapter 2.1 the template provided from the ASIC vendor was
selected to be used in this part of the evaluation. This template contains all
the rules in the stdc-policy. These are naming conventions, RTL coding rules
and design rules. The motive behind the decision to use the RTL-Signoff
template is explained in the last section of chapter 2.3.
Before the RTL-Signoff template was applied on any of the blocks, the
selected rules were surveyed to determine if there was anyone considered to
be of extra importance. The reason for this was to render the evaluation to be
more efficient. Experiences gained after a test run with default Spyglass rules,
were that there would be a lot of violations from a large number of rules.
Deeper knowledge and understanding about the checking functionality of
certain rules were therefore of great asset. The chosen rules were considered
even if there were no deviation between two netlist versions. The character of
these rules were such that if they occurred, the source to the violations had to
be traced further. Below is a list of the names of these selected rules along
with an explanation to why they were given extra attention.
• BB_DES042 – Avoid constant values on the data input pin on flip flops.
There is no point in setting a data pin of a D-flip flop to a constant value.
The only thing this will result in is extra silicon and power consumption.
The possibility of an unintended construct is high.
• BB_DES063 – Preferably use clock signals active on the rising edge only.
The most common practice is to have the entire design to trigger on active
edge of the clock signal. This makes both the verification task easier as
well as meeting the timing constraints. High risk of unintended construct.
There are design exceptions, such as a Double Data Rate (DDR)
mechanism.
14
• BB_DES070 – Do not use D flip flops nor latches with connected set and
reset pins.
A D-flip flop has either reset or set, not both like an Set/Reset (SR) flip
flop. If they are both set and reset, different tools in the flow might have
different priority levels on the signals and hence make the design work in
an unintended way.
The direct savings earned if Spyglass would have been used in the Anna
project (i.e. cost of “unnecessary” engineering hours spent when not using
Spyglass), would have been far from covering the cost of the tool. There was
another matter, however if the lead and calendar time delay were to be taken
into account. The cost of these delays could be immense and the risk of
delays should be considered, as shown with the example in [Wickberg, 2007].
The run times were a big problem. Applying a large number of rules on a
design containing over three million gates is not recommended. Some rules
hit the roof at 999 999 violations (not correctly parameterised naming rules),
and with nearly 400 rules enabled the run times were incredibly long. The run
times had a strong relation to the number of rules that were enabled and the
number of violations these rules generated. Later it was found out how to
reduce the maximum number of violations each rule could generate. There
was no actual reason to be informed of tens of thousands violations. It was
impossible to examine them all one by one. The designer must ask
herself/himself if the rule in question is of any value to her/him, or take drastic
correction measures to reduce the numbers. The max value was set with the
switch –lvpr X. X stands for the number of violations a rule can generate.
When this roof is hit, Spyglass moves on to check the following rule. Using
this switch helped a lot when evaluating Phoenix, where the run times were
cut to almost a third. In Anna’s case no actual gain were recognised by this
method simply because Spyglass never finished a run with the regular
template. Therefore the set of rules had to be minimized and it all came down
to only run one single rule that turned out to have found errors in the Hwacc
block. This was a great setback but nevertheless necessary.
The run times can be apprehended as unacceptably long for a static rule
checking tool. But there are a few things to remember and consider before
forming an opinion.
1
By inserting a flip flop before output.
15
• Spyglass has not been used in the way it should be. The optimal way of
use is through the entire design flow with a set of rules that was defined in
advanced. In this way faults and errors will not be allowed to propagate
through the design. Otherwise a single error at a low level might generate
thousands in a higher level. A simple example is a signal naming rule. If
this rule is not applied until chip signoff and is violated, all the signals will
be reported and the work of renaming all these would be massive. If it had
been applied from the beginning only a few violations would have been
reported and the work correcting these would be effortless.
The memory usage was an issue as well, and the reason for this behaviour
was strongly connected to the reasons why Spyglass had such long run
times. At some points the memory on a regular 32-bit processor was not
enough and the run crashed with the message:
It was mainly Anna that suffered from the large memory usage and was run
on a 64-bit CPU. A strange behavior was that a 32-bit CPU could be used
when running the actual evaluation of the Phoenix block in batch mode but
when bringing up the GUI for violation navigation and examination the 64-bit
core had to be used. As mentioned above the reasons for the immense
memory usage were the same as for the reasons with the large run times.
The number of violations and type of rules selected for the run had a great
impact on how large the spyglass.vdb file (the database file) became. But
even though only one rule was selected for the evaluation on Anna, which
only generated 320 violations, the 64-bit CPU had to be used. It was therefore
legitimate to assume that Spyglass demands more than 2^32 = 4.29 GB of
memory for a synthesis of a 3 million gate design. This might sound alarming
but one must keep in mind that most of the runs are to be executed on block
level RTL code (RTL code checks runs faster). When checking the netlist,
theoretically only one evaluation at the time will be run.
16
3 Part II – Spyglass used on RTL
In part II the Spyglass packages Constraints, DFT and CDC was evaluated.
The objective was to compose such a comprehensive information base
regarding each package and making it possible for Ericsson to decide
whether the package is of interest at an eventual purchase of the tool. There
is a presentation of the method used for evaluating each of the packages.
There is also a section regarding regular checks (also known as Lint), in the
end of the chapter there is a summary. The results from the evaluations is
found in chapter 5.2.
Constraints are essential when developing a new design. The constraints set
up are the environmental, clock, test and power boundaries the designers
must keep themselves within when designing an ASIC. The constraints set up
is often captured and written in a Synopsys Design Constraints file (SDC). For
more information regarding SDC, the reader is referred to [Synopsys 2, 2006].
Without constraints the design can go haywire and when implemented on a
chip it will not have the desired functionality nor behave as expected. In order
to implement the functionality when a new ASIC is under development, the
designers review the design specification. In order to develop a design that
will make sense in reality, it is at least as important to have a complete
constraints set up and to verify the design against it during the development
phase. This process is shown in Figure 8.
Design
Specification
Design constraints
New
Design
17
The work of specifying constraints for a design is an ongoing and complex
task. If there are new ports added in the design, parameters constraining
these port must be added in the constraint set up. The risk of missing a
constraint is obvious when there are many people working with different
blocks. If adding a constraint is omitted, the result could be fatal and thus cost
vast amounts of money. Therefore Spyglass functionality regarding verifying
the constraint set up coverage, correctness and consistency were evaluated.
The following is an example of a multi cycle path problem. The path between
A* and B* in Figure 9 has been declared as a multicycle path of two cycles. In
other words the value at A* will not be read at B* until after two clock cycles.
What happens if there is a similar path between A* and C* which is not
declared as a MCP? The synthesis tool will meet the requirement of the
“worst” path between A* and C*, which will then be unnecessary fast due to
that the value at A* only will be allowed to change every second pulse. The
structure is therefore wrongly constrained resulting in unnecessary use of
logic gates and similar. It would be desirable to check for these kind of
constraints defects.
3.1.1 Method
18
When running Spyglass the two default templates Constraints/sanitycheck
and Constraints/synthesis were used to evaluate the constraints set up. The
template mentioned first was used mainly to check whether signals defined in
the SDC file had equivalences in the code. The other template contains rules
for RTL pre synthesis runs and this was the one that was used for the actual
SDC evaluation.
B_o C_i
FF FF
Block B Block C
clk
Block A
output delay overdue violation
B_o
Figure 10 If the output delay constraint from block B plus the input delay constraint
from block C is longer than the clock period it could lead to a severe error.
This error would then cause unwanted iterations late in the design phase
costing time and resources.
In order to check this functionality a smaller example design was used. The
design is a bubble sort accelerator.
The Bubble sort design was constructed of three blocks. There were an SDC
file written for each of the blocks and these were linked together in the SGDC
file with the following commands.
current_design ARRAY_BB_SORT_STRUCTURAL
mapped_pin_map –clock CLK –enable EN E –data D –out Q QN
sdcschema –file bb_sort_structural.sdc –level rtl –mode fn1
block –name REG_STD_LOGIC_VECTOR FSM
19
current_design REG_STD_LOGIC_VECTOR
mapped_pin_map –clock CLK –enable EN E –data D –out Q QN
sdcschema –file bb_sort_reg.sdc –level rtl –mode
current_design FSM
mapped_pin_map –clock CLK –enable EN E –data D –out Q QN
sdcschema –file bb_sort_fsm.sdc –level rtl –mode fn1
The templates used when running Spyglass were the same as for the CMC
block evaluation.
Size and complexity of new architectures are growing fast which in turn
makes the testing procedures harder. It is therefore important for the
designers to follow the Design For Test (DFT) technique. DFT can be
described in short as making the validation process easier and simpler by
taking testing in consideration from the beginning of the design process. To
achieve a design that is easy to test, the two terms controllability and
observability are used. The meanings of them are shortly explained below.
One of the approaches under the DFT technique is Scan-Based testing. This
means that flip flops are directly connected with each other in a long chain,
from chip input to output. The testing personnel are then able to scan desired
values into the design using predefined test vectors. The vectors put the
design into desired states which are excited whereupon the new states are
scanned out and read at the outputs. The work of implementing an effective
scan chain puts great demands on the design regarding the observability and
controllability properties previously mentioned. Spyglass capability of
checking these properties early in the design phase was interesting and
therefore evaluated. For more information regarding DFT the reader is
referenced to [Rabaey, Chandrakasan and Nikolic´, 2003] page 721.
3.2.1 Method
The Anna Core was chosen for the DFT evaluation. See Figure 11 for a
hierarchy overview. The reason for not including the entire design was that
the ASIC vendor had not implemented parts of the test logic in the Anna Chip.
Therefore were some test signals connected to ground at the Anna Chip level
awaiting further implementation. The following signals were, referring to the
Anna test documentation [Test, 2006], defined in the SGDC file in order to
satisfy the scan ready checks.
• tst_scanenable and ScTest were set to 1, which puts the design in scan
mode.
In order to check the observability and controllability of the BIST logic the
following signals were also stimulated:
• BIST_IN [1] (RBACT) and BIST_IN [5] (BYPASS) were set to 1. This
enables ram bypass and test mode.
• BIST_IN [10] (CLK_BMP) defined a test clock to verify that the BITMAP
logic had a controllable clock as input.
The template “Scan_ready” was used, which contains rules to check for how
well prepared the design was for Scan chain insertion. The three properties
Spyglass checks for are given below.
• All resets and sets should be disabled in test mode. To check this property
the Scan_ready template uses the rule Async_07 – All internally
generated asynchronous sources should be inactive in scan mode.
PseudoChip
PseudoCore
BIST_IN
tmc
As new hardware designs are getting larger, clock path length becomes
critical. In order to shorten the clock path, and thus avoid clock skews that are
too large to be handled, a common design method used is Globally
Asynchronous Locally Synchronous (GALS). The main idea with this method
is to design small blocks with individual clocks. The blocks are then
connected with each other through an asynchronous handshaking
mechanism or a FIFO (among others). On each of the communication paths
between the individual synchronous blocks there will be one or more Clock
Domain Crossings (CDC). The CDC can be a bit tricky to handle and the
consequences of a badly constructed CDC can be severe. For more
information about GALS the reader is referenced to [Myers, 2001]. An
alternative reason for the use of several clock domains is different demands
of clock frequency from CPU subsystem and varieties of I/Os (as there are in
Anna).
The structures used for synchronising data at a CDC are many and varies a
lot in complexity. A simple example of a poorly implemented data
synchronisation structure is the absent of one or several Meta stability flip
flops. The structural idea of using meta stability flip flops can be viewed in
Figure 12. The meta stable behaviour is a question of probability. The
probability of sampling meta stable data once is very small but significant,
while the probability of sampling meta stable data twice in a row is several
times smaller and hence considered to be insignificant. More about CDC
problems can be found in [Cadence 1, 2006].
a b
Domain 1 Domain 2 Domain 1 Domain 2
D12 D2’ D2
D1 D12 D2 D1
clk_1 clk_1
clk_2 clk_2
clk_1
clk_1 D12
D12
clk_2
clk_2 D2’
D2
D2
22
Spyglass possesses functionality of checking CDC. In the basic CDC
package there are rules for checking the meta stability problem mentioned
above, reset is correctly de-asserted, the presence of a CDC, rules to check
for a custom CDC structure etc. In the advanced CDC package there are
rules checking over/underflow of FIFO, if data is stable during the entire
period of the require signal, reconverging synchronised signals, the correct
implementation of busses crossing domains, the existence and structures of a
fast to slow clock domain etc. Even thought not many CDC exist in the
present designs, it was decided that some of Spyglass CDC checking
functionality were to be tested due to the severity of a CDC error.
3.3.1 Method
The Anna Core was used with the template Clock-reset/Sync_checks. The
template contains rules from the basic CDC package mentioned in the
previous section. The following clocks and their relation were defined in the
SGDC file.
• I_REF_CLK, domain1
• I_TCK, domain1
• I_EIO0_FP_156_CLK, domain2
• I_EIO1_FP_156_CLK, domain3
• I_EIO2_FP_156_CLK, domain4
• O_DDR_CLK_P, domain5
• O_DDR_CLK_N, domain5
• I_POW_ON_RESET_N
• ddr2_rst_n
The reason why the FIFO rules were not evaluated was problems with the
Design Ware (DW) component in the FIFO implementation. This problem is
more intensely discussed in chapter 3.5.
A synthesis run of a typical design can take days. If warnings or errors occur
during the synthesis due to design failure, there will be wasted time and the
synthesis must be rerun after the correction of the error. If a majority of these
errors or warnings could be prevented from reaching the synthesis phase, the
time gain would be considerable. In this chapter the investigation of Spyglass
capabilities regarding prevention of unnecessary synthesis failures is
presented.
23
3.4.1 Method
Warnings from a synthesis log was extracted and counted. The warnings
were then discussed with an experienced designer regarding severity and
their need to be checked. After this, the warnings were compared with the
result from a Spyglass run on Anna to see if they could have been caught. A
dilemma was that the synthesis log file origins from a different design than the
one used for the Spyglass test run. This can be a problem in means of
evaluation accuracy, but it should reflect the reality sufficiently. If time could
be saved, the cost of this time was added to the calculations in [Wickberg,
2007]. The cost of the saved time was calculated through engineering hours
saved multiplied with 850 SEK (cost of one engineering hour).
Conclusions drawn from the Constraints evaluation was that Spyglass has
good functionality regarding to check constraints cover in terms of clock
definitions, input/output constraints, load, capacitance, transition etc. A
negative result was that rule clk_Gen01 flagged signals that were input to
latch enables as unconstrained clocks. The rule therefore generated
thousands of ”unnecessary” violations. This behaviour would make the
correction work harder in terms of identifying real unconstrained clocks.
Spyglass could not map the rules checking input/output delays regarding how
much logic there were between the input and the first flip flop. A suggestion
would be that a threshold parameter is used to set a default value on
combinatorial gate in the path. As it was, a combination of the Inp_delay rules
along with rule Topology_10 had to be used. The Topology_10 rule is shipped
in a different package, which could be a problem. Spyglass could however
check the delay against a customisable percentage of the clock period.
In terms of checking RTL code for scan readiness Spyglass functioned well.
According to Atrenta it should be enough by removing all violations to rule
Async_07 and Clock_11. It was easy to understand the violations generated
by these two rules. In order to satisfy LSSD instead of Scan insertion the rule
Async_07 LSSD should be used. One must then also configure the SGDC file
with the scantype –lssd constraint. This results in that Spyglass only
checks whether set and reset are inactive in test mode because the test clock
is not inserted until the actual LSSD insertion.
24
If the test implementation procedure in future projects will be performed as it
was in Anna more information sharing is desired in order to gain as much as
possible from the use of tools like Spyglass. As it was with the Anna project,
implementation of test signals in the AnnaCore were requested by the ASIC
vendor which then was cleared in the AnnaChip, during RTL, awaiting
connection work from the ASIC vendor at gate level. There was no
information regarding the use of these signals because the test document
developed by the ASIC vendor was written for the chip interface. The
connection between the signals into the chip and the signals into the core was
therefore partly unknown until the ASIC vendor connected them. If future
vendors request implementation of signals in blocks it would be preferred if a
specification of them is shipped with the request, describing purpose and
stimuli for the different modes. However this test implementation procedure is
not how Ericsson intends to work in the future. Either test is implemented fully
from the beginning or not implemented at all until later. This would certainly
increase the ease of using Spyglass in DFT purpose.
Another problem encountered during the DFT evaluation was the use of a
DesignWare component. Even though this has little to do with DFT it is worth
mention. DesignWare is Synopsys customizable IP libraries. Spyglass is
supposed to have functionality to handle and parse DW components but this
was not managed to work. Contact was taken with Atrenta regarding this.
They referred the problem to that the DW component used was new and that
there were no wrappers to handle it at the time. The support at Atrenta made
new wrappers which were received within a day. But the parsing problem
persisted and after a few days of troubleshooting and debugging without
progress the rest of the evaluation had to move on. The problem was
temporarily solved by black boxing the DW instance. Possible causes to the
problem could be the environment linking to Design Compiler (which Spyglass
invokes to compile the DesignWare libraries) or that the Spyglass version
used did not work with the new DW wrappers. Atrenta was however very
forthcoming and eager to help, as they were during the entire evaluation.
The main problem seen in the CDC package was Spyglass’ lack of
functionality regarding propagation of the reset signal. The tool was unable to
detect the de-assertion structure used in the Anna project. Because of this a
large number of unwanted violations were generated which in turn
complicated the correction work. The reset signal had to be manually defined
as synchronously de-asserted in the SGDC file. Due to the simple structure of
the reset de-asserter used in Anna it is quite surprising that Spyglass was
unable to detect it. Contact was taken with Atrenta regarding this problem and
they promised to look into it. CDC checks are however not a big issue at the
ASIC department. There are not that many crossings in the designs and the
basic CDC package would therefore suit their purpose.
25
In the question regarding whether Spyglass can reduce resources costs by
preventing faults that would otherwise appear during synthesis the answer is
yes. Spyglass has functionality to check for all the three warnings with
importance degree “high” and half of the warnings with importance degree
“medium”. After discussion with a designer it was concluded that the
estimated saving in time could be a week to several month, if Spyglass were
to be introduced. This estimation is based on the assumption that the
synthesis engineers’ saves a week if the warnings with “high” importance
degree were to be confirmed as “intentional” directly. The overhead of going
through them all would be redundant if the person writing the code had
already confirmed them with Spyglass. If one of the warnings slips through,
the correction work could be massive and take up to a month and involve
many engineers. The result is that the savings could be very considerable on
this level of use. For the calculations the reader is referred to [Wickberg,
2007].
An interesting aspect that has not been evaluated in this thesis was the Auto-
Verify policy in Spyglass. This policy contained functionality to verify false
paths and later on (in Spyglass version 3.8.3) multi cycle paths. Another
interesting aspect was the SOC rules in the DFT policy. These rules were
supposed to be able to verify that signals specified in the SGDC file were
correct with different input stimuli. A more extent evaluation regarding case
analysis on a design containing full implementation of test logic would also
have been interesting to perform.
26
4 Part III - Spyglass compared with other tools
This chapter contains a comparison between Spyglass and three other static
rule check tools. For each tool the overall impression and capabilities is
outlined and discussed. The tools are also compared in a spreadsheet to get
a good overview of the differences in interesting aspects. The spreadsheet
can be found in chapter 4.4. There is also a comparison between Spyglass
and Synopsys LEDA regarding the ability to customise rules for
SystemVerilog code.
Leda is probably, after Spyglass, the most advanced tool in the area. The
results gained from one week of testing the tool are outlined in this chapter.
For information regarding how to use LEDA the reader is referred to
[Synopsys 3, 2006].
Setting the environment took a lot of time and LEDA did not elaborate in the
beginning. The main reason for this behaviour was that there were instances
in the design lacking functionality in libraries. The compilations of the libraries
were difficult and the impression was that Synopsys have to work with this.
The application was uncomplicated to handle once the environment had been
set up, in terms of finding and compiling all the libraries etc, the checks run
quite fast and the explanations to the violated rules were decent however
more details were desirable. It was easy to dig deeper into the code from
where the violation occurred which could be done by either tracing the error
with a schematic view or directly in the code with the built in editor. The
schematic view visualised only the logic involved in with the chosen violation,
however the user could navigate further in the design if that was required. The
LEDA main window with the schematic view is visualised below in Figure 13.
There were cross-reference capabilities between the schematic view and the
editor. This made it possible to select a desired structure in the schematic to
be viewed in the editor.
27
Figure 13 Screenshot of LEDA.
When browsing through the violations after a run it was hard to get a good
overview of the violations. It would have been nice with filter capabilities like
not showing violations that went over a thousand in number, or was decided
to be of little importance during that particular run, without to have to turn that
rule of before the run. Filter functions like “show only violations regarding
clocks and resets” or “show FSM correlated violations” in the design could be
of help. Another nice but absent functionality would have been the ability to
filter a particular violation of a rule in the design.
4.1.3 Reports
A very nice feature was the ability to save an HTML document that further
explained the rules that had failed. In this document the violations were
described in more details than in the GUI and it also presented the number of
gates and latches that the design contained etc. This feature would make it
possible to correct uncomplicated bugs and errors without running the
application and thus not occupy a licence someone else needs. Below is an
example of one of the reports.
-- DESIGN REPORT --
There were a lot of different angles to approach the report. This was done
through, as mentioned, a HTML document, a text document, or the GUI
depending on the desired way of procedure.
There were a lot of different rules in different categories, about 1500. When
choosing the desired rules you can either sort them by topic (e.g. CLOCKS,
FSM, DFT etc.) or by policy (e.g. IEEE, DC, LEDA etc.). There were rules for
e.g. how a state machine should be constructed, if the outputs from a block
are registered, is there a reset for all the flip flops etc. There were also rules
concerning the RTL code’s power efficiency. The desired checks concerning
identification and verification of multi-cycle path was however not available.
LEDA was capable of checking whether a signal was synchronised with a
double flip flop when crossing clock domains, but for now, not capable of
checking the synchronisation of busses.
It was relatively hard to configure your own set of rules in terms of selecting
and identifying desired rules. At this point the application was not as user
friendly as the HTML report. When putting together a set there were a lot of
different rules to choose from and it was hard to get a good overview. A
feature desired was a search function where you can search for e.g.
“Asynchronous loop” and then get a list of rules concerning that subject.
Instead you had to search with the UNIX functions find and grep in a
terminal.
29
4.1.5 LEDA compared to Spyglass
The main impression of LEDA was that it was acceptable with remarks.
Compared to Spyglass the schematic view could be more sophisticated, the
explanations to the rule violations more extensive and the navigation through
rules and violations easier. Filter abilities that exists in Spyglass was also
highly desirable. Regarding to functionality LEDA was somewhere between
Spyglass and Cadence HAL. It can check double flip flop synchronisation of a
signal as mentioned before but not the synchronisations of a bus. On the
other hand had LEDA some advantage in relation to Spyglass. Especially the
extensive HTML report over the violations was good. With this, the user could
make the error corrections without holding to any licence.
HAL is supposed to be used early in design flow on the RTL block and chip
design. As Cadence describes in [Cadence 2, 2004]:
“HAL supports Verilog, VHDL, and Mixed language designs. For Verilog
designs, HAL supports both file-based analysis as well as the snapshot-based
analysis (This snapshot is the simulation snapshot created after elaboration).
For VHDL and Mixed language designs, HAL supports snapshot-based
analysis. In the snapshotbased mode, HAL performs the complete set of
checks including checks, which span across multiple modules. In the file-
based mode (for Verilog only), HAL performs only lint checks.”
Navigating through the violations was easy in HAL and the explanations to the
violations were good. The schematic view was also quite nice and easy to
use. Using HAL Definition File Editor the user could either decide which
predefined set of rules to be used or configure new customized sets. All the
rules could be parameterized. The overview of the rules in the HAL Definition
File Editor was poor and the user have to use a combination of the grep
command in a terminal and the GUI to be able to define a set of rules. The
main reason to the low grade given was that there were no explanations to
the rules in the GUI, but instead a six letter long name that did not tell you
anything about the rules purpose. The switching between the GUI and the
terminal made it so complicated that simply editing the .def with a text editor
was easier.
30
Figure 14 Screen dump of HAL.
4.2.3 Reports
The report HAL generates fulfilled its purpose in terms of making it possible to
correct errors without occupying a license. The report was short, descriptive
and concise, though at some occasions more explanations to the violations
was desired.
HAL’s main use was for regular lint checks and simpler CDC and DFT
checks. More advanced rule checking as complex CDC checks, constraints
checks and power were not supported.
That HAL only supported file-based mode lint checks for verilog files, this was
a disadvantage compared with Spyglass in the sense that for some rules the
tool needed to do a synthesis.
The schematic tracer in HAL was not as sophisticated as the one in Spyglass
even though it was acceptable. There was also no support for signal
stimulation and propagation in HAL, and no such functionality as a waveform
diagram was present, as in Spyglass. Configuration of the set of rule to be
used was a major disadvantage in HAL compared to Spyglass where this
activity was easy. Spyglass had first class violation explanation although the
explanations in HAL were not bad at all.
31
4.3 Mentor HDL Designer/Design Checker, version 2006.1 beta
Design Checker is a tool for pure lint checking and it is supposed to be run at
an early stage in the design flow. The application is hardly integrated in
Mentors HDL Designer which is a tool for helping engineering teams create,
manage and analyze large complex designs. More information regarding
Design Checker can be found in [Mentor, 2006].
32
4.3.2 Running Design Checker
The environmental setting for Design Checker was done in Designer Manager
(the main GUI of HDL Designer) and was very easy, but then the purpose of
HDL Designer is to manage designs so that was somewhat expected.
The cross references between HDL Designers main window and Design
Checker were also very good. When the user had run the desired checks
other features of HDL Designer was used to navigate and correct errors and
warnings found in the design during the run. Another nice feature in the tool
was the filter function, which provided an excellent overview and made the
correction work easy. There were many ways of filtering the violation
messages and it was easily done. Waiving capabilities were not supported
and should be implemented in the upcoming version of the tool.
Design Checker was shipped with a couple of hundred rules, which almost all
could be parameterised. The tool was also shipped with a number of pre
defined sets of rules, but the idea was that the company puts together their
own. The work of specifying a new set of rules was easy and there were
excellent explanations to the rules. What you cannot do in Design Checker
was to define your own rules, which were a great minus. New rules could be
ordered from Mentor from a charge or contract.
When correcting your design there was a feature in HDL Designer that gave
the user a spreadsheet view over the design. This view was excellent to use
when debugging block connectivity problems or just errors that propagated
over the entire chip.
4.3.3 Reports
The report features in Design Checker has not been tested and therefore a
grade has not been set. But referring to the “Design Checker tutorial” the tool
is capable of generating CSV, TSV and HTML document. The CSV (comma
separated value) is written into a .csv extended file, the TSV (tab separated
value) into a .txt file and HTML (HyperText Markup Language) into a .htm
extended file.
33
- Are the tool meant for plain lint checking or shall the tool be used to debug
clock/reset tree propagation, constraint files, DFT problems (test signal
propagation observability/controllability), power use etc.?
If the answer is that the tool chosen solitarily will be used for lint checking
then Design Checker is the preferred choice, otherwise Spyglass or LEDA
should be selected.
Both tools give a very solid impression and it feels like there are a lot of
thoughts behind the development in either case. The filter function in Design
Checker was somewhat more sophisticated than its counterpart in Spyglass,
even though the Spyglass equivalent was good.
34
4.4 Tool comparison overview
S y nopsy s LED A C a de nc e H A L A tre nta S py gla ss M e ntor H D L-D e signe r
Ge ne ra l
Ove ra ll s ta b ility 2 3 4 3
K n o w le d g e a b o u t d e s ig n
fu n c tio n a lity to a c e rta in d e g re e no y es no
S e ttin g u p th e e n viro n m e n t 2 2 4 5
lim ite d , fu ll in
S y s te m ve rilo g s u p p o rt lim ite d lim ite d ~fe b ru a ry 2 0 0 7 no
E la b o ra tio n e rro r E la b o ra tio n e rro r Give s a w a rn in g o f
B la c k b o x h a n d lin g m es s age m es s age B B d e te c tio n H ig h lig h te n s B B
1 0 m in - >2 4 h ,
R u n tim e 1 0 m in - 1 h 1 0 m in - 1 h d e p e n d in g o f ru le s 1 0 m in - 1 h
R ule se le c tion
N o (D o n e w ith g re p N o (D o n e w ith g re p
R u le s e a rc h e n g in e in te rm .) in te rm .) 4 4
P a ra m e te riz e d ru le s y es y es 3 4
y e s , in C P I y e s , u s in g p re -
y e s , u s in g V e R S L , (C a d e n c e S p e c ific d e fin e d ru le p rim itive s n o , n e w ru le s c a n b e
V R S L , C /C ++ o r A P I fo r c o d in g in P E R L e n v. o r C o rd e re d a fte r
C re a tio n o f n e w ru le s TC L s tru c tu ra l c h e c k s ) w ith a n A P I. c h a rg e /c o n tra c t.
R e port
H TM L d o c u m e n t g e n e ra tio n 4 no no y es
.tx t d o c u m e n t g e n e ra tio n 4 y es 4 y es
S upporte d R ule s
te m p la te b a s e d /lig h t
D e te c tio n o f c lo c k s /re s e t lig h t s y n te s is s y n th e s is lig h t s y n te s is te m p la te b a s e d
L in t ru le s y es y es y es y es
C o n s tra in ts c h e c k in g y es no y es n o , d o n e in P re c is io n
Tim in g p a rtly no y es no
P o w e r (le ve l s h ifte rs , d o u b le
in p u t ...) y es no y es no
D e te c tio n o f m u ltic y c le p a th s no no 0 7 -m a r n o , d o n e in C D C 0 -In
V e rific a tio n o f m u ltic y c le p a th s no no 0 7 -m a r n o , d o n e in C D C 0 -In
D o u b le flo p s y n c h ro n iz a tio n fo r
s ig n a ls y es y es y es n o , d o n e in C D C 0 -In
P ro p e r s y n c h ro n iz a tio n o f
bus s es no no y es n o , d o n e in C D C 0 -In
FS M s tru c tu re s y es y e s , ~1 0 ru le s y es y es
D e te c tio n u n re g is te re d
o u tp u ts /in p u ts y es y es y es y es
D FT y es y e s , ~ 4 0 ru le s y es no
To be able to determine the support for customising and creating new rules in
Spyglass and Leda, six test cases have been defined. The test cases was
chosen and defined in a way so they would be syntactically representative
and reflect the SystemVerilog language rather than design behaviour. The
test cases are listed below:
1. Port declarations for objects that are packed arrays of unpacked array
objects, must not use the type ‘logic’ for the packed dimension.
Example:
a = unsigned’(b + c);
4. Assignment operators (‘+=’, ‘-=’, ‘++’ etc.) must not be used. Example:
a += 2;
4.5.1 Spyglass
The chapter will start with a short result presentation for the different test
cases and end with a summary of the work procedure and conclusions.
36
4.5.1.1 Case 1
4.5.1.2 Case 2
4.5.1.3 Case 3
4.5.1.4 Case 4
Spyglass was able to parse the code in Case 5 and Case 6 but there was no
functionality present for writing new rules.
4.5.1.5 Summary
Referring to the [Atrenta 3, 2006] there are four ways of customizing rules.
These are listed below in order of increasing complexity.
• The easiest way is to identify a similar existing rule and check whether it
has some parameters that can be changed to fit your need.
• If there are no rules to parameterise the user can see if the Built-In
Checks can be used. This method does not actually end up with new
check functionality, but more messages to existing built-in rules.
37
• The third way is to use Spyglass pre-defined rule-primitives to write new
rules. The rule primitives are C-functions which extracts information from
the design database in different ways depending on the object they are
run at and the arguments given. A good procedure of finding the right rule-
primitive is to use the spydocviewer and browse the Standard Rule-
Primitives section or do a grep in
$SPYGLASS_HOME/doc/c_primitives or
$SPYGLASS_HOME/policies/<policy-name>/c-primitives.
• If there are no c-primitives matching the desired functionality the user can
define new.
After some browsing and searching among the existing rules it was
established that there were none which could be parameterized to have the
desired abilities. This was expected from the beginning. The next way of
course, described above, was of no interest because it was new checking
functionality rather than only new messages desired. Using rule-primitives
could be profitable because it would make the development of new rules
much easier. Spyglass’ set of rules templates were searched for rules with
similar behaviour to the cases previously defined. As an example for case 1,
the rule STX_287 (improper assignment to a mixed array) was found. If the
functionality concerning identifying a mixed array along with the functionality
to identify logic declaration could have been united, it could have been the
solution. The problem was that this rule (STX_287) and other similar rules
used a primitive called “veParser”. This primitive could not be found in the c-
primitive directories. After contact with Atrenta they confirmed that this
primitive was not documented and could not be used by external users. They
also eventually confirmed what was already suspected, that there are no
primitives to handle the sought behaviour. This left it into the creation of new
rule-primitives which in turn could have been used to make the rules for the
test cases. This method was, compared to the other three, quite more
complicated and required a lot of knowledge of how the Spyglass database
was constructed. According to Atrenta it would be difficult for customers to
write the new rules themselves. Being able to create new rule-primitives was
also only possible if the user possessed a Spyglass Rule Builder license,
which gave full access to the database.
An interesting point of view was that the test code went through the Spyglass
parser without complaints or errors. This indicated that the tool could handle
SystemVerilog code, which also was a question mark. The test code used is
shown in Figure 16
It was decided to round up the investigation here and leave the further
rule-primitive definition to an external part, if the company decided to go
further in this area.
38
// Simple testcase for the custom defined rules for SV built
// with sv_test_rules.sl file
module testmod(
input logic clk, rst_n,
input wire [7:0] alia,
output wire [3:0] al, ia,
output logic [3:0] inc_in [3:0]); //Should fail.
always_comb
begin
for (i=0;i<4;i=i+1) begin
inc_in[i] += 2; //Should fail.
end
end
initial
begin
a = unsigned'(b + c); //Should fail.
d = unsigned'(b); //Should pass.
w = x + y * z; //Should pass.
an_array = {4, 6, 9}; //Should fail.
end
endmodule
4.5.2 Leda
The chapter will start with a short result presentation for the different test
cases and end with a summary of the work procedure and conclusions. For
4.5.2.1 Case 1
Solution: A new custom rule was not written. The current build of Leda was
not able to catch this structure. It will however work with the next build
according to Synopsys.
Test code runs through Leda parser: YES
4.5.2.2 Case 2
39
4.5.2.3 Case 3
4.5.2.4 Case 4
Solution: A new custom rule was written. For this occasion a new rule were
created which prohibited all assignment operators. The function used was not
documented in [Synopsys 4,2006] but came directly from Synopsys R&D
division.
Test code runs through Leda parser: YES
4.5.2.5 Case 5
Solution: A new custom rule was not written. Problems with identifying both
the array structure { .., .. , .. } and the use of unpacked arrays in the
assignment were encountered.
Test code runs through Leda parser: YES
4.5.2.6 Case 6
4.5.2.7 Summary
The language used when creating new rules was called VeRSL (Verilog Rule
Specification Language) or VRSL (for VHDL). For more information regarding
this area the reader is referred to [Synopsys 1, 2006] and [Synopsys 4, 2006].
This language was macro-based and was constructed of a number of
templates and adherent attributes on which a set of commands were used
upon. Example: The definition of a rule checking that only addition and
subtraction were used in the design looked like this:
Only_add_n_sub:
limit operator_symbol in binary_operation to “+”, “-“
message “Only + and – operators are allowed in the
design”
severity WARNING
40
In Case 2 there were already a rule checking the use of “cast”, but that rule
prevented all use of “casts”. It was later also confirmed by Synopsys that it
would not be possible to customise the rule. The absence of documentation
regarding the cast attribute used in the existing rule made it impossible to
know how it should be used. In all other cases Leda lacked the functionality of
identifying the SystemVerilog syntax. However all the test cases passed the
parser except Case 3, where the use of the alias statement caused build
failure.
Apart from using VeRSL, rules could also be made using C or TCL, however
rules checking RTL code could not be made in this way. The C and TCL
languages were only meant to be used for rules catching design behaviour.
Therefore, if there were no templates and attributes available that could catch
the undesired language syntax, no rules could be made.
always_comb
begin
for (i=0;i<4;i++) begin
inc_in[i] += 2;
end
end
initial
begin
a = unsigned'(b + c);
an_array = {4, 6, 9};
end
endmodule
41
42
5 Results
5.1 Part I
In this chapter the results from the evaluations of Phoenix, Hwacc and Anna
are presented. For each block the deviating rules are presented along with an
explanation to why they were or were not considered to be the cause to the
undesired iteration. Rules that did not cause a deviating number of violations
between two versions, but were considered to be important nevertheless are
also presented. Rules that were violated in more than one comparison but not
considered to be the cause to the undesired iteration is not presented
extensively more than once, but only mentioned.
Rule violation concerning naming and DFT was not considered in this part of
the evaluation. The reasons were that a naming violation would not have
caused an undesired iteration and the chip vendor inserted most of the test
functionality. The setup functionality was to a great part therefore unknown. In
part II of this evaluation on the other hand, where checks on RTL was studied,
an entire chapter is spent on Spyglass capacity of making RTL code DFT
ready. The reason to why these rules were run was to simulate the run time, if
such rules were to be used in the future.
The Phoenix netlist versions 8 and 9 were evaluated. Between these two
versions the following rules gave a deviating number of violations. An
explanation to why the violations were or were not considered to be the cause
to the undesired iteration is given. Appendix A describes how the netlist
version selection process was performed and the results from it.
43
BB_DES050 – Do not use feedthrough signals.
17 violations in v.8, 16 violations in v.9.
Feedthrough signals is not design practice and should be avoided. Spyglass
reported feedtrough paths inside the ASIC vendor library cells. They were
therefore not considered to be a reason to the undesired iteration. The
problem was that the BB_DES050, according to [Atrenta 1, 2006], is only
used on RTL while the BB_DES250 checks the equivalence for netlists.
2
This was later defined in the SGDC file.
44
BB_DES040a – All flip-flops must be initialized from external resets.
3 violations in v.8 and v.9.
The violations turned out to be a design choice and were hence not
considered to be a cause to the undesired iteration.
From the results presented this far no cause to the undesired iteration had
been found. The reason for this could be one of the following.
• The error was of such a kind that Spyglass was unable to find it.
Remember that the ASIC vendor did not evaluate Anna using Spyglass.
• It might not have been an error that generated the iteration. New
functionality might have been added.
• Spyglass did recognise the error but it slipped past in the filtering before
the violation examination. As mentioned, in chapter 2.1, the method used
for the evaluation is not flawless and fault proof but only a heuristic model.
In this section is the rules that deviated in number between runs on version 2
and version 3 of hwacc.v presented.
45
BB_DES746 – Some outputs from a top module are not registered.
96 violations in v.2, 97 violations in v.3.
These violations could be important and they were all examined but it turned
out to be only the bist vector which was not registered. In this early stage the
bist logic were not ready and due to this these violations were not considered
to be the cause of the undesired iteration.
BB_DES042 – Avoid constant values on the data input pin of flip flops.
120 violations in v.2 and v.3.
As with rule BB_DES013 the tied input signals are for test logic as scan chain,
bist etc. The reason for that this rule has so much fewer violations than
BB_DES013 is because this rule reports a great number of flip flops in each
violation. Only having this rule enabled would probably be sufficient and do
the job, but whether to disable BB_DES013 would depend on the way the
corrections were to be made.
The result from the examined violations was that no cause to the examined
undesired iteration was found. The reason to this is discussed in section 5.1.1.
But two of the rules that were considered to be extra important had violated
and had to be traced further. These rules will be discussed in section 5.1.2.2
with the presentation of the results from the comparison of version 3 versus
version 4.
In this section the rule that deviated in number between runs on version 3 and
version 4 of hwacc.v is presented. Rules having the same explanation to why
they were, or were not, considered to be cause to the undesired iteration as in
the comparison of version 2 and 3 are referenced to section 5.1.2.1 for this
explanation.
46
The rules BB_DES013, BB_DES014, BB_DES042, BB_DES125,
BB_DES151, BB_DES250, BB_DES720, BB_DES746 were violated between
these to versions as well. The reason to why these were not considered to be
the cause to the undesired iteration is given in section 5.1.1 and 5.1.2.1.
From the explanations to the rule violations given above no direct cause were
found to the undesired netlist iteration. The reason for this is discussed in
section 5.1.1. There were however still the rules that were considered to be of
extra importance which were violated in the comparison between hwacc v.2
and v.3. Rule BB_DES042 deviated in the present comparison and were after
an examination not considered to cause to the undesired iteration. That left
rule BB_DES040 which still had the same 16 violations. A trace, with only the
BB_DES040 rule enabled, was performed to see if these violations persisted
through the versions. The trace was performed according to the following
procedure.
• The netlist versions were checked in increasing order starting from the
current.
The trace stopped when a version with less number of violations from rule
BB_DES040 occurred and an explanation to all violations were found.
The result from the trace was the following. In version 5 only 8 violations
occurred. Therefore a possible cause to the undesired iteration was found
between version 4 and version 5. After consultation with a designer the
conclusion that an actual error had been found were made. The remaining 8
violations turned out to be flip flops that should not have resets according to
their functionality. The errors found were added to Equation 1.
5.1.3 Anna
The evaluation of the Anna block suffered from incredibly long run times (this
issue will be discussed further in chapter 2.6) and after a few tryouts with
different sets of rules only rule BB_DES040 was selected and run on version
3 and 5.
47
BB_DES040 – All flip-flops must be initialized from external resets.
There were a number of violations to the rule, most of them were to be found
in the pad logic the ASIC vendor provided and was therefore not considered
to be a cause to the undesired iteration. After a trace there were interesting
differences between versions 6 and 7 and versions 8 and 9. Between
versions 6 and 7 two flip flops cells had been corrected with reset. Between
versions 8 and 9 four flip flops cells had been corrected with reset. After
consultation with a designer the conclusion that an actual error had been
found were made and the result was added to Equation 1.
5.2 Part II
5.2.1 Constraints
In this section the results from the evaluation regarding Constraints cover and
correctness are presented. The rules that were evaluated were chosen
regarding to the SDC commands used in the Anna project and rules that were
especially desired by the designers in the project. Besides the chosen rules
associated parts of the SDC file is presented.
Most of the constraints rules were not violated in the unmodified version of the
CMC. In order to check the functionality of the rules some changes were done
in SDC file in order to force a violation.
48
• Clk_Gen12, Virtual clock has no corresponding real clock with same
period and waveform.
The rule generated a violation if there was no physical clock correlated
with a defined virtual clock. When the command line below concerning clk
was left out in the SDC file a violation occurred.
49
• Clk_Trans02, clock_transition constraint not defined.
The rule was violated if there was no set_clock_transition
command constraining the clock. When the command lines below were
left out a violation occurred.
50
Input delay rules
• Inp_Del09, Not all pins on the same bus have the same input delay.
The rule was violated if the ports on a bus were constrained by deviating
values of the set_input_delay command. If the rows below were
defined in the SDC file a violation occurred due to input delay constraint
mismatch.
52
• IO_Consis04, Sum of input delay and output delay should not exceed
(clock period * parameter).
The rule generated a violation if the sum of the output delay from one
block and the input delay from a connected block was more than the
specified clock period multiplied with a customizable factor. When the
lines below were used the rule was violated. The factor used was 1.1,
3.2x1.1 < 2.5+1.6.
5.2.2 DFT
The assumption was made that the bus was cleared awaiting further test logic
implementation by the ASIC vendor (as the case with the BIST signals).
53
Three violations were caused by the absence of test clock definition for each
of the clocks into the EIO. As one can see in Figure 19 there was no select
logic between the clock input and the first flip flop. A reasonable assumption
was that the system clock/test clock selection was done in the AnnaChip
higher in the hierarchy. The last violations concerned the clock propagation of
the ddr2_fifo_test_in bus and the tst_pll_bypass signal. Which are
both cleared in the AnnaChip.vhdl. These signals were assumed to be
awaiting further test logic implementation by the ASIC vendor regarding to
their functionality and naming.
Figure 19 The propagation of the 156 MHz clock into the EIO jitterbuffer. Notice the
absence of a system clock / test clock multiplexer. The probable reason is
that this selection is done in the Test Mode Controller (see Figure 11).
54
Figure 20 The reset selection structure that was flagged by rule Async_07. The X in the zoom in
symbolises the unknown value of the reset input. The ddr2_rst_n input signal is connected to the rst_n.
5.2.3 CDC
3
The Jitter Buffer is a synchronisation scheme developed by Ericsson in Kista.
55
Reset_sync01 – Asynchronous reset should be synchronously de-asserted.
All violations generated by this rule correlated to the fact that Spyglass did not
recognise the de-asserter mechanism (see Figure 21 for a de-asserter
explanation) used in Anna. This was somewhat surprising due to the
simplicity of the de-asserter structure used (see Figure 22 for the structure
used in Anna).
Clk
Clk
Asynchronous signal
De-asserted signal
56
PsFifo01 – Detects FIFO:s and looks for underflow and overflow situations.
The rule checks for underflow and overflow of FIFO queues. The code in the
demo looked standard. But that information does not provide much in terms of
how well the rule suits Ericsson. The interesting part was however that the
tool generated a waveform diagram in order to aid in the debugging
procedure. It was impressing that the tool can generate and point to
suspicious structures automatically. The Waveform diagram (see Figure 23
for example) could though have been a little bit more specific in terms of
pointing out where the suspected behaviour appeared. In the demo example
used it was easy to find, but with more complex structures it might get a lot
trickier.
57
5.2.4 Synthesis readiness
The warnings extracted from the synthesis log are presented. For each of
these warnings, the number of occasions it had in the synthesis log is
presented. An importance grading is also given to each warning. The degree
given was decided in consent with a designer. Rules with low importance
degree were not considered in the evaluation. The rule that could have
prevented the warning from reaching the synthesis phase is also presented. A
comment is also given regarding severity and if the rule was tested in reality.
Warning: Signal assignment delays are not supported for synthesis. They are
ignored.
Number of occasions: 705
Importance: low
Rule: W257 Lint, Synthesis tools ignores delays.
Comment: The rule generated violations on Anna.
58
Warning: Comparison against ‘unknown’ value is always false; may cause
simulation/synthesis mismatch.
Number of occasions: 1
Importance: Medium
Rule: STARC-2.10.1.4, Signals must not be compared with X or Z,
STARC02-2.10.1.5 Do not use X or Z values (Verilog), STARC02-2.10.1.5a
Do not use values including ‘X’,’Z’,’U’,’-‘,’W’,’H’,’L’. (VHDL),
Comment: For synthesis comparison with X or Z is not valid. If it appears it
might be remains from simulation. It is therefore important to remove these.
The rule STARC02-2.10.1.5 reports all occurrences of X, Z, U, - , W, H, L and
the rule STARC-2.10.1.4 reports where such values are used for
comparisons. Both rules generated violations in Anna after modification (a
comparison of a ‘1’ was changed to an X).
Warning: <name> is being read, but does not appear in the sensitivity list of
the block.
Number of occasions: 4
Importance: High
Rule: STARC02-2.2.2.1, Signals read inside a combinational process block
must be present in the sensitivity list.
Comment: The rule reports a signal which is outside a “elsif Clk’event
and Clk = ‘1’ then” construct and is read. What happens then is that
the signal is latched and the design intention might be lost. The rule
generated violations on Anna after modification. A signal was added outside a
sequential block of a process and was read.
Warning: design ‘<name>’ has 294 out of 310 cells marked size-only which
may limit optimization.
Number of occasions: 1
Importance: Low
Rule: NONE
Comment: Warning is not important.
59
Warning: Pad ‘<name>’ connected to port ‘<name>’ is don’t-touch. No
optimization done.
Number of occasions: 2
Importance: Low
Rule: NONE
Comment: Warning is not important.
60
6 Conclusions
This chapter aims to discuss and answer the questions in chapter 1.3 based
on the results gained from the evaluation of Spyglass, LEDA, HAL and Design
Checker.
It is advised to implement a static rule checking tool in the design flow. The
tool to be selected for this depends of the usage demand. Spyglass is the
most advanced and considered to be the most stable tool tested during this
project, but it has issues; as with rules generating “false” violations, unable to
detect certain structures, limited SystemVerilog support, a number of rules
that aught to be customizable regarding design choices. One of the strongest
arguments to choose Spyglass is probably the extensive use of the tool by the
chip manufacturers. It is believed that there is a lot to be gained in the means
of netlist deliveries if there is a good collaboration in the terms of using
Spyglass between both parties. Another reason to choose Spyglass is
Atrenta’s helpfulness and co-operate when issues regarding the tools
functionality occur.
One reason for not choosing Spyglass is the packaging of the tool. There are
a number of licenses for different packaging set ups that can be purchased
compared to the other tools where only one is license is required, which
covers all their functionality4. The packaging can be an issue when cost
savings are measured againts performance and efficiency.
The implementation and use of Spyglass is in the range of 700 kSEK to 1 500
kSEK per project (depending on the number of licenses required and number
of project starts per year) including educational costs and support. This
corresponds to 20 - 40 weeks of work in costs, or 15 engineers that waits for
a delay two to three weeks.
The gain of using Spyglass is mainly on RTL. This is based on the fact that
the errors found in the netlist during part I also were found in the RTL code
during part II. The cost versus saving calculation for Part I in [Wickberg, 2006]
applies therefore also in Part II. The objective is to find errors as soon as
possible in the design and thus save time. There are also gains regarding less
synthesis runs. Spyglass can catch a number of errors that appears during
synthesis. Even though not all of the extra synthesis runs may be possible to
prevent with the use of Spyglass, it is expected that a significant number will
be prevented. As mentioned in chapter 3.5 the saving potential could be one
week to months. This corresponds to delay costs in the range of tens of
thousands to a million SEK.
4
Exception is Synopsys LEDA builder which require an additional license.
61
On netlist level the direct savings, if Spyglass would have been used in the
Anna project, was far from covering the tool cost. But then it should be
remembered that the ASIC vendor did not use the tool in their verification
process and that the lead time has not been taken in account (for which the
costs could be very large). It is believed that the gain seen during this
evaluation would have been much greater if Spyglass had been used from
project start and that the set of rules used on both RTL and netlist would have
reflected the rules the chip vendor used.
A scenario could also be that the delayed project’s purpose was to reduce
cost by replacing an expensive card with a new cheaper one. The new ASIC
would only have been a part among many other circuits on that cheaper card.
A delay of the ASIC would hence have caused the new and cheaper card to
be delayed and the old one would have had to be manufactured in the
meantime. If the manufacturing cost would have been reduced with 1000
SEK/card with the new card, 10 000 cards per month were produced and the
delay is one month, the cost of the delay would be 10 MSEK.
The scenario given above along with what has been previously discussed in
this chapter regarding RTL and netlist level of use concludes that the saving
potential of the tool is large compared to the implementation costs.
The changes to the design flow are not expected to be extensive but
nevertheless considerable. Spyglass is meant to be used during the entire
process, from starting of the RTL coding until netlist delivery. This means that
the designers might have to run the tool up to four times a day during intense
periods which might cause some inconvenience at start. In the constraints
area there might also be a bit of change in terms of how large the constraints
set to use, this to gain as much as possible from the tool. At each project start
there should also be a person who is assigned as a collaborator with the chip
manufacturer. The reason is to make the rules that are to be used to mirror
the chip vendors hand off procedure from the beginning, and thus save
resources.
Attempting to create entirely new rules for Spyglass is not advised. But if C-
primitives that suit the purpose exist it is manageable. Creating new rules to
Synopsys LEDA (using VeRSL or VRSL) is considered to be easier, but
perhaps not as powerful, than the use of C-primitives.
62
From the calculations in chapter 2.4, three to four licenses is a good
estimation.
Neither Spyglass nor any other tool makes any difference regarding what
geometrical technology that is used. But the reason to why the need of
implementing a static rule checking tool has been seen, could be the possible
complexity increase the new technology brings. What before was a minor fault
can now cause large damage to the complex designs in terms of correction
work. The need of having complete constraints set ups might also be an issue
due to that more and more focus is put on timing. At 65 nm technology the
wires might have reached a critical level in terms of resistance and signal
propagation time. It is therefore important to have a full timing constraints
setup on all paths from the project start. A signal that worked before without a
flip flop prior an output port does not work any longer.
63
64
7 References
[Atrenta 1, 2006] - SpyGlass® DC Rules Reference, Version 3.8.0.3, July 2006,
Author: Atrenta, Inc.
[Atrenta 2, 2006] - SpyGlass® Predictive Analyzer User Guide, Version 3.8.1, August
2006, Author: Atrenta, Inc.
[Cadence 3, 2006] - Incisive HDL analysis (HAL) User Guide, Version 5.82, August
2006, Author: Cadence.
[Synopsys 3, 2006] - Leda User Guide, Version 2006.06, June 2006, Author:
Synopsys
[Synopsys 4, 2006] - Leda VeRSL Reference Guide, Version 2006.06, June 2006,
Author: Synopsys
[Mentor, 2006] - DesignChecker User Guide, Version 2006.1, 10 May 2006, Author:
Mentor.
65
66
Appendix A – Netlist drops
As described in Chapter 2.1, Spyglass was used on different revisions and
drops of the netlist. Therefore the drops had to be identified before the actual
evaluation could be performed. In order to do this all the versions of the three
blocks AnnaChip.v, phoenix.v and hwacc.v were listed using clear case (a
version handling program). The outputted list was then copied to an excel
spreadsheet. The versions that were compared against each other are listed
below. The reason why the listed versions were chosen was the timestamp. If
the difference between the “check in” timestamp for two consecutive versions
was more than a week, there was a high probability that only new functionality
were added between them. In other words they would not have been in the
same drop. A visualisation of this is shown in Figure 5. If the timestamp was
less than a day the chances that the chip vendor found out an error in the
netlist was very small. An iteration could not have happened within 24 hours.
In the case of identifying versions to run for the Hwacc block, there were no
definite versions that could have been selected based on the parameters
described above. Therefore a compromise was made and three versions
were to be compared. The following versions were chosen to be evaluated
with Spyglass.
Anna
PseudoChip.v@@/main/3 18-May.12:55
PseudoChip.v@@/main/5 22-May.09:33
Phoenix
phoenix.v@@/main/8 29-May.14:21
phoenix.v@@/main/9 02-Jun.10:39
Hwacc
hw acc.v@@/main/2 10-Apr.17:55
hw acc.v@@/main/3 12-Apr.07:39
hw acc.v@@/main/4 20-Apr.17:49
67
68
Appendix B
The code below was used to evaluate the handshake rules. The original
version is taken from a demo made by Atrenta. The modified version was
made by the author of this thesis. The modification was used to check
whether the violations from the original version disappeared and thus validate
the correctness of the handshake rules.
In the modified version data is applied one state in advance to the activation
of the request signal, which will ensure data signal stability. The other change
is that a new state has been added (WAIT_ACK2). The new state waits for a
completion of acknowledge. This functionality will make sure that a full
handshake has taken place before a new can be initiated.
Original version of the request generator Modified version of the request generator
always @(posedge reqclk or posedge reset) begin always @(posedge reqclk or posedge reset)
begin
69
70
På svenska
In English
The publishers will keep this document online on the Internet - or its possible
replacement - for a considerable time from the date of publication barring
exceptional circumstances.
© Fredrik Wickberg