ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cadical_tier.cpp
Go to the documentation of this file.
1#include "global.h"
2
3#include "internal.hpp"
4
6
7namespace CaDiCaL {
8
10 if (!opts.recomputetier)
11 return;
12
13 ++stats.tierecomputed;
14 const int64_t delta =
15 stats.tierecomputed >= 16 ? 1u << 16 : (1u << stats.tierecomputed);
16 lim.recompute_tier = stats.conflicts + delta;
17 LOG ("rescheduling in %zd at %zd (conflicts at %zd)", delta,
18 lim.recompute_tier, stats.conflicts);
19#ifndef CADICAL_NDEBUG
20 uint64_t total_used = 0;
21 for (auto u : stats.used[stable])
22 total_used += u;
23 CADICAL_assert (total_used == stats.bump_used[stable]);
24#endif
25
26 if (!stats.bump_used[stable]) {
27 tier1[stable] = opts.reducetier1glue;
28 tier2[stable] = opts.reducetier2glue;
29 LOG ("tier1 limit = %d", tier1[stable]);
30 LOG ("tier2 limit = %d", tier2[stable]);
31 return;
32 } else {
33 uint64_t accumulated_tier1_limit =
34 stats.bump_used[stable] * opts.tier1limit / 100;
35 uint64_t accumulated_tier2_limit =
36 stats.bump_used[stable] * opts.tier2limit / 100;
37 uint64_t accumulated_used = 0;
38 for (size_t glue = 0; glue < stats.used[stable].size (); ++glue) {
39 const uint64_t u = stats.used[stable][glue];
40 accumulated_used += u;
41 if (accumulated_used <= accumulated_tier1_limit) {
42 tier1[stable] = glue;
43 }
44 if (accumulated_used >= accumulated_tier2_limit) {
45 tier2[stable] = glue;
46 break;
47 }
48 }
49 }
50
51 LOG ("tier1 limit = %d in %s mode", tier1[stable],
52 stable ? "stable" : "focused");
53 LOG ("tier2 limit = %d in %s mode", tier2[stable],
54 stable ? "stable" : "focused");
55}
56
57} // namespace CaDiCaL
58
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
Definition global.h:14
#define LOG(...)