mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 01:54:10 +00:00
aiger2: Drop empty_lit()
as a function
This commit is contained in:
parent
dbc937b2a7
commit
9db1ca83fc
|
@ -118,7 +118,7 @@ struct Index {
|
||||||
modules.reserve(top->design->modules().size());
|
modules.reserve(top->design->modules().size());
|
||||||
int nlits = index_module(top);
|
int nlits = index_module(top);
|
||||||
log_debug("allocating for %d literals\n", nlits);
|
log_debug("allocating for %d literals\n", nlits);
|
||||||
lits.resize(nlits, Writer::empty_lit());
|
lits.resize(nlits, Writer::EMPTY_LIT);
|
||||||
top_minfo = &modules.at(top);
|
top_minfo = &modules.at(top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ struct Index {
|
||||||
}
|
}
|
||||||
|
|
||||||
int idx = cursor.bitwire_index(bit);
|
int idx = cursor.bitwire_index(bit);
|
||||||
if (lits[idx] != Writer::empty_lit()) {
|
if (lits[idx] != Writer::EMPTY_LIT) {
|
||||||
// literal already assigned
|
// literal already assigned
|
||||||
return lits[idx];
|
return lits[idx];
|
||||||
}
|
}
|
||||||
|
@ -503,13 +503,7 @@ struct AigerWriter : Index<AigerWriter, unsigned int> {
|
||||||
|
|
||||||
const static Lit CONST_FALSE = 0;
|
const static Lit CONST_FALSE = 0;
|
||||||
const static Lit CONST_TRUE = 1;
|
const static Lit CONST_TRUE = 1;
|
||||||
|
const static constexpr Lit EMPTY_LIT = std::numeric_limits<Lit>::max();
|
||||||
// for some reason having a 'const static int EMPTY_LIT'
|
|
||||||
// led to linkage errors
|
|
||||||
static Lit empty_lit()
|
|
||||||
{
|
|
||||||
return 0x80000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Lit negate(Lit lit) {
|
static Lit negate(Lit lit) {
|
||||||
return lit ^ 1;
|
return lit ^ 1;
|
||||||
|
@ -722,7 +716,7 @@ struct AIGCounter : Index<AIGCounter, int> {
|
||||||
typedef int Lit;
|
typedef int Lit;
|
||||||
const static Lit CONST_FALSE = -1;
|
const static Lit CONST_FALSE = -1;
|
||||||
const static Lit CONST_TRUE = 1;
|
const static Lit CONST_TRUE = 1;
|
||||||
static Lit empty_lit() { return 0; }
|
const static constexpr Lit EMPTY_LIT = 0;
|
||||||
static Lit negate(Lit lit) { return -lit; }
|
static Lit negate(Lit lit) { return -lit; }
|
||||||
int nvars = 1;
|
int nvars = 1;
|
||||||
int ngates = 0;
|
int ngates = 0;
|
||||||
|
|
Loading…
Reference in a new issue