It is highly recommended that you let the automatic placement and routing program, PAR, define the pinout. Pre-assigning locations to the I/Os can sometimes degrade the performance of the place and route tools. However, it is usually necessary, at some point, to lock the pinout of a design so that it can be integrated into a board design. You should define the initial pinout by running the place and route tools without pin assignments, then locking down the I/O placement so that it reflects the locations chosen by the tools. I/O in the tutorial schematics must be assigned pin locations so that the Calc design can function in the Xilinx demonstration boards. Because the design is fairly simple, these pin assignments do not adversely affect the ability of PAR to place and route the design completely.
Pin locations are specified by attaching a LOC property to the net attached to the pad. LOC properties should not be attached directly to I/O pads. Properties are not associated with nets, only with vertices on nets. When attaching properties, if the center of a net is selected, the entire net segment appears highlighted, indicating that two net vertices are selected, one at each end of the net segment. If a property is then attached to the net, it appears twice when placed, indicating it has been attached to both net vertices associated with the segment. While this is not illegal, it does clutter the schematic. To prevent this, select only one vertex before attaching properties. To select a net vertex, position the cursor exactly above the point where the net attaches to the pin, or above the point where the net bends. Otherwise, an entire net segment is selected. This operation is simplified because default pin locations are included with the I/O pins; for example, the PXX on the OPAD symbols. You can modify the existing property, rather than adding a new one.
Modify the LOC property on the pad associated with the STACKLED(0) signal on the Calc schematic as follows:
Figure 9.41 Assigning a Location to an Output Net |
For simplicity, the other pin locations for the Calc design have been placed in a data file known as a constraint file, which is described in a later section. You can leave the other location values undefined. Valid pin locations vary depending on the package. PLCC, HQFP, and other numeric-only package pins are designated with a P followed by the pin number, such as P17. PGA and other grid-array package pins use alphanumerics such as A12. The Programmable Logic Data Book lists the pinouts of each FPGA and CPLD for each package that Xilinx supplies.
You can modify the output slew rate by assigning a FAST attribute to the output buffer, as shown in the Designating a FAST Pad figure. The default slew rate is SLOW. Fast pads have different timing specifications and draw more current than slow (slew-rate-limited) pads. Slow pads are used by default. See The Xilinx Programmable Logic Data Book for timing specifications for the various slew rate modes.
Add a FAST attribute to the led output display drivers attached to the STACK(3:0) bus as follows:
Figure 9.42 Designating a FAST Pad |
Xilinx XC3000A and XC4000E devices have two flip-flops in each Input Output Block (IOB). Each pad has an associated input flip-flop and output flip-flop. You can also configure input flip-flops as latches and output flip-flops as 3-state. You access these elements using the library components IFD, ILD, OFD, and OFDT, as well as other higher-level macros that contain these components. For more information on these library elements, consult the Xilinx Libraries Guide.
IOB flip-flops are used whenever possible to free up internal CLB resources. IOB flip-flops are used to register the switch inputs. As shown in the figure below, the SWITCH7 macro attached to the input bus SW(7:0) in the lower-left area of the schematic has an underlying schematic that consists of seven IFD (input flip-flop D-type) Xilinx primitives. If similar flip-flops, such as FDs, had been used instead, the flip-flops in the IOBs would be wasted and would occupy valuable CLB resources.
Figure 9.43 SWITCH7 Schematic Using Input Flip-Flops |
Before continuing, check and save the changes made to Calc, as shown earlier in this tutorial.