38 config.extended_normality_processing = params->extended_normality_processing;
39 config.apply_strash = params->apply_strash;
40 config.fill_subcircuits = params->fill_subcircuits;
41 config.fix_seed = params->fix_seed;
42 config.trial_limit_active = params->trial_limit_active;
43 config.timeout = params->timeout;
44 config.iterations = params->iterations;
45 config.subcircuit_size_bound = params->subcircuit_size_bound;
46 config.strash_intervall = params->strash_intervall;
47 config.nselection_trials = params->nselection_trials;
48 config.seed = params->seed;
49 config.verbosity_level = params->verbosity_level;
50 config.expansion_probability = params->expansion_probability;
55 params->forbidden_pairs = 1;
56 params->extended_normality_processing = 0;
57 params->fill_subcircuits = 0;
58 params->apply_strash = 1;
60 params->trial_limit_active = 1;
61 params->apply_inprocessing = 1;
62 params->timeout = 1620;
63 params->timeout_inprocessing = 180;
64 params->iterations = 0;
65 params->subcircuit_size_bound = 6;
66 params->strash_intervall = 100;
67 params->nselection_trials = 100;
71 params->verbosity_level = 1;
72 params->expansion_probability = 0.4;
78 if (allow_forbidden_pairs) {
84 if (allow_forbidden_pairs) {
90 if (allow_forbidden_pairs) {
96 std::cerr <<
"eSLIM -- Invalid mode given\n";
97 assert (
false &&
"Invalid approach selected");
104 if ( Gia_ManAndNum(pGia) > Gia_ManAndNum(tmp) ) {
114 std::cout <<
"Apply eSLIM (timeout: " << params->timeout <<
") ";
115 if (params->apply_inprocessing) {
116 std::cout <<
"+ deepsyn (timeout: " << params->timeout_inprocessing <<
") ";
118 std::cout << params->nruns <<
" times.\n";
119 if (params->iterations > 0) {
120 std::cout <<
"Stop eSLIM runs after " << params->iterations <<
" iterations.\n";
122 std::cout <<
"Consider subcircuits with up to " << params->subcircuit_size_bound <<
" gates.\n";
123 printf(
"When expanding subcircuits, select gates with a probability of %.2f %%.\n", 100 * params->expansion_probability);
124 if (params->forbidden_pairs) {
125 std::cout <<
"Consider subcircuits containing gates, which are connected outside of the subcircuit.\n";
127 if (params->mode == 0) {
128 std::cout <<
"Use an incremental SAT encoding for exact synthesis and the SAT solver CaDiCaL.\n";
130 std::cout <<
"Use a one-shot SAT encoding for exact synthesis and the SAT solver Kissat.\n";
136 config.verbosity_level = params->verbosity_level;
138 int eSLIM_reductions = 0;
139 int deepsyn_reductions = 0;
143 int initial_size = Gia_ManAndNum(pThis);
144 if (params->verbosity_level > 0) {
146 std::cout <<
"Initial size: " << initial_size <<
"\n";
148 for (
unsigned int i = 0; i < params->nruns; i++) {
150 config.seed = params->seed + i;
152 int size_iteration_start = Gia_ManAndNum(pThis);
153 if (params->verbosity_level > 0) {
154 std::cout <<
"Start eslim run " << i + 1 <<
"\n";
157 int size_eslim = Gia_ManAndNum(pThis);
158 eSLIM_reductions += size_iteration_start - size_eslim;
160 if (params->apply_inprocessing) {
161 if (params->verbosity_level > 0) {
162 std::cout <<
"Start inprocessing run " << i + 1 <<
"\n";
165 if (params->verbosity_level > 0) {
166 std::cout <<
"Inprocessing: Initial size: " << size_eslim <<
" final size: " << Gia_ManAndNum(pThis) <<
"\n";
168 deepsyn_reductions += size_eslim - Gia_ManAndNum(pThis);
171 if (params->verbosity_level > 0) {
172 int final_size = Gia_ManAndNum(pThis);
173 std::cout <<
"Final size: " << final_size <<
"\n";
174 int total_reductions = eSLIM_reductions + deepsyn_reductions;
175 double reduction_ratio = 100 *
static_cast<double>(total_reductions) / initial_size;
176 printf(
"Total reduction: %d (%.2f %%)\n", total_reductions, reduction_ratio);
177 if (params->apply_inprocessing) {
178 std::cout <<
"#Gates reduced by eSLIM: " << eSLIM_reductions <<
" ";
179 std::cout <<
"#Gates reduced by deepsyn: " << deepsyn_reductions <<
"\n";
183 if (params->verbosity_level > 1) {
186 std::cout <<
"Total synthesis time (s): " << log.
synthesis_time <<
"\n";
189 if (params->verbosity_level > 2) {
193 std::cout <<
"#gates: " << i <<
" - #analysed: " << log.
nof_analyzed_circuits_per_size[i] <<
" - #replaced: " << replaced <<
" - #reduced: " << reduced <<
"\n";
195 if (params->mode == 0) {
198 std::cout <<
"#gates: " << i <<
" - avg. sat time: -\n";
205 std::cout <<
"#gates: " << i <<
" - avg. unsat time: -\n";
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static Gia_Man_t * applyeSLIM(Gia_Man_t *p, const eSLIMConfig &cfg, eSLIMLog &log)
void seteSLIMParams(eSLIM_ParamStruct *params)
void printSetting(const eSLIM_ParamStruct *params)
ABC_NAMESPACE_HEADER_END ABC_NAMESPACE_IMPL_START eSLIM::eSLIMConfig getCfg(const eSLIM_ParamStruct *params)
ABC_NAMESPACE_HEADER_START Gia_Man_t * Gia_ManDeepSyn(Gia_Man_t *pGia, int nIters, int nNoImpr, int TimeOut, int nAnds, int Seed, int fUseTwo, int fVerbose)
Gia_Man_t * applyeSLIM(Gia_Man_t *pGia, const eSLIM_ParamStruct *params)
Gia_Man_t * runInprocessing(Gia_Man_t *pGia, const eSLIM_ParamStruct *params, unsigned int it)
Gia_Man_t * selectApproach(Gia_Man_t *pGia, eSLIM::eSLIMConfig params, eSLIM::eSLIMLog &log, int approach, bool allow_forbidden_pairs)
typedefABC_NAMESPACE_HEADER_START struct eSLIM_ParamStruct_ eSLIM_ParamStruct
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t
std::vector< int > nof_sat_calls_per_size
std::vector< int > nof_reduced_circuits_per_size
std::vector< int > nof_unsat_calls_per_size
unsigned int iteration_count
std::vector< ABC_UINT64_T > cummulative_sat_runtimes_per_size
std::vector< int > nof_replaced_circuits_per_size
double relation_generation_time
std::vector< int > nof_analyzed_circuits_per_size
std::vector< ABC_UINT64_T > cummulative_unsat_runtimes_per_size
unsigned int subcircuits_with_forbidden_pairs