Macro Operations in Design Mode
This section describes how macros are used when EPIC is in Design Mode. The following sections describe how these macro operations are performed.
- Operating on macro components and nets
- Selecting macros
- Adding macros
- Deleting macros
- Viewing and changing macro attributes
- Moving a macro
- Copying a macro
- Unbinding macros
- Placing and unplacing macros
- Routing and unrouting macros
- Operating on a macro's external pins
- Running the macro DRC
Operating on Macro Components and Nets in Design Mode
Normally you place, route, unplace, and unroute a macro instance as a whole object, instead of performing these operations on the individual components and nets that comprise the macro. If a macro is instantiated from a completely placed and routed library file, these operations are always performed on the whole macro. However, because it is possible to define a macro that is not completely placed and routed, you must place and route those individual components and nets that do not have predefined placement and routing information. These rules govern a macro's internal components, nets, and pins.
- Components within a macro instance cannot be added, deleted, reconfigured, or renamed.
- Pre-placed components which are placed in the macro definition cannot be manually or automatically placed, unplaced, or swapped in the macro instance, except by placing, unplacing, or swapping the entire macro instance.
- Components that are not pre-placed can be placed, unplaced, and swapped in the macro instance.
- Internal nets in a macro instance cannot be deleted or added. Pins cannot be added to or deleted from internal nets.
- Pre-routed nets which are routed in the macro library file cannot be manually or automatically routed or unrouted in the macro instance, except by routing the entire macro instance.
- Macro nets which are not pre-routed can be routed and unrouted.
- Unused pins on macro components cannot be used to create non-macro nets. Only external pins can be connected to external nets.
Selecting Macros
To select a macro in Design Mode, use one of these methods.
- Display a list of the appropriate macros (all, placed, or unplaced) in the EPIC List dialog box, then select the desired macro name. If you select the name of a placed macro, the components and nets making up the macro change color in the editing area.
- Press the Ctrl key while selecting a macro component. The components and nets making up the macro change color in the editing area, and the macro instance and the macro file are identified in the EPIC history area. If there is no macro component at the cursor position, a normal select occurs.
Adding Macros
When you add a macro to the design, you are instantiating a macro; that is, you are bringing an instance of a library macro file into the design. A design can contain multiple instances of the same macro library file, and each will have a unique name within the design. A macro can only be added if the design file and the macro library file are of the same family. For example, if your design is an XC4000 part, you can only add an XC4000 macro library file.
The first time you instantiate a macro library file, a copy of the library file is placed into the design file. Any subsequent instantiations of the same library file into the design file will refer to this local copy, and will not be affected by changes in the external library file that was used for the original instantiation.
To add a macro to the design follow this procedure.
- If you want to place the macro when you add it, select a vacant site in which to place the macro.
The site must match the reference component specified in the macro library file. For example, if the macro library file specifies an I/O component as the reference component, the selected site must be an I/O component site.
If there is no reference component in the macro library file, the selected site is ignored and the macro is unplaced when it is instantiated. If you do not select a site, the macro will be unplaced when it is instantiated.
- Display the Add Macro dialog box in one of these ways.
- Select Add Macro from the Edit menu.
- Enter post addmacro in the EPIC Command Line dialog box.
The Add Macro dialog box appears.
The fields in this dialog box are as follows.
Macro Name
| Name for the macro instance. If you do not enter a name, a name is assigned automatically when the macro is added.
|
Macro Library File
| Name of the macro library file to add to the design. If you previously added this same macro to the design, the added macro will be a copy of the first instantiation. If you changed the macro library file since the original instantiation, these changes will not be reflected in this new instantiation.
|
- Fill in the dialog box fields and click OK.
An instance of the macro library file is added to the design. If you selected a site in step 1, the macro's reference component is placed at the specified site, and any other placed components in the macro library file is placed relative to the reference component.
When you close the Add Macro dialog box, a Macro Attributes dialog box may appear for the newly created macro. Whether the dialog box is displayed 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 displays the name of the new macro, the macro library file that defined the macro, and other information. You can edit the dialog boxes to modify component attributes or you remove the dialog box by clicking Cancel. See the Viewing and Changing Macro Attributes section.
Notes on Adding Macros
- If you do not specify a macro name when you add a macro, the name assigned to the new macro is in the format: $libfile_number, where libfile is the name of the macro library file that defined the macro when it was added. Number is a number assigned to that instance of the macro library file. Numbering starts at 0, and increases by one for each new added macro. For example, if you add multiple instances of a macro library file named adder the first instance is called $adder_0, the second is called $adder_1, and so on.
- Any characters special to the EPIC command interpreter must be preceded by a backslash (\) escape character when used in a macro name. Special characters are quotation marks ( or `) * ; ? # - (leading dash). The restriction only applies to commands entered at the command line or those in an EPIC command script file. The special characters can be entered in the Macro Attributes dialog box without the escape character.
If you use another vendor's tool set in conjunction with Xilinx's that vendor may have other naming restrictions.
- When a macro is added, the names of all components, nets, and external pins within the macro has this format: macro_name/object_name, for example, $adder_3/$comp_0 or $decoder_2/$extpin_0.
- All components, nets, and macros have their own name space and must have unique names within their own name space. For example, you can have a component and a macro both of which are named FRED, but you cannot have two macros named FRED or two nets named FRED. EPIC prevents you from entering non-unique names within a name space.
Also, the name must not be empty.
- If the original (external) macro library file is changed or deleted, there is no effect on any instances of this library file in your design.
If you change the external macro library file and want to update an existing design to use this revised library file, you can do either of these things.
Remap the design. Or delete all instances of the revised macro library file, then add new instances of the revised macro library file in place of the old instances.
Deleting Macros
When you delete a macro, all of the macro's external pins are unrouted, all components and nets that are part of the macro are eliminated. And finally, the macro name is removed from the database.
To delete a macro follow this procedure.
- Display a list of macro names in the EPIC List dialog box.
- Select the macros to delete.
- Perform the delete command in one of the following ways.
- Select Delete from the Edit menu.
- Select the Delete push button.
- Enter delete in the EPIC Command Line dialog box.
The macros are eliminated from the database.
Viewing and Changing Macro Attributes
You can view or change macro attributes in the Macro Attributes dialog box. To view macro attributes, follow this procedure.
- In the EPIC List dialog box, display a list of macro names.
- Select the macro that you want to view or change its attributes.
- Display the Macro Attributes dialog box in one of the following ways.
- Select Post Attributes from the Misc menu.
- Select the Attrib push button.
- Enter post attr in the EPIC Command Line dialog box.
The Macro Attributes dialog box appears.
Macro Name
| Name of the macro. If you change the macro name, all of the names of the components, nets, and external pins which are part of the macro are updated automatically to reflect this change.
|
Macro Library File
| Name of the macro library file that defined this macro instance.
|
Status
| Indicates whether the macro is unplaced or placed. A macro is only shown as placed if all the components in the macro are placed.
|
Reference Comp
| Indicates that the component is designated as a reference component. A macro with no pre-placed components does not have a reference component; a macro with at least one pre-placed component has one. The reference component is described in the Reference Component in Macro Mode section. This field holds up to 50 characters, is non-modifiable, and scrollable.
|
External Pins
| Lists the pins that are defined as external pins. External pins are described in the Adding External Pins in Macro Mode section.
|
Show Constraints
| When selected, displays a Macro Constraints dialog box, which displays the constraints that are applied to the macro.
|
If you select the Show Constraints command from the Macro Attributes dialog box, this dialog box appears.
Name
| Macro name.
|
Lock
| If enabled, indicates a lock macro or global lock placement constraint is applied. If a macro is locked, all macro components that were pre-placed that is, components that were placed in the macro's library file are locked. The macro cannot be unplaced.
|
Locate
| If enabled, indicates a locate macro constraint is applied. This constraint places the macro's reference component at a specified site, places all of the macro's pre-placed components (that is, all components that were placed in the macro's library file) in sites relative to the reference component, and locks all of these placed components at their sites.
|
None/Soft/Hard
| Specifies whether the value in the Range field is an absolute requirement (hard) or not (soft) for the placement tools.
|
Level
| Sets up a priority for the placement tools to resolve constraint conflicts.
|
Range
| Specifies the location of the site or range of sites for the placement tools.
|
Block
| Use this timing constraint to block the enumeration of all timing paths that go through this macro.
|
TSid
| Assigns a timing period or frequency to a timing specification.
|
Moving Macros
To move a macro with placed components to an unused group of sites, use the Swap command. When you move a placed macro by swapping, you save a step compared to unplacing the macro then placing it at the new location.
To move a macro to an unused group of sites follow this procedure.
- Select the macro to move.
- Select an unused site to which you will move the macro's reference component.
The reference component and the selected site must be the same type of block that is, I/O block and I/O block, or logic block and logic block.
- Perform the Swap command in one of the following ways.
- Select Swap from the Edit menu.
- Click the Swap push button.
- Enter swap in the EPIC Command Line dialog box.
The reference component moves to the unused site, and the other components in the macro move to maintain their positions relative to the reference component.
If the Automatic Routing Option is on, each macro's external pins are routed after the macro is placed. Also, any non-prerouted macro nets are automatically routed.
Copying Macros
When you copy a macro, you add a duplicate of the macro instance to the design. The source is a placed or unplaced macro. The target is a vacant site in which to place the reference component of the copy.
To copy a macro follow this procedure.
- In the EPIC List dialog box, display a list of macro names.
- Select the macro to copy.
The selected macro is the source macro.
- Select the vacant site or target into which you want to copy the source macro's reference component.
- Invoke the Copy command in one of the following ways.
- Select Copy from the Edit menu.
- Type copy in the EPIC Command Line dialog box.
The reference component of the source macro is copied to the selected site, and the other components in the macro are copied in positions relative to the reference component.
If you do not specify a name for the copy, the name assigned to the new macro is in the format: $libfile_number, where libfile is the name of the macro library file of the source macro and number is a number assigned to each new copy of the source. Numbering starts at 0, and increases by one for each new copy of the macro. For example, if you make multiple copies of a macro called add, which is an instantiation of macro library file adder, the first copy will be called $adder_0, the second will be called $adder_1, and so on.
Unbinding Macros
When you unbind a macro, you disassociate the macro's components and nets from the macro. The macro name disappears from the design's database. After unbinding, all of the components and nets are treated as separate components and nets. Also, component names and net names are changed, replacing the forward slash (/) that indicates the macro's library file with an underscore (_).
To unbind a macro follow these steps.
- In the EPIC List dialog box, display a list of macro names.
- Select the macros to unbind.
- Perform the Unbind command in one of these ways.
- Select Unbind from the Edit menu.
- Enter unbind in the EPIC Command Line dialog box.
For each of the selected macros, the included components and nets no longer are associated with the macro, and the macro name disappears from the EPIC List dialog box.
Placing and Unplacing Macros
Macros can be placed in the editing area either automatically or manually. When you use automatic placement (AutoPlace), the system selects an appropriate site or sites for each macro you select. When you use manual placement, you select both a macro and a site in which to place the macro's reference component.
When you manually place a macro, you only place the pre-placed components in the macro that is, those components which were placed in the macro library file that defined this macro instance. You must place any unplaced components in the macro's library file in a separate operation.
When you automatically place a macro, the system tries to place all of the macro components, whether they are pre-placed or not.
You can also unplace macros. Unplacing a macro unroutes each of the macro's external pins, then removes the macro from the editing area and adds the macro to the list of the design's unplaced macros.
The following sections describe placing and unplacing macros.
AutoPlacing Macros
You can place macros automatically by invoking the Autoplace command.
- In the EPIC List dialog box, display a list of unplaced macros.
- Select the macros to automatically place.
- Perform the Autoplace command in one of these ways.
- Select AutoPlace from the Place menu.
- Enter autoplace in the EPIC Command Line dialog box.
The macros you selected are automatically placed in vacant sites in the editing area. For each macro, any connections that were unrouted in the macro's library file are routed when the macro is placed.
If the Automatic Routing Option is On, each macro's external pins are routed after the macro is placed. Also, any non-prerouted macro nets are automatically routed.
Manually Placing Macros
There are two macro manual placement procedures.
- Manually placing an unplaced macro in a vacant site.
- Moving a macro to another site after it has been placed.
To manually place an unplaced macro follow this procedure.
- In the EPIC List dialog box, display a list of unplaced macros.
- Select one name from the list of unplaced macros.
- Select a vacant site in the editing area in which to place the macro's reference component.
The macro's reference component and the selected site must be the same type of block (I/O component and I/O component or logic component and logic component).
The first two steps can be performed in reverse order.
- Invoke the Place command in one of these ways.
- Select Manual Place from the Place menu.
- Enter place in the EPIC Command Line dialog box.
The macro's reference component is placed in the selected site, and all of the macro's pre-placed components that is, components placed in the macro's library file are placed in sites relative to the reference component. Macro components that are not pre-placed must be placed in a separate operation.
Any connections that were routed in the macro's library file will be routed when the macro is placed. If the Automatic Routing Option is On, the macro's external pins are routed after the macro is placed. Also, any non-prerouted macro nets are automatically routed.
To move a macro, follow the procedure described in the Moving Macros section.
Unplacing
The Unplace command removes selected macros from their current sites and puts them into the unplaced macros list. The list of unplaced macros can be viewed in the EPIC List dialog box. Unplaced macros can be re-placed.
Before unplacing a macro, the system unroutes each external pin on the macro.
NOTELocked macros cannot be unplaced.
| To unplace selected macros follow this procedure.
- Select the macros to unplace by displaying the list of placed macros in the EPIC List dialog box, then click on the macro names.
- Unplace the macros in one of these ways.
- Select Unplace from the Place menu.
- Enter unplace in the EPIC Command Line dialog box.
All of the selected macros are unplaced. If you display a list of unplaced macros in the EPIC List dialog box, you will see the names of the macros you unplaced.
Routing and Unrouting Macros
Routing and unrouting macros is similar to routing and unrouting components. These operations are described in the Routing and Unrouting section of the Using EPIC chapter.
Notes on Routing and Unrouting Macros
- To select a macro for automatic routing, you must display a list of placed macros in the EPIC list dialog box, then select the name of the desired macro.
- When you place a macro, any pre-routed connections are automatically be routed after the macro is placed. You cannot unroute these connections in Design Mode.
- When you place a macro without the Automatic Routing option enabled, any internal connections that were unrouted in the macro's library file will be unrouted after the macro is placed. You must perform a separate route operation to route these connections.
- When you automatically route a macro, each external pin connected to a net is routed. Also, any nets that are not pre-routed will be automatically routed.
Macro External Pins
In Design Mode, external macro pins are treated as other pins in the design. You can add them to nets in the design, if these nets are external to the macro, route and unroute them, and find them with the Find command.
Some differences exist between external pins in Macro Mode and in Design Mode. You cannot add or delete external pins in Design Mode. In Macro Mode, you can change an external pin name, in Design Mode, you cannot.
Macro DRC Checks
There are a number of physical DRC checks that test macros in Design Mode. You can execute these tests during your EPIC session.
To run the macro DRC check follow these steps.
- Make sure nothing is selected in the editing area or the EPIC List dialog box. If necessary, select the Clear push button to deselect any selected objects.
- Perform the DRC command in one of these ways.
- Select DRC from the Tools menu.
- Press the DRC push button.
- Enter DRC in the command area.
The macro DRC is performed, along with other DRC tests. DRC results appear in the history area.