aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/driver.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-08-20 09:48:12 +0200
committerClifford Wolf <clifford@clifford.at>2013-08-20 09:48:12 +0200
commit485e870bcd563c843a257b4c8178589c9c3a3e66 (patch)
treeec48f1cccfe68d2b74e0959038a827189af6b181 /kernel/driver.cc
parent1af1cebb64b5d8d3f0a66d01d05762a15b3bc0db (diff)
downloadyosys-485e870bcd563c843a257b4c8178589c9c3a3e66.tar.gz
yosys-485e870bcd563c843a257b4c8178589c9c3a3e66.tar.bz2
yosys-485e870bcd563c843a257b4c8178589c9c3a3e66.zip
Added version info to yosys command and added -V option
Diffstat (limited to 'kernel/driver.cc')
-rw-r--r--kernel/driver.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 8765c8b87..8d8f29e77 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -31,6 +31,9 @@
#include "kernel/register.h"
#include "kernel/log.h"
+// from kernel/version_*.o (cc source generated from Makefile)
+extern const char *yosys_version_str;
+
bool fgetline(FILE *f, std::string &buffer)
{
buffer = "";
@@ -438,10 +441,13 @@ int main(int argc, char **argv)
}
int opt;
- while ((opt = getopt(argc, argv, "Sm:f:b:o:p:l:qts:c:")) != -1)
+ while ((opt = getopt(argc, argv, "VSm:f:b:o:p:l:qts:c:")) != -1)
{
switch (opt)
{
+ case 'V':
+ printf("%s\n", yosys_version_str);
+ exit(0);
case 'S':
backend_command = "verilog -noattr";
passes_commands.push_back("hierarchy");
@@ -494,7 +500,7 @@ int main(int argc, char **argv)
break;
default:
fprintf(stderr, "\n");
- fprintf(stderr, "Usage: %s [-S] [-q] [-t] [-l logfile] [-o <outfile>] [-f <frontend>] [{-s|-c} <scriptfile>]\n", argv[0]);
+ fprintf(stderr, "Usage: %s [-V] [-S] [-q] [-t] [-l logfile] [-o <outfile>] [-f <frontend>] [{-s|-c} <scriptfile>]\n", argv[0]);
fprintf(stderr, " %*s[-p <pass> [-p ..]] [-b <backend>] [-m <module_file>] [<infile> [..]]\n", int(strlen(argv[0])+1), "");
fprintf(stderr, "\n");
fprintf(stderr, " -q\n");
@@ -527,6 +533,9 @@ int main(int argc, char **argv)
fprintf(stderr, " -m module_file\n");
fprintf(stderr, " load the specified module (aka plugin)\n");
fprintf(stderr, "\n");
+ fprintf(stderr, " -V\n");
+ fprintf(stderr, " print version information and exit\n");
+ fprintf(stderr, "\n");
fprintf(stderr, "The option -S is an alias for the following options that perform a simple\n");
fprintf(stderr, "transformation of the input to a gate-level netlist. This can be helpful when\n");
fprintf(stderr, "e.g. using yosys as a pre-processor for a tool that can't understand full verilog.\n");
@@ -569,6 +578,8 @@ int main(int argc, char **argv)
log(" | |\n");
log(" \\-----------------------------------------------------------------------------/\n");
log("\n");
+ log(" %s\n", yosys_version_str);
+ log("\n");
Pass::init_register();