From cc6d98887281636fdd3cacfb95bb1590632eccc1 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 6 May 2020 14:31:56 -0600 Subject: [PATCH] bug fix in grid SDC generator --- openfpga/src/fpga_sdc/pnr_sdc_grid_writer.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openfpga/src/fpga_sdc/pnr_sdc_grid_writer.cpp b/openfpga/src/fpga_sdc/pnr_sdc_grid_writer.cpp index 740ba097b..009b834fe 100644 --- a/openfpga/src/fpga_sdc/pnr_sdc_grid_writer.cpp +++ b/openfpga/src/fpga_sdc/pnr_sdc_grid_writer.cpp @@ -94,7 +94,7 @@ void print_pnr_sdc_constrain_pb_pin_interc_timing(std::fstream& fp, * If des module is not the parent module, it is a child module. * We should find the instance id */ - std::string src_instance_name = src_module_name; + std::string src_instance_name; if (parent_module != src_module) { src_instance_name = module_manager.module_name(parent_module) + std::string("/"); /* Instance id is actually the placement index */ @@ -124,7 +124,7 @@ void print_pnr_sdc_constrain_pb_pin_interc_timing(std::fstream& fp, * If des module is not the parent module, it is a child module. * We should find the instance id */ - std::string des_instance_name = des_module_name; + std::string des_instance_name; if (parent_module != des_module) { des_instance_name = module_manager.module_name(parent_module) + std::string("/"); /* Instance id is actually the placement index */ @@ -152,12 +152,18 @@ void print_pnr_sdc_constrain_pb_pin_interc_timing(std::fstream& fp, /* Give full path if hierarchical is not enabled */ std::string src_module_path = src_instance_name; if (false == hierarchical) { + if (true == src_instance_name.empty()) { + src_instance_name = generate_instance_name(src_module_name, 0); + } src_module_path = module_path + src_instance_name; } std::string des_module_path = des_instance_name; if (false == hierarchical) { - src_module_path = module_path + des_instance_name; + if (true == des_instance_name.empty()) { + des_instance_name = generate_instance_name(des_module_name, 0); + } + des_module_path = module_path + des_instance_name; } /* Print a SDC timing constraint */