An 545: Design Guidelines and Timing Closure Techniques For Hardcopy Asics
An 545: Design Guidelines and Timing Closure Techniques For Hardcopy Asics
                           This application note covers topics from a timing closure perspective, for the
                           successful migration to HardCopy ® ASICs from Altera’s FPGAs. The first section
                           covers metastability, synchronous and asynchronous resets, and synchronizing an
                           asynchronous reset. This section also describes techniques for passing control and
                           data signals across clock domains using a handshake mechanism and FIFO.
                           The next section covers the concept of timing requirements at the system level (I/O
                           constraints) and describes in detail what you must do to fully and properly constrain
                           your design (I/O and internal timing constraints). This section focuses on timing
                           constraints by introducing a few basic commands available in the TimeQuest Timing
                           Analyzer that are the most critical for any design. This section also describes how you
                           can properly constrain your design using Altera’s TimeQuest Timing Analyzer
                           available in the Quartus® II software.
                f          The following are required reading for the “Timing Analysis” section in volume 3 of
                           the Quartus II Handbook:
© July 2010   Altera Corporation                             AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 2                                                                       Top 10 Issues for Designs Migrating to HardCopy ASICs
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                         © July 2010   Altera Corporation
Design Guidelines                                                                                                         Page 3
Design Guidelines
                           This section describes how to handle multi-clock domain designs for best design
                           practices and guidelines for timing analysis. Wherever possible, hints, tips, and
                           features in the Quartus II software are highlighted.
Metastability
                           The output of an edge-triggered flipflop has two valid states: high and low. To ensure
                           reliable operation, designs must meet flipflop timing requirements for both setup and
                           hold. Whenever a signal violates the setup and hold requirements of a flipflop, the
                           output of the flipflop can be metastable. Metastable outputs oscillate, or hover,
                           between high and low states for a brief period of time and eventually settle down to
                           either a low state or high state. This can cause the system to fail.
                           In multi-clock designs, ensure that signals crossing clock domains are properly
                           synchronized. Typically, this involves using a synchronizer, a handshake mechanism,
                           or a FIFO.
Synchronizer
                           A synchronizer samples an asynchronous signal and outputs a version of the signal
                           that has transitions synchronized to the local clock.
                           Figure 1 shows an example where a potential metastable state for a signal generated
                           in one clock is sampled too close to the rising edge of another clock domain. If the
                           metastable output is feeding to a state machine, the design might not function.
© July 2010   Altera Corporation                       AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 4                                                                                                      Design Guidelines
                                                               Dat12
                                                                                       Dat2
                         Dat1
CLK1
CLK2
CLK1
Dat12
CLK2
Dat2
                                                                             Dat12 violates
                                                                             setup and hold
                                                                             requirements of
                                                                             the flipflop in the
                                          Dat2 is metastable                 CLK2 domain
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                    © July 2010   Altera Corporation
Design Guidelines                                                                                                                        Page 5
Dat2_1
                                                Dat12
                             Dat1
CLK1
CLK2
CLK1
Dat12
                     CLK2
                                                                                      Dat12 violates setup in
                                                                                      CLK2 and Dat2_1.
                                                                                      It could be metastable
                                                                                      in the first stage of
                                                                                      synchronizer
Dat21
Dat22
                                                         Dat2_2 is
                                                         synchronized properly
                                                         and is valid
                              Proper signal naming conventions reduce problems when running static timing
                              analysis. Set the false paths for the signal crossing clock domain using wildcards. For
                              the output of the first stage, you only have to perform minimum time (hold) checks.
                              The number of synchronizing flipflops required depends on the technology library.
© July 2010   Altera Corporation                            AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 6                                                                                                            Design Guidelines
               f          You can use the Quartus II software to analyze the mean time between failures
                          (MTBF) due to metastability in your design. For more information, refer to the
                          Managing Metastability with the Quartus II Software chapter in volume 1 of the
                          Quartus II Handbook.
                          If you are concerned that a particular asynchronous signal in your design may lead to
                          metastability, use the Quartus II software to determine and optimize the MTBF for the
                          registers that synchronize that signal. You can improve the MTBF by adding
                          additional synchronizer registers as required.
How to Synchronize a Signal from a Fast Clock Domain to a Slow Clock Domain
                          When synchronizing a signal from a fast clock domain to a slow clock domain, ensure
                          that the signal is properly captured in the slow clock domain. Figure 3 shows an
                          example where the signal is transferred from a fast clock domain to a slow clock
                          domain. Because the signal is asserted for only one clock period in the fast clock
                          domain, the signal is not captured in the slow clock domain.
Figure 3. Incorrect Way to Pass Signal from a Fast Clock Domain to a Slow Clock Domain
CLK1
DAT
CLK2
DAT2_1
DAT2_2
                          An easy solution is to ensure that the signal in the fast clock domain is asserted for a
                          period that exceeds the cycle time of the clock in the slow clock domain, as shown in
                          Figure 4. The signal must exceed the cycle time of the slow clock to ensure proper
                          operation across process, voltage, and temperature (PVT) variations and any skew
                          that might arise either in the data or clock signals.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                          © July 2010   Altera Corporation
Design Guidelines                                                                                                                   Page 7
Figure 4. Passing a Signal from a Fast Clock Domain to a Slow Clock Domain
CLK1
DAT
CLK2
DAT2_1
DAT2_2
                            Another solution is to use a handshake mechanism to ensure that the slower clock
                            domain captures the data. This involves passing the DAT2_2 signal back to the fast
                            clock domain as an acknowledge (ack) signal using two synchronous flipflops. If the
                            ack signal does not come back within a certain number of fast clock cycles, the data
                            can be retransmitted to the slow clock domain, as shown in Figure 5.
                 Data2_2
                 resynchronized
                 to the CLK1
                 domain as a
                 handshake
                 signal
CLK1
Data2_2
                            Another way to ensure that the control signal is properly synchronized in the slow
                            clock domain is to de-assert the control signal in the fast clock domain after DAT2_2 is
                            re-synchronized in the fast clock domain. This is described in “Datapath
                            Synchronization” on page 9.
© July 2010   Altera Corporation                                 AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 8                                                                                                                       Design Guidelines
                                                                        en2_2
                                      en1                                                  en
                                      Id1
                                                                        Id2_2
                                                                                           Id
CLK2
                                 Synchronizers
                                                                     data                               dout
                                                                                Id_en2_2
                                        Id_en1                                             en
Id
CLK2
                                               CLK2
                                                                                                   Both control
                                                                                                   signals not issued
                                               en2_2                                               at the same time
                                                                                                   in CLK2 domain
                                               Id2_2
                                                 data
                                                                                                dout not loaded
                                                 dout
                                              Id_en1
                                                                                                  Combined control
                                                                                                  signal in CLK1
                                            Id_en2_2
data
                            Id_en2_2
                            asserted             dout
                            correctly
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                                     © July 2010   Altera Corporation
Design Guidelines                                                                                                           Page 9
                           There are several scenarios where having to pass more than one control signal
                           between clock domains is necessary. The solution is to limit the number of control
                           signals crossing domains. Use one or, at most, two control signals from the sending
                           clock domain to generate the other control signals in the receiving clock. Simulating
                           your design with random delays to the control signals is one way to identify potential
                           design problems. Relying only on timing analysis may not be sufficient.
Datapath Synchronization
                           Using synchronizers is not an accepted practice for datapath synchronization,
                           particularly when multiple data bits are involved. When you use synchronizers, skew
                           in the data bits can lead to data being captured incorrectly. For datapath
                           synchronization, use a handshake mechanism or FIFOs. In the Quartus II software,
                           view the datapath transfers by using the report_clock_transfers command. Be
                           sure to view the Design Assistant messages. Example 1 and Example 2 show typical
                           Design Assistant Warnings for datapath synchronization.
© July 2010   Altera Corporation                         AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 10                                                                                                                      Design Guidelines
                          Figure 7 shows the handshake mechanism between two clock domains for passing
                          data. Latency is caused because the next data word cannot be transmitted until the
                          ack signal is received in the sending clock domain.
Figure 7. Handshake Mechanism for Transmitting Data Between Two Clock Domains
aclk
aload
adata
bclk
bload_1
bload_2
bdata
ack_1
ack_2
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                                     © July 2010   Altera Corporation
Design Guidelines                                                                                                          Page 11
                    1      When migrating from an Altera® FPGA to a HardCopy Series ASIC for FIFOs, keep
                           the PLL M and N counters the same in both revisions because the jitter values and
                           static phase error depends on the M and N counters. Choosing the same M and N
                           counter values between the FPGA and HardCopy revision also limits the variation in
                           the analog component. You can change the phases.
                    1      In the Quartus II software, review the Design Assistant Critical Warnings and
                           Warnings and Information Only messages for reset-related issues. Example 3 shows a
                           sample Design Assistant Warning.
© July 2010   Altera Corporation                         AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 12                                                                                                                    Design Guidelines
pad_clk clk
                                                                    Asynchronous
                                                                    reset assertion
Note to Figure 8:
(1) Source from Cummings, Mills, Golson; “Asynchronous & Synchronous Reset Design Techniques”; SNUG Boston 2003; Synopsys Inc.
                          In Figure 8, the reset signal (rst_n) from the pad is connected to the ACLR pins of the
                          flipflop. The D-input of the first stage flipflop is tied high. When reset is de-asserted
                          asynchronously, masterrst_n is removed synchronously within the design. In this
                          scheme, the reset distribution buffer tree is very similar to the clock-tree itself.
                    1     Because the reset signal typically has a large fan-out, you may want to promote this
                          net to the appropriate global or regional clock network in the Quartus II software. For
                          more information about nets that have high fan-out but are not promoted to either
                          global or regional clock networks, in the Quartus II software, look in the Fitter
                          resource section under Non-Global High Fan-out signals. You can promote some of
                          these high fan-out nets to global or regional clock networks using the Assignment
                          Editor. This improves recovery and removal times for the reset signal.
                          You can then use synchronized reset (masterrst_n) in a design with multiple clock
                          domains, as shown in Figure 9. Within each clock domain, the reset signal is
                          synchronized again.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                                   © July 2010   Altera Corporation
Design Guidelines                                                                                                                                    Page 13
Module A local_reset D Q D Q
                                                                             clka
                             Vcc
                                      D   Q   D   Q
                                                      sync_reset
                                      FF1     FF2                               Module B
                                                                                                             local_reset     D   Q       D       Q
          ref_clk
                                                                            clkb
                       Vcc
                                                                                Module C                       local_reset   D   Q   D       Q
                                                                                                                  ffc3
                                                                                                                   D   Q
                                                                                                                             D   Q   D       Q
          areset
                                                                                                    ffc1          ffc2
                                                                                              Vcc    D   Q         D   Q
clkc
                             At the top level, the areset signal is asynchronously asserted and the reset signal
                             propagates through the reset retiming registers (highlighted in gray) as they are reset
                             down to the user logic (highlighted in blue).
                             In this example, ref_clk is a system-level input reference clock to the device and
                             areset is a chip-level asynchronous reset.
                             When areset is de-asserted, both FF1 and FF2 hold their outputs low until the next
                             clock arrival of ref_clk. In the event that the ref_clk edge arrives close to the time
                             areset is removed from FF1 and FF2, there is no metastability risk on FF2 because
                             the D-input value is already at a stable value.
                             At the first subsequent clock edge of ref_clk after areset is de-asserted, FF1
                             updates the Q pin to logic 1, while FF2 remains logic 0, holding the system in reset for
                             an additional clock cycle.
                             At the second subsequent edge of ref_clk, FF2 updates the Q pin to logic 1, while
                             the global reset signal propagates it to each block of the design, where the local reset
                             retiming stages reside.
                             The reset signal of Module A (or Module B) is metastability safe for the same reason
                             the top-level reset circuit is metastability safe, regardless of when clka (or clkb)
                             arrives relative to ref_clk. The second stage ffa2 has a static value on its input even
                             if the clock arrives too close to the removal of global_reset.
                             Use separate local reset circuits for Module A and B because they reside in separate
                             clock domains. The purpose is to retime resets within local clock domains to allow a
                             full clock period for recovery and removal timing closure.
© July 2010   Altera Corporation                                   AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 14                                                                                                                        Design Guidelines
                           In Module C, both clock edges are used because of design requirements; however, a
                           half clock cycle recovery and removal requirement is often difficult to meet in
                           high-speed clock domains. The solution is to split the second stage flipflops (ffc2 and
                           ffc3) by the clock edge and allow reset of user logic to have a full clock cycle to meet
                           recovery and removal timing.
                           In Figure 9, reset is removed in the three clocks domains in a non-coordinated fashion.
                           In non-coordinated reset removal, the order in which each of the clock domains come
                           out of reset does not matter.
                                 Vcc
                                       FF1     FF2
                                       D   Q   D   Q
                                                                            a_clk_reset
                                                                    FF1             FF2
                   a_clk                                            D   Q       D    Q
                                                                                              b_clk_reset
                                 Vcc
                           Vcc
                                                       b_clk
                                                                                          FF1          FF2
                  areset                                                                  D   Q        D    Q    c_clk_reset
c_clk
                           In this scheme, the logic in the a_clk domain is reset first, followed by the logic in the
                           b_clk domain, followed by the logic in the c_clk domain. Ensure that data is not
                           accessed from a module until that module completely comes out of reset.
                           Notice the signal naming conventions used in Figure 10 for the resets in the different
                           clock domains.
                 1         A good design practice is to separate resets in your design. For example, isolating the
                           PLL reset from a chip reset in the RTL allows you to reset the PLL and logic
                           independently. This allows a safe reset of the PLL to allow it to re-lock in a loss-of-lock
                           situation in a design. You could hold the RTL in reset while the PLL is reset and locks
                           again. After lock is re-established, you can release the reset of the core logic driven by
                           the PLL to receive a good clock signal. Another example is to use reset as a way to
                           save dynamic power by holding a block of logic in reset when not in use, thus limiting
                           the toggle activity in the block of logic to just the clock tree.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                                      © July 2010    Altera Corporation
Timing Constraints                                                                                                             Page 15
Timing Constraints
                           This section provides an overview of TimeQuest Timing Analyzer constraints.
                f          For a full description of the constraints, refer to the Timing Analysis section of
                           volume 3 of the Quartus II Handbook.
                f          For a detailed description of the timing commands, refer to the Help menu in the
                           Quartus II software or Volume 3: Verification in the Quartus II Handbook.
                f          This application note assumes a basic knowledge of .sdc-style constraints. For more
                           information about the Quartus II TimeQuest Timing Analyzer, refer to the Timing
                           Analysis” section in Volume 3 in the Quartus II Handbook.
© July 2010   Altera Corporation                             AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 16                                                                                                Timing Constraints
               f          You can use the Quartus II software to analyze the MTBF due to metastability in your
                          design. For more information, refer to the Managing Metastability with the Quartus II
                          Software chapter in volume 1 of the Quartus II Handbook.
                          If you are concerned that a particular asynchronous signal in your design may lead to
                          metastability, use the Quartus II software to determine and optimize the MTBF for the
                          registers that synchronize that signal. You can improve the MTBF by adding
                          additional synchronizer registers as required.
Constraints
                          For HardCopy ASICs, it is very important to fully constrain your design. Failure to
                          properly and fully constrain your design may cause device failure when migrating to
                          HardCopy ASICs. This section describes how to best constrain your design for
                          completeness.
                          To perform static timing analysis, specify all timing requirements. The basic
                          constraints in a design are clocks and clock uncertainty, input and output delays, and
                          timing exceptions (false paths, multi-cycle paths, and minimum and maximum
                          delays).
               f          All HardCopy ASIC designs must use the TimeQuest Timing Analyzer as the default
                          timing analysis engine. If you still use the Classic Timing Analyzer, refer to the
                          Switching to the TimeQuest Timing Analyzer chapter in volume 3 of the Quartus II
                          Handbook.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs               © July 2010    Altera Corporation
Timing Constraints                                                                                                         Page 17
                                                                        CLK Source
                                          REF CLK                       50 MHz
                                          125 MHz
Chip Y
                                                               FPGA
                               Chip X                            or
                                                             HardCopy
                                                                Chip
Chip Z
                      Master
                      Reset
                           Clocks
                           Begin constraining your design by defining the clocks. Typically, the board has a
                           crystal oscillator as the reference clock, which is fed to a PLL (either external or inside
                           an Altera FPGA or HardCopy ASIC). When using an external PLL, you must consider
                           PLL jitter and clock latencies of the source.
© July 2010   Altera Corporation                         AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 18                                                                                                 Timing Constraints
               f          The PLL reconfig megafunction also allows you to have different phase settings
                          between the FPGA revision and the HardCopy ASIC revision. For more information
                          about how to have different PLL settings between the FPGA and HardCopy revisions,
                          refer to AN432: Using Different PLL Settings Between Stratix II and HardCopy II Devices.
                          When using an internal PLL, choose a crystal source that is easily multiplied and
                          divided to get the desired frequency. The higher the M and N counter values, the
                          greater the jitter and static phase errors.
                 1        Beginning with Quartus II software version 7.1, automatic self reset on loss-of-lock is
                          no longer supported in Stratix II devices and HardCopy II ASICs.
                          If your system qualification requires that you run tests above or below the nominal
                          operating frequency, enter the highest frequency for PLL outputs when configuring
                          the PLL megafunction. This ensures the voltage-controlled oscillator (VCO) of the
                          PLL is properly centered to minimize jitter and static phase error.
                          When planning pin placements on the PLL, place the clocks on dedicated clock input
                          pins. When placed on dedicated clock pins, the clock signals use global or regional
                          clock networks, thus reducing skew and latency.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                © July 2010    Altera Corporation
Timing Constraints                                                                                                                             Page 19
                              Figure 12 shows commands associated with clocks that are available in the TimeQuest
                              Timing Analyzer in the Quartus II software.
Figure 12. Clocks and Clock Uncertainty and the Various Commands in the TimeQuest Timing Analyzer
                                                                    set_clock_uncertainty
                                                                    -hold -setup
                                                                                                                       Clock
                                                                                                                       Network
                  create_clock
                  (at clock pin)
                                                                                                                   create_generated_clock
                                                                                                                   (PLL generated or
                                                                                                                   internally generated)
© July 2010   Altera Corporation                                             AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 20                                                                                                                       Timing Constraints
                          Intra-Clock Transfer
                          Intra-clock transfer occurs when the source and destination clocks come from the
                          same PLL, I/O, or clock pins, as shown in Figure 13.
CLK1
PLL D Q
INBUF CLK1
Destination Clock
                          Inter-Clock Transfer
                          Inter-clock transfer occurs when the source and destination clocks come from
                          different PLLs or I/O clock pins, as shown in Figure 14.
                                                                 PLL5
                                                                                    CLK2
D Q
                                                                                                     Destination
                                                                                                     Clock
                                                                   PLL7
                                                                                    CLK9
                          I/O Transfers
                          I/O transfers are between an off-chip output pin and an on-chip input pin. There can
                          also be an I/O transfer from an on-chip output pin and an off-chip input pin. These
                          are shown in Figure 15 and Figure 16.
INBUF
PLL5
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                                     © July 2010        Altera Corporation
Timing Constraints                                                                                                                 Page 21
INBUF
PLL5
                           For clock uncertainties to be accurately accounted for in each of the transfers, create
                           virtual clocks. This separates the clock domains for the I/O and core. Do this to set the
                           correct clock uncertainty numbers in the clock uncertainty constraints, which differ
                           for the core and I/O transfers. The benefit of using virtual clocks is that it allows you
                           to make separate and distinct clock uncertainty constraints for each unique clock
                           transfer. Without using virtual clocks, the clock uncertainty values are incorrect for
                           I/O timing transfers and you may have difficulty closing timing.
                           The TimeQuest Timing Analyzer still calculates the proper clock uncertainty in this
                           case using derive_clock_uncertainty.
                           “Case 1: No PLL Involved” and “Case 2: With PLL” on page 23 describe the correct
                           virtual clock use. Clock uncertainty values are different between the two
                           implementations in each case.
                                                        data_in                            data_out
                              D    Q                                 D   Q     D   Q                                           D   Q
© July 2010   Altera Corporation                            AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 22                                                                                                          Timing Constraints
                          No Virtual Clocks
                          Example 4 shows the constraints where no virtual clocks are created.
                          Virtual Clocks
                          Example 5 shows the constraints with virtual clocks.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                         © July 2010    Altera Corporation
Timing Constraints                                                                                                             Page 23
                            As you can see from “Case 1: No PLL Involved” on page 21, not only are the clock
                            transfers separated, but the clock uncertainty numbers are different for the intra-clock
                            core transfer and the output I/O transfer.
                            No Virtual Clocks
                            The following are constraints without using virtual clocks:
© July 2010    Altera Corporation                           AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 24                                                                                                             Timing Constraints
                          The resulting clock uncertainty (based on example design PLL settings) is:
                          ■    From clk_in to pll_clk0                       Setup: 270 ps         Hold: 230 ps
                          ■    From pll_clk0 to pll_clk0                     Setup: 100 ps         Hold: 50 ps
                          ■    From pll_clk0 to clk_in                       Setup: 230 ps         Hold: 270 ps
                          Virtual Clocks
                          Example 7 shows the constraints with virtual clocks.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                            © July 2010    Altera Corporation
Timing Constraints                                                                                                         Page 25
Clock Uncertainty
                           You can use the derive_clock_uncertainty command to calculate clock
                           uncertainties.
                           This command automatically calculates clock uncertainties and applies them to the
                           design using the set_clock_uncertainty command. The calculated clock
                           uncertainty values are based on I/O buffer, static phase errors (SPE), and jitter in the
                           PLL’s clock networks and core noises.
                  1        For HardCopy designs, the HardCopy Design Center requires that you set clock
                           uncertainty constraints.
© July 2010   Altera Corporation                         AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 26                                                                                                               Timing Constraints
                          Input Delay
                          The set_input_delay constraint specifies the data arrival time at the input pin of a
                          device with reference to the clock.
                          Figure 19 shows an input delay path.
                                                              Board
                                                              minimum and
                                                              maximum delay
Clock Source
                                                                                                    Clock
                                                                                                    minimum and
                                                                                                    maximum
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                              © July 2010    Altera Corporation
Timing Constraints                                                                                                        Page 27
                           You can specify input delays relative to a port (-reference_pin) in the clock
                           network. Clock arrival times to the reference port are added to data arrival times.
                           Non-port reference pins are not supported.
                           Specifying input delays relative to a reference pin are supported in the TimeQuest
                           Timing Analyzer, but not in the Astro Place and Route tool. Altera’s HardCopy
                           Design Center modifies such constraints by adding a generated clock to the reference
                           pin and using that clock for the -clock option of the input/output delay, removing the
                           -reference_pin option. You are notified of any constraint modifications.
                           In some cases, the input delay can include clock source latency. By default, the clock
                           source latency of the related clock is added to the input delay value, but when the
                           source_latency_included option is specified, clock source latency is not added
                           because it was factored into the input delay value.
© July 2010   Altera Corporation                        AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 28                                                                                                                Timing Constraints
                          Use maximum input delay (-max) for clock setup checks or recovery checks; use
                          minimum input delay (-min) for clock hold checks or removal checks. If only -min or
                          -max (or neither) is specified for a given port, the same value is used for both. To fully
                          constrain your design, specify both the minimum and maximum input delays for all
                          your inputs.
                          You can also specify separate rising (-rise) and falling (-fall) arrival times at the
                          port. If only one -rise and -fall is specified for a given port, the same value is
                          used for both.
                          By default, set_input_delay removes any other input delays to the port except for
                          those with the same -clock, -clock_fall, and -reference_pin combination.
                          You can specify multiple input delays relative to different clocks, clock edges, or
                          reference pins by using the -add_delay option.
                          The value of the targets is either a collection or a Tcl list of wildcards used to create a
                          collection of the appropriate type. The values used must follow standard Tcl or
                          TimeQuest-extension substitution rules.
                          Output Delay
                          The set_output_delay constraint specifies the data requirement at the device pin
                          with respect to a clock specified by the -clock option. The clock must refer to a clock
                          name in the design.
                          Figure 20 shows an output delay path.
                                                         Board
                                                         minimum and
                                                         maximum
                                                         delay
Clock Source
                                                                                   Clock
                                                                                   minimum and
                                                                                   maximum
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                              © July 2010     Altera Corporation
Timing Constraints                                                                                                           Page 29
                           If the output delay is specified relative to a simple generated clock (a generated clock
                           with a single target), the clock arrival times to the generated clock are added to the
                           data required time.
                           You can specify output delays relative to a port (-reference_pin) in the clock
                           network. Clock arrival times to the reference port are added to the data required time.
                           Non-port reference pins are not supported.
                           Specifying output delays relative to a reference pin are supported in the TimeQuest
                           Timing Analyzer, but not in the Astro Place and Route tool. Altera’s HardCopy
                           Design Center modifies such constraints by adding a generated clock to the reference
                           pin and using that clock for the -clock option of the input and output delay, removing
                           the -reference_pin option. You are notified of any constraint modifications.
© July 2010   Altera Corporation                         AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 30                                                                                                 Timing Constraints
                          Output delays can include clock source latency. By default, the clock source latency of
                          the related clock is added to the output delay value, but when the
                          -source_latency_included option is specified, the clock source latency is not added
                          because it was factored into the output delay value.
                          Use maximum output delay (-max) for clock setup checks or recovery checks; use
                          minimum output delay (-min) for clock hold checks or removal checks. If only one of
                          the -min and -max (or neither) is specified for a given port, the same value is used for
                          both.
                          You can specify separate rising (-rise) and falling (-fall) required times at the
                          port. If only one of the -rise and -fall times is specified for a given port, the same
                          value is used for both.
                          Be sure to specify both the minimum and maximum output delays for outputs in your
                          design to be fully constrained.
                          For input and output delays, you may have to create a virtual clock to reference the
                          clock for the input or output pins to account for the proper clock uncertainties.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                © July 2010    Altera Corporation
Timing Constraints                                                                                                             Page 31
Timing Exceptions
                           By default, the TimeQuest Timing Analyzer assumes that data launched at the
                           starting point of a path is captured by the next rising edge of the clock at the end
                           point. If this is not the case for some paths in your design, you must specify timing
                           exceptions. Failure to do so results in timing violations.
                           The timing exception commands available in the TimeQuest Timing Analyzer are:
                           ■       set_false_path (“False Paths” on page 31)
                           ■       set_min_delay (“Maximum and Minimum Delays” on page 33)
                           ■       set_max_delay (“Maximum and Minimum Delays” on page 33)
                           ■       set_multicycle_path (“Multicycle Paths” on page 38)
False Paths
                           False paths are paths in your design that can be ignored during timing analysis.
                           Typically, these paths cross clock domains and occur in the first stage of the
                           synchronizer. You can use the set_false_path command to ignore these paths for
                           timing analysis.
                           Usage: set_false_path [-h | -help] [-long_help] [-fall_from
                           <names>] [-fall_to <names>] [-from <names>] [-hold] [-rise_from
                           <names>] [-rise_to <names>] [-setup] [-through <names>] [-to
                           <names>]
                           Table 4 lists the set_false_path commands and their definitions.
                           Before you set a large number of false paths in your design, understand the reasons
                           for eliminating those paths from timing analysis. Using wildcards can result in fewer
                           lines in your constraint file, but you must ensure that valid paths are not
                           inadvertently set as false paths.
© July 2010   Altera Corporation                             AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 32                                                                                                          Timing Constraints
data_in D Q D Q data_out
clk_A or clk_B
                          In this example, clk_A and clk_B cannot exist on the clock network at the same
                          time. Therefore, use the set_clock_groups -exclusive command as follows:
                          set_clock_groups -exclusive -group {clk_A} -group {clk_B}
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                         © July 2010    Altera Corporation
Timing Constraints                                                                                                        Page 33
data_in_A D Q D Q data_out_A
clk_A
data_in_B D Q D Q data_out_B
clk_B
                           In this example, clk_A and clk_B can be present in the design at the same time, but
                           have no synchronous relationship with each other (inside or outside the chip). Use the
                           following constraints for this case:
                           set_clock_groups -asynchronous -group {clk_A} -group {clk_B}
                           You can use the set_clock_groups -exclusive constraint in this case, but that is
                           not the correct choice. Using the set_clock_groups -asynchronous constraint is
                           the right choice because Altera’s HardCopy Design Center uses PrimeTime-SI to
                           determine the worst-case crosstalk coupling noise possible in analysis. PrimeTime-SI
                           must know which clocks are truly asynchronous so that their worst-case coupling can
                           be determined over overlapping periods. PrimeTime-SI performs crosstalk analysis
                           on synchronous clock domains as well, but the crosstalk effect may be insignificant for
                           clocks that have a synchronous relationship but are out-of-phase with each other, such
                           as two clocks coming from the same PLL.
© July 2010   Altera Corporation                        AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 34                                                                                                             Timing Constraints
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                            © July 2010    Altera Corporation
Timing Constraints                                                                                                              Page 35
                           When using minimum and maximum delays, use explicit collections for targets, such
                           as:
                           ■       Use [get_ports { <pin name> } ] for I/O targets of constraints
                           ■       Do not use [get_keepers * ] for core targets
                           In combinational timing circuits, a path exists from a primary input port to a primary
                           output port. This type of circuit does not contain registers. Therefore, it does not
                           require a clock for constraint specification. You only need the maximum and
                           minimum delay from the primary input port to the primary output port to constrain
                           the path for timing requirements, as shown in Figure 23.
Data_A Out_X
Data_B Out_Y
© July 2010   Altera Corporation                              AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 36                                                                                                   Timing Constraints
                          Apply the minimum and maximum delay constraint exception to an output port that
                          does not use an output delay constraint. In this case, the setup summary and hold
                          summary report the slack for these paths. Because there is no clock associated with
                          the output port, no clock is reported for these paths. In this case, you cannot report
                          timing for these paths.
                          To report timing using clock filters for output paths with the minimum and maximum
                          delay constraints, use the set_output_delay command for the output port with a
                          value of 0 using an existing clock from the design or a virtual clock as the clock
                          reference in the set_output_delay command.
                          For the minimum and maximum delay constraints used for paths from
                          register-to-register, which are clocked by PLL generated clocks, the PLL phase shifts
                          (on the clocks that feed these registers) are not considered in the timing reports by
                          default. PrimeTime-SI only considers the absolute delay between these registers. Also,
                          frequency and board trace information with respect to the system clock are not
                          considered. You cannot use proper clock uncertainty constraints because no clock is
                          involved.
                          The following scenarios may arise in your design when specifying minimum and
                          maximum delays.
                          Specifying the Minimum and Maximum Delay for Pin-to-Register (tSU and tH )
                          In this case, you are specifying a minimum and maximum delay from a port to a
                          register for input setup and hold checks. In such cases, you are constraining the
                          maximum and minimum data arrival time without taking into account the latch clock
                          arrival time.
                          For example, consider the following constraint, assuming the PLL clock is actually a
                          10 ns clock:
                          set_max_delay 6 -from [get_ports {in_data_a*} ]
                          This constraint sets the maximum arrival time for the data signals in_data_a*
                          regardless of the arrival time of the latch clock. Therefore, the latch edge is set at 6 ns
                          and the clock is propagated based on the latch edge time.
                          Consider the following constraint:
                          set_min_delay 0.5 -from [get_ports {in_data_a*}]
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                  © July 2010    Altera Corporation
Timing Constraints                                                                                                         Page 37
                           You are setting the minimum arrival time for the data signals in_data_a* regardless
                           of the arrival time of the latch clock. In this case, the hold check latching clock from
                           the PLL is really at time 0 ns, but the minimum delay requirement is 0.5 ns. Therefore,
                           the latch edge is set at 0.5 ns and the clock is propagated based on that latch edge
                           time.
                           Specifying the Minimum and Maximum Delay for Register-to-Pin (max/min TCO )
                           In this case, you are specifying the minimum and maximum data arrival time
                           regardless of the arrival time of the latch clock for performing proper output setup
                           and hold checks.
                           Consider the following maximum delay constraint:
                           set_max_delay 8 -from [get_ports {data_out_b*}]
                           This constraint sets up the maximum arrival time for the signals data_out_b* from
                           a register to an output pin regardless of the arrival time of the latch clock. Therefore,
                           the latch edge is set at 8 ns and the latch clock is propagated based on that time.
                           Similarly, the following constraint sets up the hold check:
                           set_min_delay 0.5 -from [get_ports {data_out_b*}]
                           The preceding constraint, which holds the check latching clock from the PLL, is really
                           at time 0 ns, but the minimum delay requirement is 0.5 ns. Therefore, the latch edge is
                           set at 0.5 ns and the clock is propagated based on that latch edge time.
                           Specifying the Minimum and Maximum Delay for Register-to-Register (internal path)
                           For register-to-register paths, the minimum and maximum delay overrides the
                           natural derived setup and hold requirement between the launch and latch clocks.
                           The following are the constraints for the maximum delay:
                           set_max_delay 8 -from [get_registers {data_2_in_b_reg* }] -to
                           [get_registers {data_2_out_reg* }]
                           In this case, the default requirement is a 10 ns clock period, but the maximum delay
                           requirement is 8 ns. Clock propagation is factored in for both launch and latch paths.
                           This is more significant in inter-clock transfers.
                           The following are the constraints for the minimum delay:
                           set_min_delay 0.5 -from [get_registers {data_2_in_b_reg* }] -to
                           [get_registers {data_2_out_reg* }]
                           In this case, the default requirement is 0 ns because it is an intra-clock transfer, but the
                           minimum delay requirement is 0.5 ns. Clock propagation is factored in for both
                           launch and latch paths. This is more significant in inter-clock transfers.
© July 2010   Altera Corporation                         AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 38                                                                                                              Timing Constraints
                          For cases where you want to use set_max_delay and set_min_delay to establish
                          an I/O timing requirement (tSU , tH , tCO, and tCO-min ), you must constrain the port using
                          set_input_delay/output_delay with a virtual clock. The delay value can be 0
                          for -max/min in set_output_delay/set_input_delay because
                          set_max_delay/set_min_delay is used to override the setup and hold
                          requirement and thereby establishing the tSU, tH, tCO, and tCO-min requirement. Because
                          you set your requirement in set_max/min_delay, you do not need to specify a
                          value for the set_input_delay or set_output_delay constraint, but you still
                          must use a virtual clock to make the clock transfer be correctly identified as an I/O
                          transfer. In this way, derive_clock_uncertainty applies uncertainty correctly on
                          this path.
                 1        For core paths, you can also use multicycle or clock uncertainty constraints instead of
                          using the set_max_delay and set_min_delay constraints.
Multicycle Paths
                          By default, the TimeQuest Timing Analyzer assumes that data launched at a path
                          starting point is captured at the path end point by the next clock edge at the end point.
                          However, some paths may take multiple clock cycles from launch to capture. If you
                          correctly apply multicycle-path timing exceptions to the path, the TimeQuest Timing
                          Analyzer checks for the arrival of data at the appropriate clock edge.
                          Usage: set_multicycle_path [-h | -help] [-long_help] [-end]
                          [-fall_from <names>] [-fall_to <names>] [-from <names>] [-hold]
                          [-rise_from <names>] [-rise_to <names>] [-setup] [-start]
                          [-through <names>] [-to <names>] <value>
                          Table 8 lists the set_multicycle_path commands and their definitions.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                             © July 2010     Altera Corporation
Timing Constraints                                                                                                                             Page 39
U1 U2
datain
U1/CLK
U2/CLK
                               After specifying your multicycle paths, view them visually and examine the clock
                               edge relationships in the TimeQuest Timing Analyzer GUI to ensure they are correct.
                               Pay attention to the launch and latch clock edges, phase shifts, and clock periods
                               involved.
                               Using -start or -end makes a difference, especially with different clock periods for
                               launch and latch clocks. Use the Waveform View tool in the TimeQuest Timing
                               Analyzer GUI to assess if the correct edge relationships for setup and hold are being
                               timed.
© July 2010    Altera Corporation                                     AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 40                                                                                                Timing Constraints
                          You must analyze and constrain cross-clock domain multicycle paths—never assume
                          they are correct by default—particularly when dealing with I/O clock transfers
                          (virtual clocks) and different clock periods for launch and latch clocks.
                          Exception Priority
                          If you apply multiple exceptions to a path and there are conflicts, the question arises
                          as to which one the TimeQuest Timing Analyzer will accept. The TimeQuest Timing
                          Analyzer follows the exception priority, from highest to lowest, as follows:
                          ■    False paths
                          ■    Maximum and minimum delays
                          ■    Multicycle paths
               f          For more information about how to use these commands, refer to the Quartus II
                          TimeQuest Timing Analyzer chapter in volume 3 of the Quartus II Handbook.
The .sdc
                          Timing constraints are located in a file that is in .sdc format. Constraint files are
                          unlimited. For example, you could have one .sdc for constraining your I/Os and
                          clocks and another .sdc for clock uncertainty and yet another .sdc for setting up false
                          paths, minimum and maximum delays, and multicycle paths. Or you could have
                          .sdcs for each design partition and one .sdc for the top-level design. You can also have
                          .sdcs for slow and fast corners and for FPGA and HardCopy ASIC revisions.
                          Alternatively, you could choose to have just one .sdc for your entire design, with
                          smart Tcl scripts to manage the FPGA and HardCopy ASIC revisions. Remember to
                          add all the relevant .sdcs to the design file list in the Quartus II software.
                          In your .sdcs, add comments about how the values were obtained for the constraints.
                          Altera recommends the following .sdc structure:
                          1. Constraints for clocks.
                          2. Input and output delays.
                          3. False path, maximum and minimum delays, and multicycle paths.
                          4. Clock uncertainty constraints for the HardCopy ASIC using the Tcl construct
                             shown in Example 8.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs               © July 2010    Altera Corporation
Timing Constraints                                                                                                             Page 41
                           Example 9. Base Clocks for the HardCopy ASIC with the else Clause for the FPGA Base Clocks
                           if { $::TimeQuestInfo(family) == "HardCopy II"} {
                                   # The base clock runs faster in the HC revision
                                   set period 5
                                   set waveform {0 2.5}
                                   } else {
                                   set period 8
                                   set waveform {0 4}
                               }
                           create_clock -name iclk -period $period -waveform $waveform
© July 2010   Altera Corporation                             AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 42                                                                                            Timing Constraints
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs           © July 2010    Altera Corporation
Timing Constraints                                                                                                    Page 43
© July 2010   Altera Corporation                    AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 44                                                                                    Timing Constraints
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs   © July 2010    Altera Corporation
Timing Closure Techniques for Designs Migrating to HardCopy ASICs                                                                     Page 45
Summary
                           This section described how to constrain your design for both timing and input and
                           output loads and also described some of the commands available in the TimeQuest
                           Timing Analyzer. It offered useful tips for successful timing closure. Although it is
                           important to fully constrain your design, do not over constrain your design. If you
                           want additional guard band for your design, consider clock uncertainty constraints.
                           Remember to constrain all your inputs and outputs and take special care of signals
                           crossing clock domains. Use the report_ucp command to report a list of
                           unconstrained paths in your design.
CCLK
         ACLK
                                                               A        C                                                     CDATA
                                                               Syncronization
        ADATA                                                  Modules                             Module C
                                   Module A                                                                                   CADDR
       AADDR
                                                                                                                              CEN
          AEN
                                                                                                                              CLD
          ALD
                                                                                                    B        C
                                              A        B               Module B                     Syncronization
                                              Syncronization                                        Modules
                                              Modules
Bref_clk PLL
                                                                    BADDR         BEN
                                                                                                           Chip boundary
                                                                           BDATA
© July 2010   Altera Corporation                                  AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 46                                                                 Timing Closure Techniques for Designs Migrating to HardCopy ASICs
                          In Figure 25, synchronization modules can be either synchronizers or FIFOs. You need
                          a synchronizer or FIFO for every clock transfer between clock domains. For example,
                          one synchronizer for the transfer from the ACLK to BCLK domain and one
                          synchronizer for the transfer from the BCLK to ACLK domain. All modules have only
                          one clock except the synchronization modules, which have multiple clocks.
                          In this methodology, you can easily employ a signal naming convention. All signals
                          that do not interact with other clock domains are named so. For example, an ald
                          signal only interacts in the aclk domain.
                          All signals that cross clock domains are also properly named. For example, a signal
                          that crosses the clock domain ACLK to BCLK is named a2b_dat. An ack signal that
                          crosses from the domain BCLK to ACLK is named b2a_ack, and so on. Timing
                          analysis is simpler with this type of signal naming convention. All signals that cross
                          clock domains are easily identified and can have false paths (or clock groups) set for
                          timing analysis without trouble.
                          In addition to making timing closure easier, the advantages of design partitioning are
                          better floor planning for synthesis reduction in area, performance, and potentially
                          lower power. The synthesis tool or engine is able to do a better job because there is
                          only one clock in the module and the design can be easily optimized for area, speed,
                          or power.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                                © July 2010   Altera Corporation
HardCopy Performance Improvement                                                                                          Page 47
                f          For more information about incremental compilation, refer to the Best Practices for
                           Incremental Compilation Partitions and Floorplan Assignments and Quartus II Incremental
                           Compilation for Hierarchical and Team-Based Design chapters in volume 1 of the
                           Quartus II Handbook.
                           You may ask, if my design is well-partitioned, why do I need to floorplan the design
                           as well? Design partitions are logical entities based on the design hierarchy, whereas
                           LogicLock regions are physical placement assignments that constrain logic to a
                           rectangular region on the device. In the absence of LogicLock assignments, the Fitter
                           places the logic anywhere on the device. To control the placement of the logic from a
                           design partition and isolate it to a particular region in the device, you must assign
                           logical design partitions to a physical region in the device floorplan using LogicLock
                           assignments.
                           Floorplan location planning is very important to ensure good quality results when
                           compiling a design that migrates to a HardCopy ASIC using the full top-down
                           incremental compilation flow. Altera recommends creating a floorplan for
                           timing-critical partitions. However, you can choose not to implement floorplan
                           assignments for partitions that are not timing-critical.
                f          For more information about floorplans and LogicLock regions, refer to the Analyzing
                           and Optimizing the Design Floorplan chapter in the volume 2 of the Quartus II Handbook.
                           Performance improvement over the FPGA brings an added complexity to the timing
                           constraints. The base clocks may need to be different, as do the PLL settings. The
                           Quartus II software, together with the TimeQuest Timing Analyzer engine, makes
                           constraining your design easy. The following section describes how you can have a
                           single .sdc to analyze timing for the low-speed FPGA and HardCopy ASIC running at
                           your target performance requirement. It also describes how you can set the PLL
                           settings differently between the FPGA and the HardCopy ASIC. Finally, this section
                           describes when you cannot achieve performance improvement in the HardCopy
                           ASIC.
© July 2010   Altera Corporation                        AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 48                                                                              HardCopy Performance Improvement
                          In the preceding constraint example, the M and N counter values and the phase offsets
                          of the PLL are assumed to be identical.
                          Performance improvement almost always requires the instantiated PLLs in the FPGA
                          and HardCopy ASICs to operate using different settings. You can easily accommodate
                          different settings for the FPGA and HardCopy ASIC by manipulating the PLLs’ M and
                          N counter values. However, be aware that the revision compare can fail because the
                          tool detects different PLL settings in the FPGA and HardCopy devices.
               f          If you use the guidelines outlined in AN432: Using Different PLL Settings between
                          Stratix II and HardCopy II Devices, your design can have a significant performance
                          improvement in the HardCopy ASIC and also achieve a successful HardCopy
                          Revision Comparison report.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs               © July 2010   Altera Corporation
HardCopy Performance Improvement                                                                                             Page 49
Multi-Frequency Analysis
                           Altera and Altera’s customers are increasingly creative when it comes to using the
                           HardCopy ASIC as a production vehicle. One customer designed a HardCopy ASIC
                           that went into production on two different systems. Depending on which system the
                           board plugged into, the firmware powered-up differently—the PLL settings changed
                           by the boot code using the PLL reconfig megafunction—one board powered up at
                           200 Mhz, and another powered up at 250 Mhz. The customer wanted timing analysis
                           to be run at both frequencies and sign-off was based on both operating frequencies.
                           This was accomplished using the technique described in the previous section. The
                           following section describes two other techniques that you can use to obtain the same
                           results.
                           Figure 26 shows two base clocks to a reference clock pin of a PLL
ref_clk
                                                             pll_refclkin                                      clk0
                                                                                      PLL
                                                                                                               clk1
sys_clk
                           In this situation, define the two base clocks to a PLL input clock using the following
                           constraints:
                           create_clock -name ref_clk -period 10 -waveform {0 5}
                           [get_ports pll_refclkin]
                           create_clock -name sys_clk -period 8 -waveform {0 4} [get_ports
                           pll_refclkin] -add
                           Because the two base clocks are being defined to the same input pin (pll_refclkin)
                           of the PLL, you cannot use the derive_pll_clocks constraint because the
                           derive_pll_clocks macro cannot determine what the master clock is for the
                           generated clocks clk0, clk1, and so on.
                           Therefore, instead of using the derive_pll_clocks macro, use the
                           create_generated_clock constraint for each of the PLL-generated clocks for both
                           the base clocks with the -add option shown in Example 13.
© July 2010   Altera Corporation                           AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 50                                                                                    HardCopy Performance Improvement
                          In the preceding example, to minimize user error for the PLL-generated clocks within
                          the TimeQuest Timing Analyzer GUI, define one of the base clocks using the
                          derive_pll_clocks constraint and use the write_sdc -expand command to
                          get the generated clocks and repeat the step for the other base clock.
               f          If the PLL settings are different between the two base clocks, use the guidelines
                          outlined in AN432: Using Different PLL Settings between Stratix II and HardCopy II
                          Devices.
                          Because the two base clocks are unrelated, cut the timing paths between the different
                          base clocks and the corresponding generated clocks by using the
                          set_clock_groups -exclusive constraint.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                       © July 2010   Altera Corporation
HardCopy Performance Improvement                                                                                         Page 51
                           The reference clock of the PLL can be either inclk0 or inclk1 and is selected by the
                           clkswitch signal. Depending on your board and system requirements, you can
                           assert the clkswitch signal by the bootcode. With this feature, you do not need
                           explicitly generated clocks on the outputs of the PLL. The two base clocks are defined
                           and using the derive_pll_clocks macro takes care of the generated clocks. The
                           only constraints that you must add are the set of timing paths that have to be cut
                           using the set_clock_groups constraint.
                           Example 14 shows the set of constraints.
                f          For more information about the ALTPLL megafunction, refer to the ALTPLL
                           Megafunction User Guide.
© July 2010   Altera Corporation                       AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 52                                                                                Quartus II Software Optimizations
               f          Contact the HardCopy Design Center before using these settings to ensure that the
                          back-end tools are able to close hold time requirements. For other techniques to fit
                          difficult-to-fit designs, refer to AN 453: HardCopy II Fitting Techniques.
Figure 28 shows the Quartus II Fitter set to meet the hold time requirements.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs              © July 2010   Altera Corporation
Quartus II Software Optimizations                                                                                         Page 53
                           Figure 29 shows the Quartus II Fitter set to let the HardCopy Design Center back-end
                           tools perform the optimizations necessary to meet the hold time requirements.
Figure 29. Quartus II Fitter Settings for Fixing the Hold Time Requirements for the I/O Paths and Minimum TPD Paths Only
                           Another useful setting for getting a hard-to-route design to fit is the Placement Effort
                           Multiplier setting. Increasing the multiplier to as much as 3.0 can produce a better
                           starting placement and improve routing.
© July 2010   Altera Corporation                        AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 54                                                                                             Quartus II Software Optimizations
Figure 30. Quartus II Fitter with the Placement Effort Multiplier Set to 3.0
                 1        There is also a Routing Effort Multiplier setting. Increasing this setting increases
                          compile time and does not significantly improve routing in HardCopy designs.
                          Therefore, Altera recommends that you leave this setting at 1.0.
               f          For more information about the Quartus II Optimization settings, refer to the Area,
                          Timing and Power Optimization section in volume 2 of the Quartus II Handbook.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                           © July 2010   Altera Corporation
Quartus II Software Optimizations                                                                                              Page 55
                           ■       AN 413: Using Legacy Integrated Static Data Path and Controller Megafunction with
                                   HardCopy II Structured ASICs
                           ■       AN 463: Using ALTMEMPHY Megafunction with HardCopy II Structured ASICs
                           ■       AN 325: Interfacing RLDRAM II with Stratix II, Stratix & Stratix GX devices
                           ■       AN 326: Interfacing QDRII+ & QDRII with Stratix II, Stratix II GX, Stratix, & Stratix
                                   GX Devices
                           ■       RLDRAM II Controller MegaCore Function User Guide
                           ■       QDRII SRAM Controller MegaCore Function User Guide
                f          For more information about timing source synchronous interfaces, refer to AN 433:
                           Constraining and Analyzing Source-Synchronous Interfaces.
                f          For information about using an RGMII source synchronous interface, refer to AN 477:
                           Designing RGMII Interface with FPGA and HardCopy Devices.
© July 2010   Altera Corporation                             AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 56                                                                                      Appendix A: Design Example
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                © July 2010   Altera Corporation
Appendix A: Design Example                                                                                                   Page 57
                           3. Review the .sdcs for the FPGA device and HardCopy II ASIC. Compare the timing
                              numbers in your Worksheet and make corrections in
                              demo_design_constraints.sdc and demo_design_cu.sdc.
                                   a. Note which constraints are missing and add them. You can compile the design
                                      and review the Timing report to look for unconstrained paths.
                                   b. Note the use of the derive_pll_clocks command. Use this command
                                      instead of the create_generated_clocks command, because the
                                      derive_pll_clocks command avoids errors (typically typos) when
                                      generating the clock commands.
                                   c. The clkb_o source synchronous output clock does not need a generated clock
                                      to check timing on that interface.
                           4. Review clock uncertainty to the timing constraints in the demo_design_cu.sdc file.
                           5. Identify issues and make the appropriate changes to make the design HardCopy
                              Ready. Record these changes on the HardCopy Worksheet.
                           6. For actual customer designs, Design Assistant warnings are either waived or RTL
                              modifications are made. In general, the designer best understands the intended
                              operation of the circuitry and can make the best judgments on what design
                              structures can cause different operations of the FPGA devices versus the
                              HardCopy ASIC. For this exercise, you can wave the reset and synchronization
                              type Design Assistant warnings.
                           7. BONUS SECTION: Altera recommends the alt_pll_reconfig PLL wrapper
                              for HardCopy ASIC designs. Add this wrapper around your PLLs. For this
                              exercise, bond the pins out of these blocks (there are two PLLs) to the primary I/O.
                              Normally, customers map the PLL reconfiguration register space into their CPU
                              interface configuration registers (or whatever means they use at the system level to
                              configure their design).
                           8. BONUS SECTION: You will find that the FPGA device does not meet
                              performance. This makes the design a candidate for HardCopy II performance
                              improvement. To allow the FPGA device and HardCopy II ASIC to meet timing,
                              you can slow the clock down for the FPGA device and keep the HardCopy II clock
                              speed the same, but maintain two different PLL settings.
                                   f      The reference for this flow is in AN 432: Using Different PLL Settings
                                          Between Stratix II and HardCopy II Devices.
© July 2010   Altera Corporation                           AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 58                                                                                                       Appendix A: Design Example
                                                                                       CLK
                                                                                       Source
20 MHz
                                                                                             wb_clk
                                                                                             wb_rst
                                                                                             wb_adr
wb_dat
ref_clk wb_we
addr_read wb_stb
data_a wb_cyc
                                          data_b                                             wb_sel
                                          addr                                               srx_pad
                                          rst                                                cts_pad
              ASSP 1                                            Demo_design                  dsr_pad
                                                                                                                  UART
                                                                                             ri_pad
                                           data                                              dcd_pad
                                         div_reg
                                                                                             wb_dat
wb_ack
                                                                                                int
                in_clk
                                                                                             stx_pad
                                                                                             rts_pad
                                                                                             dtr_pad
clkb
                                                                                              data_demo2
                                                                   50 MHz
                                                                                    clkb2
                                                                                                                  ASSP 2
                                                                         CLK
                 50 MHz                                                  Source
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                                 © July 2010   Altera Corporation
Appendix A: Design Example                                                                                                             Page 59
© July 2010     Altera Corporation                                  AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 60                                                                                          Demo Design Walkthrough
                          Input delays:
                          ■    set_input_delaymax = boardmax + Tcomax - clockmin (external
                               device > FPGA [or HCII)])
                          ■    set_input_delaymin = boardmin + Tcomin - clockmax (external
                               device > FPGA [or HCII])
                          Board Delay:
                          In Table 9 on page 59, the board delay specified in row two is as follows:
                          All data signals have 2 +/- 0.25 ns board delay from source to destination
                          This means that Boardmax = 2.25 ns and Boardmin = 1.75 ns
                          Clock Delay:
                          For setup, consider the earliest clock; for hold, consider the latest clock.
                          The board has a delay of 1 ns for the clock. The TCOMAX for ref_clk is 0.5 ns; the
                          TCOMIN for ref_clk is -0.5 ns.
                          Therefore, Clockmin = 1.0 - 0.5 = 0.5 ns and Clockmax = 1.0 + 0.5 = 1.5 ns.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                  © July 2010   Altera Corporation
Demo Design Walkthrough                                                                                                        Page 61
                           Output Delays
                           set_output_delaymax = boardmax + Tsu -clockmin(FPGA [or HCII] >
                           external device)
                           set_output_delaymin = boardmin - Th - clockmax(FPGA [or HCII] >
                           external device)
                           Board Delay
                           In Table 9 on page 59, the board delay specified in row two is as follows:
                           ■       All data signals have 2 +/- 0.25 ns board delay from source to destination
                           ■       This means that Boardmax = 2.25 ns and Boardmin = 1.75 ns
                           Clock Delay
                           The clock delay for the outputs can be difficult. In Figure 31 on page 58, the outputs
                           from the FPGA to ASSP1, data, and div_reg, have no reference clock. These outputs
                           are referenced with respect to ref_clk. The question remains, what should the
                           values for Clockmax and Clockmin be set to?
© July 2010   Altera Corporation                             AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 62                                                                                       Demo Design Walkthrough
                          The answer is simple. For setup, consider the worst-case arrival clock; for hold,
                          consider the best-case arrival of clock.
                          Clockmin = 1 - (-0.5) = 1.5 ns
                          Clockmax = 1 - 0.5 = 0.5 ns
                          ref_clk is from ASSP1 to FPGA (or HCII); therefore, the output delay equation is
                          changed as follows:
                          ■    For the data signal:
                               set_output_delaymax = boardmax + Tsu + clockmin                   = 2.25 + 5 +
                               1.5 = 8.75 ns
                               set_output_delaymin = boardmin - Th + clockmax = 1.75 - 1.0 +
                               0.5 = 1.25 ns
                          ■    For div_reg:
                               set_output_delaymax = boardmax + Tsu + clockmin                   = 2.25 + 7 +
                               1.5 = 10.75 ns
                               set_output_delaymin = boardmin - Th -clockmax = 1.75 - 0.0 +
                               0.5 = 2.25 ns
                          Enter the above values in Table 9 on page 59.
                          The constraints for the output pins are as follows:
                               set_output_delay -max -clock virtual_ref_clk_i 8.75
                               [get_ports {data_o*}]
                               set_output_delay -min -clock virtual_ref_clk_i 1.25
                               [get_ports {data_o*}]
                               set_output_delay -max -clock virtual_ref_clk_i 10.75
                               [get_ports {div_reg_o*}]
                               set_output_delay -min -clock virtual_ref_clk_i 2.25
                               [get_ports {div_reg_o*}]
                          FPGA (or HCII) > ASSP2
                          Again, the out delay equation is as follows:
                               set_output_delaymax = boardmax + Tsu - clockmin(FPGA [or
                               HCII] > external device)
                               set_output_delaymin = boardmin - Th - clockmax(FPGA [or HCII]
                               > external device)
                          Board Delay
                          In Table 9 on page 59, the board delay specified in row two is as follows:
                          ■    All data signals have 2 +/- 0.25 ns board delay from source to destination
                          ■    This means that Boardmax = 2.25 ns and Boardmin = 1.75 ns
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs               © July 2010   Altera Corporation
Demo Design Walkthrough                                                                                                      Page 63
                            Clock Delay
                            For setup, consider the earliest clock; for hold, consider the latest clock.
                            The board has a delay of 1 ns for the clock.
                            Therefore, Clockmin = 1.0 = 0.5 ns and Clockmax = 1.0 ns.
                            set_output_delaymax = boardmax + Tsu + clockmin                                = 2.25 + 4 -
                            1.0 = 5.25 ns
                            set_output_delaymin = boardmin - Th + clockmax = 1.75 - 1.0 -
                            1.0 = -0.25 ns
                            Enter the results in Table 9 on page 59.
                            The constraints for the output pins are as follows:
                            set_output_delay -max -clock clkb_o 5.25 [get_ports
                            {data_demo2_o*}]
                            set_output_delay -min -clock clkb_o -0.25 [get_ports
                            {data_demo2_o*}]
                            Calculate the input and output delays for the rest of the pins and enter them in Table 9
                            on page 59. Create the command for the constraints as you calculate them.
                            Table 10 lists the calculated values. Cross-check your results with this table to confirm
                            they are correct.
Table 10. Final Timing Constraints After System Timing Review (Note 1), (2), (3), (4) (Part 1 of 2)
                                                                      FPGA and HardCopy II ASIC Timing Specification
 Timing Specifications for the Interfaces                                           SDC Constraint
© July 2010   Altera Corporation                          AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 64                                                                                                             Demo Design Walkthrough
Table 10. Final Timing Constraints After System Timing Review (Note 1), (2), (3), (4) (Part 2 of 2)
                                                                                FPGA and HardCopy II ASIC Timing Specification
 Timing Specifications for the Interfaces                                                     SDC Constraint
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                                     © July 2010   Altera Corporation
Demo Design Walkthrough                                                                                              Page 65
© July 2010   Altera Corporation                   AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 66                                                                           Demo Design Walkthrough
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs   © July 2010   Altera Corporation
Demo Design Walkthrough                                                                                              Page 67
######################
# Demo Design ' ASSP2
######################
© July 2010   Altera Corporation                   AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 68                                                                             Demo Design Walkthrough
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs     © July 2010   Altera Corporation
Demo Design Walkthrough                                                                                                     Page 69
© July 2010   Altera Corporation                          AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 70                                                                                       Demo Design Walkthrough
                 1        Pay special attention to where you place your clock pins. For maximum performance,
                          place the clock pins on dedicated clock I/Os.
                          4. Under device settings (go to Assignments, then Device), set the drive strengths.
                             Review the guidelines about how to handle unused pins. The tool automatically
                             defaults unused pins as inputs, tri-stated, with weak pull-ups. By default, the
                             drive strength is set to 24 mA. You may need to change this value based on your
                             board’s signal integrity (SI) requirements.
                          5. Open the HardCopy II Advisor and correct the recommended settings. Use the
                             HardCopy II Advisor for compiling the FPGA and HardCopy II revisions
                             (Figure 32).
                          6. As you go through the flow, review the reports (Synthesis, Fitter, Timing, and
                             Design Assistant). Mark your observations in the sample HardCopy Design
                             Review Document.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs               © July 2010   Altera Corporation
Demo Design Walkthrough                                                                                                  Page 71
                           Figure 32 shows the HardCopy II Advisor before correcting the settings. To make the
                           required correction, click Correct the Settings.
                           After you make the recommended changes for the FPGA revision, the HardCopy II
                           Advisor reflects the changes, as shown in Figure 33.
© July 2010   Altera Corporation                       AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 72                                                                                        Demo Design Walkthrough
For example, during synthesis, you can ignore the messages shown in Example 17.
                          You can suppress these messages using the message suppression feature in the
                          Quartus II software. To suppress these types of messages, right click on the message,
                          and click Suppress, then click Suppress Similar messages.
                          Example 18 shows a critical warning that needs immediate attention:
                          This critical warning has been issued because, for HardCopy Series Devices, memory
                          initialization is not supported. The solution to this problem is to remove memory
                          initialization.
                          Go through all the warning and critical warnings and note them in the Sample
                          HardCopy Design Review Document. For your design to be HardCopy Ready, you
                          must review all of the warnings and they must be either fixed or waived.
                          After you have gone through the Synthesis report, go through the Fitter report. Look
                          for resource utilization and fan-outs that might affect performance. Look for warnings
                          about pin placement, non-global high fan-out nets that can be promoted to global
                          resources, and other areas in the Resource section of the Fitter. Example 19 shows an
                          sample warning message in the Fitter report that you must resolve.
                          The warning message is generated because the pins have not been assigned and the
                          Fitter has automatically assigned them. Use the Pin Planner and assign the pins to
                          match the board requirements.
                          Under the Resource section, review the non-global high fan-out nets and see if you
                          can promote any of them to the global network. In this design, the resets are good
                          candidates for global signal promotion.
                          Next, review the Timing report to see if you can make any improvements to the
                          design. In this design, timing analysis fails due to a long divider path. A possible
                          solution is to relax the timing requirement on this path, which results in decreased
                          performance. The other possible solution is to redesign this module or add pipeline
                          stages. Adding pipeline stages is a good choice.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                © July 2010   Altera Corporation
Demo Design Walkthrough                                                                                                  Page 73
Critical Warning: (High) Rule D103: Data bits are not correctly synchronized when
transferred between asynchronous clock domains. Found 2 asynchronous clock domain
interface structure(s) related to this rule.
Warning: (Medium) Rule R102: External reset should be synchronized using two cascaded
registers. Found 2 node(s) related to this rule.
                           Review these messages and take the necessary corrective action. For example, for the
                           reset related warning, you can easily add synchronization registers.
                           After taking the necessary corrective actions, recompile the FPGA.
                           After successfully recompiling the FPGA revision, follow the steps in the HardCopy
                           Advisor and create the HardCopy II companion revision.
                  1        Compile the HardCopy II revision while the FPGA device is still being verified to
                           ensure the design actually fits in the targeted HardCopy II ASIC. If your design
                           appears not to fit, refer to AN 453: HardCopy II Fitting Techniques.
© July 2010   Altera Corporation                       AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 74                                                                        Sample HardCopy Design Review Document
                 1        If you have followed the guidelines described in the previous section, some of the
                          warnings and observations may not be applicable in the HardCopy Design Review
                          Document. The Design Review Document is representative of what a typical design
                          review looks like when a design is reviewed by the HardCopy Design Center. In real
                          designs, the Design Review Document is completed by one of the engineers at
                          Altera’s HardCopy Design Center.
                          Customer: Altera
                          Customer Engineer Name: Altera Engineer1
                          Design Top Level Module: demo_design
                          Date: 8/15/2008
                          Altera FAE:
                          Meeting Attendees:
                          FPGA: EP2S30F484C4
                          HardCopy Device: HC210F484
                          Estimated DR1 Date: March 2007
                          Estimated DR2 Date: July 2007
                          Synthesis / Analyzer Warnings: This design has many synthesis and analyzer
                          warnings. Here are some examples:
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs               © July 2010   Altera Corporation
Sample HardCopy Design Review Document                                                                                      Page 75
                           Memory MIF files: The RAM: ram_inst1 included a RAM implied through the ram.v
                           file. This was removed so that HCII compile could proceed. Check with designer if
                           removal of MIF file is okay.
PLL # used: 2 out of 4 PLLs were used: 2 enhanced - PLL_5 and PLL_6.
                           PLL Counters: M counters are 12 and 14. charge pump current is >100 uA (good for
                           low static phase error).
                           PLL Compensation Mode: Normal mode - for removal of clock insertion. No issue.
                           PLL Reconfig: This has not been added. Design should add the PLL reconfig blocks on
                           both PLLs. Consult with designer when PLL reconfig can be added if if this can be
                           verified in FPGA prototype prior to DR2.
© July 2010   Altera Corporation                          AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 76                                                                         Sample HardCopy Design Review Document
                          FPGA versus ASIC constraints: ASIC style using SDC and TQ. Some of the values
                          look wrong. Check the values in the demo_design_constraints.sdc against the
                          specification.
                          Ran fast model timing with corrected timing constraints and see the following failing
                          paths:
                          FPGA -
                          Slow Model - Fails divider paths by a lot. WC negative slack is -12.726 ns. This means
                          the designer should run this clock domain slower in the FPGA or pipeline/rearchitect
                          the divider.
                          There are also failures in the source synchronous output domain clkb_o. This fails by
                          -0.942 ns.
                          Fast Model - All paths work. Will need to change phase shift on clkb_o to center the
                          output window.
                          HCII -
                          Slow Model - Divider paths and all other core paths work. The IO setup path that
                          failed in the FPGA works in the HCII device since paths tend to speed up in HCII.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                © July 2010   Altera Corporation
Sample HardCopy Design Review Document                                                                                     Page 77
                           Fast Model - There are hold time violations on paths within the same clock domain:
                           PLL2:clk0
                           PLL Clock Uncertainty Spreadsheet: Was run but numbers need a review. Missing
                           some clock domain transfers in the demo_design_cu.sdc file.
                           DDR: None
                           Mhz: __________________________________________________________________
                           Number of interfaces: ____________________________________________________
                           Width of interface: _______________________________________________________
                           # PLLs per Interface: _____________________________________________________
                           PLL reconfig: ___________________________________________________________
                           DTW Knowledge: ________________________________________________________
                           DLL Disable During Reads: _______________________________________________
                           DLL Reconfig: __________________________________________________________
                           PLL Reconfig: Needs to be added to both PLLs.
                           Design Assistant: Was not originally enabled. After turning this feature on, the
                           following types of violations were introduced:
                           1. D101: Data bits are not correctly synchronized when transferred between
                              asynchronous clock domains.
                           2. Rule D103: Data bits are not correctly synchronized when transferred between
                              asynchronous clock domains.
                           3. Rule R102: External reset should be synchronized using two cascaded registers.
                           4. Rule D102: Multiple data bits that are transferred across asynchronous clock
                              domains are synchronized, but not all bits may be aligned in the receiving clock
                              domain.
                           The above design assistant warnings need review with the designer to see if they can
                           be waived or should be changed in the demo_design.
                           AIs / Comments:
                           1. The design contained a RAM with memory initialization specified. This is not
                              supported in HardCopy. Modify ram.v to remove the memory MIF file reference.
                           2. The HardCopy II companion device was specified in the device setting but the
                              HCII fitter was not run since the memory initialization file was there. After
                              removing the MIF file, the design successfully compiled.
© July 2010   Altera Corporation                         AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs
Page 78                                                                         Sample HardCopy Design Review Document
Summary
                          This section described the FPGA compile and steps that must be taken to make the
                          migration to the HardCopy Series Device a success. The section outlined timing
                          constraints, setting up the FPGA and HardCopy II revisions in the Quartus II Design
                          software, and achieving timing closure in both revisions. Also reviewed was the need
                          to pay extra attention to the various warning messages and noting them in the
                          HardCopy Worksheet. Some of these warnings require the designer to review them
                          and make the necessary changes to the design or waive them.
AN 545: Design Guidelines and Timing Closure Techniques for HardCopy ASICs                © July 2010   Altera Corporation
Document Revision History
                              Copyright © 2010 Altera Corporation. All rights reserved. Altera, The Programmable Solutions Company, the stylized
                              Altera logo, specific device designations, and all other words and logos that are identified as trademarks and/or service
                              marks are, unless noted otherwise, the trademarks and service marks of Altera Corporation in the U.S. and other
                              countries. All other product or service names are the property of their respective holders. Altera products are protected
101 Innovation Drive          under numerous U.S. and foreign patents and pending applications, maskwork rights, and copyrights. Altera warrants
San Jose, CA 95134            performance of its semiconductor products to current specifications in accordance with Altera's standard warranty,
www.altera.com                but reserves the right to make changes to any products and services at any time without notice. Altera assumes no
Technical Support             responsibility or liability arising out of the application or use of any information, product, or service
www.altera.com/support        described herein except as expressly agreed to in writing by Altera Corporation. Altera customers are
                              advised to obtain the latest version of device specifications before relying on any published
                              information and before placing orders for products or services .