aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/log.cc2
-rw-r--r--common/log.h5
-rw-r--r--frontend/json/jsonparse.cc27
3 files changed, 21 insertions, 13 deletions
diff --git a/common/log.cc b/common/log.cc
index 84150a15..00e1765f 100644
--- a/common/log.cc
+++ b/common/log.cc
@@ -31,8 +31,6 @@
std::vector<FILE*> log_files;
std::vector<std::ostream*> log_streams;
-std::map<std::string, std::set<std::string>> log_hdump;
-bool log_hdump_all = false;
FILE *log_errfile = NULL;
bool log_error_stderr = false;
diff --git a/common/log.h b/common/log.h
index 259a30a1..2bf1604a 100644
--- a/common/log.h
+++ b/common/log.h
@@ -24,6 +24,7 @@
#include <string>
#include <vector>
#include <set>
+#include <ostream>
#include <stdio.h>
#include <stdarg.h>
@@ -38,9 +39,6 @@ struct log_cmd_error_exception { };
extern std::vector<FILE*> log_files;
extern std::vector<std::ostream*> log_streams;
-extern std::set<std::string> log_warnings;
-extern int log_warnings_count;
-extern bool log_hdump_all;
extern FILE *log_errfile;
extern bool log_quiet_warnings;
@@ -54,6 +52,7 @@ void logv_warning_noprefix(const char *format, va_list ap);
NXP_NORETURN void logv_error(const char *format, va_list ap)
NXP_ATTRIBUTE(noreturn);
+extern std::ostream clog;
void log(const char *format, ...);
void log_header(const char *format, ...);
void log_info(const char *format, ...);
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");