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:
parent
aa7a3ed83f
commit
acb435b6cf
3 changed files with 41 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue