mirror of https://github.com/YosysHQ/yosys.git
Merge pull request #4210 from whitequark/fix-read_verilog-hdlname
read_verilog: correctly format `hdlname` attribute value
This commit is contained in:
commit
78b0697d33
|
@ -1820,7 +1820,7 @@ std::string AstModule::derive_common(RTLIL::Design *design, const dict<RTLIL::Id
|
||||||
|
|
||||||
AstNode *new_ast = ast->clone();
|
AstNode *new_ast = ast->clone();
|
||||||
if (!new_ast->attributes.count(ID::hdlname))
|
if (!new_ast->attributes.count(ID::hdlname))
|
||||||
new_ast->set_attribute(ID::hdlname, AstNode::mkconst_str(stripped_name));
|
new_ast->set_attribute(ID::hdlname, AstNode::mkconst_str(stripped_name.substr(1)));
|
||||||
|
|
||||||
para_counter = 0;
|
para_counter = 0;
|
||||||
for (auto child : new_ast->children) {
|
for (auto child : new_ast->children) {
|
||||||
|
|
|
@ -5662,7 +5662,7 @@ std::string AstNode::try_pop_module_prefix() const
|
||||||
if (current_scope.count(new_str)) {
|
if (current_scope.count(new_str)) {
|
||||||
std::string prefix = str.substr(0, pos);
|
std::string prefix = str.substr(0, pos);
|
||||||
auto it = current_scope_ast->attributes.find(ID::hdlname);
|
auto it = current_scope_ast->attributes.find(ID::hdlname);
|
||||||
if ((it != current_scope_ast->attributes.end() && it->second->str == prefix)
|
if ((it != current_scope_ast->attributes.end() && it->second->str == prefix.substr(1))
|
||||||
|| prefix == current_scope_ast->str)
|
|| prefix == current_scope_ast->str)
|
||||||
return new_str;
|
return new_str;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue