aboutsummaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
authorZipCPU <dgisselq@ieee.org>2018-06-05 11:39:27 -0400
committerZipCPU <dgisselq@ieee.org>2018-06-05 11:39:27 -0400
commitbd08f9e698269764d9e06052470d4a699f69f951 (patch)
treebdf7bdd53665896e241f1d65682f4f3ad2cc9cfe /frontend
parent8b6f8382b8d80147e6528238ae7a7cf642daaa07 (diff)
downloadnextpnr-bd08f9e698269764d9e06052470d4a699f69f951.tar.gz
nextpnr-bd08f9e698269764d9e06052470d4a699f69f951.tar.bz2
nextpnr-bd08f9e698269764d9e06052470d4a699f69f951.zip
Removed the log_ dependencies from json-parser
Diffstat (limited to 'frontend')
-rw-r--r--frontend/json/jsonparse.cc39
1 files changed, 4 insertions, 35 deletions
diff --git a/frontend/json/jsonparse.cc b/frontend/json/jsonparse.cc
index 2f5ab602..9e8aecbe 100644
--- a/frontend/json/jsonparse.cc
+++ b/frontend/json/jsonparse.cc
@@ -25,6 +25,7 @@
#include <iostream>
#include <fstream>
#include <assert.h>
+#include <log.h>
#include "common/design.h"
#include "ice40/chip.h"
#warning "CC files shouldnt be included"
@@ -36,41 +37,8 @@
namespace JsonParser {
-void log_error(const char fmt, ...) {
- va_list args;
-
- std::string sfmt = "ERROR: " + fmt;
- va_start(args, fmt);
- vfprintf(stderr, fmt, args);
- va_end(args);
- exit(EXIT_FAILURE);
-}
-
-void log_warning(const char fmt, ...) {
- va_list args;
-
- std::string sfmt = "WARNING: " + fmt;
- va_start(args, fmt);
- vfprintf(stderr, sfmt.c_str(), args);
- va_end(args);
-}
-
-void log_info(const char fmt, ...) {
- va_list args;
-
- std::string sfmt = "INFO: " + fmt;
- va_start(args, fmt);
- vfprintf(stderr, sfmt.c_str(), args);
- va_end(args);
-}
-
typedef std::string string;
-void log_header(Design *d, const char *str) {
- std::cout << str;
- // log_header(design, "Executing JSON frontend.\n");
-}
-
template<typename T> int GetSize(const T &obj) { return obj.size(); }
@@ -487,7 +455,7 @@ struct JsonFrontend {
virtual void execute(std::istream *&f, std::string filename,
Design *design)
{
- log_header(design, "Executing JSON frontend.\n");
+ // log_header(design, "Executing JSON frontend.\n");
JsonNode root(*f);
@@ -501,7 +469,6 @@ struct JsonFrontend {
if (modules->type != 'D')
log_error("JSON modules node is not a dictionary.\n");
-fprintf(stderr, "Looping\n");
for (auto &it : modules->data_dict)
json_import(design, it.first, it.second);
}
@@ -521,6 +488,8 @@ int main(int argc, char **argv) {
std::string fname = "../../ice40/blinky.json";
std::istream *f = new std::ifstream(fname);
parser->execute(f, fname, design);
+
+ printf("Successful exit\n");
}
int num_wires_384 = 0;