Previous

Creating Symbols (Macros)

A symbol is a graphic representation of a level of hierarchy. Symbols can represent user-defined macros or design files from other sources. This section describes how to create a symbol.

  1. Open a blank symbol window by clicking on File Open, which displays the Open dialog box.

  2. Change the Directory to primary (or any writable library directory) and change the Type to Symbol.

  3. In the Symbol field, type in the symbol name.

  4. Click on OK.

The File Open dialog box closes and a symbol window opens.

The symbol window contains a box called a block sheet that defines the perimeter of the symbol. The block sheet does not show up on the screen when the symbol is placed in a design schematic. You can see only the elements that you add to the symbol.

The initial size of the symbol, shown as the area defined by the block sheet, is 1 inch by 1 inch or 100 x 100 grid units. For most symbols, you must enlarge or reduce this default size.

Changing Symbol Size

To change the size of the symbol, follow these instructions.

  1. Click the right mouse button and select Properties, or double click in the work area. The Symbol Properties dialog box appears as represented in the next figure.

    Figure 3.10 Symbol Properties Dialog Box

  2. The default Width and Height appear as 100. Change these to your new values and click on OK.

  3. Press the F4 key to resize the screen relative to the new block size.

Creating Symbol Box

Most symbols have a visible frame or symbol body to which pins attached. To add a box for a symbol, follow these steps.

  1. Select the Add Box command. See the associated icon represented next.

    figures/addbox.gif

  2. Place the cursor on the grid pip two down and two to the right of the upper left hand corner of the working area. Turn the grid pips on, if necessary, from the Project Settings menu. Under the Project tab, check the box in the top row labeled Grid. Click on OK.

  3. With the left mouse button, click and drag to the grid pip two up and two to the left of the lower right hand corner of the work area. Release the mouse button to complete the box.

    The Box toolbar icon remains depressed after you define the box because ViewDraw remains in Add Box mode.

  4. Press Escape or click on the Cursor icon to terminate this command.

You can move the mouse in any direction, as long as you go from corner to opposite corner. The symbol appears similar to the one represented in the following figure.

Figure 3.11 Symbol Box

A two-pip distance exists from the symbol box to the edge of the work area. While not required, this distance provides a constant symbol pin length. The Xilinx Unified Libraries follow this convention.

Adding Pins

To add pins to the symbol, follow these steps.

  1. Select the Add Pin command. See the associated icon represented in the following figure.

    figures/addpin.gif

  2. On the symbol box just drawn, single click the left mouse button at the spot where you want the pin to start. This draws a pin from this point to the edge of the work area.

    The Pin toolbar icon remains depressed after the box has been defined because ViewDraw remains in Add Pin mode. You can add multiple pins in succession without re-invoking the Add Pin command.

  3. Press Escape or click on the Cursor icon to terminate this command.

Adding Pin Labels

Pin labels must exactly match the labels used for the same signals in the corresponding schematic. For example, for a pin labeled “clock” on the symbol, there must exist a net labeled “clock” in the symbol's underlying schematic. To add pin labels, follow the procedure given in the “Adding Labels” section in this chapter.

Adding Pin Attributes

You can attach attributes to pins as well as to symbols. The most common attribute applied to a pin is the PINTYPE attribute. The valid optional values for the PINTYPE attribute are IN, OUT, and BI. You can add attributes to pins using the procedure given in the “Adding Attributes” section in this chapter.

Merging Design Files from Other Sources

You can enter part of your design in some form other than schematics, such as state machine entry. You can also bring in netlist files produced by interface software from a Xilinx Alliance partner. Whatever the form of entry, you must use as the starting point for inclusion into a Viewlogic schematic design a Xilinx Netlist Format (XNF) file or an EDIF 2 0 0 netlist file. This file must reside in the project directory. Without an XNF file, you cannot include this portion of the design; with it, the origin of the logic becomes irrelevant.

See the “Design and Simulation Techniques” chapter for instructions about creating custom symbols for non-schematic-based modules.

Next