From d9b0bac248a12466cd2b62d02ec11b2e60d25019 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 7 Jun 2019 16:11:11 +0200 Subject: Save top level attrs and store current step --- json/jsonwrite.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'json/jsonwrite.cc') diff --git a/json/jsonwrite.cc b/json/jsonwrite.cc index 811a2eec..19c43d7c 100644 --- a/json/jsonwrite.cc +++ b/json/jsonwrite.cc @@ -64,13 +64,17 @@ void write_parameters(std::ostream &f, Context *ctx, const std::unordered_mapattrs.find(ctx->id("module")); + if (val != ctx->attrs.end()) + 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\": {"); write_parameters(f, ctx, ctx->settings, true); f << stringf("\n },\n");*/ f << stringf(" \"attributes\": {"); - // TODO: Top level attributes + write_parameters(f, ctx, ctx->attrs, true); f << stringf("\n },\n"); f << stringf(" \"ports\": {"); // TODO: Top level ports -- cgit v1.2.3