aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/json_frontend.cc
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/json_frontend.cc')
-rw-r--r--frontend/json_frontend.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/frontend/json_frontend.cc b/frontend/json_frontend.cc
index 0debd9f2..d2e6248e 100644
--- a/frontend/json_frontend.cc
+++ b/frontend/json_frontend.cc
@@ -134,6 +134,16 @@ struct JsonFrontendImpl
}
}
+ template <typename TFunc> void foreach_setting(const Json &obj, TFunc Func) const
+ {
+ const auto &settings = obj["settings"];
+ if (settings.is_null())
+ return;
+ for (const auto &setting : settings.object_items()) {
+ Func(setting.first, parse_property(setting.second));
+ }
+ }
+
template <typename TFunc> void foreach_port_dir(const CellDataType &cell, TFunc Func) const
{
for (const auto &pdir : cell["port_directions"].object_items())