mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Added dumping of attributes in AST frontend
This commit is contained in:
parent
2a25e3bca3
commit
79910a5547
|
@ -263,6 +263,11 @@ void AstNode::dumpAst(FILE *f, std::string indent)
|
||||||
fprintf(f, " int=%u", (int)integer);
|
fprintf(f, " int=%u", (int)integer);
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|
||||||
|
for (auto &it : attributes) {
|
||||||
|
fprintf(f, "%s ATTR %s:\n", indent.c_str(), it.first.c_str());
|
||||||
|
it.second->dumpAst(f, indent + " ");
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < children.size(); i++)
|
for (size_t i = 0; i < children.size(); i++)
|
||||||
children[i]->dumpAst(f, indent + " ");
|
children[i]->dumpAst(f, indent + " ");
|
||||||
}
|
}
|
||||||
|
@ -296,6 +301,12 @@ void AstNode::dumpVlog(FILE *f, std::string indent)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto &it : attributes) {
|
||||||
|
fprintf(f, "%s" "(* %s = ", indent.c_str(), id2vl(it.first).c_str());
|
||||||
|
it.second->dumpVlog(f, "");
|
||||||
|
fprintf(f, " *)%s", indent.empty() ? "" : "\n");
|
||||||
|
}
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case AST_MODULE:
|
case AST_MODULE:
|
||||||
|
|
Loading…
Reference in a new issue