diff options
Diffstat (limited to 'frontend/json_frontend.cc')
-rw-r--r-- | frontend/json_frontend.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/frontend/json_frontend.cc b/frontend/json_frontend.cc index 37c1dabd..2eb0a39b 100644 --- a/frontend/json_frontend.cc +++ b/frontend/json_frontend.cc @@ -181,6 +181,10 @@ bool parse_json(std::istream &in, const std::string &filename, Context *ctx) root = Json::parse(json_str, error, JsonParse::COMMENTS); if (root.is_null()) log_error("Failed to parse JSON file '%s': %s.\n", filename.c_str(), error.c_str()); + root = root["modules"]; + if (root.is_null()) + log_error("JSON file '%s' doesn't look like a netlist (doesn't contain \"modules\" key)\n", + filename.c_str()); } GenericFrontend<JsonFrontendImpl>(ctx, JsonFrontendImpl(root))(); return true; |