ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
eSLIM.h File Reference
Include dependency graph for eSLIM.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  eSLIM_ParamStruct_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct eSLIM_ParamStruct_ eSLIM_ParamStruct
 

Functions

void seteSLIMParams (eSLIM_ParamStruct *params)
 
Gia_Man_tapplyeSLIM (Gia_Man_t *pGia, const eSLIM_ParamStruct *params)
 
Gia_Man_tapplyeSLIMIncremental (Gia_Man_t *pGia, const eSLIM_ParamStruct *params, unsigned int restarts, unsigned int deepsynTimeout)
 

Typedef Documentation

◆ eSLIM_ParamStruct

typedef typedefABC_NAMESPACE_HEADER_START struct eSLIM_ParamStruct_ eSLIM_ParamStruct

CFile****************************************************************

FileName [eSLIM.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Using Exact Synthesis with the SAT-based Local Improvement Method (eSLIM).]

Synopsis [Interface to the eSLIM package.]

Author [Franz-Xaver Reichl]

Affiliation [University of Freiburg]

Date [Ver. 1.0. Started - March 2025.]

Revision [

Id
eSLIM.h,v 1.00 2025/03/17 00:00:00 Exp

]

Definition at line 29 of file eSLIM.h.

Function Documentation

◆ applyeSLIM()

Gia_Man_t * applyeSLIM ( Gia_Man_t * pGia,
const eSLIM_ParamStruct * params )

Definition at line 134 of file eSLIM.cpp.

134 {
136 config.verbosity_level = params->verbosity_level;
137
138 int eSLIM_reductions = 0;
139 int deepsyn_reductions = 0;
140
141 Gia_Man_t * pThis = Gia_ManDup(pGia);
142 eSLIM::eSLIMLog log(params->subcircuit_size_bound);
143 int initial_size = Gia_ManAndNum(pThis);
144 if (params->verbosity_level > 0) {
145 printSetting(params);
146 std::cout << "Initial size: " << initial_size << "\n";
147 }
148 for (unsigned int i = 0; i < params->nruns; i++) {
149 if (config.fix_seed) {
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 }
156 pThis = selectApproach(pThis, config, log, params->mode, params->forbidden_pairs);
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 }
164 pThis = runInprocessing(pThis, params, i);
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}
struct config_s config
void printSetting(const eSLIM_ParamStruct *params)
Definition eSLIM.cpp:113
ABC_NAMESPACE_HEADER_END ABC_NAMESPACE_IMPL_START eSLIM::eSLIMConfig getCfg(const eSLIM_ParamStruct *params)
Definition eSLIM.cpp:36
Gia_Man_t * runInprocessing(Gia_Man_t *pGia, const eSLIM_ParamStruct *params, unsigned int it)
Definition eSLIM.cpp:102
Gia_Man_t * selectApproach(Gia_Man_t *pGia, eSLIM::eSLIMConfig params, eSLIM::eSLIMLog &log, int approach, bool allow_forbidden_pairs)
Definition eSLIM.cpp:75
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Definition giaDup.c:720
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
Here is the call graph for this function:

◆ applyeSLIMIncremental()

Gia_Man_t * applyeSLIMIncremental ( Gia_Man_t * pGia,
const eSLIM_ParamStruct * params,
unsigned int restarts,
unsigned int deepsynTimeout )

◆ seteSLIMParams()

void seteSLIMParams ( eSLIM_ParamStruct * params)

Definition at line 54 of file eSLIM.cpp.

54 {
55 params->forbidden_pairs = 1;
56 params->extended_normality_processing = 0;
57 params->fill_subcircuits = 0;
58 params->apply_strash = 1;
59 params->fix_seed = 0;
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;
68 params->nruns = 1;
69 params->mode = 0;
70 params->seed = 0;
71 params->verbosity_level = 1;
72 params->expansion_probability = 0.4;
73}