mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-21 05:13:40 +00:00
Various improvements in support for generate statements
This commit is contained in:
parent
f4b46ed31e
commit
4a4a3fc337
7 changed files with 161 additions and 7 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue