create_power_domain -include_scope与-exclude_scope对hierarchy的影响

解读

国内SoC级UPF低功耗验证面试中,面试官常把“-include_scope/-exclude_scope”作为“坑点”题。表面问的是命令参数,实质考察两点:

  1. 是否真正理解power domain在逻辑层次(HDL hierarchy)与物理层次(power hierarchy)上的“双轨”概念;
  2. 能否区分“域成员”与“域边界”的语义,避免在后续isolation/retention/mv_cells插入时产生“跨域孤儿”或“冗余belonging”。

知识点

  1. power domain的“域成员”由scope和elements共同决定;
  2. -include_scope把指定层次“整体”拉进域,其内部子模块默认继承该域,但子模块仍可用set_domain_supply_*或后续create_power_domain二次声明,形成“域嵌套”;
  3. -exclude_scope把指定层次“整体”踢出当前域,被踢出的子树回到“无域”状态,或继承父域的父域(如果存在),此时必须保证被踢出路径的supply net仍合法,否则UPF checker会报“supply mismatch”;
  4. 两个选项只影响“域隶属”属性,不会修改RTL实例化关系,也不会自动移动hierarchy位置;
  5. 国内主流EDA flow(Synopsys ICC2/FC、Cadence Innovus)在后端读入UPF时,会把域隶属关系写到DEF的REGION属性,若-include_scope/-exclude_scope与RTL hierarchy不一致,易造成“power domain overlap”或“instance not in any domain”DRC;
  6. 对CLP(Conformal Low Power)验证而言,-exclude_scope若把某个instance踢出域但其port仍被域内信号驱动,会被判定为“illegal domain crossing”,必须补isolation策略,否则LP-ECO阶段会反复迭代。

答案

-include_scope:把参数指定的hierarchy子树整体纳入当前power domain,子模块默认继承同一supply set,逻辑层次保持不变,但物理实现上该子树所有instance将共享同一primary power/ground net,后续若对子模块再create_power_domain,则形成“域嵌套”,子域优先级高于父域。
-exclude_scope:把参数指定的hierarchy子树整体排除出当前power domain,被排除的子树回到“未分配”状态或继承更顶层的域隶属;其supply net需单独保证,否则UPF checker阶段报supply缺失;exclude后若子树与父域存在信号交互,必须显式定义isolation/level-shifter,否则CLP验证会报跨域路径违规。
总结:两条选项只改变“域成员”属性,不牵动RTL结构,但会直接影响后端power plan、special cell插入及LP验证的cross-domain规则,必须在UPF 3.0语法里与supply network、isolation策略保持一致。

拓展思考

  1. 多电源域AI芯片中,常把“memory子系统”做成独立域,若顶层先用-include_scope把整个CPU_TOP拉入PD_CPU,再用-exclude_scope把memory子树踢出,随后对memory create_power_domain PD_MEM,可一次性解决“memory retention”与“CPU shut-off”需求;但须注意exclude路径中的bus interface若存在双向信号,需额外加“clamp”隔离,否则掉电后总线浮空会造成待机漏电。
  2. 国内12nm以下工艺,power domain数目往往超过32个,手工写-include_scope/-exclude_scope易出错,推荐在Perl/Tcl脚本里用“get_cells -filter {is_memory_instance || is_black_box}”自动筛选exclude列表,再用write_upf -atomic_scope生成增量UPF,避免“域重叠”DRC。
  3. 面试时可主动提“UPF 3.0的‘domain resolution’规则”:当同一instance被多次include/exclude,工具以最后一次声明为准,但supply net必须提前在map_power_switch阶段绑定,展示你对“前后端一致性”的闭环思维,可加分。