#===============================================================================
# Zero out negative internal power
#===============================================================================
enable_api pub
proc sis_proc_zero_out_negative_power {LIB} {
log_info "Zero out negative power"
foreach cellid [pub::get_obj_list $LIB type cell] {
set no_def_pins {}
log_info "Working on cell [pub::get_obj_name $cellid]"
foreach pinid [pub::get_obj_list $cellid type pin] {
set pintype [pub::get_obj_attr $pinid direction]
log_info "Working on $pintype pin [pub::get_obj_name $pinid]"
set flag 0
foreach power_block [pub::get_obj_list $pinid type internal_power] {
set when_cond [pub::get_obj_attr $power_block when foobar]
foreach p_type {rise_power fall_power} {
foreach power_arc [pub::get_obj_list $power_block type $p_type] {
set target_values_id [pub::get_obj_list $power_arc type values]
set target_values [pub::get_obj_attr $power_arc values]
set complete_new_vector ""
foreach check_values $target_values {
set new_vector ""
foreach check_single_values $check_values {
#log_info "check_single_values is $check_single_values"
if {$check_single_values < 0} {
set check_single_values "0.0000000"
}
lappend new_vector $check_single_values
}
lappend complete_new_vector $new_vector
}
pub::set_obj_attr $power_arc [list values $complete_new_vector]
}}
}
}
}
}
set LIB [pub::read_model -liberty ss_0.945v_0.945v_1.65v_1.65v_-30c_cmax_-30c.lib]
sis_proc_zero_out_negative_power $LIB
set tmp [pub::write_model $LIB ss_0.945v_0.945v_1.65v_1.65v_-30c_cmax_-30c.lib_zero]