mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-06 17:44:09 +00:00
write_aiger: Include $assert
and $assume
cells in -ywmap output
This commit is contained in:
parent
639a8d83e4
commit
6469d90293
|
@ -67,6 +67,8 @@ struct AigerWriter
|
||||||
int initstate_ff = 0;
|
int initstate_ff = 0;
|
||||||
|
|
||||||
dict<SigBit, int> ywmap_clocks;
|
dict<SigBit, int> ywmap_clocks;
|
||||||
|
vector<Cell *> ywmap_asserts;
|
||||||
|
vector<Cell *> ywmap_assumes;
|
||||||
|
|
||||||
int mkgate(int a0, int a1)
|
int mkgate(int a0, int a1)
|
||||||
{
|
{
|
||||||
|
@ -269,6 +271,7 @@ struct AigerWriter
|
||||||
unused_bits.erase(A);
|
unused_bits.erase(A);
|
||||||
unused_bits.erase(EN);
|
unused_bits.erase(EN);
|
||||||
asserts.push_back(make_pair(A, EN));
|
asserts.push_back(make_pair(A, EN));
|
||||||
|
ywmap_asserts.push_back(cell);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,6 +282,7 @@ struct AigerWriter
|
||||||
unused_bits.erase(A);
|
unused_bits.erase(A);
|
||||||
unused_bits.erase(EN);
|
unused_bits.erase(EN);
|
||||||
assumes.push_back(make_pair(A, EN));
|
assumes.push_back(make_pair(A, EN));
|
||||||
|
ywmap_assumes.push_back(cell);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,6 +856,19 @@ struct AigerWriter
|
||||||
for (auto &it : init_lines)
|
for (auto &it : init_lines)
|
||||||
json.value(it.second);
|
json.value(it.second);
|
||||||
json.end_array();
|
json.end_array();
|
||||||
|
|
||||||
|
json.name("asserts");
|
||||||
|
json.begin_array();
|
||||||
|
for (Cell *cell : ywmap_asserts)
|
||||||
|
json.value(witness_path(cell));
|
||||||
|
json.end_array();
|
||||||
|
|
||||||
|
json.name("assumes");
|
||||||
|
json.begin_array();
|
||||||
|
for (Cell *cell : ywmap_assumes)
|
||||||
|
json.value(witness_path(cell));
|
||||||
|
json.end_array();
|
||||||
|
|
||||||
json.end_object();
|
json.end_object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue