diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-06-01 13:25:42 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-06-01 13:25:42 +0200 |
commit | 4372cf690d829755279a6a5778023e5e0a4493b2 (patch) | |
tree | 1598748761fe015b7f95b4c3c89679f36ccd7f0a /frontends/ast | |
parent | f273291dfe5de460192ef2a63a121b3c2e8b9a62 (diff) | |
download | yosys-4372cf690d829755279a6a5778023e5e0a4493b2.tar.gz yosys-4372cf690d829755279a6a5778023e5e0a4493b2.tar.bz2 yosys-4372cf690d829755279a6a5778023e5e0a4493b2.zip |
Add (* gclk *) attribute support
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'frontends/ast')
-rw-r--r-- | frontends/ast/genrtlil.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index 57ba9668d..40cbbc2a3 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -223,12 +223,18 @@ struct AST_INTERNAL::ProcessGenerator bool found_global_syncs = false; bool found_anyedge_syncs = false; for (auto child : always->children) + { + if ((child->type == AST_POSEDGE || child->type == AST_NEGEDGE) && GetSize(child->children) == 1 && child->children.at(0)->type == AST_IDENTIFIER && + child->children.at(0)->id2ast && child->children.at(0)->id2ast->type == AST_WIRE && child->children.at(0)->id2ast->get_bool_attribute("\\gclk")) { + found_global_syncs = true; + } if (child->type == AST_EDGE) { if (GetSize(child->children) == 1 && child->children.at(0)->type == AST_IDENTIFIER && child->children.at(0)->str == "\\$global_clock") found_global_syncs = true; else found_anyedge_syncs = true; } + } if (found_anyedge_syncs) { if (found_global_syncs) @@ -242,6 +248,9 @@ struct AST_INTERNAL::ProcessGenerator bool found_clocked_sync = false; for (auto child : always->children) if (child->type == AST_POSEDGE || child->type == AST_NEGEDGE) { + if (GetSize(child->children) == 1 && child->children.at(0)->type == AST_IDENTIFIER && child->children.at(0)->id2ast && + child->children.at(0)->id2ast->type == AST_WIRE && child->children.at(0)->id2ast->get_bool_attribute("\\gclk")) + continue; found_clocked_sync = true; if (found_global_syncs || found_anyedge_syncs) log_error("Found non-synthesizable event list at %s:%d!\n", always->filename.c_str(), always->linenum); |