Why clock gaters:
Clock gating is the well known technique to reduce dynamic power consumption.
i) If done properly: Saving the dynamic power of flops
ii) if not done properly: Glitches may lead to meta-stability issues.
How to model:
-ve latch followed by AND gate:
En is input to -ve latch, CLK is the clock of the -ve latch
Output of latch and CLK are going to AND
Output of AND is going to set of flops
Let us assume EN pin is gating clock pin (CLK)
The gating check is performed on pins (EN) that gate a clock signal.
When Clock gating Checks required:
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.
The clock gating setup check is used to ensure the controlling data signals are stable before the clock is active. i.e., EN signal is stable enough before the -ve level (as it is -ve latch) of clock signal.
This check is performed on combinational gates through which the clock signals are propagated.
The arrival time of the leading edge of the clock pin is checked against both levels of any data signals gating the clock.
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.
2. Clock push:
As a general phenomenon, clock push can be done when there is setup margin at the next stage.
As output of CGC is the start point for setup of flops, so our clock push should not result in setup violtaion at the startpoints of those timing paths.
##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]]
foreach_in_collection fo1 $fo {
set slack [get_attribute [get_timing_path -from [get_attribute $fo1 full_name ]/clk -exclude [get_ports *] ] slack]
puts $f "[get_attribute $fo1 full_name] $slack "
}
close $f
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/
How to define CGC constraints:
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.
pt_shell> set_clock_gating_check -setup 0.2 -hold 0.4 [get_clocks CK1]
The following example specifies a setup time of 0.5 on the gate and1.
pt_shell> set_clock_gating_check -setup 0.5 [get_cells and1]
Clock gating is the well known technique to reduce dynamic power consumption.
i) If done properly: Saving the dynamic power of flops
ii) if not done properly: Glitches may lead to meta-stability issues.
Adv of using CGC:
Drawback of Simple AND as CGC:
How to mitigate this problem:
How to model:
-ve latch followed by AND gate:
En is input to -ve latch, CLK is the clock of the -ve latch
Output of latch and CLK are going to AND
Output of AND is going to set of flops
Let us assume EN pin is gating clock pin (CLK)
The gating check is performed on pins (EN) that gate a clock signal.
When Clock gating Checks required:
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.
The clock gating setup check is used to ensure the controlling data signals are stable before the clock is active. i.e., EN signal is stable enough before the -ve level (as it is -ve latch) of clock signal.
This check is performed on combinational gates through which the clock signals are propagated.
The arrival time of the leading edge of the clock pin is checked against both levels of any data signals gating the clock.
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.
How to fix setup violations in PrimeTime:
Let us assume setup violation is occurring in the below path
start point: FF1 clock
end point: EN input of CGC
Fix1:
1. Reduce data path delay:
2. Clock push:
- adding delay in the clock path (inserting buffers at CLK input pin of CGC)
When this clock push can be done?
As output of CGC is the start point for setup of flops, so our clock push should not result in setup violtaion at the startpoints of those timing paths.
##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]]
foreach_in_collection fo1 $fo {
set slack [get_attribute [get_timing_path -from [get_attribute $fo1 full_name ]/clk -exclude [get_ports *] ] slack]
puts $f "[get_attribute $fo1 full_name] $slack "
}
close $f
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/
How to define CGC constraints:
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.
pt_shell> set_clock_gating_check -setup 0.2 -hold 0.4 [get_clocks CK1]
The following example specifies a setup time of 0.5 on the gate and1.
pt_shell> set_clock_gating_check -setup 0.5 [get_cells and1]
even if we are adding the buffers for clock gating setup in clock this will effect the next reg to reg so what is the solution to fix this?
ReplyDelete