Merge pull request #3206 from YosysHQ/micko/quote_remove

Remove quotes if any from attribute
This commit is contained in:
Miodrag Milanović 2022-03-04 16:39:01 +01:00 committed by GitHub
commit 13655ddccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -169,7 +169,10 @@ void VerificImporter::import_attributes(dict<RTLIL::IdString, RTLIL::Const> &att
FOREACH_ATTRIBUTE(obj, mi, attr) {
if (attr->Key()[0] == ' ' || attr->Value() == nullptr)
continue;
attributes[RTLIL::escape_id(attr->Key())] = RTLIL::Const(std::string(attr->Value()));
std::string val = std::string(attr->Value());
if (val.size()>1 && val[0]=='\"' && val.back()=='\"')
val = val.substr(1,val.size()-2);
attributes[RTLIL::escape_id(attr->Key())] = RTLIL::Const(val);
}
if (nl) {