mirror of
https://github.com/YosysHQ/yosys
synced 2025-05-10 09:15:49 +00:00
driver: add --no-version to suppress writing Yosys version in command outputs
This commit is contained in:
parent
f60bbe64ac
commit
d7affb8821
14 changed files with 31 additions and 13 deletions
|
@ -662,8 +662,8 @@ struct AigerWriter
|
||||||
f << std::endl;
|
f << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (yosys_write_versions)
|
||||||
f << stringf("c\nGenerated by %s\n", yosys_version_str);
|
f << stringf("c\nGenerated by %s\n", yosys_version_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_map(std::ostream &f, bool verbose_map, bool no_startoffset)
|
void write_map(std::ostream &f, bool verbose_map, bool no_startoffset)
|
||||||
|
|
|
@ -671,7 +671,8 @@ struct XAigerWriter
|
||||||
//f.write(reinterpret_cast<const char*>(&buffer_size_be), sizeof(buffer_size_be));
|
//f.write(reinterpret_cast<const char*>(&buffer_size_be), sizeof(buffer_size_be));
|
||||||
//f.write(buffer_str.data(), buffer_str.size());
|
//f.write(buffer_str.data(), buffer_str.size());
|
||||||
|
|
||||||
f << stringf("Generated by %s\n", yosys_version_str);
|
if (yosys_write_versions)
|
||||||
|
f << stringf("Generated by %s\n", yosys_version_str);
|
||||||
|
|
||||||
design->scratchpad_set_int("write_xaiger.num_ands", and_map.size());
|
design->scratchpad_set_int("write_xaiger.num_ands", and_map.size());
|
||||||
design->scratchpad_set_int("write_xaiger.num_wires", aig_map.size());
|
design->scratchpad_set_int("write_xaiger.num_wires", aig_map.size());
|
||||||
|
|
|
@ -649,7 +649,8 @@ struct BlifBackend : public Backend {
|
||||||
if (module->get_bool_attribute(ID::top))
|
if (module->get_bool_attribute(ID::top))
|
||||||
top_module_name = module->name.str();
|
top_module_name = module->name.str();
|
||||||
|
|
||||||
*f << stringf("# Generated by %s\n", yosys_version_str);
|
if (yosys_write_versions)
|
||||||
|
*f << stringf("# Generated by %s\n", yosys_version_str);
|
||||||
|
|
||||||
std::vector<RTLIL::Module*> mod_list;
|
std::vector<RTLIL::Module*> mod_list;
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,9 @@ struct EdifBackend : public Backend {
|
||||||
*f << stringf(" (edifVersion 2 0 0)\n");
|
*f << stringf(" (edifVersion 2 0 0)\n");
|
||||||
*f << stringf(" (edifLevel 0)\n");
|
*f << stringf(" (edifLevel 0)\n");
|
||||||
*f << stringf(" (keywordMap (keywordLevel 0))\n");
|
*f << stringf(" (keywordMap (keywordLevel 0))\n");
|
||||||
*f << stringf(" (comment \"Generated by %s\")\n", yosys_version_str);
|
|
||||||
|
if (yosys_write_versions)
|
||||||
|
*f << stringf(" (comment \"Generated by %s\")\n", yosys_version_str);
|
||||||
|
|
||||||
*f << stringf(" (external LIB\n");
|
*f << stringf(" (external LIB\n");
|
||||||
*f << stringf(" (edifLevel 0)\n");
|
*f << stringf(" (edifLevel 0)\n");
|
||||||
|
|
|
@ -291,7 +291,8 @@ struct JsonWriter
|
||||||
design->sort();
|
design->sort();
|
||||||
|
|
||||||
f << stringf("{\n");
|
f << stringf("{\n");
|
||||||
f << stringf(" \"creator\": %s,\n", get_string(yosys_version_str).c_str());
|
if (yosys_write_versions)
|
||||||
|
f << stringf(" \"creator\": %s,\n", get_string(yosys_version_str).c_str());
|
||||||
f << stringf(" \"modules\": {\n");
|
f << stringf(" \"modules\": {\n");
|
||||||
vector<Module*> modules = use_selection ? design->selected_modules() : design->modules();
|
vector<Module*> modules = use_selection ? design->selected_modules() : design->modules();
|
||||||
bool first_module = true;
|
bool first_module = true;
|
||||||
|
|
|
@ -459,7 +459,9 @@ struct RTLILBackend : public Backend {
|
||||||
design->sort();
|
design->sort();
|
||||||
|
|
||||||
log("Output filename: %s\n", filename.c_str());
|
log("Output filename: %s\n", filename.c_str());
|
||||||
*f << stringf("# Generated by %s\n", yosys_version_str);
|
|
||||||
|
if (yosys_write_versions)
|
||||||
|
*f << stringf("# Generated by %s\n", yosys_version_str);
|
||||||
RTLIL_BACKEND::dump_design(*f, design, selected, true, false);
|
RTLIL_BACKEND::dump_design(*f, design, selected, true, false);
|
||||||
}
|
}
|
||||||
} RTLILBackend;
|
} RTLILBackend;
|
||||||
|
|
|
@ -1289,6 +1289,7 @@ class MkVcd:
|
||||||
assert t >= self.t
|
assert t >= self.t
|
||||||
if t != self.t:
|
if t != self.t:
|
||||||
if self.t == -1:
|
if self.t == -1:
|
||||||
|
# TODO if (yosys_write_versions) equivalent?
|
||||||
print("$version Generated by Yosys-SMTBMC $end", file=self.f)
|
print("$version Generated by Yosys-SMTBMC $end", file=self.f)
|
||||||
print("$timescale 1ns $end", file=self.f)
|
print("$timescale 1ns $end", file=self.f)
|
||||||
print("$var integer 32 t smt_step $end", file=self.f)
|
print("$var integer 32 t smt_step $end", file=self.f)
|
||||||
|
|
|
@ -2596,7 +2596,9 @@ struct VerilogBackend : public Backend {
|
||||||
|
|
||||||
design->sort();
|
design->sort();
|
||||||
|
|
||||||
*f << stringf("/* Generated by %s */\n", yosys_version_str);
|
if (yosys_write_versions)
|
||||||
|
*f << stringf("/* Generated by %s */\n", yosys_version_str);
|
||||||
|
|
||||||
for (auto module : design->modules()) {
|
for (auto module : design->modules()) {
|
||||||
if (module->get_blackbox_attribute() != blackboxes)
|
if (module->get_blackbox_attribute() != blackboxes)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -252,6 +252,7 @@ int main(int argc, char **argv)
|
||||||
options.add_options("logging")
|
options.add_options("logging")
|
||||||
("Q", "suppress printing of banner (copyright, disclaimer, version)")
|
("Q", "suppress printing of banner (copyright, disclaimer, version)")
|
||||||
("T", "suppress printing of footer (log hash, version, timing statistics)")
|
("T", "suppress printing of footer (log hash, version, timing statistics)")
|
||||||
|
("no-version", "suppress writing Yosys version in command outputs")
|
||||||
("q,quiet", "quiet operation. Only write warnings and error messages to console. " \
|
("q,quiet", "quiet operation. Only write warnings and error messages to console. " \
|
||||||
"Use this option twice to also quiet warning messages")
|
"Use this option twice to also quiet warning messages")
|
||||||
("v,verbose", "print log headers up to <level> to the console. " \
|
("v,verbose", "print log headers up to <level> to the console. " \
|
||||||
|
@ -318,6 +319,7 @@ int main(int argc, char **argv)
|
||||||
if (result.count("A")) call_abort = true;
|
if (result.count("A")) call_abort = true;
|
||||||
if (result.count("Q")) print_banner = false;
|
if (result.count("Q")) print_banner = false;
|
||||||
if (result.count("T")) print_stats = false;
|
if (result.count("T")) print_stats = false;
|
||||||
|
if (result.count("no-version")) yosys_write_versions = false;
|
||||||
if (result.count("V")) {
|
if (result.count("V")) {
|
||||||
std::cout << yosys_version_str << std::endl;
|
std::cout << yosys_version_str << std::endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
|
@ -81,6 +81,7 @@ YOSYS_NAMESPACE_BEGIN
|
||||||
|
|
||||||
int autoidx = 1;
|
int autoidx = 1;
|
||||||
int yosys_xtrace = 0;
|
int yosys_xtrace = 0;
|
||||||
|
bool yosys_write_versions = true;
|
||||||
RTLIL::Design *yosys_design = NULL;
|
RTLIL::Design *yosys_design = NULL;
|
||||||
CellTypes yosys_celltypes;
|
CellTypes yosys_celltypes;
|
||||||
|
|
||||||
|
|
|
@ -274,6 +274,7 @@ inline int GetSize(RTLIL::Wire *wire);
|
||||||
|
|
||||||
extern int autoidx;
|
extern int autoidx;
|
||||||
extern int yosys_xtrace;
|
extern int yosys_xtrace;
|
||||||
|
extern bool yosys_write_versions;
|
||||||
|
|
||||||
RTLIL::IdString new_id(std::string file, int line, std::string func);
|
RTLIL::IdString new_id(std::string file, int line, std::string func);
|
||||||
RTLIL::IdString new_id_suffix(std::string file, int line, std::string func, std::string suffix);
|
RTLIL::IdString new_id_suffix(std::string file, int line, std::string func, std::string suffix);
|
||||||
|
|
|
@ -99,7 +99,8 @@ struct InternalStatsPass : public Pass {
|
||||||
|
|
||||||
if (json_mode) {
|
if (json_mode) {
|
||||||
log("{\n");
|
log("{\n");
|
||||||
log(" \"creator\": %s,\n", json11::Json(yosys_version_str).dump().c_str());
|
if (yosys_write_versions)
|
||||||
|
log(" \"creator\": %s,\n", json11::Json(yosys_version_str).dump().c_str());
|
||||||
std::stringstream invocation;
|
std::stringstream invocation;
|
||||||
std::copy(args.begin(), args.end(), std::ostream_iterator<std::string>(invocation, " "));
|
std::copy(args.begin(), args.end(), std::ostream_iterator<std::string>(invocation, " "));
|
||||||
log(" \"invocation\": %s,\n", json11::Json(invocation.str()).dump().c_str());
|
log(" \"invocation\": %s,\n", json11::Json(invocation.str()).dump().c_str());
|
||||||
|
|
|
@ -444,7 +444,8 @@ struct StatPass : public Pass {
|
||||||
|
|
||||||
if (json_mode) {
|
if (json_mode) {
|
||||||
log("{\n");
|
log("{\n");
|
||||||
log(" \"creator\": %s,\n", json11::Json(yosys_version_str).dump().c_str());
|
if (yosys_write_versions)
|
||||||
|
log(" \"creator\": %s,\n", json11::Json(yosys_version_str).dump().c_str());
|
||||||
std::stringstream invocation;
|
std::stringstream invocation;
|
||||||
std::copy(args.begin(), args.end(), std::ostream_iterator<std::string>(invocation, " "));
|
std::copy(args.begin(), args.end(), std::ostream_iterator<std::string>(invocation, " "));
|
||||||
log(" \"invocation\": %s,\n", json11::Json(invocation.str()).dump().c_str());
|
log(" \"invocation\": %s,\n", json11::Json(invocation.str()).dump().c_str());
|
||||||
|
|
|
@ -690,9 +690,11 @@ struct SatHelper
|
||||||
fprintf(f, "$date\n");
|
fprintf(f, "$date\n");
|
||||||
fprintf(f, " %s\n", stime);
|
fprintf(f, " %s\n", stime);
|
||||||
fprintf(f, "$end\n");
|
fprintf(f, "$end\n");
|
||||||
fprintf(f, "$version\n");
|
if (yosys_write_versions) {
|
||||||
fprintf(f, " Generated by %s\n", yosys_version_str);
|
fprintf(f, "$version\n");
|
||||||
fprintf(f, "$end\n");
|
fprintf(f, " Generated by %s\n", yosys_version_str);
|
||||||
|
fprintf(f, "$end\n");
|
||||||
|
}
|
||||||
fprintf(f, "$comment\n");
|
fprintf(f, "$comment\n");
|
||||||
fprintf(f, " Generated from SAT problem in module %s (declared at %s)\n",
|
fprintf(f, " Generated from SAT problem in module %s (declared at %s)\n",
|
||||||
module->name.c_str(), module_fname.c_str());
|
module->name.c_str(), module_fname.c_str());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue