3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-22 22:03:40 +00:00

Added const folding of AST_CASE to AST simplifier

This commit is contained in:
Clifford Wolf 2014-08-18 00:02:30 +02:00
parent aa7a3ed83f
commit acb435b6cf
3 changed files with 41 additions and 1 deletions

View file

@ -722,6 +722,14 @@ AstNode *AstNode::mkconst_str(const std::string &str)
return node;
}
bool AstNode::bits_only_01()
{
for (auto bit : bits)
if (bit != RTLIL::S0 && bit != RTLIL::S1)
return false;
return true;
}
RTLIL::Const AstNode::bitsAsConst(int width, bool is_signed)
{
std::vector<RTLIL::State> bits = this->bits;