Return to previous page Advance to next page
FPGA Editor Guide
Chapter 5: Working with Physical Macros

Editing Your Macro File

This section describes how to edit your macro library file. You can perform the following editing operations.

The FPGA Editor Edit menu includes the following macro commands.

Table 5_1 Edit Menu Macro Commands

Command
Description
Add Macro
Use this command to add a macro to your design
Add Macro External Pin
Use this command to define a selected component pin as a macro external pin
Set Macro Reference Comp
Use this command to designate a selected component in a macro file as the macro's reference component
Unbind Macro
Use this command to separate a selected macro into its individual components

Adding External Pins

External pins connect the instantiated macro to other components in your design. You define the external pins in the macro library file, and the pins cannot be modified in an instantiated macro. External pins are displayed in the same color as the macro layer in the Array window.

To add external pins to a macro library file, follow these steps.

Note: If you are adding a large number of external pins, you can create a User toolbar button to perform this operation. See the “Button” section of the “Command Line Syntax” chapter for more information.

  1. Open a macro file in the FPGA Editor.

  2. Select the pins that you want to define as external pins.

  3. Select Edit Add Macro External Pin.

    The selected pins are now external pins; the color of the external pins changes to the color used for the macro layer.

When you add external pins, the “External Pin Property Sheet” figure is displayed for each newly created external pin if the Automatic Post option is enabled in the Main Properties property sheet.Each property sheet displays the name of the new external pin and additional pin information. You can edit the property sheet to modify external pin properties, or you can click Cancel to close the property sheet. See the “Viewing and Changing External Pin Properties” section for details.

When you add an external pin, the name assigned to the new pin is in the format $extpin_number, where number is a number assigned to each new external pin. Numbering starts at 0, and increases by one for each new external pin. For example, if you add multiple external pins, the first one is $extpin_0, the second is $extpin_1, and so on.

Macro to External Net Recommendations

For macro nets connected to external nets, use the recommendations in this section to declare and name external pins, and to set their Type attributes.

The following examples illustrate these recommendations.

Viewing and Changing External Pin Properties

To view or change external pin attributes, follow these steps.

  1. Select an external pin.

  2. Select Edit Properties of Selected Items to display the External Properties property sheet, as shown in the following figure.

Figure 5.6 External Pin Property Sheet

Refer to the following table for a description of the properties in the External Pin Property sheet.

Property
Description
External Name
Name of this pin when the macro library file is instantiated in your design
Pin Name
Name of component or site pin
Type of Pin
Specifies the function of the pin within the macro. The pin type determines how paths passing through the pin are defined for timing analysis. Pin types are described in the following tables.
Site Name
Site in which the component containing the pin is placed.
Component Name
Name of the component containing the pin.
Net Name
Name of the net connected to the pin.

For an input pin, the pin types are the following.

Type
Description
INPUT
Pin is an input to combinational logic in the macro; it is not clocked.
CLOCK
Pin is used as a clock signal within the macro.
SRDIRECT
Pin is used as an asynchronous Set or Reset signal within the macro.
ENABLE
Pin is used as an asynchronous control line (for example, a tristate buffer enable) within the macro.
SYNCINPUT
Pin is an input that is clocked within the macro (for example, a register input).
SYNCENABLE
Pin is used as a control line synchronous to a clock within the macro.

For an output pin, the pin types are the following.

Type
Description
OUTPUT
Pin is an output from combinational logic within the macro; it is not clocked within the macro.
SYNCOUTPUT
Pin is an output from clocked logic within the macro. The pin is synchronous with respect to the macro clock.
DIRECTIN
Pin should be treated as a direct input pin, that is, a pin with no internal delay. This pin type should not be specified for an external macro pin.

Deleting External Pins

When you delete an external pin, the pin is no longer defined as external. If the external pin is connected to a net, it remains connected after you delete it as an external pin.

To delete external pins, follow this procedure.

  1. Select the pins that you want to remove as external pins.

  2. Select Edit Cut.

    The selected pins are no longer external pins. If you display a list of external pins, these pins do not appear in the list.

Listing External Pins

To list all currently defined external pins, enter the getattr main extpins command in the Command Line toolbar. A listing of all of the external pins currently defined for the macro appears in the history area, as shown following, and is written to the log file.

#   External Pin Name  Pin Type      Comp.Pin Location 
# ----------------- ---------- -----------------
# Input Pins:
# A<0> INPUT Q0.F1
# A<1> INPUT Q0.G4
# A<2> INPUT Q2.F1
# A<3> INPUT Q2.G4
# C CLOCK OFL.K
# R INPUT OFL.F3
# Output Pins:
# OFL OUTPUT OFL.XQ
# Q<0> OUTPUT Q0.XQ
# Q<1> OUTPUT Q0.YQ
# Q<2> OUTPUT Q2.XQ
# Q<3> OUTPUT Q2.YQ
# External Pin Summary:
# Number of inputs: 6
# Number of outputs: 5
# Total pin count: 11

Designating a Reference Component

A reference component is a component in the macro library file used as the origin when a macro instance is placed, moved, or copied. Placement and routing of all other macro components are determined relative to this component.

If a macro library file has at least one pre-placed component, the macro will have a reference component. A macro can have only one reference component. You can specify the reference component when you create a macro library file, or you can have the system assign one automatically. If you do not designate a reference component, the component in the lower-left corner is selected by default when the macro file is saved.

When you place, move, or copy a macro instance, select a site, and then execute the appropriate command, the macro's reference component is placed in the site you designated. All other placed components in the macro are located in sites relative to the reference component.

To designate a reference component, follow this procedure.

  1. Select the component you want as the reference component.

  2. Select Edit Set Macro Reference Comp

To determine which component is the reference component, enter getattr main refcomp in the Command Line Toolbar. The name of the reference component appears in the history area.

You can define a macro with unplaced components and unrouted nets. In this case, there is no reference component, and it you cannot place an instance of this library file, except by placing each macro component individually.

Adding a Macro to a Macro File

You can add a macro instance to a macro file. Use the procedure described in the “Saving a Macro Library File” section.

When you add a macro instance to a macro file, the macro instance is unbound; the components and nets in the instance are added as separate components and nets, not as macro elements. After instantiation, there is no indication that these components or nets were added as a macro.

Macro File Placement and Routing

You can place components and route the connecting nets in your macro file. When you later instantiate the macro library file in your design, the placement of the components relative to each other is maintained in the instantiated macro. Also, routing in the instantiated macro follows the routing specified in the library file. Placement and routing operations in a macro file are identical to these same operations in a design file.

When you instantiate a pre-routed macro into your design, the design can take a substantially longer time to place and route, depending on the route complexity and the number of connections in the macro nets. Xilinx recommends not adding any unnecessary routing to your library file.

Do not define a macro with CLB K pins routed together using long lines. This configuration may be impossible to route when the macro is instantiated into your design.