From b79d276ea9bc83c2ce61156a60023729dfffefc8 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 3 Jul 2019 14:44:54 -0600 Subject: [PATCH] add profiling to fpga_x2p_setup --- vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_setup.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_setup.c b/vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_setup.c index df2d52625..0cca853d8 100644 --- a/vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_setup.c +++ b/vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_setup.c @@ -1310,12 +1310,19 @@ void fpga_x2p_free(t_arch* Arch) { /* Top-level function of FPGA-SPICE setup */ void fpga_x2p_setup(t_vpr_setup vpr_setup, t_arch* Arch) { + /* Timer */ + clock_t t_start; + clock_t t_end; + float run_time_sec; + int num_rename_violation = 0; int num_clocks = 0; float vpr_crit_path_delay = 0.; float vpr_clock_freq = 0.; float vpr_clock_period = 0.; + /* Start time count */ + t_start = clock(); vpr_printf(TIO_MESSAGE_INFO, "\nFPGA-SPICE Tool suites Initilization begins...\n"); @@ -1465,6 +1472,13 @@ void fpga_x2p_setup(t_vpr_setup vpr_setup, spice_net_info_add_density_weight(vpr_setup.FPGA_SPICE_Opts.signal_density_weight); } + /* End time count */ + t_end = clock(); + + run_time_sec = (float)(t_end - t_start) / CLOCKS_PER_SEC; + vpr_printf(TIO_MESSAGE_INFO, "FPGA X2P setup took %g seconds\n", run_time_sec); + + return; }