134 {
136 config.verbosity_level = params->verbosity_level;
137
138 int eSLIM_reductions = 0;
139 int deepsyn_reductions = 0;
140
143 int initial_size = Gia_ManAndNum(pThis);
144 if (params->verbosity_level > 0) {
146 std::cout << "Initial size: " << initial_size << "\n";
147 }
148 for (unsigned int i = 0; i < params->nruns; i++) {
150 config.seed = params->seed + i;
151 }
152 int size_iteration_start = Gia_ManAndNum(pThis);
153 if (params->verbosity_level > 0) {
154 std::cout << "Start eslim run " << i + 1 << "\n";
155 }
157 int size_eslim = Gia_ManAndNum(pThis);
158 eSLIM_reductions += size_iteration_start - size_eslim;
159
160 if (params->apply_inprocessing) {
161 if (params->verbosity_level > 0) {
162 std::cout << "Start inprocessing run " << i + 1 << "\n";
163 }
165 if (params->verbosity_level > 0) {
166 std::cout << "Inprocessing: Initial size: " << size_eslim << " final size: " << Gia_ManAndNum(pThis) << "\n";
167 }
168 deepsyn_reductions += size_eslim - Gia_ManAndNum(pThis);
169 }
170 }
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";
180 }
181 }
182
183 if (params->verbosity_level > 1) {
184 std::cout << "Total #iterations: " << log.iteration_count << "\n";
185 std::cout << "Total relation generation time (s): " << log.relation_generation_time << "\n";
186 std::cout << "Total synthesis time (s): " << log.synthesis_time << "\n";
187 std::cout << "#Iterations with forbidden pairs: " << log.subcircuits_with_forbidden_pairs << "\n";
188 }
189 if (params->verbosity_level > 2) {
190 for (int i = 2; i < log.nof_analyzed_circuits_per_size.size(); i++) {
191 int replaced = log.nof_replaced_circuits_per_size.size() > i ? log.nof_replaced_circuits_per_size[i] : 0;
192 int reduced = log.nof_reduced_circuits_per_size.size() > i ? log.nof_reduced_circuits_per_size[i] : 0;
193 std::cout << "#gates: " << i << " - #analysed: " << log.nof_analyzed_circuits_per_size[i] << " - #replaced: " << replaced << " - #reduced: " << reduced << "\n";
194 }
195 if (params->mode == 0) {
196 for (int i = 0; i < log.nof_sat_calls_per_size.size(); i++) {
197 if (log.nof_sat_calls_per_size[i] == 0) {
198 std::cout << "#gates: " << i << " - avg. sat time: -\n";
199 } else {
200 std::cout << "#gates: " << i << " - avg. sat time: " << static_cast<double>(log.cummulative_sat_runtimes_per_size[i]) / (1000 * log.nof_sat_calls_per_size[i]) << " sec\n";
201 }
202 }
203 for (int i = 0; i < log.nof_unsat_calls_per_size.size(); i++) {
204 if (log.nof_unsat_calls_per_size[i] == 0) {
205 std::cout << "#gates: " << i << " - avg. unsat time: -\n";
206 } else {
207 std::cout << "#gates: " << i << " - avg. unsat time: " << static_cast<double>(log.cummulative_unsat_runtimes_per_size[i]) / (1000* log.nof_unsat_calls_per_size[i]) << " sec\n";
208 }
209 }
210 }
211 }
212 return pThis;
213}
void printSetting(const eSLIM_ParamStruct *params)
ABC_NAMESPACE_HEADER_END ABC_NAMESPACE_IMPL_START eSLIM::eSLIMConfig getCfg(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)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
struct Gia_Man_t_ Gia_Man_t