/usr/share/covered/doc/html/chapter.attr.html is in covered-doc 0.7.10-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 5. Inline Attributes</title><link rel="stylesheet" href="covered.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="Covered User's Guide - 0.7.9"><link rel="up" href="part.overview.html" title="Part I. Overview"><link rel="prev" href="chapter.race.html" title="Chapter 4. Race Condition Checking"><link rel="next" href="part.installation.html" title="Part II. Installation"><center><img src="img/banner.jpg"></center><hr></head><body bgcolor="#dfeef8" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Inline Attributes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="chapter.race.html"><img src="img/prev.gif" alt="Prev"></a> </td><th width="60%" align="center">Part I. Overview</th><td width="20%" align="right"> <a accesskey="n" href="part.installation.html"><img src="img/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="chapter.attr"></a>Chapter 5. Inline Attributes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="chapter.attr.html#section.attr">5.1. What are inline attributes?</a></span></dt><dt><span class="sect1"><a href="chapter.attr.html#section.attr.fsm">5.2. Adding FSM attributes</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="section.attr"></a>5.1. What are inline attributes?</h2></div></div></div><p>
In the IEEE Verilog 1364-2001 standard, an attribute is a way to add information to a Verilog object, statement or
groups of statements that is tool-specific and does not affect simulation of that design. All Verilog-2001
attributes begin with the token <code class="code">(*</code> and end with the token <code class="code">*)</code>. An attribute can be
multi-line and is "attached" to the Verilog object, statement, or group of statements that is specified immediately
beneath the attribute.
</p><p>
Covered uses the Verilog-2001 attribute for allowing users to specify coverage-specific information about embedded
objects within a particular design. When an attribute is found, it is interrogated to see if it is a Covered
attribute. If the attribute is a Covered attribute, its contents are parsed. If the attribute is not found to be a
Covered attribute, it is ignored and parsing continues normally.
</p><p>
The rest of this chapter specifies the attributes that Covered is capable of handling, along with their use and
syntax.
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="section.attr.fsm"></a>5.2. Adding FSM attributes</h2></div></div></div><p>
There are two ways that Covered currently allows the user to specify the location of and information about FSMs
embedded in a particular design. The first way to specify an FSM is on the score command-line. The benefit to
specifying the location of a state machine this way is that the source code does not need to be modified. The
potential disadvantage to this method is that the FSM location and coverage information can get lost if the FSM is
used in a different testbench (or even a different project if the FSM code is reused in a later project). For more
information on specifying an FSM on the score command-line, please refer to
<a href="chapter.score.html#section.score.fsm" title="9.6. Scoring FSMs">Section 9.6, “Scoring FSMs”</a>.
</p><p>
The second way that an FSM can be specified to Covered is through the use of the Verilog-2001 attribute. The
advantages to using this method are that the FSM information specified in an attribute stays embedded in the design
(for ease of reusing the FSM and still retaining information relevent to coverage). Additionally, at the current
release of Covered, using attributes to specify an FSM is the only way to tell Covered what all of the valid states
and state-transitions are for a specific FSM (the command-line specification does not allow for this). This
provides a unique advantage of this method over the command-line method. The potential disadvantage of this method
for specifying FSM information is that source code needs to be modified.
</p><p>
To learn how to specify an FSM attribute within a design, let's use an example of an FSM that is embedded in a
design.
</p><p>
</p><div class="example"><a name="example.attr"></a><p class="title"><b>Example 5.1. Module Containing an Embedded FSM</b></p><div class="example-contents"><pre class="programlisting">
module foo (
input clk,
input reset,
input head,
input tail,
input valid
);
parameter STATE_IDLE = 2'b00,
STATE_HEAD = 2'b01,
STATE_DATA = 2'b10,
STATE_TAIL = 2'b11;
reg [1:0] state;
reg [1:0] next_state;
always @(posedge clock)
state <= reset ? STATE_IDLE : next_state;
always @(reset or state or head or valid or tail)
begin
case( state )
STATE_IDLE: next_state = (valid & head) ?
STATE_HEAD : STATE_IDLE;
STATE_HEAD: next_state = (valid & tail) ?
STATE_TAIL : STATE_DATA;
STATE_DATA: next_state = (valid & tail) ?
STATE_TAIL : STATE_DATA;
STATE_TAIL: next_state = (valid & head) ?
STATE_HEAD : STATE_IDLE;
endcase
end
endmodule
</pre></div></div><p><br class="example-break">
</p><p>
This example shows an FSM that has an input FSM variable called "state" and an output FSM variable called
"next_state". There are four states in the state machine that are represented with the parameters located in this
module (STATE_IDLE, STATE_HEAD, STATE_DATA, STATE_TAIL). There are a total of eight (8) state transitions that this
FSM can take. They are the following:
</p><p>
</p><div class="orderedlist"><ol type="1"><li><p><code class="code">STATE_IDLE -> STATE_IDLE</code> (loopback)</p></li><li><p><code class="code">STATE_IDLE -> STATE_HEAD</code></p></li><li><p><code class="code">STATE_HEAD -> STATE_DATA</code></p></li><li><p><code class="code">STATE_HEAD -> STATE_TAIL</code></p></li><li><p><code class="code">STATE_DATA -> STATE_DATA</code> (loopback)</p></li><li><p><code class="code">STATE_DATA -> STATE_TAIL</code></p></li><li><p><code class="code">STATE_TAIL -> STATE_HEAD</code></p></li><li><p><code class="code">STATE_TAIL -> STATE_IDLE</code></p></li></ol></div><p>
</p><p>
All attributes that specify information for an FSM are a comma-separated list of values that contain the following
information:
</p><p>
</p><div class="orderedlist"><ol type="1"><li><p>"covered_fsm" attribute keyword</p><p>
</p><div class="itemizedlist"><ul type="disc"><li><p>
MUST be first value in the attribute list
</p></li><li><p>
Specifies to Covered that this attribute contains information for an FSM that Covered needs to handle.
</p></li></ul></div><p>
</p></li><li><p>FSM identifier</p><p>
</p><div class="itemizedlist"><ul type="disc"><li><p>
MUST be second value in the attribute list
</p></li><li><p>
Specifies a alphanumeric name for this FSM.
</p></li><li><p>
The name will eventually be used to tie individual attributes that specify information for the same FSM.
</p></li></ul></div><p>
</p></li><li><p>Input state expression (optional)</p><p>
</p><div class="itemizedlist"><ul type="disc"><li><p>
Syntax: <code class="code">is="<span class="emphasis"><em>expression</em></span>"</code>
</p></li><li><p>
If this is specified, MUST be specified third in the list.
</p></li><li><p>
Specifies the input state expression.
</p></li><li><p>
Can be a combination of signal names, signal bit selects, and concatenation operators.
</p></li><li><p>
See <a href="chapter.score.html#section.score.fsm" title="9.6. Scoring FSMs">Section 9.6, “Scoring FSMs”</a> for more information on the specification of an input
state expression.
</p></li></ul></div><p>
</p></li><li><p>Output state expression</p><p>
</p><div class="itemizedlist"><ul type="disc"><li><p>
Syntax: <code class="code">os="<span class="emphasis"><em>expression</em></span>"</code>
</p></li><li><p>
If the input state expression is specified, MUST be fourth value in list; otherwise, MUST be third
value in list.
</p></li><li><p>
Specifies the output state expression of the FSM.
</p></li><li><p>
Can be a combination of signal names, signal bit selects, and concatenation operators.
</p></li><li><p>
See <a href="chapter.score.html#section.score.fsm" title="9.6. Scoring FSMs">Section 9.6, “Scoring FSMs”</a> for more information on the specification of an output
state expression.
</p></li></ul></div><p>
</p></li><li><p>State-transition specifiers (optional)</p><p>
</p><div class="itemizedlist"><ul type="disc"><li><p>
Syntax: <code class="code">trans="<span class="emphasis"><em>from_state</em></span>-><span class="emphasis"><em>to_state</em></span>"</code>
</p></li><li><p>
MUST be specified after the above has been specified in the list.
</p></li><li><p>
Arguments MUST be constant values (parameters; numerical values -- binary, octal, decimal, hexidecimal;
and defines that equate to one of these two types of values).
</p></li><li><p>
Each transition that is specified is a unique value in the attribute list.
</p></li><li><p>
You may optionally add characters after the "trans" keyword and before the '=' character (with the
exception of the '=' character) to make each transition parameter name unique. Covered will ignore
these extra characters, but this can be useful to avoid warning messages that may get emitted from
your Verilog compiler when these attributes are parsed (some compilers expect each parameter name
in an attribute list to have a unique name). This feature was put in the 0.7.8 stable release.
</p></li></ul></div><p>
</p></li></ol></div><p>
</p><p>
To specify the FSM attribute in the above example, including input state, output state and all state transitions,
the code would be modified to look like:
</p><p>
</p><div class="example"><a name="example.attr.fsm"></a><p class="title"><b>Example 5.2. FSM Attribute Code Sample</b></p><div class="example-contents"><pre class="programlisting">
(* covered_fsm, channel, is="state", os="next_state",
trans="STATE_IDLE->STATE_IDLE",
trans="STATE_IDLE->STATE_HEAD",
trans="STATE_HEAD->STATE_DATA",
trans="STATE_HEAD->STATE_TAIL",
trans="STATE_DATA->STATE_DATA",
trans="STATE_DATA->STATE_TAIL",
trans="STATE_TAIL->STATE_HEAD",
trans="STATE_TAIL->STATE_IDLE" *)
always @(reset or state or head or tail or valid)
...
</pre></div></div><p><br class="example-break">
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="chapter.race.html"><img src="img/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="part.overview.html"><img src="img/up.gif" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="part.installation.html"><img src="img/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. Race Condition Checking </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="img/home.gif" alt="Home"></a></td><td width="40%" align="right" valign="top"> Part II. Installation</td></tr></table></div></body></html>
|