Skip to content

Commit

Permalink
synth_xilinx: add -json
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Oct 9, 2024
1 parent 038e262 commit 981b267
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion techlibs/xilinx/synth_xilinx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <file>\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 <from_label>:<to_label>\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");
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 ? "<file-name>" : json_file.c_str()));
}
}
} SynthXilinxPass;

Expand Down

0 comments on commit 981b267

Please sign in to comment.