ch09.4.htm

来自「介绍asci设计的一本书」· HTM 代码 · 共 1,773 行 · 第 1/4 页

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

<HTML>

<HEAD>

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



<TITLE> 9.4&nbsp;EDIF</TITLE></HEAD><!--#include file="top.html"--><!--#include file="header.html"-->



<DIV>

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

<H1 CLASS="Heading1">

<A NAME="pgfId=11261">

 </A>

9.4&nbsp;<A NAME="16064">

 </A>

EDIF</H1>

<P CLASS="BodyAfterHead">

<A NAME="pgfId=30864">

 </A>

An ASIC designer spends an increasing amount of time forcing different tools to communicate. One standard for exchanging information between EDA tools is the <A NAME="marker=30865">

 </A>

<SPAN CLASS="Definition">

electronic design interchange format</SPAN>

 (<A NAME="marker=30866">

 </A>

<SPAN CLASS="Definition">

EDIF</SPAN>

). We will describe EDIF version 2&nbsp;0&nbsp;0. The most important features added in EDIF&nbsp;3&nbsp;0&nbsp;0 were to handle buses, bus rippers, and buses across schematic pages. EDIF&nbsp;4&nbsp;0&nbsp;0 includes new extensions for PCB and multichip module (MCM) data. The <SPAN CLASS="Definition">

Library of Parameterized Modules</SPAN>

<A NAME="marker=30867">

 </A>

 (<A NAME="marker=30868">

 </A>

LPM<A NAME="marker=30869">

 </A>

) standard is also based on EDIF. The newer versions of EDIF have a richer feature set, but the ASIC industry seems to have standardized on EDIF 2&nbsp;0&nbsp;0. Most EDA companies now support EDIF. The FPGA companies Altera and Actel use EDIF as their netlist format, and Xilinx has announced its intention to switch from its own XNF format to EDIF. We only have room for a brief description of the EDIF format here. A complete description of the EDIF standard is contained in the <A NAME="marker=30871">

 </A>

<SPAN CLASS="Definition">

Electronic Industries Association</SPAN>

 (<SPAN CLASS="Definition">

EIA</SPAN>

<A NAME="marker=30875">

 </A>

<A NAME="marker=30876">

 </A>

) publication, Electronic Design Interchange Format Version 2&nbsp;0&nbsp;0 (<A NAME="marker=30872">

 </A>

ANSI/EIA Standard 548-1988) [<A NAME="EDIF, 1988">

 </A>

EDIF, 1988].</P>

<DIV>

<H3 CLASS="Heading2">

<A NAME="pgfId=25875">

 </A>

9.4.1&nbsp;EDIF Syntax</H3>

<P CLASS="BodyAfterHead">

<A NAME="pgfId=3481">

 </A>

The structure of EDIF is similar to the <A NAME="marker=24363">

 </A>

Lisp programming language or the <A NAME="marker=24364">

 </A>

Postscript printer language. This makes EDIF a very hard language to read and almost impossible to write by hand. EDIF is intended as an exchange format between tools, not as a design-entry language. Since EDIF is so flexible each company reads and writes different &#8220;flavors&#8221; of EDIF. Inevitably EDIF from one company does not quite work when we try and use it with a tool from another company, though this situation is improving with the gradual adoption of EDIF&nbsp;3&nbsp;0&nbsp;0. We need to know just enough about EDIF to be able to fix these problems. </P>

<TABLE>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableFigTitleSide">

<A NAME="pgfId=25884">

 </A>

FIGURE&nbsp;9.8&nbsp;<A NAME="42376">

 </A>

The hierarchical nature of an EDIF file.</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableFigure">

<A NAME="pgfId=25889">

 </A>

<IMG SRC="CH09-8.gif" ALIGN="BASELINE">

&nbsp;</P>

</TD>

</TR>

</TABLE>

<P CLASS="Body">

<A NAME="pgfId=25631">

 </A>

<A HREF="#42376" CLASS="XRef">

Figure&nbsp;9.8</A>

 illustrates the hierarchy of the EDIF file. Within an EDIF file are one or more libraries of cell descriptions. Each library contains technology information that is used in describing the characteristics of the cells it contains. Each cell description contains one or more user-named views of the cell. Each view is defined as a particular <SPAN CLASS="BodyComputer">

viewType</SPAN>

 and contains an <SPAN CLASS="BodyComputer">

interface</SPAN>

 description that identifies where the cell may be connected to and, possibly, a <SPAN CLASS="BodyComputer">

contents</SPAN>

 description that identifies the components and related interconnections that make up the cell.</P>

<P CLASS="Body">

<A NAME="pgfId=24332">

 </A>

The EDIF syntax consists of a series of statements in the following format:</P>

<P CLASS="ComputerOneLine">

<A NAME="pgfId=3483">

 </A>

(keywordName {form})</P>

<P CLASS="BodyAfterHead">

<A NAME="pgfId=3489">

 </A>

A left parenthesis (round bracket) is always followed by a <SPAN CLASS="Definition">

keyword name</SPAN>

<A NAME="marker=11013">

 </A>

, followed by one or more EDIF <A NAME="marker=3487">

 </A>

<SPAN CLASS="Definition">

forms</SPAN>

 (a form is a sequence of identifiers, primitive data, symbolic constants, or EDIF statements), ending with a right parenthesis. If you have programmed in Lisp or Postscript, you may understand that EDIF uses a &#8220;define it before you use it&#8221; approach and why there are so many parentheses in an EDIF file. </P>

<P CLASS="Body">

<A NAME="pgfId=3497">

 </A>

The semantics of EDIF are defined by the <A NAME="marker=3495">

 </A>

<SPAN CLASS="Definition">

EDIF keywords</SPAN>

. Keywords are the only types of name that can immediately follow a left parenthesis. Case is not significant in keywords. </P>

<P CLASS="Body">

<A NAME="pgfId=3505">

 </A>

An <A NAME="marker=3503">

 </A>

<SPAN CLASS="Definition">

EDIF identifier</SPAN>

 represents the name of an object or group of data. Identifiers are used for name definition, name reference, keywords, and symbolic constants. Valid EDIF identifiers consist of alphanumeric or underscore characters and must be preceded by an ampersand (<A NAME="marker=11021">

 </A>

&amp;) if the first character is not alphabetic. The ampersand is not considered part of the name. The length of an identifier is from 1 to 255 characters and case is not significant. Thus <SPAN CLASS="BodyComputer">

&amp;clock</SPAN>

, <SPAN CLASS="BodyComputer">

Clock</SPAN>

, and <SPAN CLASS="BodyComputer">

clock</SPAN>

 all represent the same EDIF name (very confusing).</P>

<P CLASS="Body">

<A NAME="pgfId=25225">

 </A>

<A NAME="marker=11022">

 </A>

Numbers in EDIF are 32-bit signed <A NAME="marker=11023">

 </A>

integers. <A NAME="marker=11024">

 </A>

Real numbers use a special EDIF format. For example, the real number 1.4 is represented as <SPAN CLASS="BodyComputer">

(e&nbsp;14&nbsp;-1)</SPAN>

. The <SPAN CLASS="BodyComputer">

e</SPAN>

<A NAME="marker=11025">

 </A>

 form requires a mantissa (<SPAN CLASS="BodyComputer">

14</SPAN>

) and an exponent (<SPAN CLASS="BodyComputer">

-1</SPAN>

). Reals are restricted to the range &#177; 1 <SPAN CLASS="Symbol">

&#165;</SPAN>

 10 <SUP CLASS="Superscript">

&#177; 35</SUP>

. Numbers in EDIF are dimensionless and the units are determined according to where the number occurs in the file. Coordinates and line widths are units of distance and must be related to meters. Each coordinate value is converted to meters by applying a <SPAN CLASS="Definition">

scale factor</SPAN>

<A NAME="marker=25226">

 </A>

. Each EDIF library has a <SPAN CLASS="BodyComputer">

technology</SPAN>

<A NAME="marker=25227">

 </A>

 section that contains a required <SPAN CLASS="BodyComputer">

numberDefinition</SPAN>

<A NAME="marker=25228">

 </A>

. The <SPAN CLASS="BodyComputer">

scale</SPAN>

<A NAME="marker=25229">

 </A>

 keyword is used with the <SPAN CLASS="BodyComputer">

numberDefinition</SPAN>

 to relate EDIF numbers to physical units. </P>

<P CLASS="Body">

<A NAME="pgfId=28814">

 </A>

Valid EDIF <A NAME="marker=25250">

 </A>

strings consist of sequences of ASCII characters enclosed in double quotes. Any alphanumeric character is allowed as well as any of the following characters: <SPAN CLASS="BodyComputer">

! # $ &amp; ' () * + , - &nbsp; . / : ; &lt; = &gt; ? @ [ \ ] ^ _ ` { | } ~</SPAN>

. Special characters, such as <SPAN CLASS="BodyComputer">

&quot;</SPAN>

 and <SPAN CLASS="BodyComputer">

%</SPAN>

 are entered as escape sequences: <SPAN CLASS="BodyComputer">

%number%</SPAN>

, where <SPAN CLASS="BodyComputer">

number</SPAN>

 is the integer value of the ASCII character. For example, <SPAN CLASS="BodyComputer">

&quot;A quote is % 34 %&quot;</SPAN>

 is a string with an embedded double-quote character. Blank, tab, line feed, and carriage-return characters (white space) are used as delimiters in EDIF. Blank and tab characters are also significant when they appear in strings.</P>

<P CLASS="Body">

<A NAME="pgfId=25255">

 </A>

The <SPAN CLASS="BodyComputer">

rename</SPAN>

<A NAME="marker=25254">

 </A>

 keyword can be used to create a new EDIF identifier as follows:</P>

<P CLASS="ComputerOneLine">

<A NAME="pgfId=3557">

 </A>

(cell (rename TEST_1 &quot;test$1&quot;) ...</P>

<P CLASS="Body">

<A NAME="pgfId=3561">

 </A>

In this example the EDIF string contains the original name, test$1, and a new name, <SPAN CLASS="BodyComputer">

TEST_1</SPAN>

, is created as an EDIF identifier.</P>

</DIV>

<DIV>

<H3 CLASS="Heading2">

<A NAME="pgfId=24494">

 </A>

9.4.2&nbsp;An EDIF Netlist Example</H3>

<P CLASS="BodyAfterHead">

<A NAME="pgfId=24498">

 </A>

<A HREF="#22211" CLASS="XRef">

Table&nbsp;9.11</A>

 shows an EDIF netlist. This EDIF description corresponds to the halfgate example in Chapter&nbsp;8 and describes an inverter. We shall explain the functions of the EDIF in <A HREF="#22211" CLASS="XRef">

Table&nbsp;9.11</A>

 by showing a piece of the code at a time followed by an explanation.</P>

<TABLE>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableTitle">

<A NAME="pgfId=24505">

 </A>

TABLE&nbsp;9.11&nbsp;<A NAME="22211">

 </A>

EDIF file for the <SPAN CLASS="BodyComputer">

halfgate</SPAN>

 netlist from Chapter&nbsp;8.</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="Table">

<A NAME="pgfId=24582">

 </A>

&nbsp;</P>

<DIV>

<MAP NAME="CH09-9">

</MAP>

<IMG SRC="CH09-9.gif" USEMAP="#CH09-9">

</DIV>

</TD>

</TR>

</TABLE>

<P CLASS="ComputerFirst">

<A NAME="pgfId=24613">

 </A>

(edif halfgate_p</P>

<P CLASS="Computer">

<A NAME="pgfId=24644">

 </A>

	(edifVersion 2 0 0) (edifLevel 0) (keywordMap (keywordLevel 0))</P>

<P CLASS="Computer">

<A NAME="pgfId=24650">

 </A>

(status (written (timeStamp 1996 7 10 22 5 10)</P>

<P CLASS="Computer">

<A NAME="pgfId=24668">

 </A>

(program &quot;COMPASS Design Automation -- EDIF Interface&quot;</P>

<P CLASS="ComputerLast">

<A NAME="pgfId=24666">

 </A>

(version &quot;v9r1.2 last updated 26-Mar-96&quot;)) (author &quot;mikes&quot;)))</P>

<P CLASS="Body">

<A NAME="pgfId=24605">

 </A>

Every EDIF file must have an <SPAN CLASS="BodyComputer">

edif</SPAN>

 form. The <SPAN CLASS="BodyComputer">

edif</SPAN>

 form must have a <SPAN CLASS="BodyComputer">

name</SPAN>

, an <SPAN CLASS="BodyComputer">

edifVersion</SPAN>

<A NAME="marker=24982">

 </A>

, an <SPAN CLASS="BodyComputer">

edifLevel</SPAN>

<A NAME="marker=24983">

 </A>

, and a <SPAN CLASS="BodyComputer">

keywordMap</SPAN>

<A NAME="marker=24984">

 </A>

. The <SPAN CLASS="BodyComputer">

edifVersion</SPAN>

 consists of three integers describing the <SPAN CLASS="Definition">

major</SPAN>

 (first number) and <SPAN CLASS="Definition">

minor version</SPAN>

<A NAME="marker=24985">

 </A>

 of EDIF. The <SPAN CLASS="BodyComputer">

keywordMap</SPAN>

 must have a <SPAN CLASS="BodyComputer">

keywordLevel</SPAN>

<A NAME="marker=24603">

 </A>

. The optional <SPAN CLASS="BodyComputer">

status</SPAN>

<A NAME="marker=24604">

 </A>

 can contain a <SPAN CLASS="BodyComputer">

written</SPAN>

<A NAME="marker=24606">

 </A>

 form that must have a <SPAN CLASS="BodyComputer">

timeStamp</SPAN>

<A NAME="marker=24607">

 </A>

 and, optionally, <SPAN CLASS="BodyComputer">

author</SPAN>

 or <SPAN CLASS="BodyComputer">

program</SPAN>

 forms. </P>

<P CLASS="ComputerOneLine">

<A NAME="pgfId=24671">

 </A>

(library xc4000d (edifLevel 0) (technology</P>

<P CLASS="Body">

<A NAME="pgfId=24492">

 </A>

(The unbalanced parentheses are deliberate since we are showing segments of the EDIF code.) The <SPAN CLASS="BodyComputer">

library</SPAN>

<A NAME="marker=24608">

 </A>

 form must have a <SPAN CLASS="BodyComputer">

name</SPAN>

, <SPAN CLASS="BodyComputer">

edifLevel</SPAN>

 and <SPAN CLASS="BodyComputer">

technology</SPAN>

. The <SPAN CLASS="BodyComputer">

edifLevel</SPAN>

 is normally 0. The xc4000d library contains the cells we are using in our schematic.</P>

<P CLASS="ComputerOneLine">

<A NAME="pgfId=24709">

 </A>

(numberDefinition ) (simulationInfo (logicValue  H) (logicValue  L)))</P>

<P CLASS="Body">

<A NAME="pgfId=24744">

 </A>

The simulationInfo form is used by simulation tools; we do not need that information for netlist purposes for this cell. We shall discuss numberDefinition in the next example. It is not needed in a netlist.</P>

<P CLASS="ComputerOneLine">

<A NAME="pgfId=24758">

 </A>

(cell (rename INV &quot;inv&quot;) (cellType GENERIC)</P>

<P CLASS="Body">

<A NAME="pgfId=24756">

 </A>

This cell form defines the name and type of a cell <SPAN CLASS="BodyComputer">

inv</SPAN>

 that we are going to use in the schematic.</P>

<P CLASS="ComputerFirst">

<A NAME="pgfId=24777">

 </A>

(view COMPASS_mde_view (viewType NETLIST)</P>

<P CLASS="Computer">

<A NAME="pgfId=24779">

 </A>

(interface (port I (direction INPUT)) (port O (direction OUTPUT))</P>

<P CLASS="ComputerLast">

<A NAME="pgfId=24784">

 </A>

(designator &quot;@@Label&quot;)))))</P>

<P CLASS="Body">

<A NAME="pgfId=24775">

 </A>

The NETLIST view of this inverter cell has an input port <SPAN CLASS="BodyComputer">

I</SPAN>

 and an output port <SPAN CLASS="BodyComputer">

O</SPAN>

. There is also a place holder &quot;@@Label&quot; for the instance name of the cell.</P>

<P CLASS="ComputerOneLine">

<A NAME="pgfId=24848">

 </A>

(library working...</P>

<P CLASS="Body">

<A NAME="pgfId=24846">

 </A>

This begins the description of our schematic that is in our library working. The lines that follow this library form are similar to the preamble for the cell library xc4000d that we just explained.</P>

<P CLASS="ComputerFirst">

<A NAME="pgfId=24885">

 </A>

(cell (rename HALFGATE_P &quot;halfgate_p&quot;)(cellType GENERIC)</P>

<P CLASS="ComputerLast">

<A NAME="pgfId=24886">

 </A>

	(view COMPASS_nls_view (viewType NETLIST)</P>

<P CLASS="Body">

<A NAME="pgfId=24859">

 </A>

This cell form is for our schematic named halfgate_p. </P>

<P CLASS="ComputerFirst">

<A NAME="pgfId=24905">

 </A>

(interface (port myInput (direction INPUT))</P>

<P CLASS="ComputerLast">

<A NAME="pgfId=24908">

 </A>

	(port myOutput (direction OUTPUT))</P>

<P CLASS="Body">

<A NAME="pgfId=24902">

 </A>

The interface form defines the names of the ports that were used in our schematic, myInput and myOutput. At this point we have not associated these ports with the ports of the cell <SPAN CLASS="BodyComputer">

INV</SPAN>

 in the cell library.</P>

<P CLASS="ComputerFirst">

<A NAME="pgfId=32772">

 </A>

(designator &quot;@@Label&quot;)) (contents (instance B1_i1</P>

<P CLASS="Body">

<A NAME="pgfId=32773">

 </A>

This gives an instance name B1_i1 to the cell in our schematic.</P>

<P CLASS="ComputerFirst">

<A NAME="pgfId=32774">

 </A>

(viewRef COMPASS_mde_view (cellRef INV (libraryRef xc4000d))))</P>

<P CLASS="Body">

<A NAME="pgfId=25037">

 </A>

The cellRef form links the cell instance name B1_i1 in our schematic to the cell INV in the library xc4000d.</P>

<P CLASS="ComputerFirst">

<A NAME="pgfId=25079">

 </A>

(net myInput (joined (portRef myInput) </P>

<P CLASS="ComputerLast">

<A NAME="pgfId=26087">

 </A>

	(portRef I (instanceRef B1_i1))))</P>

⌨️ 快捷键说明

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