Return to Support Page
 homesearchagentssupportask xilinxmap

Answers Database


Foundation: using XNF files as macros


Record #1340

Product Family:  Software

Product Line:  Aldec

Problem Title:
Foundation: using XNF files as macros


Problem Description:
Keywords: foundation macro xnf
Urgency:  Standard

General Description:
Sometimes you may want to use an XNF file as a macro in a
schematic.

Reasons you may want to do this include:

1) The XNF file comes from a different design entry tool.
2) The source schematic or HDL code is no longer available.
3) The XNF file is specially optimized.

There are two ways to handle XNF file macros.  Some design
entry tools (like XABEL) create an additional file with a
.XSF extension whenever they create an XNF file.  If you have
an XSF file, refer to the resolution titled "With XSF File".
To learn how to create your own XSF file, refer to the
resolution titled "Creating an XSF File".  If you do not have
an XSF file and do not wish to create one, refer to the
resolution titled "No XSF File".

NOTE: Bus pins will not be created when using an XSF file.
      If your symbol requires bus pins, refer to the
      resolution titled "Bus Pins".


Solution 1:

Bus Pins
--------
Foundation does not create bus pins when importing an XNF
netlist.

If your XNF file includes buses, open the XNF file using a
text editor to see which type of bus notation is used:

Bracketed : D<0>, D<1>, etc.
Unbracketed : D0, D1, etc.

These are the only acceptable bus notations.  If your
XNF file uses a different notation, you will not be able
to use bus pins on your Foundation symbol.

Use the "No XSF File" method to create a symbol manually,
or use the "With XSF File" method and use the Symbol Editor
to add bus pins.


Bracketed Bus Notation
----------------------
Use bus pins wherever you want a bus coming out of the
symbol.  If you wish to break up a bus into individual pins,
include the brackets in the pin name.

NOTE: If you break up a bracketed bus into individual pins,
      those pins will not simulate correctly, even if you
      used an XSF file to create the symbol (output pins
      will always be tristated, and input pins will be
      disconnected).


Unbracketed Bus Notation
------------------------
Use bus pins wherever you want a bus coming out of the
symbol.  If you wish to break up a bus into individual pins,
nothing special needs to be done.

If you use any bus pins, put a $DEF=ABEL attribute on each
instance of the symbol on the schematic.  This will ensure
that the Foundation software writes the bus pin names
without brackets.




Solution 2:

With XSF File
-------------
In this procedure, <filename> refers to the base name of the
XNF file, with no extension.

1. Copy <filename>.XNF and <filename>.XSF into your
   Foundation project directory.
2. Open the Schematic Editor and select Hierarchy -> Import
   Netlist.  Select the XNF file and click OK.	This will
   convert the XNF file into a Foundation macro netlist, and
   also create a library symbol with the same name.
3. Place the new symbol in your schematic.
4. Add the attribute FILE=<filename> (not to be confused with
   the $FILE attribute) to each instance of the symbol on
   the schematic.



Solution 3:

Creating an XSF File
--------------------
You can create your own XSF file easily.  The format of an
XSF file is shown in the template below.  After creating an
XSF file, refer to the resolution titled "With XSF File".

In the template, <filename> is the base name of the XNF file
with no extension, <pin_name#> is a signal that should map to
a symbol pin, and <dir> is either I (input), or O (output).

LCANET, 5
SYM, I1, <filename>
PIN, <pin_name1>, <dir>, <pin_name1>
PIN, <pin_name2>, <dir>, <pin_name2>
.
.
.
END
EOF



Solution 4:

No XSF File
-----------
In this procedure, <filename> refers to the base name of the
XNF file, with no extension.

1. Copy <filename>.XNF into your Foundation project
   directory.
2. Create a symbol using the Symbol Editor.  You can name the
   symbol however you want, but it is most convenient to use
   the same name as the XNF file.
3. Place the new symbol in your schematic.
4. Add the attribute FILE=<filename> attribute (not to be
   confused with the $FILE attribute) to each instance of the
   symbol on the schematic.

NOTE:  When using this procedure, functional simulation may
       not work (all outputs of the XNF macro will appear to
       be tristated).  If you are targeting an FPGA, one way
       to avoid this problem is to place an XBLOX component
       on the schematic (you can leave it unconnected).
       Remove the XBLOX component before implementing the
       design.



End of Record #1340

For the latest news, design tips, and patch information on the Xilinx design environment, check out the Xilinx Expert Journals!

© 1998 Xilinx, Inc. All rights reserved
Trademarks and Patents