FPGA Editor GuideChapter 5: Working with Physical Macros
Adding Macros to Your Design
When you add a macro to your design, you are instantiating a macro or adding an instance of a library macro file to your design. A design can contain multiple instances of the same macro library file; each one has a unique name in your design. A macro can only be added if the design file and the macro library file are 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 your design file. Any subsequent instantiations of the same library file into your design file refers to this local copy, and is not affected by changes in the external library file that was used for the original instantiation.
To add a macro to your 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 is unplaced when it is instantiated.
- Select Edit Add Macro to display the Add Macro dialog box, as shown in the Add Macro Dialog Box figure of the Menu Commands chapter.
- Fill in the dialog box fields and click OK. The fields in this dialog box are described in the Add Macro Dialog Box Options section of the Menu Commands chapter.
An instance of the macro library file is added to your design. If you selected a site, the macro's reference component is placed at the specified site, and any other placed components in the macro library file are placed relative to the reference component.
When you close the Add Macro dialog box, a Macro Properties property sheet may appear for the newly created macro if the Automatic Post option is enabled in the Main Properties property sheet. You can edit the property sheet to modify macro properties or click Cancel to close the property sheet.
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 $adder_0, the second is $adder_1, and so on.
- Any characters special to the FPGA Editor 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 FPGA Editor command script file. The special characters can be entered in the Macro Properties property sheet without the escape character. If you use another vendor's tool set in conjunction with the Xilinx tools, they 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 this name space. For example, you can have a component and a macro named FRED, but you cannot have two macros named FRED or two nets named FRED. The FPGA Editor prevents you from entering non-unique names within a name space. Also, the name cannot 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 one of the following.
- Remap your design
- Delete all instances of the revised macro library file, and then add new instances of the revised macro library file in place of the old instances.