Tuesday, August 22, 2017

get pins, nets, ports - max fanout


proc make_hfn_timing_ideal {HFN_FANOUT_THRESHOLD} {
set all_nets [get_net -hier -top_net_of_hierarchical_group]
set total_high_fanout_nets 0
echo -n “Searching [sizeof_collection $all_nets] nets “

echo “looking for fanouts > $HFN_FANOUT_THRESHOLD”
foreach_in_collection the_net $all_nets {
set fanout [sizeof_collection \
[filter [get_pins -quiet -leaf -of_objects $the_net] “pin_direction!=out”]]
if {$fanout > $HFN_FANOUT_THRESHOLD} {
if {[regexp {\*Logic[01]\*} [get_attribute $the_net base_name]]} {
# this is a tie-off net, so no need to change it
continue
}

# find all the pins on the net
set all_pins [get_pins -leaf -of_objects $the_net]

# find all the pins driving the net
set driver_pins [filter [get_pins -quiet -leaf -of_objects $the_net] “pin_direction==out”]

# find all the ports driving the net
set driver_ports [filter \
[get_ports -quiet -of_objects $the_net] \
“port_direction==in”]

# report the drivers
foreach_in_collection the_pin $driver_pins {
echo -n “Setting Ideal Net on [get_object_name $the_net] with fanout $fanout”
echo “ driven by pin [get_attribute $the_pin full_name]”
set_ideal_network -no_propagate $driver_pins
}

foreach_in_collection the_port $driver_ports {
echo -n “Setting Ideal Net on [get_object_name $the_net] with fanout $fanout”
echo “ driven by port [get_attribute $the_port full_name]”
set_ideal_network -no_propagate $the_port
}

incr total_high_fanout_nets
}
}
  echo “Fixed $total_high_fanout_nets nets with fanouts > $HFN_FANOUT_THRESHOLD”
}

and now you can invoke this in your analysis scripts
# fix high-fanout nets
if {$FIX_HFN} {
make_hfn_timing_ideal $HFN_FANOUT_THRESHOLD
}
The HFN_FANOUT_THRESHOLD parameter defines the cutoff. This should agree with the
value used in the synthesis scripts to control which nets are idealized during synthesis.

No comments:

Post a Comment