aboutsummaryrefslogtreecommitdiffstats
path: root/json
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-06-12 18:34:34 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2019-06-12 18:34:34 +0200
commit856760599e51bd4c6da34112c993dc8bfb995f36 (patch)
tree02ea7d93a960eb5d177b7a9301693710b6724884 /json
parentd9b0bac248a12466cd2b62d02ec11b2e60d25019 (diff)
downloadnextpnr-856760599e51bd4c6da34112c993dc8bfb995f36.tar.gz
nextpnr-856760599e51bd4c6da34112c993dc8bfb995f36.tar.bz2
nextpnr-856760599e51bd4c6da34112c993dc8bfb995f36.zip
Use properties for settings and save in json
Diffstat (limited to 'json')
-rw-r--r--json/jsonparse.cc2
-rw-r--r--json/jsonwrite.cc5
2 files changed, 3 insertions, 4 deletions
diff --git a/json/jsonparse.cc b/json/jsonparse.cc
index a36f891d..f0d0069a 100644
--- a/json/jsonparse.cc
+++ b/json/jsonparse.cc
@@ -907,7 +907,7 @@ bool parse_json_file(std::istream &f, std::string &filename, Context *ctx)
log_info("Checksum: 0x%08x\n", ctx->checksum());
log_break();
- ctx->settings.emplace(ctx->id("input/json"), filename);
+ ctx->settings[ctx->id("input/json")] = filename;
ctx->attributesToArchInfo();
return true;
} catch (log_execution_error_exception) {
diff --git a/json/jsonwrite.cc b/json/jsonwrite.cc
index 19c43d7c..ac54bc4e 100644
--- a/json/jsonwrite.cc
+++ b/json/jsonwrite.cc
@@ -69,10 +69,9 @@ void write_module(std::ostream &f, Context *ctx)
f << stringf(" %s: {\n", get_string(val->second.str).c_str());
else
f << stringf(" %s: {\n", get_string("top").c_str());
- // TODO: check if this is better to be separate
- /*f << stringf(" \"settings\": {");
+ f << stringf(" \"settings\": {");
write_parameters(f, ctx, ctx->settings, true);
- f << stringf("\n },\n");*/
+ f << stringf("\n },\n");
f << stringf(" \"attributes\": {");
write_parameters(f, ctx, ctx->attrs, true);
f << stringf("\n },\n");