aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/json
diff options
context:
space:
mode:
authorZipCPU <dgisselq@ieee.org>2018-06-07 07:38:35 -0400
committerZipCPU <dgisselq@ieee.org>2018-06-07 07:38:35 -0400
commitd7bb30cc66f2ba39c77a979b809a6e6bdfcb5097 (patch)
treeda200cee3b96d711c68455e602ebf351d1b62e08 /frontend/json
parent109287ee90cf5d7a7858d04dbc0fea595981538f (diff)
downloadnextpnr-d7bb30cc66f2ba39c77a979b809a6e6bdfcb5097.tar.gz
nextpnr-d7bb30cc66f2ba39c77a979b809a6e6bdfcb5097.tar.bz2
nextpnr-d7bb30cc66f2ba39c77a979b809a6e6bdfcb5097.zip
added ports (not ports_directions) to jsonparse.cc
Diffstat (limited to 'frontend/json')
-rw-r--r--frontend/json/jsonparse.cc27
1 files changed, 19 insertions, 8 deletions
diff --git a/frontend/json/jsonparse.cc b/frontend/json/jsonparse.cc
index 25b01e44..41ecebd4 100644
--- a/frontend/json/jsonparse.cc
+++ b/frontend/json/jsonparse.cc
@@ -34,7 +34,7 @@ extern bool check_all_nets_driven(Design *design);
namespace JsonParser {
- const bool json_debug = false;
+ const bool json_debug = true;
typedef std::string string;
@@ -566,13 +566,24 @@ void json_import_cell(Design *design, string modname, JsonNode *cell_node,
// Both should contain dictionaries having the same keys.
//
- JsonNode *pdir_node
- = cell_node->data_dict.at("port_directions");
- if (pdir_node->type != 'D')
- log_error("JSON port_directions node of \'%s\' "
- "in module \'%s\' is not a "
- "dictionary\n", cell->name.c_str(),
- modname.c_str());
+ JsonNode *pdir_node = NULL;
+ if (cell_node->data_dict.count("port_directions") > 0) {
+
+ pdir_node = cell_node->data_dict.at("port_directions");
+ if (pdir_node->type != 'D')
+ log_error("JSON port_directions node of \'%s\' "
+ "in module \'%s\' is not a "
+ "dictionary\n", cell->name.c_str(),
+ modname.c_str());
+
+ } else if (cell_node->data_dict.count("ports") > 0) {
+ pdir_node = cell_node->data_dict.at("ports");
+ if (pdir_node->type != 'D')
+ log_error("JSON ports node of \'%s\' "
+ "in module \'%s\' is not a "
+ "dictionary\n", cell->name.c_str(),
+ modname.c_str());
+ }
JsonNode *connections
= cell_node->data_dict.at("connections");