Professional Documents
Culture Documents
Suresh's Official Blog... - CGC Setup and Hold Checks
Suresh's Official Blog... - CGC Setup and Hold Checks
1. Its worth mentioning that clock gating does not have much significance on
individual flops. But imagine a scenario of writing a 64bit register based on an
enable. The power dissipated by all 64 flops can be greatly reduced by using a
single clock gate cell common to all 64 flops, which amounts to a
very significant power saving.
2. On a side note, clock gating can greatly help save area in the scenario
described by getting rid of the large mux'ed feedback path which would
otherwise be necessary to meet logic requirements.
1. Here's the catch, if the enable is asynchronous to the clock and gates the
clock during its active phase, you can end up with a clipped clock,
which effects the duty cycle.
2. This scenario can lead to timing violations on the flop and downstream
logic. If clock clipping happens very close to the active edge of the clock, there
might even be a clock width violation.
Code:
always_latch
if(!clk) en_syn <= en;
How to model:
The gating check is performed on pins (EN) that gate a clock signal.
Clock gating checks need to be done where the clock is gated with a data or enable
signal. The basic idea here is to check whether the enable signal is toggling only when
the clock is in its inactive phase. If enable toggles in the clock's active phase, it will result
in glitch in the gate output clock.
AND/NAND gate is inactive when clock is in the LOW phase. i.e., at this
time gate output will not depen on the other inputs. So AND/NAND gate
is having a HIGH clock gating check. Similarly, for OR/NOT gate is
inactive when clock is in the HIGH phase, so it has LOW clock gating
check.
Setup violation:
Similar to normal flop, here, D input is EN and clock is CLK. And we
are checking setup violation of Latch.
If clock gating setup failure leads to: A clock gating setup failure
can cause either a glitch at the leading edge of the clock pulse, or a
clipped clock pulse.
Fix1:
1. Reduce data path delay:
2. Clock push:
- adding delay in the clock path (inserting buffers at CLK input pin of
CGC)
##Getting slack of next stage flops (from endpoint of current path under fix)
as gated clock is the start point for those flops:
set f [open slc_cg.txt w ]
set fo [get_cells [all_fanout -from CGC_cell/clk -flat -endpoints_only -
only_cells]]
ECO:
insert_buffer path_till_CGC/CGC_cell/clk_in clk_buffer_1x_drive
Hold check:
The clock gating hold check is used to ensure that the controlling
data signals are stable while the clock is active.
The arrival time of the trailing edge of the clock pin is checked against
both levels of any
data signal gating the clipped clock pulse.
References:
http://tech.tdzire.com/clock-gating-checks-and-clock-gating-cell/
EXAMPLES
The following example specifies a setup time of 0.2 and a hold
time of 0.4 for all gates in the clock network of clock CK1.
set_clock_gating_check
NAME
set_clock_gating_check
Specifies the value of setup and hold
time for clock gating
checks.
SYNTAX
string set_clock_gating_check
[-setup setup_value]
[-hold hold_value]
[-rise | -fall]
[-high | -low]
[object_list]
float setup_value
float hold_value
list object_list
ARGUMENTS
-setup setup_value
Specifies the clock gating setup time. The
default is 0.0.
-hold hold_value
Specifies the clock gating hold time. The
default is 0.0.
object_list
Specifies a list of objects in the current design
for which the
clock gating check is to be applied. The
objects can be clocks,
ports, pins, or cells. If a cell is specified, all
input pins of
that cell are affected. If a pin, cell, or port
is specified,
all gates in the transitive fanout are affected.
If a clock is
specified, the clock gating check is applied to
all gating gates
driven by that clock. If you specify -high or
-low you must
also specify object_list; in that case,
object_list must not
contain a clock or a port. By default, if
object_list is not
specified, the clock gating check is
applied to the current
design.
DESCRIPTION
The set_clock_gating_check command specifies a
setup or hold time clock
gating check to be used for clocks, ports, pins, or
cells. The gating
check is performed on pins that gate a clock signal.
SYNTAX
string remove_clock_gating_check
[-setup]
[-hold]
[-rise]
[-fall]
[-high | -low]
[object_list]
list object_list
ARGUMENTS
-setup
DESCRIPTION
This command is available only if you invoke the pt_shell
with the -constraints option.
The remove_clock_gating_check command removes
clock gating checks for design objects set
by set_clock_gating_check.
EXAMPLES
The following example removes the setup requirement (for
rising and falling delays) on all gates in the clock network
involved with clock CK1 path.