Pages

Search Here

Showing posts with label Digital Design. Show all posts
Showing posts with label Digital Design. Show all posts

Setup and Hold times

Many designers are familiar with setup and hold time definitions - however, few can identify correctly the launch and capture edges and the slack/violation between two flops during timing analysis. In this post, we will cover setup/hold times in a design with clear examples.

Setup time is defined as the minimum amount of time BEFORE the clock’s active edge by which the data must be stable for it to be latched correctly. Any violation in this minimum required time causes incorrect data to be captured and is known as setup violation.

Hold time is defined as the minimum amount of time AFTER the clock’s active edge during which the data must be stable. Any violation in this required time causes incorrect data to be latched and is known as hold violation.

The setup time in a design determines the maximum frequency at which the chip can run without any timing failures. Factors affecting the setup analysis are the clock period Tclk, Clock to Q propagation delay of the launch flop Tck->q, negative clock skew Tskew, required setup time of the capture flop Tfs and combinational logic delay Tcomb between the two flops being timed. The following condition must be satisfied.

Tfs <= Tclk – Tck->q – Tskew – Tcomb


Hold analysis depends on the Tck->q, combinational logic delay, the clock skew and the hold time requirement Tfh of the capture flop. It is independent of the frequency of the clock. The condition below must be satisfied.

Tck->q + Tskew + Tcomb >= Tfh



Consider the figure below depicting a flop to flop path in the same domain with some combinational logic between them. We will now calculate the setup and hold time slacks in the design based on the given timing parameters.


 Setup and Hold time illustration - Full cycle transfer




For setup checks in single cycle paths, the clock edges that are relevant is shown in the Figure above. The data required time for the capture flop B to meet setup is



Data Required time = (Clock Period + Clock Insertion Delay + Clock Skew - Setup time of the flop) = 8 + 2 + 0.25 -0.1 = 10.15 ns

The data arrival time from the launch flop is



Data Arrival time = (Clock Insertion Delay + CK->Q Delay of the launch flop + Combinational logic Delay) = 2 + 0.1 + 5 = 7.1 ns.



Setup slack is



Setup Margin = Data Required Time - Data Arrival Time = 10.15 - 7.10 = 3.05 ns



Similarly for hold checks assuming the hold time requirement of the flop B is 100 ps, the data expected time is



Data expected time = (Clock Insertion Delay + Clock skew + Hold time requirement of flop) = 2 + 0.25 +0.1 = 2.35 ns.



So the hold time slack is



Hold Margin = Data Arrival time - Data expected time = 7.10 - 2.35 = 4.85 ns



Consider the case where the clock to flop B is inverted (or that the flop is negative edge trigerred). In this particular case, the relevant edges for setup/hold are as shown in the figure below.






Setup and Hold time illustration - Half cycle transfer


In this scenario, the setup margin considering all the other parameters to be the same is



Data Required time = (half_clock_period + clock insertion delay + Ck->Q delay of flop A - Setup time required for flop B) = 4 + 2 + 0.25 -0.1 = 6.15 ns


Since the Data Arrival time remains the same, there is a setup violation of


Setup violation = 6.15 ns - 7.10 ns = -1.05 ns



There is no hold violation since the data arrival time remains the time but the data expected time is any time after (Clock skew + Hold time requirement of flop B)


Data expected time = 0.25 + 0.1 = 0.35 ns



Hold Margin = 7.10 - 0.35 = 6.75 ns




Estimating power in FPGA designs

In simpler times, FPGA power consumption was a simpler issue. In the traditional applications of high-capacity FPGAs, such as expensive network routers, telecommunications switching gear, and prototype boards for ASIC designs, all you needed to know was how much peak power the FPGA could consume and how to provide cooling for its operating appetites. Today, the world is different. “Previously, FPGAs were not a serious alternative for production,” says Rahul Shah, director of customer solutions at design-services vendor eInfochips. “But with shorter life spans for products and more emphasis on time to market, we are seeing customers want to go into production with FPGAs. So, more focus is now going onto the power consumed in the FPGA.”
Facing tight enclosures with minimal cooling, tight budgets, and sometimes even battery power, designers must be able to get accurate power estimates on their FPGA designs early in the design cycle. They must be able to refine those estimates throughout the cycle so that they can apply aggressive power-management techniques (Figure 1). And they must be able to accurately measure the power of the resulting design. As it turns out, none of these requirements is trivial.

Early estimation

Ideally, design teams could begin to explore the power-consumption implications of their designs from the beginning, when they are formulating the design requirements and exploring algorithms. No widely used tools are available, however, for estimating power consumption from a set of design requirements or even from an algorithm. So, when the members of a design team have the most leverage over power consumption, they are flying nearly blind. Only experience with similar applications is there to guide them. “Our engagement with power issues begins at the specification stage,” says Raj Kothandaraman, lead FPGA designer at Wipro Technologies. The company built up an internal design method with an emphasis on power management. Through that method, design teams accumulate data—vital to early power estimates—on switching activity for various kinds of structures. Such history can give the design team some qualitative idea of the implications of the design requirements and even the power costs of algorithm decisions.

Shah describes a similar dependence on experience. “You define the power budget early, considering things you can know early, such as voltage levels, input-data characteristics, and the major functional blocks in the proposed system,” he says. “Often, we will look at static power first since it is less sensitive to detailed information that we won't have early in the design. Then, as we understand more about the design, we will begin estimating dynamic power, and, finally, we will begin to estimate the impact of power-saving strategies. There are no formal tools for this estimation process. So we have to rely on data-sheet information, spreadsheets, and our own experience with FPGAs.”

These early estimates are necessarily vague because much of the information necessary for an accurate estimate—detailed toggle-rate information, actual data flows, routing loads, and power-management features, for instance—doesn't yet exist. But it is still necessary to have a conservative estimate of the final system. Mike Morgan, principal design engineer at design shop North Pole Engineering, points out that the customer's decision to use an FPGA in the first place often results from a tight design schedule. That same pressure demands that the board design start concurrently with the FPGA design. And the board design, early on, needs estimated power. “In general, when I start a PCB [printed-circuit-board] design centered around a Xilinx device, I conservatively estimate power consumption and design or specify power supplies, distribution, and heat dissipation based on this [estimation],” he says.

Refining the estimates

As the design progresses from algorithms through definition of blocks and on to the beginnings of implementation, the design team gets more specific data about signals, toggle rates, and the structure of the blocks. At this point, still long before freezing the RTL (register-transfer-level) logic, design teams begin to use vendor-supplied power-estimation tools to improve the accuracy of their power estimates. “Tools from the FPGA vendor—typically, Excel spreadsheets—become important,” Kothandaraman says. These tools can absorb huge amounts of information about the design. For example, Ian Milton, a member of the technical staff at Altera, says that the company's Early Power Estimator allows designers to enter activity levels on registers, clock frequencies, enable-pin duty cycles, block-RAM configurations, read/write duty cycles, statistical characteristics of input signals, estimates of the number of logic elements in a block, and so on.

For the most part, vendors have designed these spreadsheets so that design teams can enter architectural information early, leave many of the inputs at default settings, and get a crude estimate of power. As the team learns more about the design, they can replace more of the defaults with design data, refining the power estimate. “We try to encourage people to use the default settings early on,” Milton says. The reason for relying on the defaults is that the vendors have built what amount to intelligent systems into those default settings, deriving defaults from actual measurements of large numbers of designs. For example, Altera's tool estimates how many of the nets in a design will have critical timing and how many will have timing slack and, employing that estimate, determines how many logic cells will be in high-performance mode and how many will be in low-leakage mode.

Even with the defaults, though, the design team still has to understand a great deal about the behavior—rather than the implementation—of the design to get the best estimate. “We look at input-data patterns,” says eInfochips' Shah. “From there, we look at clock-tree power. Then, we ask whether the inputs are going into a datapath or a control path and try to understand what that [placement] implies about the activity levels inside. There are no predefined calculations that will tell you these things. You have to rely on experience and methodology. You try to institutionalize the knowledge you gain from each new design by creating templates and processes. Unfortunately, the vendors have not defined a clear methodology for doing a power-aware design, so every design team around the world is doing this job in its own way.”

Wipro's Kothandaraman agrees that one of the most powerful weapons for using the early-estimate spreadsheets is experience. “For instance, we have estimates for I/O activity based on previous designs in the same application area,” he says. “That [information] is a great help in estimating the final power.”

The accuracy of these early estimates is an interesting issue. “These tools have really improved recently,” Kothandaraman says. “Years ago, there were lots of correlation problems with the tool results. But today, you can expect your early estimates to be within 20 or 30 percent of the final power consumption.”

Shah agrees. “Vendors are becoming more sensitive to power issues,” he says. “They are providing more accurate models and more Webinars on how to use the tools; this estimation process was not so accurate before.”

But Kothandaraman warns that the design process has a way of undermining its own power estimates. “As we go along, we tend to add more logic to the design,” he says. “That [tendency] kills our early power estimates.”

As the tools improve, the problems are getting more complex. A modern FPGA has multiple power rails, including core, auxiliary, I/O, and analog rails. All these rails are important in the analysis of parts, according to Jatinder Singh, an application engineer at Lattice Semiconductor. Each of these rails may be operating at a different voltage, and there may be two or more I/O voltages. Some devices may have separate core-power rails that you can shut down independently, and each of these power rails may respond to a different measure of activity. So the early-estimate spreadsheets must be explicit about separating activity in the logic fabric from I/O activity, monitoring SERDES (serializer/deserializer) activity as a separate issue, and so on. Further, the growing plethora of embedded functions in modern FPGAs adds complications. Estimates must encompass the configuration of and activity on DSP blocks and block RAMs, for instance.

Final estimates

As the design team creates RTL logic, the inputs to the spreadsheet estimators can become more precise. Once there is enough logic to perform simulation, however, a new category of vendor tool becomes available: the power analyzer.

These tools work in a fundamentally different way from spreadsheet estimators. “Once you have good RTL, you can synthesize and map the design,” says Altera's Milton. “Then, you can run a simulation and extract a value-change dump. This [step] will provide actual toggle rates on every node in a block.” A power analyzer reads this data, combines it with the mapping files that indicate the actual LUT (look-up-table) and routing-segment configuration at each node, and produces power calculations that, in principle, are as accurate as the vendor's device models. “The tools know things the customer couldn't know, such as the actual wire segments the mapping tool used to connect two logic elements,” Milton says. “And the tools understand the differences between FPGAs and ASICs. For example, in an ASIC, if you have an AND gate with one input low, there is no significant activity in the gate; the output is low. But, in an FPGA, the output buffer will stay low, but there is significant power-consuming activity within the LUT. Every change in the active input is causing, in effect, a read cycle in a little RAM.”

Power analyzers should be the last word in estimating the power consumption of an FPGA design. Accuracy is a two-edged sword, however. If you put in the wrong input data, you get precisely wrong results. One problem is trying to employ too precise a tool too early, according to eInfochips' Shah. “Don't update your power estimates with incomplete RTL,” he says. “That remaining few [percentage points] of the RTL may turn out to consume 30 percent of the power.”

Also, Shah warns that seemingly small changes to the RTL can make big changes in power consumption. “FPGA mapping is not as deterministic as ASIC layout,” he says. “Routing depends on the remaining resources in the device. If you are filling up the FPGA, you may find that LUTs that are connected to each other are nowhere near adjacent to each other.” Increased distance would increase power dissipation for each toggle of signals passing between the LUTs.

Wipro's Kothandaraman also counsels caution. “The power-analyzer tools do not always improve our understanding of the power consumption of our design,” he says. “Partly, this [drawback] is because we keep adding logic until late in the design. Also, the tools don't always do the most powerful job of processing the simulation dumps. And the value of the predictions depends on the value of the simulation scenarios you choose to run. But there are many operating modes in a modern FPGA design. It is a big challenge to generate vectors that will actually stimulate worst-case toggle rates.” On this last point, Kothandaraman says that Wipro is trying to establish a feedback loop within its design teams to capture experience in creating vectors for power estimation. But that work is still in progress.

The company knows from experience what worst-case traffic patterns should be for memory activity in networking equipment, for instance. In applications such as media processors or set-top boxes, however, identifying a worst-case video clip may take a major simulation effort all by itself. Kothandaraman adds that it is important to study not just logic-fabric activity, but also what's going on in the other parts of the FPGA. In both media and networking applications, memory blocks and SERDES may be more important to the power consumption than the logic fabric itself.

Another increasingly important variable comes from the fact that many system-in-FPGA designs now include microprocessor cores. This fact makes the power scenarios depend not only on the RTL logic, the mapping, and the vectors, but also on the firmware. Just as the hardware design team is freezing RTL logic and trying to pin down power data, the software team may be just getting working silicon and entering their period of highest rate of change for the firmware, with huge implications for power. The bottom line, according to Kothandaraman, is that you must make careful use of power-analysis tools. He warns that the early-estimation tools may end up giving you more accurate results than the analysis tools do.

Measuring the results

One big advantage of FPGAs is that, in the case of any uncertainly, you can always program up a part, drop it into a prototyping board, and see what it does. In the case of FPGA-power measurement, however, this problem is far from trivial. In part, measuring FPGA power is complicated because there are so many power rails and pins. In practice, the multiplicity of pins per rail means you have to measure voltage and current closer to the regulator, rather than closer to the chip, risking errors on high-current transients. It helps that most FPGA vendors provide access for current probes on their evaluation boards (Figure 2).

A more serious problem is that FPGA power-rail current tends to be dynamic. “As you move to finer geometries, the inrush current when you first apply power to an FPGA is often greater than the steady-state current,” says Lattice's Singh. “You must characterize SRAM-based FPGAs in three sections—inrush, initialization, and programming—in addition to steady-state current.”

Kothandaraman describes another problem. “On some devices, there is also a current pulse between the programming and operating modes,” he says.

North Pole's Morgan reports similar experience. “Once we have a prototype, power demands are one of many items we verify as part of the design-verification process,” he says. “We are most concerned with identifying the peak current demand [and] peak inrush and reporting the observed peak and average operating quiescent currents to ensure that our power supplies and dc/dc converters are operating optimally, traces and power vias are appropriately sized, junction temperatures do not exceed data-sheet specifications, and so on.” As Morgan points out, the dynamics on the power pins create their own measurement problems. Sudden bursts of activity in a highly parallel structure within the core or sudden bursts of memory traffic may produce narrow current spikes. These spikes may not contribute much to rms (root/mean/square) power, but they can fry metal on advanced-geometry FPGAs. The spikes also cause IR drops, which the decoupling-capacitor network needs to handle.

The problem is not getting any simpler. Vendors are making available more sophisticated power-management techniques, including clock gating, reduced-voltage operation, and some degree of power gating. According to one source, National Semiconductor is working with some FPGA designs to apply dynamic voltage-frequency scaling to the core-logic fabric of an FPGA, claiming that it is possible to achieve a 30 to 40 percent reduction in power in this way. Each of these techniques makes the problem of estimating—and measuring—power that much harder. Shah says that eInfochips often manipulates the configuration of FPGAs in the prototype, attempting to isolate a functional block and get an accurate power measurement on it. “This is an interesting problem,” he says. “Measuring power is a bit challenging on the board.”

Estimating and measuring FPGA power is a difficult problem. Design teams need early worst-case estimates and accurate data throughout the design to make decisions on power-management strategies. When they are done, they also need to know what they've accomplished. We can expect vendor tools to improve, but it may be deep experience in an application and with an FPGA architecture that ends up making the most difference.

Design of VLSI Systems


Hai friends here i attached the links for the detailed description of following subjects
please go through the links

For direct link to 'Table of contents' please clik here

For publications click here


Clocking Strategies in VLSI Systems


Clock - key to synchronous systems

  • Clocks help the design of FSM where outputs depend on both input and previous states.
  • Clock signals provide reference points in time - define what is previous state, current state and  next state:



Latch vs Flip-Flop




Clock for timing synchronization

Clocks serve to slow down signals that are too fast
  1. Flip-flops / latches act as barriers
  2. With a latch, a signal can’t propagate through until the clock is high
  3. With a Flip-flop, the signal only propagates through on the rising edge
  4. All real flip-flops consist of two latch like elements (master and slave latch)




Latch Timing Parameters




Flip-flop Timing Parameters




Typical Clock System




Clocking Overhead

  • Latches and flops slow down the slow signals
  • Flip-flop delays the slowest signal by the setup + clk-q delay
  • Latches delay the late arriving signals by the delay through the latch




Problem of Clock Skew

  • Not all clocks arrive at the same time
  • Some clocks might be gated (ANDed with a control signal) or buffered There is an RC delay associated with clock wire



Clock Skew and Jitter

Clock skew
  • Spatial variation in temporally equivalent clock edges; deterministic + random, tSK

Clock jitter
  • Temporal variations in consecutive edges of the clock signal; modulation +random noise - Cycle-to-cycle (short-term) tJS Long term tJL
Both skew and jitter affect the effective cycle time

Only skew affects the race margin





Longest Logic Path - Edge Triggered

Unger and Tran, Trans. On Comp. 10/86





Shortest Path Constraint

If launching edge is early and receiving edge is late:




Clocking Strategies

  • Trade off between overhead / robustness / complexity
  • Constraints on the logic vs. Constraints on the clocks
  • Look at a number of different clocking methods:
  1. Pulse mode clocking
  2. Edge triggered clocking
  3. Two phase clocking
  4. Single phase clocking
  • We will only look at system level strategy - consider clocked circuits in the next lecture

Pulse Mode Clocking

Two requirements:
  1. All loops of logic are broken by a single latch
  2. The clock is a narrow pulse
It must be shorter than the shortest path through the logic



Timing Requirements


  • Used in the original Cray computers (ECL machines)

  • Advantage is it has a very small clocking overhead
  1. One latch delay added to cycle

  • Leads to double sided timing constraints
  1. If logic is too slow OR too fast, the system will fail

  • Pulse width is critical
  1. Hard to maintain narrow pulses through inverter chains

  • People are starting to use this type of clocking for MOS circuits
  1. Pulse generation is done in each latch.
  2. Clock distributed is 50% duty cycle
  3. CAD tools check min delay

  • Not a good clocking strategy for a beginning designer


Edge Trigger Flip-flop

  • Popular TTL design style
  • Used in many ASIC designs (Gate Arrays and Std Cells)
  • Using a single clock, but replaces latches with flip-flops


  • Timing Constraints



  • If skew is large enough, still have two sided timing constraints


Two phase clocking


Use different edges for latching the data and changing the output





There are 4 different time periods, all under user control:
  • Φ1 high
  • Φ1 falling to Φ2 rising
  • Φ2 high
  • Φ2 falling to Φ1 rising

Look at shift register again:

  1. If there is a large skew on the Φ2x clock, then the spacing between Φ1 and Φ2
  2. can be increased to make sure that even with the skew, the Φ2 latch closes 
  3. before the Φ1 latch lets the new data pass.
  4. For some setting of the timing of the clock edges, the circuit will work!




Stable signal type

  • We will give signals timing types, so it will be easier to know which latchto use:
  • Output of a Φ1 latch is stable Φ2 (_s2) – good input to Φ2 latch
  • Output of a Φ2 latch is stable Φ1 (_s1) – good input to Φ1 latch
  • Signal is called stable2, since it is stable for the entire Φ2 period




General two phase system

  • Combination logic does not change the value of timing types.
  • No static feedback in the combination logic is allowed either. This makes the system not sensitive to logic glitches.




Why two phase clocking?

It is a constrained clocking style:
  • Synchronous design
  • Two clocks
  • Constrained composition rules

But gives this guarantee:

If you clock it slow enough (with enough non-overlap between edges)
  • It will be a level sensitive design
  • no race, glitch, or hazard problems
  • no skew problems
  • One sided timing constraints
  • Impossible for logic to be too fast

Mealey and Moore Machines



More on latch timing

  • Look a little more closely at latches, to come up with a more complete set of timing types (more than _s1 _s2 signals) that we can use in our synchronous designs.
  1. Look at a latch since this the critical element
  • What is the weakest requirement on the input to a latch?
  • Signal must settle before Φ1 falls, and not change for some time after Φ1 falling, even for a skewed Φ1 (this is usually called the setup and hold times of the latch)




Valid Signal Type

  • The weakest input to a latch is called a valid signal (_v1 _v2)
  1. For a valid signal we need to be sure we can guarantee it meets the setup and hold requirements of the latch
  • To do this we need to have the signal settle off an edge that comes before Φ1 falling. The closest edge is Φ1 rising.
  • The signal should not change until an edge occurs that comes after Φ1 falling. The closest edge is Φ2 rising.
  • If we changed the input on Φ1 falling, most of the time the circuit would work fine. But if it failed, we can’t change the clock timing to make the circuit work -- Φ1 falling controls the changing of the input, and the closing of the latch. Since we can’t guarantee it would be ok a signal that changes on Φ1 falling would not be a _v1 signal. 



Use of valid signal

  • Very useful for precharged logic
  • Is not needed for standard combinational logic with latches
  1. This should always give stable signals
  • Can’t use stable signals if you want to drive two signals/cycle on a wire (multiplex the wire), since the value has to change twice. There are many wrong ways to do it, and only one right way, which is shown below. The values become _v signals. 



Stable Signals

  a. Have even larger timing margins than valid signals

  b. A _s1 signal starts to change sometime after Φ2 rises

  c. A _s1 signal settles sometime after Φ2 rises

  d. Input to the latch must be a _v2 (settles after Φ2 rises)

  e. Output of a latch settles some small delay after input settles
  1. Please note that combinational logic does not change the value of the timing type, even though it does increase the delay of the signal path. The timing types have to do with the clocking guarantee that we are trying to keep. This promise is that the circuit will work at some frequency. A _s1 signal might not settle until after Φ1 rises when the part is run at high-frequency, but the label means that you can make that signal stabilize before Φ1 rises if you need to by slowing the clock down. 




Qualified (Gated) Clocks

  • These are signals that have the same timing as clocks, but they don’t occur every cycle. They are formed by ANDing a ‘_s1’ signal with Φ1 giving _q1, or ANDing a ‘_s2’ signal with Φ2 giving a _q2 signal.
  • The control signal needs to be a stable signal to prevent glitches on the qualified clocks.
  • Qualified clocks can only be used as the clock input to a latch



Summary of Clock Types

The figure shows the timing of all the signals we have discussed with little arrows that indication with clock edge caused the signal to change. Remember the pictures, and the timing types are what the signals look like at slow clock frequencies




Disadvantages of two phase clocking

1. Need four clocks in general
  • Need true and complement of both clocks
2. Still need low skew for good performance
  • The skew increases the cycle time of the machine
  • Need low skew between all the clocks for good performance
  • Want to have Φ1 and Φ2 close to coincident
3. Many systems use clock and its complement instead of 2 phases
  • Needless to say they are very careful about clock skew
  • For these systems it is still useful to maintain 2 phase timing types, since it ensures you connect all logic to the right latches
  • Call Clk - Φ1 and Clk - Φ2, and go from there.
  • Note in this class we will use Φ1 and Φ2 for clocks)

Advantage of Latches Over Flip-Flops

1. If you are going to use Clk and Clk_b and control skew, why not go back
to flip-flops?

2. Many people do:
  • Most designs in industry are based on flip-flops
  • Very easy to verify timing
  • Each path between flip-flops must be less than cycle time
  • Tools check for skew and hold time violations
  • Short paths are padded (buffers are added to slow down the signals)
  • Skew in flip-flop based systems affects the critical path
3. Latch designs are more flexible than a flip-flop design
  • Gives the designer more rope
  • Need to CAD tools to make sure it works
  • Can borrow time to allow a path to be longer than clock period
  • Can tolerate clock skew -- skew does not directly add to cycle time

Single-phase Clocking

Unger and Tan, Trans. On Comp Oct 86




Latch-based Design with Single-phase clock