This section describes how macro library files are created and edited in EPIC. These operations are done while EPIC is in Macro Mode.
You can start EPIC in Macro Mode in either of these two ways.
Although you must specify a part number and speed, a macro you create can be instantiated in any design file of the same family. For example, if you create a macro library file and specify a 4008PG191 package at a speed of 5, the macro can still be instantiated in a design file for a 4010PQ208 package at a speed of 6, or any other Xilinx XC4000 family design file.
You can start an EPIC session in Macro Mode by making selections from a dialog box. You must be in a window environment (Microsoft Windows on a PC, and X Window System on a UNIX workstation).
To edit an existing macro when you start EPIC, follow these steps.
Figure 5.3 EPIC Start Dialog Box |
Figure 5.4 Open Macro Dialog Box |
You can start EPIC in Macro Mode from the DOS or UNIX prompt. On a UNIX workstation, the X Window System must be running. On a PC, you can start EPIC from the DOS command line.
On a PC, from within the Microsoft Windows Program Manager, select Run from the File menu. In the Run dialog box, enter the command. (Remember that commands for a PC are case insensitive).
epic -m [-e | -r] macro_name[.nmc]
This command also applies to workstations.
The EPIC window appears, displaying the existing macro library file.
To start EPIC from the command line and create a new macro library file, enter this command.
epic -m macro_name[.nmc] arch device package speed
The EPIC window appears, displaying an empty macro library file using the designated part and speed. When you create a new macro library file, you are placed in a mode that allows you to make changes to the file.
To create a new macro when you start EPIC, follow these steps.
Figure 5.5 EPIC Start Dialog Box |
Figure 5.6 New Macro Dialog Box |
Although you must specify a part number and speed, a macro you create can be instantiated in any design file of the same family. For example, if you create a macro library file and specify a 4008PG191 package at a speed of 5, the macro can still be instantiated in a design file for a 4010PQ208 package at a speed of 6, or any other Xilinx XC4000 family design file.
To open an existing macro library file while you are in the EPIC window, use this procedure.
Figure 5.7 Open Macro Dialog Box |
The macro library file you specified is loaded into the EPIC window.
To create a new macro library file while you are in the EPIC window follow this procedure.
Figure 5.8 New Macro Dialog Box |
You can create a macro library file by saving a design in the EPIC window, when EPIC is in Design Mode, as a macro. When you save a design as a macro, EPIC switches to Macro Mode. You can then edit this new macro library file.
To save the design as a macro library file, use this procedure.
Figure 5.9 Save As Dialog Box |
To use this macro, you must assign one or more external pins; this procedure is described in the Adding External Pins in Macro Mode section section.
Constraints are not retained when you save a design file as a macro library file. No constraint file is generated, even if the design had constraints defined.
This section describes how to edit the macro library file. Most editing operations in Macro Mode are identical to those same operations in Design Mode. However, there are operations which are performed differently in Macro and Design modes. In addition, certain operations can only be performed in Macro Mode.
Many of the operations unique to Macro Mode are performed using the entries in the Macros menu. The Macros menu is only used in Macro Mode.
Figure 5.10 Macros Menu |
Add External Pin | Designates that a selected component pin is an external pin. The pin can be connected to external nets after the macro is instantiated in a design file. |
List External Pins | Lists all external pins specified in the macro library file. |
Set Reference Comp | Designates a selected macro component as the macro's reference component. If the macro has at least one pre-placed component, it has a reference component. When you place, move, or copy a macro, you select a site for the reference component, and all other components are then located relative to the reference component. If you do not designate a reference component, the component in the lower left corner is selected when the macro library file is saved. |
Get Reference Comp | Displays the name of the reference component in the history area. |
The following sections describe how to perform these operations in Macro Mode.
External pins connect the instantiated macro to other components in the design. You define the external pins in the macro library file, and the pins cannot be modified in a macro instance. In the EPIC editing area, external pins are displayed in the macro layer color.
To add external pins to the macro library file, follow these steps.
If you add a number of external pins, create a push button to perform the operation. Enter the command button addpin add_extpin in the EPIC Command Line dialog box. You can then specify external pins by selecting the desired pins and selecting the Addpin push button you created.
When you add external pins, an External Pin Attributes dialog box can appear for each newly created external pin. Whether the dialog box displays or not is controlled by the Automatic Post main window attribute. See the Main Window Attributes section of the Using EPIC chapter. Each dialog box shows the name of the new external pin and other information about the pin. You can edit the dialog boxes to modify external pin attributes or you can remove the dialog boxes by pressing Cancel. See the External Pin Attributes 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 will be called $extpin_0, the second will be called $extpin_1, and so on.
For macro nets connected to external nets, use these rules to declare and name external pins, and to set their Type attributes.
If your schematic symbol contains a multi-bit pin and your schematic will be read into Foundry as an XNF file, you must name the corresponding macro external pins in the format: pin_name number (for example, DATA<0> or A<2>). When you name these external pins in the macro, you must insert the angle brackets (< and >) to denote the bit numbers for these pins.
The following examples illustrate these rules.
The following figure shows a macro that connects an external clock pin to multiple clock input pins. Only one K pin needs to be designated as the external clock pin to the macro.
Figure 5.11 External Pins Example 1 |
The following figure shows a macro that functions as a latch. External pins appear as filled-in triangles. There are two input external pins and one output external pin for the macro. The output external pin (Y) also feeds back to an input pin (the F1 pin) within the macro, but only the Y pin is used as an external pin; Y is a driver to the external circuitry, and you therefore want to designate this output pin as external.
Figure 5.12 External Pins Example 2 |
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 change pins so that they are no longer defined as external pins, follow this procedure.
The selected pins are no longer external pins. If you display a list of external pins, these pins will be missing from the list.
To list all currently defined external pins, select List External Pins from the Macros menu or enter the getattr main extpins command in the EPIC command line dialog box. 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
To view or change external pin attributes, select the external pin and then select the Attrib push button or the Post Attributes command in the Misc menu. The following dialog box appears.
Figure 5.13 External Pin Attributes Dialog Box |
Name | Name of the component pin. |
External Name | Name by which this pin will be known when the macro library file is instantiated in a design. |
Component Name | Name of the component containing the pin. This field holds an unlimited number of characters; it is non-modifiable or scrollable. |
Site Name | Site in which the component containing the pin is placed. |
Type | 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 table. |
For an input pin, the pin types are the following.
Type | Meaning |
---|---|
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 | Meaning |
---|---|
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. |
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, which you specify when the macro library file is created or edited. If you do not specify one, the system assigns one automatically.
When you place, move, or copy a macro instance, select a site, then execute the appropriate command. The macro's reference component is placed in the site you designated, and all other placed components in the macro are located in sites relative to the reference component.
To designate the reference component follow this procedure.
You can change the reference component at any time while EPIC is in Macro Mode. 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.
To determine which component is the reference component, select Get Reference Comp from the Macros menu or enter getattr main refcomp in the EPIC Command Line dialog box. 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 will be no reference component, and it will not be possible to place an instance of this library file, except by placing each macro component individually.
A macro instance can be added to a macro definition file. The procedure for adding a macro instance is identical, whether EPIC is in Macro or Design Mode. This procedure is described in the Adding Macros section.
When you add a macro while EPIC is in Macro Mode, the macro instance is unbound that is, 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.
In Macro Mode, you can place components in the editing area and route the connecting nets. When you later instantiate the macro library file in a design, the placement of the components relative to each other is maintained in the instantiated macro. Also, routing in the instantiated macro will follow the routing specified in the library file.
Placement and routing operations in Macro Mode are identical to these same operations in Design Mode.
When you instantiate a pre-routed macro into a 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. Therefore, make sure that you do not add 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 a design.
There are a number of physical DRC checks that test the macro you are editing. You can execute these tests during your EPIC session. Also, the tests run automatically whenever you save the macro library file.
To run the macro DRC check follow these steps.
The macro DRC is performed (along with other DRC tests). DRC results appear in the history area.
At any time during an EPIC session, you can save the macro library file.
When you save a macro library file, you cannot save a constraint file along with the NMC file, even if constraints were created when the macro library file was edited. All constraints are lost when you save the NMC file.
To save your current macro library file, select Save in the File menu. The macro library file is written to disk.
To save the macro library file under a different name follow these steps.
Figure 5.14 Macro Save as Dialog Box |
If you are using the default aliases supplied with EPIC, you can enter the save command instead the unload command.
To save a macro library file as a design file, enter this command.
unload design design_name [pcffile_name]
Your macro library file is saved as a design file. Any constraints in the macro library file are written to the constraint file you specified.
To exit EPIC while in Macro Mode follow this procedure.
Figure 5.15 Exit Dialog Box |