aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast/ast.cc
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/ast/ast.cc')
-rw-r--r--frontends/ast/ast.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc
index ccadc2069..10c7fc85b 100644
--- a/frontends/ast/ast.cc
+++ b/frontends/ast/ast.cc
@@ -135,6 +135,7 @@ std::string AST::type2str(AstNodeType type)
X(AST_GENVAR)
X(AST_GENFOR)
X(AST_GENIF)
+ X(AST_GENCASE)
X(AST_GENBLOCK)
X(AST_POSEDGE)
X(AST_NEGEDGE)
@@ -700,6 +701,15 @@ RTLIL::Const AstNode::asParaConst()
return val;
}
+bool AstNode::asBool()
+{
+ log_assert(type == AST_CONSTANT);
+ for (auto &bit : bits)
+ if (bit == RTLIL::State::S1)
+ return true;
+ return false;
+}
+
// create a new AstModule from an AST_MODULE AST node
static AstModule* process_module(AstNode *ast)
{