mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 01:54:10 +00:00
Add and use SigSpec::reverse()
This commit is contained in:
parent
e18aeda7ed
commit
6d27d43727
|
@ -410,7 +410,7 @@ void AigerReader::parse_xaiger()
|
||||||
RTLIL::Wire *output_sig = module->wire(stringf("$aiger%d$%d", aiger_autoidx, rootNodeID));
|
RTLIL::Wire *output_sig = module->wire(stringf("$aiger%d$%d", aiger_autoidx, rootNodeID));
|
||||||
log_assert(output_sig);
|
log_assert(output_sig);
|
||||||
uint32_t nodeID;
|
uint32_t nodeID;
|
||||||
std::vector<SigBit> input_bits;
|
RTLIL::SigSpec input_sig;
|
||||||
for (unsigned j = 0; j < cutLeavesM; ++j) {
|
for (unsigned j = 0; j < cutLeavesM; ++j) {
|
||||||
nodeID = parse_xaiger_literal(f);
|
nodeID = parse_xaiger_literal(f);
|
||||||
log_debug2("\t%u\n", nodeID);
|
log_debug2("\t%u\n", nodeID);
|
||||||
|
@ -420,10 +420,10 @@ void AigerReader::parse_xaiger()
|
||||||
}
|
}
|
||||||
RTLIL::Wire *wire = module->wire(stringf("$aiger%d$%d", aiger_autoidx, nodeID));
|
RTLIL::Wire *wire = module->wire(stringf("$aiger%d$%d", aiger_autoidx, nodeID));
|
||||||
log_assert(wire);
|
log_assert(wire);
|
||||||
input_bits.push_back(wire);
|
input_sig.append(wire);
|
||||||
}
|
}
|
||||||
// Reverse input order as fastest input is returned first
|
// Reverse input order as fastest input is returned first
|
||||||
RTLIL::SigSpec input_sig(std::vector<SigBit>(input_bits.rbegin(), input_bits.rend()));
|
input_sig.reverse();
|
||||||
// TODO: Compute LUT mask from AIG in less than O(2 ** input_sig.size())
|
// TODO: Compute LUT mask from AIG in less than O(2 ** input_sig.size())
|
||||||
ce.clear();
|
ce.clear();
|
||||||
ce.compute_deps(output_sig, input_sig.to_sigbit_pool());
|
ce.compute_deps(output_sig, input_sig.to_sigbit_pool());
|
||||||
|
|
|
@ -851,6 +851,8 @@ public:
|
||||||
|
|
||||||
RTLIL::SigSpec repeat(int num) const;
|
RTLIL::SigSpec repeat(int num) const;
|
||||||
|
|
||||||
|
void reverse() { inline_unpack(); std::reverse(bits_.begin(), bits_.end()); }
|
||||||
|
|
||||||
bool operator <(const RTLIL::SigSpec &other) const;
|
bool operator <(const RTLIL::SigSpec &other) const;
|
||||||
bool operator ==(const RTLIL::SigSpec &other) const;
|
bool operator ==(const RTLIL::SigSpec &other) const;
|
||||||
inline bool operator !=(const RTLIL::SigSpec &other) const { return !(*this == other); }
|
inline bool operator !=(const RTLIL::SigSpec &other) const { return !(*this == other); }
|
||||||
|
|
Loading…
Reference in a new issue