diff --git a/techlibs/xilinx/synth_xilinx.cc b/techlibs/xilinx/synth_xilinx.cc index a242cdef167..505026fe8ec 100644 --- a/techlibs/xilinx/synth_xilinx.cc +++ b/techlibs/xilinx/synth_xilinx.cc @@ -114,6 +114,10 @@ struct SynthXilinxPass : public ScriptPass log(" or above this number of inputs (minimum value 2, recommended value >= 5)\n"); log(" default: 0 (no inference)\n"); log("\n"); + log(" -json \n"); + log(" write the design to the specified JSON file. writing of an output file\n"); + log(" is omitted if this parameter is not specified.\n"); + log("\n"); log(" -run :\n"); log(" only run the commands between the labels (see below). an empty\n"); log(" from label is synonymous to 'begin', and empty to label is\n"); @@ -138,7 +142,7 @@ struct SynthXilinxPass : public ScriptPass log("\n"); } - std::string top_opt, edif_file, blif_file, family; + std::string top_opt, edif_file, blif_file, json_file, family; bool flatten, retime, ise, noiopad, noclkbuf, nobram, nolutram, nosrl, nocarry, nowidelut, nodsp, uram; bool abc9, dff; bool flatten_before_abc; @@ -276,6 +280,10 @@ struct SynthXilinxPass : public ScriptPass dff = true; continue; } + if (args[argidx] == "-json" && argidx+1 < args.size()) { + json_file = args[++argidx]; + continue; + } break; } extra_args(args, argidx, design); @@ -717,6 +725,12 @@ struct SynthXilinxPass : public ScriptPass if (!blif_file.empty() || help_mode) run(stringf("write_blif %s", blif_file.c_str())); } + + if (check_label("json")) + { + if (!json_file.empty() || help_mode) + run(stringf("write_json %s", help_mode ? "" : json_file.c_str())); + } } } SynthXilinxPass;