qbs_command::qbs_command( const environment::ptr& env ) : cirkit_command( env, "QMDD based synthesis" ) { be_verbose(); opts.add_options() ( "esop_minimizer", value_with_default( &esop_minimizer ), "ESOP minizer (0: built-in, 1: exorcism); only with symbolic approach" ) ( "new,n", "Creates new entry in store for circuit" ) ; }
simgraph_command::simgraph_command( const environment::ptr& env ) : aig_base_command( env, "Creates simulation graphs" ) { opts.add_options() ( "vectors", value_with_default( &vectors ), "Simulation vectors (comma separated):\nah: all-hot\n1h: one-hot\n2h: two-hot\nac: all-cold\n1c: one-cold\n2c: two-cold" ) ( "dotname", value( &dotname ), "If set, simulation file is written to DOT file" ) ( "signatures,s", value_with_default( &signatures ), "Maximum arity of simulation signatures" ) ( "patternname", value( &patternname ), "If filename is given, simulation vectors are written to this file" ) ; be_verbose(); }
embed_command::embed_command( const environment::ptr& env ) : cirkit_command( env, "Embedding" ) { opts.add_options() ( "bdd,b", "Embed from BDDs" ) ( "only_lines", "Only calculate additional lines" ) ( "new,n", "Add a new entry to the store; if not set, the current entry is overriden" ) ; be_verbose(); }
rec_command::rec_command( const environment::ptr& env ) : cirkit_command( env, "Equivalence checking for reversible circuits", "[L.G. Amaru, P.-E. Gaillardon, R. Wille, and G. De Micheli, DATE 2016]" ) { opts.add_options() ( "id1", value_with_default( &id1 ), "ID of first circuit" ) ( "id2", value_with_default( &id2 ), "ID of second circuit" ) ( "name_mapping,n", "map circuits by name instead by index" ) ; be_verbose(); }
tbs_command::tbs_command( const environment::ptr& env ) : command( env, "Transformation based synthesis" ) { opts.add_options() ( "bdd,b", "Use symbolic BDD-based variant (works on RCBDDs)" ) ( "sat,s", "Use symbolic SAT-based variant (works on RCBDDs)" ) ( "cnf_from_aig", "Create initial CNF from AIG instead of BDD (works for symbolic SAT-based variant)" ) ( "all_assumptions", "Use all assumptions for the SAT call (works for symbolic SAT-based variant)" ) ( "new,n", "Add a new entry to the store; if not set, the current entry is overriden" ) ; be_verbose(); }
int main(int argc, const char *argv[]) { CmdArgParser parser(argc, argv); parser.setHeader("File Allocator Tool version " EPICS_VERSION_STRING ", built " __DATE__ ", " __TIME__ "\n\n"); parser.setArgumentsInfo("<file> <reserved bytes>"); CmdArgFlag be_verbose (parser, "verbose", "Verbose mode"); if (! parser.parse()) return -1; if (parser.getArguments().size() != 2) { parser.usage(); return -1; } verbose = be_verbose; stdString file_name = parser.getArgument(0); long reserved = atol(parser.getArgument(1)); if (verbose) printf("Opening '%s'\n", file_name.c_str()); FILE *f = fopen(file_name.c_str(), "rb"); if (!f) { fprintf(stderr, "Cannot open '%s'\n", file_name.c_str()); return -1; } if (verbose) printf("Attaching read-only file allocator, %lu reserved bytes\n", reserved); FileAllocator fa; fa.attach(f, reserved, false); fa.dump(verbose ? 10 : 0); fa.detach(); fclose(f); return 0; }
required_lines_command::required_lines_command( const environment::ptr& env ) : cirkit_command( env, "Calculates number of required lines" ) { be_verbose(); }
int main(int argc, const char *argv[]) { try { CmdArgParser parser(argc, argv); parser.setHeader("Archive Export version " ARCH_VERSION_TXT ", " EPICS_VERSION_STRING ", built " __DATE__ ", " __TIME__ "\n\n"); parser.setArgumentsInfo("<index file> {channel}"); CmdArgFlag be_verbose (parser, "verbose", "Verbose mode"); CmdArgString pattern (parser, "match", "<reg. exp.>", "Channel name pattern"); CmdArgFlag do_list (parser, "list", "List all channels"); CmdArgFlag do_info (parser, "info", "Time-range info on channels"); CmdArgString start_time (parser, "start", "<time>", "Format: \"mm/dd/yyyy[ hh:mm:ss[.nano-secs]]\""); CmdArgString end_time (parser, "end", "<time>", "(exclusive)"); CmdArgFlag status_text(parser, "text", "Include text column for status/severity (default)"); CmdArgFlag no_status_text(parser, "no_text", "Exclude text column for status/severity"); CmdArgString output (parser, "output", "<file>", "Output to file"); CmdArgDouble plotbin (parser, "plotbin", "<seconds>", "Bin the raw data for plotting"); CmdArgDouble average (parser, "average", "<seconds>", "average values"); CmdArgDouble linear (parser, "linear", "<seconds>", "Interpolate values linearly"); CmdArgString format_txt (parser, "format", "<decimal|engineering|exponential>", "Use specific format for numbers"); CmdArgInt prec (parser, "precision", "<int>", "Precision of numbers"); CmdArgFlag GNUPlot (parser, "gnuplot", "Generate GNUPlot command file"); CmdArgFlag image (parser, "Gnuplot", "Generate GNUPlot output for Image"); CmdArgFlag raw_time (parser, "raw_time", "Include columns for EPICS time stamp"); CmdArgFlag millisecs (parser, "millisecs", "Truncate time to millisecs in spreadsheet dump."); // defaults prec.set(-1); if (! parser.parse()) return -1; if (parser.getArguments().size() < 1) { parser.usage(); return -1; } precision = prec; if (!strncmp(format_txt.get().c_str(), "d", 1)) format = RawValue::DECIMAL; else if (!strncmp(format_txt.get().c_str(), "en", 2)) format = RawValue::ENGINEERING; else if (!strncmp(format_txt.get().c_str(), "ex", 2)) format = RawValue::EXPONENTIAL; else if (format_txt.get().length() > 0) { fprintf(stderr, "Unknown format string '%s'\n", format_txt.get().c_str()); return -1; } verbose = be_verbose; only_millisecs = millisecs; // Start/end time AutoPtr<epicsTime> start, end; stdString txt; if (start_time.get().length() > 0) { start = new epicsTime; if (!string2epicsTime(start_time.get(), *start)) { fprintf(stderr, "Parse error for start time '%s'\n", start_time.get().c_str()); start = 0; parser.usage(); return -1; } if (verbose) printf("Using start time %s\n", epicsTimeTxt(*start, txt)); } if (end_time.get().length() > 0) { end = new epicsTime(); if (!string2epicsTime(end_time.get(), *end)) { fprintf(stderr, "Parse error for end time '%s'\n", end_time.get().c_str()); end = 0; parser.usage(); return -1; } if (verbose) printf("Using end time %s\n", epicsTimeTxt(*end, txt)); } if (start && end && *start > *end) { // Could simply swap start and end, but assume the user is // confused and should rethink the request. fprintf(stderr, "start time is greater than end time.\n"); return -1; } // Index name stdString index_name = parser.getArgument(0); // Channel names stdVector<stdString> names; if (parser.getArguments().size() > 1) { if (! pattern.get().empty()) { fputs("Pattern from '-m' switch is ignored\n" "since a list of channels was also provided.\n", stderr); } // first argument was directory file name, skip that: for (size_t i=1; i<parser.getArguments().size(); ++i) names.push_back(parser.getArgument(i)); } if ((GNUPlot || image) && output.get().length() == 0) { fprintf(stderr, "The -gnuplot/Gnuplot options require " "an -output file\n"); return -1; } // How? ReaderFactory::How how = ReaderFactory::Raw; double delta = 0.0; if (double(plotbin) > 0.0) { how = ReaderFactory::Plotbin; delta = double(plotbin); } else if (double(average) > 0.0) { how = ReaderFactory::Average; delta = double(average); } else if (double(linear) > 0.0) { how = ReaderFactory::Linear; delta = double(linear); } // Open index AutoIndex index; index.open(index_name.c_str()); if (verbose) printf("Opened index '%s'\n", index_name.c_str()); if (do_info && names.size()<=0 && pattern.get().length()<=0) do_list.set(); // otherwise it'd be a NOP if (names.size() <= 0 && (do_list || pattern.get().length() > 0)) get_names_for_pattern(index, names, pattern); if (do_info) list_channels(index, names, true); else if (do_list) list_channels(index, names, false); else if (names.size() > 0) { if (GNUPlot || image) dump_gnuplot(index, names, start, end, how, delta, output, image); else dump_spreadsheet(index, names, start, end, raw_time, !no_status_text, how, delta, output); } index.close(); } catch (GenericException &e) { fprintf(stderr, "Error:\n%s\n", e.what()); return -1; } return 0; }
nct_command::nct_command( const environment::ptr& env ) : cirkit_command( env, "NCT mapping" ) { add_new_option(); be_verbose(); }