例子中最初dut和环境见上篇low power-upf-vcsnlp(二)
例子中dut和环境在上篇基础上修改low power-upf-vcsnlp(三)
4.create_power_switch
-switch_type 指定switch类型,如果是粗粒度或者both,则output_supply_port必须指定否则报错。细粒度的则会忽略output_supply_port。
-output_supply_port指定output port name以及连接的net name
-input_supply_port指定input port name以及连接的net name
-control_port指定control port name和连接的net name。net负责开关的。
-on/off_state指定state,和对应的布尔表达式。
-ack_port -ack_delay指定响应port和延时。
(1)添加PD0的power switch
set_design_top top/dut_u
#create_power_domain PD_TOP -include_scope
create_power_domain PD_TOP -elements {.} \
-exclude_elements {inst0}
create_supply_port VDD_TOP
create_supply_port VSS_TOP
create_supply_net VDD_TOP
create_supply_net VSS_TOP
connect_supply_net VDD_TOP -ports VDD_TOP
connect_supply_net VSS_TOP -ports VSS_TOP
create_supply_set PD_TOP_SET \
-function {power VDD_TOP} \
-function {power VSS_TOP}
create_power_domain PD_TOP \
-supply {primary PD_TOP_SET} \
-update
create_supply_port VDD_TOP0
create_supply_net VDD_TOP0
connect_supply_net VDD_TOP0 -ports VDD_TOP0
#PD0
set_scope inst0
create_power_domain PD0 -elements {.}
create_supply_port VDD0_i
create_supply_port VSS0
create_supply_net VDD0_i
create_supply_net VSS0
#这个net是接到power switch中的output_supply_port上,并且作为PD0的supply_net.
create_supply_net VDD0_o
connect_supply_net VDD0_i -ports VDD0_i
connect_supply_net VSS0 -ports VSS0
create_power_switch PD0_SWITCH -domain PD0 \
-input_supply_port {in0 VDD0_i} \
-output_supply_port {out0 VDD0_o } \
-control_port {en0 pwr_en} \
-on_state {PD0_on in0 {en0}} \
-off_state {PD0_off {!en0}}
create_supply_set PD0_SET \
-function {power VDD0_o} \
-function {ground VSS0}
create_power_domain PD0 \
-supply {primary PD0_SET} \
-update
set_scope ..
connect_supply_net VSS_TOP -ports inst0/VSS0
connect_supply_net VDD_TOP0 -ports inst0/VDD0_i
仿真结果的power map如下,其中PD0的power supply port和power switch的 output supply port使用VDD0_o连接起来,power switch通过pwr_en进行控制:
(2)在增加一个PD1的power domain,并为其增加一个power switch。
set_design_top top/dut_u
#create_power_domain PD_TOP -include_scope
create_power_domain PD_TOP -elements {.} \
-exclude_elements {inst0}
create_supply_port VDD_TOP
create_supply_port VSS_TOP
create_supply_net VDD_TOP
create_supply_net VSS_TOP
connect_supply_net VDD_TOP -ports VDD_TOP
connect_supply_net VSS_TOP -ports VSS_TOP
create_supply_set PD_TOP_SET \
-function {power VDD_TOP} \
-function {power VSS_TOP}
create_power_domain PD_TOP \
-supply {primary PD_TOP_SET} \
-update
create_supply_port VDD_TOP0
create_supply_net VDD_TOP0
connect_supply_net VDD_TOP0 -ports VDD_TOP0
#PD0
set_scope inst0
create_power_domain PD0 -elements {.}
create_supply_port VDD0_i
create_supply_port VSS0
create_supply_net VDD0_i
create_supply_net VSS0
#这个net是接到power switch中的output_supply_port上,并且作为PD0的supply_net.
create_supply_net VDD0_o
connect_supply_net VDD0_i -ports VDD0_i
connect_supply_net VSS0 -ports VSS0
create_power_switch PD0_SWITCH -domain PD0 \
-input_supply_port {in0 VDD0_i} \
-output_supply_port {out0 VDD0_o } \
-control_port {en0 pwr_en} \
-on_state {PD0_on in0 {en0}} \
-off_state {PD0_off {!en0}}
create_supply_set PD0_SET \
-function {power VDD0_o} \
-function {ground VSS0}
create_power_domain PD0 \
-supply {primary PD0_SET} \
-update
set_scope ..
connect_supply_