解释clock gating cell在scan mode下的bypass策略与SDC约束

解读

国内SoC项目普遍采用“低功耗+可测性”双签核流程。面试官问这道题,是想确认两点:

  1. 你是否理解scan mode必须“关掉”clock gating,保证所有寄存器在同一时钟域内被串起来;
  2. 你是否能把bypass电路写进SDC,让PT/Tempus在scan mode下给出正确的时序签核。
    回答时要先讲电路怎么做,再讲SDC怎么写,最后补一句DFT签收经验,体现“能落地”。

知识点

  1. clock gating cell结构:latch-free(ICG)或latch-based(ICG);scan mode下EN端必须强制为1。
  2. bypass策略:
    a. 硬件——在ICG的EN路径加OR/AND型mux,由scan_enable(SE)或scan_mode(SM)控制;
    b. 功耗——bypass后clock tree功耗上升,需评估peak power,必要时在scan shift阶段降低频率。
  3. SDC约束:
    a. 定义scan_mode:set_case_analysis 1 [get_ports scan_mode];
    b. 对ICG的clock pin设false_path:set_false_path -through [get_pins ICG*/EN] -hold;
    c. 对bypass后的clock latency做derate:set_clock_latency/uncertainty;
    d. 对shift/capture分别create_clock,确保capture时钟不被gating。
  4. 签收风险:hold violation、clock skew、IR-drop导致的capture失败。

答案

“国内28 nm及以下项目,clock gating cell统一使用latch-based ICG。DFT要求scan shift和capture阶段时钟必须连续,因此在ICG的EN端加二选一mux:当scan_mode=1时,EN强制接1,ICG等效为buffer,实现bypass。
对应SDC分三步写:

  1. set_case_analysis 1 [get_ports scan_mode],让工具静态识别bypass路径;
  2. set_false_path -hold -from [get_clocks clk] -through [get_pins ICG/EN] -to [get_clocks clk],去掉EN上的hold检查,防止插入不必要的delay cell;
  3. 分别定义shift时钟和capture时钟,shift频率通常10–50 MHz,capture用功能时钟,set_clock_uncertainty额外加100 ps补偿bypass后的skew。
    签核时用PT做‘scan_mode+func_mode’双 corners,确认bypass路径的latency增量<3 %,hold slack>30 ps,即可交付DFT ATPG。”

拓展思考

  1. 先进工艺(7 nm/5 nm)采用clock gating与clock divider混合结构,scan mode下divider也要bypass,需在SDC里用set_clock_groups隔离,防止跨时钟域假路径漏设。
  2. hierarchical flow中,顶层把scan_mode当deterministic signal,子模块用retain_clock_gating_cell=none做综合,避免模块级与顶层约束冲突。
  3. 低功耗验收时,scan_mode下功耗曲线会突然抬升,可在ATPG pattern里插dummy shift cycle,或采用low-power scan cell(LP-Scan)把bypass期间的toggle降30 %。