Skip to content

Commit

Permalink
Merge pull request #4719 from AdamLee7/main
Browse files Browse the repository at this point in the history
add select option for write_json
  • Loading branch information
KrystalDelusion authored Nov 18, 2024
2 parents 22e214e + 7ed359f commit dcff8b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion backends/json/json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ struct JsonBackend : public Backend {
log(" emit 32-bit or smaller fully-defined parameter values directly\n");
log(" as JSON numbers (for compatibility with old parsers)\n");
log("\n");
log(" -selected\n");
log(" output only select module\n");
log("\n");
log("\n");
log("The general syntax of the JSON output created by this command is as follows:\n");
log("\n");
Expand Down Expand Up @@ -597,6 +600,7 @@ struct JsonBackend : public Backend {
{
bool aig_mode = false;
bool compat_int_mode = false;
bool use_selection = false;

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
Expand All @@ -609,13 +613,17 @@ struct JsonBackend : public Backend {
compat_int_mode = true;
continue;
}
if (args[argidx] == "-selected") {
use_selection = true;
continue;
}
break;
}
extra_args(f, filename, args, argidx);

log_header(design, "Executing JSON backend.\n");

JsonWriter json_writer(*f, false, aig_mode, compat_int_mode);
JsonWriter json_writer(*f, use_selection, aig_mode, compat_int_mode);
json_writer.write_design(design);
}
} JsonBackend;
Expand Down

0 comments on commit dcff8b0

Please sign in to comment.