Skip to content

Commit e72dccf

Browse files
[LOGGING] Fixed LUT Sizing Issue
The size of the LUTs were being calculated incorrectly by using the width of the port instead of the actual number of pins in the port. The parsing scripts for the golden results were also incorrect since they were using the number of 6-LUTs as the total number of LUTs.
1 parent f13f87b commit e72dccf

File tree

12 files changed

+2813
-2807
lines changed

12 files changed

+2813
-2807
lines changed

vpr/src/base/read_circuit.cpp

+28-22
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
#include "atom_netlist.h"
55
#include "atom_netlist_utils.h"
66
#include "echo_files.h"
7-
87
#include "vtr_assert.h"
98
#include "vtr_log.h"
10-
#include "vtr_util.h"
119
#include "vtr_path.h"
1210
#include "vtr_time.h"
1311

@@ -145,34 +143,31 @@ static void process_circuit(AtomNetlist& netlist,
145143
}
146144

147145
static void show_circuit_stats(const AtomNetlist& netlist) {
146+
// Count the block statistics
148147
std::map<std::string, size_t> block_type_counts;
149-
150-
//Count the block statistics
148+
std::map<std::string, size_t> lut_size_counts;
151149
for (auto blk_id : netlist.blocks()) {
150+
// For each model, count the number of occurrences in the netlist.
152151
const t_model* blk_model = netlist.block_model(blk_id);
152+
++block_type_counts[blk_model->name];
153+
// If this block is a LUT, also count the occurences of this size of LUT
154+
// for more logging information.
153155
if (blk_model->name == std::string(MODEL_NAMES)) {
154-
//LUT
155-
size_t lut_size = 0;
156+
// May have zero (no input LUT) or one input port
156157
auto in_ports = netlist.block_input_ports(blk_id);
157-
158-
//May have zero (no input LUT) or one input port
158+
VTR_ASSERT(in_ports.size() <= 1 && "Expected number of input ports for LUT to be 0 or 1");
159+
size_t lut_size = 0;
159160
if (in_ports.size() == 1) {
161+
// Use the number of pins in the input port to determine the
162+
// size of the LUT.
160163
auto port_id = *in_ports.begin();
161-
162-
//Figure out the LUT size
163-
lut_size = netlist.port_width(port_id);
164-
165-
} else {
166-
VTR_ASSERT(in_ports.size() == 0);
164+
lut_size = netlist.port_pins(port_id).size();
167165
}
168-
169-
++block_type_counts[std::to_string(lut_size) + "-LUT"];
170-
} else {
171-
//Other types
172-
++block_type_counts[blk_model->name];
166+
++lut_size_counts[std::to_string(lut_size) + "-LUT"];
173167
}
174168
}
175-
//Count the net statistics
169+
170+
// Count the net statistics
176171
std::map<std::string, double> net_stats;
177172
for (auto net_id : netlist.nets()) {
178173
double fanout = netlist.net_sinks(net_id).size();
@@ -189,21 +184,32 @@ static void show_circuit_stats(const AtomNetlist& netlist) {
189184
}
190185
net_stats["Avg Fanout"] /= netlist.nets().size();
191186

192-
//Determine the maximum length of a type name for nice formatting
187+
// Determine the maximum length of a type name for nice formatting
193188
size_t max_block_type_len = 0;
194189
for (const auto& kv : block_type_counts) {
195190
max_block_type_len = std::max(max_block_type_len, kv.first.size());
196191
}
192+
size_t max_lut_size_len = 0;
193+
for (const auto& kv : lut_size_counts) {
194+
max_lut_size_len = std::max(max_lut_size_len, kv.first.size());
195+
}
197196
size_t max_net_type_len = 0;
198197
for (const auto& kv : net_stats) {
199198
max_net_type_len = std::max(max_net_type_len, kv.first.size());
200199
}
201200

202-
//Print the statistics
201+
// Print the statistics
203202
VTR_LOG("Circuit Statistics:\n");
204203
VTR_LOG(" Blocks: %zu\n", netlist.blocks().size());
205204
for (const auto& kv : block_type_counts) {
206205
VTR_LOG(" %-*s: %7zu\n", max_block_type_len, kv.first.c_str(), kv.second);
206+
// If this block is a LUT, print the different sizes of LUTs in the
207+
// design.
208+
if (kv.first == std::string(MODEL_NAMES)) {
209+
for (const auto& lut_kv : lut_size_counts) {
210+
VTR_LOG(" %-*s: %7zu\n", max_lut_size_len, lut_kv.first.c_str(), lut_kv.second);
211+
}
212+
}
207213
}
208214
VTR_LOG(" Nets : %zu\n", netlist.nets().size());
209215
for (const auto& kv : net_stats) {

vtr_flow/parse/parse_config/vpr_chain.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%include "vpr_standard.txt"
22

33
num_le;vpr.out;\s*Total number of Logic Elements used\s*:\s*(\d+)
4-
num_luts;vpr.out;\s*6-LUT\s*:\s*(\d+)
4+
num_luts;vpr.out;\s*.names\s*:\s*(\d+)
55
num_add_blocks;odin.out;The Total Number of Hard Block adders: (\d+)
66
max_add_chain_length;odin.out;The Number of Hard Block adders in the Longest Chain: (\d+)
77
num_sub_blocks;odin.out;The Total Number of Hard Block subs: (\d+)

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test1/arithmetic_tasks/figure_8/config/golden_results.txt

+221-221
Large diffs are not rendered by default.

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test1/arithmetic_tasks/multless_consts/config/golden_results.txt

+1,024-1,024
Large diffs are not rendered by default.

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test1_odin/arithmetic_tasks/FIR_filters/config/golden_results.txt

+235-235
Large diffs are not rendered by default.

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test1_odin/arithmetic_tasks/figure_8/config/golden_results.txt

+221-221
Large diffs are not rendered by default.

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test1_odin/arithmetic_tasks/multless_consts/config/golden_results.txt

+1,024-1,024
Large diffs are not rendered by default.

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test3/vtr_reg_qor/config/golden_results.txt

+21-21
Large diffs are not rendered by default.

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test3_odin/vtr_reg_qor/config/golden_results.txt

+21-21
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
arch circuit script_params vtr_flow_elapsed_time vtr_max_mem_stage vtr_max_mem error odin_synth_time max_odin_mem parmys_synth_time max_parmys_mem abc_depth abc_synth_time abc_cec_time abc_sec_time max_abc_mem ace_time max_ace_mem num_clb num_io num_memories num_mult vpr_status vpr_revision vpr_build_info vpr_compiler vpr_compiled hostname rundir max_vpr_mem num_primary_inputs num_primary_outputs num_pre_packed_nets num_pre_packed_blocks num_netlist_clocks num_post_packed_nets num_post_packed_blocks device_width device_height device_grid_tiles device_limiting_resources device_name pack_mem pack_time placed_wirelength_est place_mem place_time place_quench_time placed_CPD_est placed_setup_TNS_est placed_setup_WNS_est placed_geomean_nonvirtual_intradomain_critical_path_delay_est place_delay_matrix_lookup_time place_quench_timing_analysis_time place_quench_sta_time place_total_timing_analysis_time place_total_sta_time min_chan_width routed_wirelength min_chan_width_route_success_iteration logic_block_area_total logic_block_area_used min_chan_width_routing_area_total min_chan_width_routing_area_per_tile min_chan_width_route_time min_chan_width_total_timing_analysis_time min_chan_width_total_sta_time crit_path_routed_wirelength crit_path_route_success_iteration crit_path_total_nets_routed crit_path_total_connections_routed crit_path_total_heap_pushes crit_path_total_heap_pops critical_path_delay geomean_nonvirtual_intradomain_critical_path_delay setup_TNS setup_WNS hold_TNS hold_WNS crit_path_routing_area_total crit_path_routing_area_per_tile router_lookahead_computation_time crit_path_route_time crit_path_total_timing_analysis_time crit_path_total_sta_time num_le num_luts num_add_blocks max_add_chain_length num_sub_blocks max_sub_chain_length
2-
k6_frac_N10_4add_2chains_tie_off_depop50_mem20K_22nm.xml mult_4x4.v common 1.20 vpr 62.24 MiB -1 -1 0.07 20964 1 0.00 -1 -1 33108 -1 -1 3 9 0 -1 success v8.0.0-6989-g4a9293e1e-dirty release IPO VTR_ASSERT_LEVEL=3 GNU 11.3.0 on Linux-5.15.0-58-generic x86_64 2023-02-04T01:37:29 dev /home/dev/Desktop/CAS-Atlantic/vtr-verilog-to-routing 63732 9 8 75 70 1 35 20 5 5 25 clb auto 23.6 MiB 0.53 86 62.2 MiB 0.00 0.00 2.25119 -23.8925 -2.25119 2.25119 0.02 4.1023e-05 3.1539e-05 0.00122774 0.00111409 34 203 14 151211 75605.7 45067.1 1802.68 0.10 0.0179246 0.0149981 167 11 115 154 5391 2823 2.41865 2.41865 -33.4427 -2.41865 0 0 54748.7 2189.95 0.00 0.01 0.00322286 0.00301138 14 16 -1 -1 -1 -1
3-
k6_frac_N10_4add_2chains_tie_off_depop50_mem20K_22nm.xml mult_9x9.v common 3.61 vpr 63.33 MiB -1 -1 0.09 21268 1 0.01 -1 -1 33200 -1 -1 9 19 0 -1 success v8.0.0-6989-g4a9293e1e-dirty release IPO VTR_ASSERT_LEVEL=3 GNU 11.3.0 on Linux-5.15.0-58-generic x86_64 2023-02-04T01:37:29 dev /home/dev/Desktop/CAS-Atlantic/vtr-verilog-to-routing 64852 19 18 308 249 1 147 46 6 6 36 clb auto 25.1 MiB 2.32 488 63.3 MiB 0.03 0.00 3.72642 -71.3132 -3.72642 3.72642 0.03 0.000152812 0.000121271 0.0114902 0.00973617 54 1211 26 403230 226817 113905. 3164.04 0.46 0.0908276 0.0791763 883 22 949 1423 57002 21423 5.96246 5.96246 -123.664 -5.96246 0 0 146644. 4073.44 0.01 0.03 0.0171281 0.0157138 63 81 -1 -1 -1 -1
1+
arch circuit script_params vtr_flow_elapsed_time vtr_max_mem_stage vtr_max_mem error odin_synth_time max_odin_mem parmys_synth_time max_parmys_mem abc_depth abc_synth_time abc_cec_time abc_sec_time max_abc_mem ace_time max_ace_mem num_clb num_io num_memories num_mult vpr_status vpr_revision vpr_build_info vpr_compiler vpr_compiled hostname rundir max_vpr_mem num_primary_inputs num_primary_outputs num_pre_packed_nets num_pre_packed_blocks num_netlist_clocks num_post_packed_nets num_post_packed_blocks device_width device_height device_grid_tiles device_limiting_resources device_name pack_mem pack_time placed_wirelength_est total_swap accepted_swap rejected_swap aborted_swap place_mem place_time place_quench_time placed_CPD_est placed_setup_TNS_est placed_setup_WNS_est placed_geomean_nonvirtual_intradomain_critical_path_delay_est place_delay_matrix_lookup_time place_quench_timing_analysis_time place_quench_sta_time place_total_timing_analysis_time place_total_sta_time min_chan_width routed_wirelength min_chan_width_route_success_iteration logic_block_area_total logic_block_area_used min_chan_width_routing_area_total min_chan_width_routing_area_per_tile min_chan_width_route_time min_chan_width_total_timing_analysis_time min_chan_width_total_sta_time crit_path_num_rr_graph_nodes crit_path_num_rr_graph_edges crit_path_collapsed_nodes crit_path_routed_wirelength crit_path_route_success_iteration crit_path_total_nets_routed crit_path_total_connections_routed crit_path_total_heap_pushes crit_path_total_heap_pops critical_path_delay geomean_nonvirtual_intradomain_critical_path_delay setup_TNS setup_WNS hold_TNS hold_WNS crit_path_routing_area_total crit_path_routing_area_per_tile router_lookahead_computation_time crit_path_route_time crit_path_create_rr_graph_time crit_path_create_intra_cluster_rr_graph_time crit_path_tile_lookahead_computation_time crit_path_router_lookahead_computation_time crit_path_total_timing_analysis_time crit_path_total_sta_time num_le num_luts num_add_blocks max_add_chain_length num_sub_blocks max_sub_chain_length
2+
k6_frac_N10_4add_2chains_tie_off_depop50_mem20K_22nm.xml mult_4x4.v common 3.59 vpr 61.01 MiB -1 -1 0.11 16896 1 0.63 -1 -1 29740 -1 -1 3 9 0 -1 success v8.0.0-10974-gd2d425477 release IPO VTR_ASSERT_LEVEL=2 GNU 9.4.0 on Linux-4.15.0-213-generic x86_64 2024-08-16T01:29:20 betzgrp-wintermute.eecg.utoronto.ca /home/singera8/vtr-verilog-to-routing/vtr_flow/tasks 62476 9 8 75 70 1 37 20 5 5 25 clb auto 22.4 MiB 0.47 82 533 165 363 5 61.0 MiB 0.01 0.00 2.68643 -29.137 -2.68643 2.68643 0.02 0.000188348 0.000174205 0.00474572 0.0044363 26 182 18 151211 75605.7 37105.9 1484.24 0.15 0.0423228 0.0352957 1908 5841 -1 155 11 111 124 5133 2870 2.88739 2.88739 -34.0156 -2.88739 0 0 45067.1 1802.68 0.00 0.01 0.01 -1 -1 0.00 0.00698364 0.00619778 14 18 -1 -1 -1 -1
3+
k6_frac_N10_4add_2chains_tie_off_depop50_mem20K_22nm.xml mult_9x9.v common 6.04 vpr 62.27 MiB -1 -1 0.19 17208 1 0.64 -1 -1 30124 -1 -1 9 19 0 -1 success v8.0.0-10974-gd2d425477 release IPO VTR_ASSERT_LEVEL=2 GNU 9.4.0 on Linux-4.15.0-213-generic x86_64 2024-08-16T01:29:20 betzgrp-wintermute.eecg.utoronto.ca /home/singera8/vtr-verilog-to-routing/vtr_flow/tasks 63760 19 18 308 249 1 147 46 6 6 36 clb auto 23.8 MiB 2.01 502 2916 768 2087 61 62.3 MiB 0.05 0.00 4.80297 -98.0082 -4.80297 4.80297 0.05 0.000629548 0.000584294 0.0259583 0.0242455 48 1077 40 403230 226817 104013. 2889.24 0.79 0.275306 0.234615 3910 18599 -1 770 17 746 1059 42320 17076 4.66916 4.66916 -105.494 -4.66916 0 0 131137. 3642.71 0.01 0.04 0.02 -1 -1 0.01 0.026422 0.0235947 63 83 -1 -1 -1 -1

0 commit comments

Comments
 (0)