<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://simhard.com/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://simhard.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Open_Source_VHDL_Verification_Methodology%2FCode_Coverage%2Fru</id>
		<title>Open Source VHDL Verification Methodology/Code Coverage/ru - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://simhard.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Open_Source_VHDL_Verification_Methodology%2FCode_Coverage%2Fru"/>
		<link rel="alternate" type="text/html" href="http://simhard.com/wiki/index.php?title=Open_Source_VHDL_Verification_Methodology/Code_Coverage/ru&amp;action=history"/>
		<updated>2026-04-04T18:05:29Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.21.3</generator>

	<entry>
		<id>http://simhard.com/wiki/index.php?title=Open_Source_VHDL_Verification_Methodology/Code_Coverage/ru&amp;diff=1118&amp;oldid=prev</id>
		<title>ANA: /* Toggle Coverage */</title>
		<link rel="alternate" type="text/html" href="http://simhard.com/wiki/index.php?title=Open_Source_VHDL_Verification_Methodology/Code_Coverage/ru&amp;diff=1118&amp;oldid=prev"/>
				<updated>2012-12-12T12:23:10Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Toggle Coverage&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{OS-VVM TOC}}&lt;br /&gt;
&lt;br /&gt;
== Типы метрик покрытия кода ==&lt;br /&gt;
&lt;br /&gt;
=== Toggle Coverage ===&lt;br /&gt;
&lt;br /&gt;
Toggle coverage is a code coverage metric used to measure the number of times each bit of a register or wire has toggled&lt;br /&gt;
its value. Although this is a realitively basic metric, many projects have a testing requirement that all ports and registers,&lt;br /&gt;
at a minimum, must have experienced a zero-to-one and one-to-zero transition.&lt;br /&gt;
&lt;br /&gt;
In general, reviewing a toggle coverage analysis report can be overwhelming and of little value if not carefully focused. &lt;br /&gt;
For example, toggle coverage is often used for basic connectivity checks between IP blocks. In addition, it can be useful&lt;br /&gt;
to know that many control structures, such as a one-hot select bus, have been fully exercised.&lt;br /&gt;
&lt;br /&gt;
Покрытие переключений является метрикой покрытия кода используемой для измерения того, сколько раз каждый бит регистра или связи переключается&lt;br /&gt;
его значение. Хотя это realitively основной метрикой, многие проекты имеют тестирования требование, чтобы все порты и регистры,&lt;br /&gt;
как минимум, должно быть, испытал нуля до одного и один-к-нулю перехода.&lt;br /&gt;
&lt;br /&gt;
В целом, анализ переключения докладе анализ охвата может быть подавляющим, и мало значения, если тщательно не сфокусированы.&lt;br /&gt;
Например, переключение покрытия часто используется для проверки основного соединения между IP-блоков. Кроме того, она может быть полезна&lt;br /&gt;
знать, что многие управляющие структуры, такие, как одна горячая выберите автобусе, были полностью осуществлены.&lt;br /&gt;
&lt;br /&gt;
=== Line Coverage ===&lt;br /&gt;
&lt;br /&gt;
Line coverage is a code coverage metric we use to identify which lines of our souce code have been executed during&lt;br /&gt;
simulation.  A line coverage metric report will have a count associated with each line of source code indicating the total&lt;br /&gt;
number of times the line has executed. The line execution count value is not only useful for identifying lines of source&lt;br /&gt;
code that have never executed, but also useful when the engineer feels that a minimum line execution threshold is&lt;br /&gt;
required to achieve sufficient testing.&lt;br /&gt;
&lt;br /&gt;
Line coverage analysis will often reveal that a rare condition required to activate a line of code has not occurred due to&lt;br /&gt;
missing input stimulus. Alternatively, line coverage analysis might reveal that the data and control flow of the source&lt;br /&gt;
code prevented it either due to a bug in the code, or dead code that is not currently needed under certain IP&lt;br /&gt;
configurations.  For unused or dead code, you might choose to exclude or filter this code during the coverage recording&lt;br /&gt;
and reporting steps, which allows you to focus only on the relavent code.&lt;br /&gt;
&lt;br /&gt;
=== Statement Coverage ===&lt;br /&gt;
&lt;br /&gt;
Statement coverage is a code coverage metric we use to identify which statements within our souce code have been&lt;br /&gt;
executed during simulation. In general, most engineers find that statement coverage analysis is more useful than line&lt;br /&gt;
coverage since a statement often spans multiple lines of source code-or multiple statements can occur on a single line of&lt;br /&gt;
source code.&lt;br /&gt;
&lt;br /&gt;
A metrics report used for statement coverage analysis will have a count associated with each line of source code&lt;br /&gt;
indicating the total number of times the statement has executed. This statement execution count value is not only useful&lt;br /&gt;
for identifying lines of source code that have never executed, but also useful when the engineer feels that a minimum&lt;br /&gt;
statement execution threshold is required to achieve sufficient testing.&lt;br /&gt;
&lt;br /&gt;
=== Block Coverage ===&lt;br /&gt;
&lt;br /&gt;
Block coverage is a variant on the statement coverage metric which identifies whether a block of code has been executed&lt;br /&gt;
or not. A block is defined as a set of statements between conditional statements or within a procedural definition, the key&lt;br /&gt;
point being that if the block is reached, all the lines within the block will be executed. This metric is used to avoid&lt;br /&gt;
unscrupulous engineers from achieving a higher statement coverage by simply adding more statements to their code.&lt;br /&gt;
&lt;br /&gt;
=== Branch Coverage ===&lt;br /&gt;
&lt;br /&gt;
Branch coverage (also referred to as decision coverage) is a code coverage metric that reports whether Boolean&lt;br /&gt;
expressions tested in control structures (such as the ''if'', ''case'', ''while'', '''repeat''', '''forever''', '''for''' and ''loop'' statements) evaluated to&lt;br /&gt;
both true and false. The entire Boolean expression is considered one true-or-false predicate regardless of whether it&lt;br /&gt;
contains logical-and or logical-or operators.&lt;br /&gt;
&lt;br /&gt;
===Expression Coverage===&lt;br /&gt;
&lt;br /&gt;
Expression coverage (sometimes referred to as condition coverage) is a code coverage metric used to determine if each&lt;br /&gt;
condition evaluated both to true and false.  A condition is an Boolean operand that does not contain logical operators.&lt;br /&gt;
Hence, expression coverage measures the Boolean conditions independently of each other.&lt;br /&gt;
&lt;br /&gt;
===Focused Expression Coverage===&lt;br /&gt;
&lt;br /&gt;
Focused Expression Coverage (FEC), which is also referred to as Modified Condition/Decision Coverage (MC/DC), is a&lt;br /&gt;
code coverage metric often used used by the DO-178B safety critical software certification standard, as well as&lt;br /&gt;
the DO-254 formal airborne electronic hardware certification standard.  This metric is stronger than condition and&lt;br /&gt;
decision coverage. The formal definition of MC/DC as defined by DO-178B is:&lt;br /&gt;
&lt;br /&gt;
''Every point of entry and exit in the program has been invoked at least once, every condition in a decision has taken all possible outcomes at least once, every decision in the program has taken all possible outcomes at least once, and each condition in a decision has been shown to independently affect that decisions outcome. A condition is shown to independently affect a decisions outcome by varying just that condition while holding fixed all other possible conditions.&lt;br /&gt;
[3]''&lt;br /&gt;
&lt;br /&gt;
It is worth noting that completely closing Focused Expressing Coverage can be non-trivial.&lt;br /&gt;
&lt;br /&gt;
=== Finite-State Machine Coverage ===&lt;br /&gt;
&lt;br /&gt;
Today's code coverage tools are able to identify finite state machines within the RTL source code. Hence, this makes it&lt;br /&gt;
possible to automatically extract FSM code coverage metrics to measure conditions. For example, the number of times&lt;br /&gt;
each state of the state machine was entered, the number of times the FSM transitioned from one state to each of its&lt;br /&gt;
neighboring states, and even sequential arc coverage to identify state visitation transitions.&lt;br /&gt;
&lt;br /&gt;
== Typical Code Coverage Flow ==&lt;br /&gt;
&lt;br /&gt;
The objective of gathering and analyzing code coverage metrics is to identify portions of the source code that have not&lt;br /&gt;
been exercised by the current verification environment. From a project perspective, it is generally best to wait until the&lt;br /&gt;
implementation of the RTL is close to complete before seriously starting to gather and analyze code coverage results. &lt;br /&gt;
Otherwise, you can waste a lot of cycles trying to make sense of a moving target from the changing RTL code. With that&lt;br /&gt;
said, we recommend that you at least run a few simulations that capture coverage metrics early in the project cycle (that&lt;br /&gt;
is, prior to seriously gathering coverage metrics) to work out any potential issues in your coverage flow.&lt;br /&gt;
&lt;br /&gt;
From a high-level perspective, there are generally three main steps involved in a code coverage flow, which include:&lt;br /&gt;
&lt;br /&gt;
1. Instrument the RTL code to gather coverage&lt;br /&gt;
&lt;br /&gt;
2. Run simulation to capture and record coverage metrics&lt;br /&gt;
&lt;br /&gt;
3. Report and analyze the coverage results&lt;br /&gt;
&lt;br /&gt;
Part of the analysis step is to identify coverage holes, and determine if the coverage hole is due to one of three&lt;br /&gt;
conditions:&lt;br /&gt;
&lt;br /&gt;
1. Missing input stimulus required to activate the uncovered code&lt;br /&gt;
&lt;br /&gt;
2. A bug in the design (or testbench) that is preventing the input stimulus from activating the uncovered code&lt;br /&gt;
&lt;br /&gt;
3. Unused code for certain IP configuations or expected unreachable code related during normal operating conditions&lt;br /&gt;
&lt;br /&gt;
The first condition requires you to either write additional directed stimulus or adjust random constraints to generate the&lt;br /&gt;
required input stimulus that targets the uncovered code.  The second condition obviously requires the engineer to fix the&lt;br /&gt;
bug that is preventing the uncovered code from being exercised. The third condition can be addressed by directing the&lt;br /&gt;
coverage tool to exclude the unused or unreachable code during the coverage recording and reporting steps.  Formal tools&lt;br /&gt;
can be used to automate the identification of unreachable code, and then automatically generate the exclusion files.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[1] J. Miller, C. Maloney,  &amp;quot;Systematic mistake analysis of digital computer programs.&amp;quot; Communications of the ACM 6&lt;br /&gt;
(2): 58-63, February 1963.&lt;br /&gt;
&lt;br /&gt;
[2] F. Fallah, S. Devadas, K. Keutzer: &amp;quot;OCCOM: Efficient Computation of Observability-Based Code Coverage Metrics&lt;br /&gt;
for Functional Verification.&amp;quot; Proceedings of the Design Automation Conference, 1998: 152-157&lt;br /&gt;
&lt;br /&gt;
[3] DO-178B, &amp;quot;Software Considerations in Airborne Systems and Equipment Certification&amp;quot;, RCTA, December 1992,&lt;br /&gt;
pp.31, 74.&lt;br /&gt;
&lt;br /&gt;
[4] M. Stuart, D. Dempster: Verification Methodology Manual for Code Coverage in HDL Designs - TransEDA, August&lt;br /&gt;
2000&lt;/div&gt;</summary>
		<author><name>ANA</name></author>	</entry>

	</feed>