mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-25 01:55:33 +00:00
Add ConstEvalAig specialised for AIGs
This commit is contained in:
parent
7f9d2d1825
commit
d39a5a77a9
2 changed files with 159 additions and 3 deletions
|
@ -234,7 +234,7 @@ void AigerReader::parse_xaiger()
|
|||
uint32_t lutNum = parse_xaiger_literal(f);
|
||||
uint32_t lutSize = parse_xaiger_literal(f);
|
||||
log_debug("m: dataSize=%u lutNum=%u lutSize=%u\n", dataSize, lutNum, lutSize);
|
||||
ConstEval ce(module);
|
||||
ConstEvalAig ce(module);
|
||||
for (unsigned i = 0; i < lutNum; ++i) {
|
||||
uint32_t rootNodeID = parse_xaiger_literal(f);
|
||||
uint32_t cutLeavesM = parse_xaiger_literal(f);
|
||||
|
@ -251,12 +251,11 @@ void AigerReader::parse_xaiger()
|
|||
}
|
||||
RTLIL::Const lut_mask(RTLIL::State::Sx, 1 << input_sig.size());
|
||||
for (int j = 0; j < (1 << cutLeavesM); ++j) {
|
||||
ce.push();
|
||||
ce.clear();
|
||||
ce.set(input_sig, RTLIL::Const{j, static_cast<int>(cutLeavesM)});
|
||||
RTLIL::SigSpec o(output_sig);
|
||||
ce.eval(o);
|
||||
lut_mask[j] = o.as_const()[0];
|
||||
ce.pop();
|
||||
}
|
||||
RTLIL::Cell *output_cell = module->cell(stringf("\\__%d__$and", rootNodeID));
|
||||
log_assert(output_cell);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue