Using unlimited complexity and depth for LVS compare

This commit is contained in:
Matthias Koefferlein 2021-03-25 23:50:37 +01:00
parent 4252085663
commit 8d5ef02c3d
3 changed files with 22 additions and 4 deletions

View File

@ -2649,7 +2649,7 @@ NetGraph::derive_node_identities_from_node_set (std::vector<std::pair<const NetG
indent_s += "*" + tl::to_string (n_branch) + " ";
}
if (depth > data->max_depth) {
if (data->max_depth != std::numeric_limits<size_t>::max() && depth > data->max_depth) {
if (options ()->debug_netcompare) {
tl::info << indent_s << "max. depth exhausted (" << depth + 1 << ">" << data->max_depth << ")";
}
@ -2783,7 +2783,7 @@ NetGraph::derive_node_identities_from_node_set (std::vector<std::pair<const NetG
new_nodes += n;
} else if (nr->num * n_branch > data->max_n_branch) {
} else if (data->max_n_branch != std::numeric_limits<size_t>::max () && double (nr->num) * double (n_branch) > double (data->max_n_branch)) {
if (options ()->debug_netcompare) {
tl::info << indent_s << "max. complexity exhausted (" << nr->num << "*" << n_branch << ">" << data->max_n_branch << ") - mismatch.";
@ -2828,8 +2828,8 @@ NetlistComparer::NetlistComparer (NetlistCompareLogger *logger)
m_cap_threshold = -1.0; // not set
m_res_threshold = -1.0; // not set
m_max_depth = 50;
m_max_n_branch = 500;
m_max_depth = std::numeric_limits<size_t>::max ();
m_max_n_branch = std::numeric_limits<size_t>::max ();
m_depth_first = true;
m_dont_consider_net_names = false;

View File

@ -519,6 +519,9 @@ Class<db::NetlistComparer> decl_dbNetlistComparer ("db", "NetlistComparer",
"@brief Sets the maximum seach depth\n"
"This value limits the search depth of the backtracking algorithm to the\n"
"given number of jumps.\n"
"\n"
"By default, from version 0.27 on the depth is unlimited and can be reduced in cases where runtimes need to be limited at the cost "
"less elaborate matching evaluation.\n"
) +
gsi::method ("max_depth", &db::NetlistComparer::max_depth,
"@brief Gets the maximum seach depth\n"
@ -531,6 +534,9 @@ Class<db::NetlistComparer> decl_dbNetlistComparer ("db", "NetlistComparer",
"net matches. Backtracking will stop when the maximum number of options\n"
"has been exceeded.\n"
"\n"
"By default, from version 0.27 on the complexity is unlimited and can be reduced in cases where runtimes need to be limited at the cost "
"less elaborate matching evaluation.\n"
"\n"
"As the computational complexity is the square of the branch count,\n"
"this value should be adjusted carefully.\n"
) +

View File

@ -616,6 +616,12 @@ module LVS
# pursues this "deduction path" in greater depth while with
# smaller values, the algorithm prefers picking nets in a random fashion
# as the seeds for this deduction path. The default value is 8.
#
# By default, the depth is unlimited, but it may
# be reduced in order to limit the compare runtimes at the cost
# of a less elaborate compare attempt. The preferred solution
# however is to use labels for net name hints which also reduces
# the branch complexity.
def max_depth(value)
v = value.to_i
@ -638,6 +644,12 @@ module LVS
# can be increased at the expense of potentially larger runtimes.
# The runtime penality is roughly proportional to the branch
# complexity.
#
# By default, the branch complexity is unlimited, but it may
# be reduced in order to limit the compare runtimes at the cost
# of a less elaborate compare attempt. The preferred solution
# however is to use labels for net name hints which also reduces
# the depth.
def max_branch_complexity(value)
v = value.to_i