Skip to content

Commit 639bf69

Browse files
committed
vpr: If logic block type can't be identified default to 100% pin util targets
Previously would halt with an assertion error. We now produce warning messages instead (warning that this may produce a denser packing than desired) and allow the tool to continue using the relaxed targets. Closes #556
1 parent fe33cd0 commit 639bf69

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

vpr/src/pack/pack.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,16 @@ static t_ext_pin_util_targets parse_target_external_pin_util(std::vector<std::st
320320
//For relatively high pin utilizations (e.g. > 70%) this has little-to-no
321321
//impact on the number of clusters required. As a result we set a default
322322
//input pin utilization target which is high, but less than 100%.
323-
constexpr float LOGIC_BLOCK_TYPE_AUTO_INPUT_UTIL = 0.8;
324-
constexpr float LOGIC_BLOCK_TYPE_AUTO_OUTPUT_UTIL = 1.0;
323+
if (logic_block_type != nullptr) {
324+
constexpr float LOGIC_BLOCK_TYPE_AUTO_INPUT_UTIL = 0.8;
325+
constexpr float LOGIC_BLOCK_TYPE_AUTO_OUTPUT_UTIL = 1.0;
325326

326-
t_ext_pin_util logic_block_ext_pin_util(LOGIC_BLOCK_TYPE_AUTO_INPUT_UTIL , LOGIC_BLOCK_TYPE_AUTO_OUTPUT_UTIL);
327+
t_ext_pin_util logic_block_ext_pin_util(LOGIC_BLOCK_TYPE_AUTO_INPUT_UTIL , LOGIC_BLOCK_TYPE_AUTO_OUTPUT_UTIL);
327328

328-
targets.set_block_pin_util(logic_block_type->name, logic_block_ext_pin_util);
329+
targets.set_block_pin_util(logic_block_type->name, logic_block_ext_pin_util);
330+
} else {
331+
VTR_LOG_WARN("Unable to identify logic block type to apply default pin utilization targets to; this may result in denser packing than desired\n");
332+
}
329333

330334
} else {
331335
//Process user specified overrides

vpr/src/util/vpr_utils.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,11 @@ t_type_ptr infer_logic_block_type(const DeviceGrid& grid) {
752752
return logic_block_candidates.front();
753753
} else {
754754
//Otherwise assume it is the most common block type
755-
return find_most_common_block_type(grid);
755+
auto most_common_type = find_most_common_block_type(grid);
756+
if (most_common_type == nullptr) {
757+
VTR_LOG_WARN("Unable to infer which block type is a logic block\n");
758+
}
759+
return most_common_type;
756760
}
757761
}
758762

@@ -771,7 +775,9 @@ t_type_ptr find_most_common_block_type(const DeviceGrid& grid) {
771775
}
772776
}
773777

774-
VTR_ASSERT(max_type);
778+
if (max_type == nullptr) {
779+
VTR_LOG_WARN("Unable to determine most common block type (perhaps the device grid was empty?)\n");
780+
}
775781
return max_type;
776782
}
777783

0 commit comments

Comments
 (0)