app2.1.htm

来自「介绍asci设计的一本书」· HTM 代码 · 共 221 行

HTM
221
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML EXPERIMENTAL 970324//EN">

<HTML>

<HEAD>

<META NAME="GENERATOR" CONTENT="Adobe FrameMaker 5.5/HTML Export Filter">



<TITLE> B.1&nbsp;	Explanation of the Verilog HDL BNF</TITLE></HEAD><!--#include file="top.html"--><!--#include file="header.html"-->



<DIV>

<P>[&nbsp;<A HREF="APP2.htm">Chapter&nbsp;start</A>&nbsp;]&nbsp;[&nbsp;<A HREF="APP2.htm">Previous&nbsp;page</A>&nbsp;]&nbsp;[&nbsp;<A HREF="APP2.2.htm">Next&nbsp;page</A>&nbsp;]</P><!--#include file="AmazonAsic.html"--><HR></DIV>

<H1 CLASS="zAppHeading1">

<A NAME="pgfId=21214">

 </A>

B.1&nbsp;	Explanation of the Verilog HDL BNF</H1>

<P CLASS="BodyAfterHead">

<A NAME="pgfId=21216">

 </A>

Annex A of the Verilog HDL LRM describes syntax using the <A NAME="marker=21215">

 </A>

BNF (Backus&#8211;Naur form). The Verilog HDL BNF is slightly different from that employed in the VHDL LRM (see Appendix A, Section A.1, &#8220;BNF&#8221;). The BNF syntax in the Verilog LRM is <SPAN CLASS="Definition">

normative</SPAN>

<A NAME="marker=43770">

 </A>

, which means that the syntax is part of the definition of the language (and the complete BNF description is contained in an <SPAN CLASS="Definition">

annex</SPAN>

<A NAME="marker=43782">

 </A>

). The BNF syntax in the VHDL LRM is <SPAN CLASS="Definition">

informative</SPAN>

<A NAME="marker=43771">

 </A>

, which means the BNF is not part of the standard defining the language (and the complete BNF description is contained in an <SPAN CLASS="Definition">

appendix</SPAN>

<A NAME="marker=43772">

 </A>

). The following items summarize the Verilog HDL BNF syntax:</P>

<UL>

<LI CLASS="BulletFirst">

<A NAME="pgfId=176">

 </A>

<SPAN CLASS="BodyComputer">

name</SPAN>

 (in lowercase) is a <SPAN CLASS="Definition">

syntax construct item</SPAN>

<A NAME="marker=44183">

 </A>

 (<SPAN CLASS="Definition">

term</SPAN>

<A NAME="marker=44181">

 </A>

, or <SPAN CLASS="Definition">

syntactic category</SPAN>

<A NAME="marker=44182">

 </A>

) defined by other syntax construct token items (<SPAN CLASS="Definition">

items</SPAN>

<A NAME="marker=44192">

 </A>

, <SPAN CLASS="Definition">

parts</SPAN>

<A NAME="marker=44212">

 </A>

, or <SPAN CLASS="Definition">

tokens</SPAN>

<A NAME="marker=44193">

 </A>

) or by lexical token items.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=180">

 </A>

<SPAN CLASS="BodyComputer">

NAME</SPAN>

 (in uppercase) is a <SPAN CLASS="Definition">

lexical token item</SPAN>

<A NAME="marker=44188">

 </A>

, the leaves in a tree of definitions.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=184">

 </A>

<SPAN CLASS="BodyComputer">

[ name ] </SPAN>

is an <SPAN CLASS="Definition">

optional item</SPAN>

<A NAME="marker=44194">

 </A>

.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=2635">

 </A>

<SPAN CLASS="BodyComputer">

{ name }</SPAN>

 is one or more items.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=200">

 </A>

The symbol <SPAN CLASS="BodyComputer">

::=</SPAN>

 gives a syntax definition (<SPAN CLASS="Definition">

definition</SPAN>

<A NAME="marker=44184">

 </A>

, <SPAN CLASS="Definition">

rule</SPAN>

<A NAME="marker=44185">

 </A>

, <SPAN CLASS="Definition">

construct</SPAN>

<A NAME="marker=44186">

 </A>

, or <SPAN CLASS="Definition">

production</SPAN>

<A NAME="marker=44187">

 </A>

) for an item (i.e., the symbol <SPAN CLASS="BodyComputer">

::=</SPAN>

 means <SPAN CLASS="Emphasis">

is equivalent to</SPAN>

).</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=204">

 </A>

<SPAN CLASS="BodyComputer">

| </SPAN>

introduces an alternative syntax definition (i.e., the symbol <SPAN CLASS="BodyComputer">

|</SPAN>

 means <SPAN CLASS="Emphasis">

or</SPAN>

).</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=41165">

 </A>

<A NAME="marker=44195">

 </A>

Braces and <A NAME="marker=44196">

 </A>

brackets, <SPAN CLASS="BodyComputer">

{&nbsp;}</SPAN>

 and <SPAN CLASS="BodyComputer">

[&nbsp;]</SPAN>

, that are required by the syntax are set in bold, <SPAN CLASS="BodyComputerKeyword">

{&nbsp;} [&nbsp;]</SPAN>

, in the 95 LRM, despite the fact they are difficult to distinguish from the plain versions.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=88215">

 </A>

The <A NAME="marker=88214">

 </A>

vertical bar, <SPAN CLASS="BodyComputer">

|</SPAN>

, that represents an alternative definition is set in bold,<SPAN CLASS="Bold">

&nbsp;</SPAN>

<SPAN CLASS="BodyComputerKeyword">

|</SPAN>

, in the 95 LRM, despite being difficult to distinguish from the plain version.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=88218">

 </A>

All other characters that are set in bold (as they are in Annex A of the 95 LRM) are literals required by the syntax (for example, a plus sign&nbsp;<SPAN CLASS="BodyComputerKeyword">

'+'</SPAN>

).</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=1546">

 </A>

Italic prefixes, for example, <SPAN CLASS="BodyComputerEmphasis">

msb</SPAN>

<SPAN CLASS="BodyComputer">

_constant_expression</SPAN>

, are comments.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=1562">

 </A>

Keywords are printed in <SPAN CLASS="BodyComputerKeyword">

bold</SPAN>

, as they are in Annex A of the 95 LRM.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=1566">

 </A>

Definitions here are in alphabetical order (Annex A of the 95 LRM groups definitions by function). The highest-level definition is <SPAN CLASS="BodyComputer">

source_text</SPAN>

; this is where you start. The lowest-level items are in uppercase; these are where you end.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=43696">

 </A>

The BNF is reproduced <SPAN CLASS="Emphasis">

exactly</SPAN>

 as it appears in Annex A of the 95 LRM. Footnotes explain a number of <A NAME="marker=44210">

 </A>

typographical issues.</LI>

<LI CLASS="BulletList">

<A NAME="pgfId=43722">

 </A>

References in brackets immediately following the <SPAN CLASS="BodyComputer">

::=</SPAN>

 symbol form <A NAME="marker=44211">

 </A>

backward-pointing links to the constructs that reference a particular item. Thus, for <A NAME="marker=58747">

 </A>

example, <SPAN CLASS="BodyComputer">

always_construct ::= [94]</SPAN>

 indicates that construct number 94 (<SPAN CLASS="BodyComputer">

module_item</SPAN>

) references the item <SPAN CLASS="BodyComputer">

always_construct</SPAN>

 (see also <A HREF="APP2.3.htm#21396" CLASS="XRef">

Table&nbsp;B.1</A>

, which collects all these links together, and <A HREF="APP2.3.htm#12661" CLASS="XRef">

Table&nbsp;B.2</A>

, which is a keyword index).</LI>

<LI CLASS="BulletLast">

<A NAME="pgfId=43730">

 </A>

References in brackets following the construct links refer to the 95 LRM. Thus, for example, <SPAN CLASS="BodyComputer">

always_construct ::= [94] [95LRM 9.9.2]</SPAN>

, indicates that section 9.9.2 of the 95 LRM contains the definition for <SPAN CLASS="BodyComputer">

always_construct</SPAN>

.</LI>

</UL>

<HR><P>[&nbsp;<A HREF="APP2.htm">Chapter&nbsp;start</A>&nbsp;]&nbsp;[&nbsp;<A HREF="APP2.htm">Previous&nbsp;page</A>&nbsp;]&nbsp;[&nbsp;<A HREF="APP2.2.htm">Next&nbsp;page</A>&nbsp;]</P></BODY>



<!--#include file="Copyright.html"--><!--#include file="footer.html"-->

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?