Changing search space exploration of ACD to search for better implementation and prune unnecessary computations based on theoretical properties

This commit is contained in:
aletempiac 2024-02-29 17:16:49 +01:00
parent 48b5f3b399
commit fa8a277765
2 changed files with 14 additions and 6 deletions

View File

@ -58,7 +58,7 @@ struct ac_decomposition_params
bool support_reducing_only{ true };
/*! \brief Use the first feasible decomposition found. */
bool use_first{ true };
bool use_first{ false };
/*! \brief If decomposition with delay profile fails, try without. */
bool try_no_late_arrival{ false };
@ -116,6 +116,10 @@ public:
{
ps.max_free_set_vars = num_vars - ps.lut_size;
}
if ( late_arriving > ps.max_free_set_vars )
{
ps.max_free_set_vars = late_arriving;
}
/* return a high cost if too many late arriving variables */
if ( late_arriving > ps.lut_size - 1 || late_arriving > ps.max_free_set_vars )
@ -227,11 +231,13 @@ private:
best_cost = multiplicity + additional_cost;
best_free_set = i;
if ( ps.use_first )
if ( !ps.use_first )
{
break;
continue;
}
}
break;
}
if ( best_multiplicity == UINT32_MAX && ( !ps.try_no_late_arrival || late_arriving == 0 ) )
@ -263,11 +269,13 @@ private:
best_cost = multiplicity + additional_cost;
best_free_set = i;
if ( ps.use_first )
if ( !ps.use_first )
{
break;
continue;
}
}
break;
}
}

View File

@ -46,7 +46,7 @@ int acd_evaluate( word * pTruth, unsigned nVars, int lutSize, unsigned *pdelay,
}
*pdelay = acd.get_profile();
*cost = 2;
*cost = st.num_luts;
return val;
}