1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-04-28 12:57:13 +00:00

Added support for attributes/properties types

This commit is contained in:
Miodrag Milanovic
2019-06-01 15:52:32 +02:00
parent ccbe2dd18d
commit d5d8213871
6 changed files with 51 additions and 13 deletions

View File

@@ -48,13 +48,16 @@ std::string get_name(IdString name, Context *ctx)
return get_string(name.c_str(ctx));
}
bool write_parameters(std::ostream &f, Context *ctx, const std::unordered_map<IdString, std::string> &parameters, bool for_module=false)
bool write_parameters(std::ostream &f, Context *ctx, const std::unordered_map<IdString, Property> &parameters, bool for_module=false)
{
bool first = true;
for (auto &param : parameters) {
f << stringf("%s\n", first ? "" : ",");
f << stringf(" %s%s: ", for_module ? "" : " ", get_name(param.first,ctx).c_str());
f << get_string(param.second);
if (param.second.isString())
f << get_string(param.second);
else
f << param.second.num;
first = false;
}
return first;