vpr/src/pack/cluster.cpp
//Calculates maximum molecule statistics accross all molecules in linked list
Calculates maximum molecule statistics accross all molecules in linked list
Calculates maximum molecule statistics accross all molecules in linked list
static t_molecule_stats calc_max_molecules_stats(const t_pack_molecule* molecule_head) {
    t_molecule_stats max_molecules_stats;
    for (auto cur_molecule = molecule_head; cur_molecule != nullptr; cur_molecule = cur_molecule->next) {
        t_molecule_stats cur_molecule_stats = calc_molecule_stats(cur_molecule);
        max_molecules_stats.num_blocks = std::max(max_molecules_stats.num_blocks, cur_molecule_stats.num_blocks);
        max_molecules_stats.num_pins = std::max(max_molecules_stats.num_pins, cur_molecule_stats.num_pins);
        max_molecules_stats.num_input_pins = std::max(max_molecules_stats.num_input_pins, cur_molecule_stats.num_input_pins);
        max_molecules_stats.num_output_pins = std::max(max_molecules_stats.num_output_pins, cur_molecule_stats.num_output_pins);
        max_molecules_stats.num_used_ext_pins = std::max(max_molecules_stats.num_used_ext_pins, cur_molecule_stats.num_used_ext_pins);
        max_molecules_stats.num_used_ext_inputs = std::max(max_molecules_stats.num_used_ext_inputs, cur_molecule_stats.num_used_ext_inputs);
        max_molecules_stats.num_used_ext_outputs = std::max(max_molecules_stats.num_used_ext_outputs, cur_molecule_stats.num_used_ext_outputs);
    }
    return max_molecules_stats;
}
static t_molecule_stats calc_max_molecules_stats ( const t_pack_molecule * molecule_head ) { t_molecule_stats max_molecules_stats ; for ( auto cur_molecule = molecule_head ; cur_molecule != nullptr ; cur_molecule = cur_molecule -> next ) { t_molecule_stats cur_molecule_stats = calc_molecule_stats ( cur_molecule ) ; max_molecules_stats . num_blocks = std :: max ( max_molecules_stats . num_blocks , cur_molecule_stats . num_blocks ) ; max_molecules_stats . num_pins = std :: max ( max_molecules_stats . num_pins , cur_molecule_stats . num_pins ) ; max_molecules_stats . num_input_pins = std :: max ( max_molecules_stats . num_input_pins , cur_molecule_stats . num_input_pins ) ; max_molecules_stats . num_output_pins = std :: max ( max_molecules_stats . num_output_pins , cur_molecule_stats . num_output_pins ) ; max_molecules_stats . num_used_ext_pins = std :: max ( max_molecules_stats . num_used_ext_pins , cur_molecule_stats . num_used_ext_pins ) ; max_molecules_stats . num_used_ext_inputs = std :: max ( max_molecules_stats . num_used_ext_inputs , cur_molecule_stats . num_used_ext_inputs ) ; max_molecules_stats . num_used_ext_outputs = std :: max ( max_molecules_stats . num_used_ext_outputs , cur_molecule_stats . num_used_ext_outputs ) ; } return max_molecules_stats ; }
Calculates maximum molecule statistics accross all molecules in linked list
Calculates maximum molecule statistics accross all molecules in linked list
//Calculate per-molecule statistics //Record the maximums (member-wise) over all molecules