<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.simhard.com/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.simhard.com/wiki/index.php?action=history&amp;feed=atom&amp;title=PSL%2FA_Practical_Introduction_to_PSL%2FSome_Philosophy</id>
		<title>PSL/A Practical Introduction to PSL/Some Philosophy - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.simhard.com/wiki/index.php?action=history&amp;feed=atom&amp;title=PSL%2FA_Practical_Introduction_to_PSL%2FSome_Philosophy"/>
		<link rel="alternate" type="text/html" href="http://www.simhard.com/wiki/index.php?title=PSL/A_Practical_Introduction_to_PSL/Some_Philosophy&amp;action=history"/>
		<updated>2026-04-15T16:45:15Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.21.3</generator>

	<entry>
		<id>http://www.simhard.com/wiki/index.php?title=PSL/A_Practical_Introduction_to_PSL/Some_Philosophy&amp;diff=3150&amp;oldid=prev</id>
		<title>ANA: Новая страница: «{{PSL TOC}}  == Some Philosophy ==   We have seen some basic PSL and gotten a feel for how it is intended to be used. Before we continue, we discuss some of the c…»</title>
		<link rel="alternate" type="text/html" href="http://www.simhard.com/wiki/index.php?title=PSL/A_Practical_Introduction_to_PSL/Some_Philosophy&amp;diff=3150&amp;oldid=prev"/>
				<updated>2013-10-26T19:46:35Z</updated>
		
		<summary type="html">&lt;p&gt;Новая страница: «{{PSL TOC}}  == Some Philosophy ==   We have seen some basic PSL and gotten a feel for how it is intended to be used. Before we continue, we discuss some of the c…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PSL TOC}}&lt;br /&gt;
&lt;br /&gt;
== Some Philosophy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have seen some basic PSL and gotten a feel for how it is intended to be&lt;br /&gt;
used. Before we continue, we discuss some of the concepts at the root of PSL.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Assertions vs. properties ===&lt;br /&gt;
&lt;br /&gt;
As we have seen, a PSL assertion is made up of the keyword assert plus&lt;br /&gt;
the PSL ''property'' being asserted, followed by a semi-colon. For example, in&lt;br /&gt;
the assertion &amp;lt;code&amp;gt;assert always (a -&amp;gt; next b);&amp;lt;/code&amp;gt;, the property is &amp;lt;code&amp;gt;always (a -&amp;gt; next b)&amp;lt;/code&amp;gt;. A property holds or does not hold on a given trace. It is agnostic&lt;br /&gt;
about whether or not holding is a good thing. An assertion, on the other hand,&lt;br /&gt;
tells the verification tool that the property being asserted is required to hold.&lt;br /&gt;
In the remainder of this book we will be very careful about distinguish-&lt;br /&gt;
ing between a property, which merely describes behavior, and an assertion,&lt;br /&gt;
which sets a requirement. For example, we might say that an assertion &amp;lt;code&amp;gt;assert always (a -&amp;gt; next b);&amp;lt;/code&amp;gt; requires that whenever signal &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; is asserted, signal&lt;br /&gt;
&amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; will be asserted in the next cycle. However, we will never say that about&lt;br /&gt;
the property &amp;lt;code&amp;gt;always (a -&amp;gt; next b)&amp;lt;/code&amp;gt;, for two reasons. First, because if the&lt;br /&gt;
property is used in an assumption (&amp;lt;code&amp;gt;assume always (a -&amp;gt; next b);&amp;lt;/code&amp;gt;), then&lt;br /&gt;
no requirement is being stated. Second, because a property may be used as a&lt;br /&gt;
sub-property of a more complicated property, and as such, it does not state a&lt;br /&gt;
requirement on its own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.2 The notion of time ===&lt;br /&gt;
&lt;br /&gt;
When a Boolean assertion is embedded in code that is being run, like in the&lt;br /&gt;
simple assertions of Java and (simulated) VHDL, the notion of time need not&lt;br /&gt;
be defined – an assertion is checked whenever the statement containing the&lt;br /&gt;
assertion is executed. For the more complicated assertions of PSL, which first&lt;br /&gt;
of all stand apart from the code (so that the notion of “execution” is foreign&lt;br /&gt;
to them) and which second of all span multiple time steps, the notion of time&lt;br /&gt;
must be given more consideration.&lt;br /&gt;
&lt;br /&gt;
PSL assumes that time is discrete, that is, that time consists of a sequence&lt;br /&gt;
of evaluation cycles. The meaning of a PSL property is defined relative to such&lt;br /&gt;
a sequence of cycles. In this book, we will refer to such a sequence of cycles&lt;br /&gt;
as a ''trace''.&lt;br /&gt;
&lt;br /&gt;
PSL does not dictate how time ticks – that is, it does not dictate how such&lt;br /&gt;
a sequence of cycles is extracted from a design under verification. This means&lt;br /&gt;
that the sequence of cycles as seen by two verification tools is not necessarily&lt;br /&gt;
the same. For example, a cycle-based simulator sees a sequence of signal values&lt;br /&gt;
calculated cycle-by-cycle, while an event-based simulator running on the same&lt;br /&gt;
design sees a more detailed sequence of signal values.&lt;br /&gt;
&lt;br /&gt;
Nevertheless, there is a way to ensure that the meaning of a PSL property&lt;br /&gt;
is not affected by the granularity of time as seen by the verification tool. PSL&lt;br /&gt;
properties can be modified by using a ''clock expression'' to indicate that time&lt;br /&gt;
should be measured in clock cycles of the clock expression. In the case of&lt;br /&gt;
a clocked property, the result of a cycle-based tool will be the same as the&lt;br /&gt;
result of an event-based tool. PSL allows the specification of a ''default clock'',&lt;br /&gt;
so that the clock does not have to be mentioned explicitly for each and every&lt;br /&gt;
property. In most of this book we have assumed a singly clocked design under&lt;br /&gt;
the cycle-based model, and thus most examples omit the explicit mention of&lt;br /&gt;
the clock. Clocks are discussed in detail in Chapters 6 and 14.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===3.3 Designs and traces===&lt;br /&gt;
&lt;br /&gt;
The purpose of a PSL property is to describe the desired behavior of a design.&lt;br /&gt;
In order to do so, it is usually convenient to examine individual traces of that&lt;br /&gt;
design. The Foundation Language (FL), which we focus on in this book, uses&lt;br /&gt;
this approach, and thus throughout most of this book we shall be interested&lt;br /&gt;
in whether or not a particular PSL property holds on a particular trace.&lt;br /&gt;
The Foundation Language is suitable for both static (formal) and dynamic&lt;br /&gt;
(simulation-based) verification.&lt;br /&gt;
&lt;br /&gt;
Another approach, used by the Optional Branching Extension (OBE), uses&lt;br /&gt;
a tree structure that represents multiple paths. This approach is applicable&lt;br /&gt;
only to formal verification, and is touched on very briefly in Chapter 11.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.4 Current cycle, sub-traces, and modularity ===&lt;br /&gt;
&lt;br /&gt;
When a PSL property composed of two or more sub-properties is checked on&lt;br /&gt;
a trace, it is sometimes necessary to decide the meaning of the sub-properties&lt;br /&gt;
on a sub-trace. The ''current cycle'' is the name we give to the first cycle of a&lt;br /&gt;
trace or a sub-trace on which we are evaluating a property or a sub-property.&lt;br /&gt;
&lt;br /&gt;
Assuming that the cycles of a trace are numbered starting from 0, the&lt;br /&gt;
current cycle of an assertion is 0. The current cycle of a sub-property of some&lt;br /&gt;
enclosing property depends on its use in the enclosing property. The operands&lt;br /&gt;
of a Boolean operator have the same current cycle as the parent property.&lt;br /&gt;
The operands of a temporal operator have a current cycle that is related to&lt;br /&gt;
the current cycle of the parent property in a way dictated by the temporal&lt;br /&gt;
operator. For example, the next operator increases the current cycle by one,&lt;br /&gt;
the always operator creates “multiple instances” of the sub-property, each of&lt;br /&gt;
which has a current cycle that corresponds either to the current cycle or to&lt;br /&gt;
some future cycle, etc.&lt;br /&gt;
&lt;br /&gt;
NOTE: It is very important to understand that the term “multiple instances”&lt;br /&gt;
is intended to convey an intuition which is useful in understanding&lt;br /&gt;
the &amp;lt;code&amp;gt;always&amp;lt;/code&amp;gt; operator. It is ''not'' intended to hint that any actual instantiation&lt;br /&gt;
is taking place; neither does it imply that a tool implementing PSL needs to&lt;br /&gt;
create multiple instances of an assertion checker, spawn multiple instances of&lt;br /&gt;
a process, or in any other way cause the words “multiple instances” to correspond&lt;br /&gt;
to actual instances of anything whatsoever. On the contrary, there are&lt;br /&gt;
many efficient implementations of PSL in which the &amp;lt;code&amp;gt;always&amp;lt;/code&amp;gt; operator does not&lt;br /&gt;
create, spawn, or in any other way generate actual multiple instances. Still,&lt;br /&gt;
the term “multiple instances” is a good way to gain intuition about how the&lt;br /&gt;
&amp;lt;code&amp;gt;always&amp;lt;/code&amp;gt; operator works, and a naive and inefficient implementation may well&lt;br /&gt;
generate multiple instances of a checker or of a process.&lt;br /&gt;
&lt;br /&gt;
Getting back to our main point, consider the assertion &amp;lt;code&amp;gt;assert always (a -&amp;gt; next b);&amp;lt;/code&amp;gt;. The current cycle of &amp;lt;code&amp;gt;always (a -&amp;gt; next b)&amp;lt;/code&amp;gt; is 0. Whether or&lt;br /&gt;
not &amp;lt;code&amp;gt;always (a -&amp;gt; next b)&amp;lt;/code&amp;gt; holds at cycle 0 depends on whether or not the&lt;br /&gt;
sub-property &amp;lt;code&amp;gt;(a -&amp;gt; next b)&amp;lt;/code&amp;gt; holds at every cycle from 0 onwards. The current&lt;br /&gt;
cycle for a particular evaluation of the sub-property &amp;lt;code&amp;gt;(a -&amp;gt; next b)&amp;lt;/code&amp;gt; will be&lt;br /&gt;
some cycle ''N''. Finally, in order to determine whether or not sub-property&lt;br /&gt;
&amp;lt;code&amp;gt;(a -&amp;gt; next b)&amp;lt;/code&amp;gt; holds at cycle ''N'', we will need to evaluate sub-properties a&lt;br /&gt;
and next b with a current cycle of ''N'', which means that we need to evaluate&lt;br /&gt;
sub-property b with a current cycle of ''N'' + 1.&lt;br /&gt;
&lt;br /&gt;
To make the discussion more concrete, let’s consider our assertion, Assertion&lt;br /&gt;
3.1a, on Trace 3.1(i). Signal a holds in cycles 4 and 8. Signal &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; holds in&lt;br /&gt;
cycle 5, and therefore &amp;lt;code&amp;gt;next b&amp;lt;/code&amp;gt; holds in cycle 4. This is shown in Trace 3.1(ii),&lt;br /&gt;
an annotated version of Trace 3.1(i). Since a holds in cycles 4 and 8, and &amp;lt;code&amp;gt;next b&amp;lt;/code&amp;gt;&lt;br /&gt;
holds in cycle 4, we get that &amp;lt;code&amp;gt;(a -&amp;gt; next b)&amp;lt;/code&amp;gt; holds in all cycles but cycle 8,&lt;br /&gt;
as shown in Trace 3.1(ii). (Remember that the else-part defaults to true, so &amp;lt;code&amp;gt;(a -&amp;gt; next b)&amp;lt;/code&amp;gt;&lt;br /&gt;
holds in all cycles where &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; does not hold, and in addition in all&lt;br /&gt;
cycles where &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; holds and &amp;lt;code&amp;gt;next b&amp;lt;/code&amp;gt; does too.) The entire property &amp;lt;code&amp;gt;always (a -&amp;gt; next b)&amp;lt;/code&amp;gt;&lt;br /&gt;
therefore holds in cycles 9, 10, 11, 12 and 13 (because in these&lt;br /&gt;
cycles, &amp;lt;code&amp;gt;(a -&amp;gt; next b)&amp;lt;/code&amp;gt; holds “now” and in all future cycles). Thus, Assertion&lt;br /&gt;
3.1a does not hold on Trace 3.1(i) (because it does not hold on cycle 0 –&lt;br /&gt;
the first cycle of the trace).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| align=center&lt;br /&gt;
! [[Файл:Psl fig3.1.png]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
assert always (a -&amp;gt; next b);          (3.1a)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Fig. 3.1: A concrete example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above explanation seems straightforward. However, the idea of modularity&lt;br /&gt;
hides some subtle points – for example, that the value of the property&lt;br /&gt;
&amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; is dependent only on the current cycle. Thus, Assertion 3.2a holds on&lt;br /&gt;
Trace 3.2(i), because signal &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; holds in cycle 0. If you want to express the fact&lt;br /&gt;
that &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; should hold in every cycle, you must use the &amp;lt;code&amp;gt;always&amp;lt;/code&amp;gt; operator, as in&lt;br /&gt;
Assertion 3.2b. Assertion 3.2b does not hold on Trace 3.2(i).&lt;br /&gt;
&lt;br /&gt;
Another subtle point is that a property can hold on a suffix of a trace&lt;br /&gt;
without holding on the trace itself. Thus, the property &amp;lt;code&amp;gt;always a&amp;lt;/code&amp;gt; holds on&lt;br /&gt;
the sub-traces of Trace 3.2(i) starting at cycles 12, 13, and 14. This would&lt;br /&gt;
be important if we used the property &amp;lt;code&amp;gt;always a&amp;lt;/code&amp;gt; as a sub-property of some&lt;br /&gt;
other property. For example, Assertion 3.2c holds on Trace 3.2(i) because the&lt;br /&gt;
property &amp;lt;code&amp;gt;always a&amp;lt;/code&amp;gt; holds on the 12&amp;lt;sup&amp;gt;''th''&amp;lt;/sup&amp;gt; next cycle.&lt;br /&gt;
&lt;br /&gt;
Finally, the cycles involved in calculating the left-hand side of a logical&lt;br /&gt;
implication may overlap those involved in calculating the right-hand side of&lt;br /&gt;
a logical implication. For example, consider Assertion 3.3a on Trace 3.3(i).&lt;br /&gt;
Assertion 3.3a holds on Trace 3.3(i) because the sub-property &amp;lt;code&amp;gt;(a &amp;amp;&amp;amp; next[6] (b)) -&amp;gt; (c &amp;amp;&amp;amp; next[2] (d))&amp;lt;/code&amp;gt; &lt;br /&gt;
holds at all cycles. It holds at cycle 2 because&lt;br /&gt;
the left-hand side &amp;lt;code&amp;gt;(a &amp;amp;&amp;amp; next[6] (b))&amp;lt;/code&amp;gt; holds and in addition the right-hand&lt;br /&gt;
side &amp;lt;code&amp;gt;(c &amp;amp;&amp;amp; next[2] (d))&amp;lt;/code&amp;gt; holds. It holds at all other cycles because if the&lt;br /&gt;
“if” part of a logical implication does not hold, then the “else” part defaults&lt;br /&gt;
to true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| align=center&lt;br /&gt;
! [[Файл:Psl fig3.2.png]]&lt;br /&gt;
|-&lt;br /&gt;
!(i) Assertions 3.2a and 3.2c hold, but 3.2b does not&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
assert a;                       (3.2a)&lt;br /&gt;
assert always a;                (3.2b)&lt;br /&gt;
assert next[12] (always a);     (3.2c)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Fig. 3.2: The importance of the always operator&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| align=center&lt;br /&gt;
! [[Файл:Psl fig3.3.png]]&lt;br /&gt;
|-&lt;br /&gt;
!(i) An illustration of the overlap between the left- and right-hand sides of &amp;lt;br /&amp;gt;&lt;br /&gt;
Assertion 3.3a. Assertion 3.3a holds.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
assert always ((a &amp;amp;&amp;amp; next[6](b)) -&amp;gt; (c &amp;amp;&amp;amp; next[2](d)));      (3.3a)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Fig. 3.3: The current cycle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Previously, for example in examining Assertions 2.2a and 2.3b, we have&lt;br /&gt;
seen cases where there is an overlap between the cycles involved in satisfying&lt;br /&gt;
two different occurrences of the left-hand side of a logical implication. These&lt;br /&gt;
overlaps are caused by the presence of the &amp;lt;code&amp;gt;always&amp;lt;/code&amp;gt; operator in the property.&lt;br /&gt;
If we remove the always operator, the issue of overlap disappears from Assertions&lt;br /&gt;
2.2a and 2.3b. The overlap of Assertion 3.3a is different from the overlap&lt;br /&gt;
of Assertions 2.2a and 2.3b in a very important way: Assertion 3.3a is written&lt;br /&gt;
in such a way that the cycles involved in calculating the left-hand side of the&lt;br /&gt;
logical implication overlap those involved in calculating the right-hand side of&lt;br /&gt;
the logical implication: calculating the “if” part of the logical implication involves&lt;br /&gt;
examining the current cycle and also “looking ahead” six cycles, while&lt;br /&gt;
calculating the “then” part of the logical implication involves examining the&lt;br /&gt;
current cycle and also “looking ahead” two cycles. Thus the overlap results&lt;br /&gt;
from the logical implication itself. This style of PSL property is usually very&lt;br /&gt;
confusing to new users of PSL, and indeed it is not an intuitive way to use&lt;br /&gt;
the language. For this reason, such properties are not recommended, and the&lt;br /&gt;
&amp;lt;code&amp;gt;simple subset&amp;lt;/code&amp;gt; of PSL restricts the language in such a way that such properties&lt;br /&gt;
are not allowed. We discuss the simple subset in more detail later. For now,&lt;br /&gt;
remember that if you have written a property in which the cycles involved in&lt;br /&gt;
calculating the left-hand side of an operator overlap for more than one cycle&lt;br /&gt;
with those involved in calculating the right-hand side of the same operator,&lt;br /&gt;
you have not written a property that is in the simple subset.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 3.5 Reporting a failure ===&lt;br /&gt;
&lt;br /&gt;
Consider Assertion 3.4a on the traces shown in Figure 3.4. Obviously, Assertion&lt;br /&gt;
3.4a does not hold on them. Now consider four different verification tools,&lt;br /&gt;
each of which reports the failure of Assertion 3.4a as indicated by the signal&lt;br /&gt;
called “failure” in Traces 3.4(i), 3.4(ii), 3.4(iii) and 3.4(iv). Tool 1 reports a&lt;br /&gt;
failure at cycle 4, the earliest that it can be detected. Tool 2 reports a failure&lt;br /&gt;
at cycle 4, but also at cycle 7, when &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; is asserted for a second time. Tool 3&lt;br /&gt;
reports a failure at the end of the trace, and Tool 4 reports a failure at cycle&lt;br /&gt;
1, when &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; is asserted.&lt;br /&gt;
&lt;br /&gt;
Which tool is correct? The answer is that they all are. PSL defines whether&lt;br /&gt;
or not a property holds on a trace – that is all. It says nothing about when&lt;br /&gt;
a tool, dynamic or static, should report on the results of the analysis. Thus,&lt;br /&gt;
there is no meaning in asking whether Tool 1, 2, 3 or 4 is correct. All of&lt;br /&gt;
them indicate that the property fails on the trace, so all are correct. The&lt;br /&gt;
failure indications shown along the trace can be thought of as debugging aids,&lt;br /&gt;
hinting to the user where to look along the trace for the failure. As far as PSL&lt;br /&gt;
is concerned, as long as a tool indicates correctly whether or not a property&lt;br /&gt;
holds on a trace, it has done its job.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| align=center&lt;br /&gt;
! [[Файл:Psl fig3.4.png]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
assert always (a -&amp;gt; never b);     (3.4a)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Fig. 3.4: Four different tools reporting the failure of Assertion 3.4a on the same trace&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>ANA</name></author>	</entry>

	</feed>