ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
profile.h
Go to the documentation of this file.
1#ifndef _profile_h_INCLUDED
2#define _profile_h_INCLUDED
3
4#include "stack.h"
5
6#include "global.h"
8
9#ifndef KISSAT_QUIET
10
11typedef struct profile profile;
12typedef struct profiles profiles;
13
14#define PROFS \
15 PROF (analyze, 3) \
16 PROF (backbone, 2) \
17 PROF (bump, 3) \
18 PROF (collect, 3) \
19 PROF (congruence, 2) \
20 PROF (decide, 4) \
21 PROF (deduce, 3) \
22 PROF (definition, 3) \
23 PROF (defrag, 3) \
24 PROF (dominate, 4) \
25 PROF (eliminate, 2) \
26 PROF (extend, 2) \
27 PROF (extract, 3) \
28 PROF (extractands, 3) \
29 PROF (extractbinaries, 3) \
30 PROF (extractites, 3) \
31 PROF (extractxors, 3) \
32 PROF (factor, 2) \
33 PROF (fastel, 2) \
34 PROF (focused, 2) \
35 PROF (forward, 4) \
36 PROF (lucky, 2) \
37 PROF (matching, 3) \
38 PROF (merge, 3) \
39 PROF (minimize, 3) \
40 PROF (parse, 1) \
41 PROF (preprocess, 2) \
42 PROF (probe, 2) \
43 PROF (propagate, 4) \
44 PROF (radix, 4) \
45 PROF (reduce, 2) \
46 PROF (reorder, 3) \
47 PROF (rephase, 3) \
48 PROF (restart, 3) \
49 PROF (search, 1) \
50 PROF (shrink, 3) \
51 PROF (simplify, 1) \
52 PROF (sort, 4) \
53 PROF (stable, 2) \
54 PROF (substitute, 2) \
55 PROF (subsume, 2) \
56 PROF (sweep, 2) \
57 PROF (sweepbackbone, 3) \
58 PROF (sweepequivalences, 3) \
59 PROF (total, 0) \
60 PROF (transitive, 2) \
61 PROF (vivify, 2) \
62 PROF (vivify0, 3) \
63 PROF (vivify1, 3) \
64 PROF (vivify2, 3) \
65 PROF (vivify3, 3) \
66 PROF (vivifysort, 4) \
67 PROF (walking, 2) \
68 PROF (warmup, 3)
69
70struct profile {
71 int level;
72 const char *name;
73 double entered;
74 double time;
75};
76
77struct profiles {
78#define PROF(NAME, LEVEL) profile NAME;
79 PROFS
80#undef PROF
81 STACK (profile *) stack;
82};
83
84struct kissat;
85
86void kissat_init_profiles (profiles *);
87void kissat_profiles_print (struct kissat *);
88void kissat_start (struct kissat *, profile *);
89void kissat_stop (struct kissat *, profile *);
90
91void kissat_stop_search_and_start_simplifier (struct kissat *, profile *);
92void kissat_stop_simplifier_and_resume_search (struct kissat *, profile *);
93
94double kissat_time (struct kissat *);
95
96#define PROFILE(NAME) (solver->profiles.NAME)
97
98#define START(NAME) \
99 do { \
100 profile *profile = &PROFILE (NAME); \
101 if (GET_OPTION (profile) >= profile->level) \
102 kissat_start (solver, profile); \
103 } while (0)
104
105#define STOP(NAME) \
106 do { \
107 profile *profile = &PROFILE (NAME); \
108 if (GET_OPTION (profile) >= profile->level) \
109 kissat_stop (solver, profile); \
110 } while (0)
111
112#define STOP_SEARCH_AND_START_SIMPLIFIER(NAME) \
113 do { \
114 if (GET_OPTION (profile) >= PROFILE (search).level) \
115 kissat_stop_search_and_start_simplifier (solver, &PROFILE (NAME)); \
116 } while (0)
117
118#define STOP_SIMPLIFIER_AND_RESUME_SEARCH(NAME) \
119 do { \
120 if (GET_OPTION (profile) >= PROFILE (search).level) \
121 kissat_stop_simplifier_and_resume_search (solver, &PROFILE (NAME)); \
122 } while (0)
123
124#else
125
126#define START(...) \
127 do { \
128 } while (0)
129#define STOP(...) \
130 do { \
131 } while (0)
132
133#define STOP_SEARCH_AND_START_SIMPLIFIER(...) \
134 do { \
135 } while (0)
136#define STOP_SIMPLIFIER_AND_RESUME_SEARCH(...) \
137 do { \
138 } while (0)
139
140#define STOP_AND_START(...) \
141 do { \
142 } while (0)
143
144#endif
145
147
148#endif
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
#define STACK(TYPE)
Definition stack.h:10
char * name
Definition main.h:24