From 58be6435f2e3a39659cda718211b072e16844482 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 28 Dec 2022 16:30:08 -0700 Subject: [PATCH] set_power_activity warn for clock ports Signed-off-by: James Cherry --- power/Power.tcl | 6 +++++- tcl/StaTcl.i | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/power/Power.tcl b/power/Power.tcl index c322f565..7397f78f 100644 --- a/power/Power.tcl +++ b/power/Power.tcl @@ -237,7 +237,11 @@ proc set_power_activity { args } { set ports [get_ports_error "input_ports" $keys(-input_ports)] foreach port $ports { if { [get_property $port "direction"] == "input" } { - set_power_input_port_activity $port $activity $duty + if { [sta::is_clock_src [sta::get_port_pin $port]] } { + sta_warn 303 "activity cannot be set on clock ports." + } else { + set_power_input_port_activity $port $activity $duty + } } } } diff --git a/tcl/StaTcl.i b/tcl/StaTcl.i index 8a055209..9b096071 100644 --- a/tcl/StaTcl.i +++ b/tcl/StaTcl.i @@ -2393,6 +2393,13 @@ find_pin(const char *path_name) return cmdLinkedNetwork()->findPin(path_name); } +Pin * +get_port_pin(const Port *port) +{ + Network *network = cmdLinkedNetwork(); + return network->findPin(network->topInstance(), port); +} + TmpPinSeq * find_pins_matching(const char *pattern, bool regexp,