diff --git a/vvp/main.cc b/vvp/main.cc index 94909d076..917f6322f 100644 --- a/vvp/main.cc +++ b/vvp/main.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2013 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2015 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -316,12 +316,13 @@ int main(int argc, char*argv[]) /* For non-interactive runs we do not want to run the interactive * debugger, so make $stop just execute a $finish. */ stop_is_finish = false; - while ((opt = getopt(argc, argv, "+hl:M:m:nNsvV")) != EOF) switch (opt) { + while ((opt = getopt(argc, argv, "+hil:M:m:nNsvV")) != EOF) switch (opt) { case 'h': fprintf(stderr, "Usage: vvp [options] input-file [+plusargs...]\n" "Options:\n" " -h Print this help message.\n" + " -i Interactive mode (unbuffered stdio).\n" " -l file Logfile, '-' for \n" " -M path VPI module directory\n" " -M - Clear VPI module path\n" @@ -332,6 +333,9 @@ int main(int argc, char*argv[]) " -v Verbose progress messages.\n" " -V Print the version information.\n" ); exit(0); + case 'i': + setvbuf(stdout, 0, _IONBF, 0); + break; case 'l': logfile_name = optarg; break; diff --git a/vvp/vvp.man.in b/vvp/vvp.man.in index 37a5bcb7c..650e853c4 100644 --- a/vvp/vvp.man.in +++ b/vvp/vvp.man.in @@ -4,7 +4,7 @@ vvp - Icarus Verilog vvp runtime engine .SH SYNOPSIS .B vvp -[\-nNsvV] [\-Mpath] [\-mmodule] [\-llogfile] inputfile [extended-args...] +[\-inNsvV] [\-Mpath] [\-mmodule] [\-llogfile] inputfile [extended-args...] .SH DESCRIPTION .PP @@ -16,6 +16,9 @@ command is not by itself executable on any platform. Instead, the .SH OPTIONS \fIvvp\fP accepts the following options: .TP 8 +.B -i +This flag causes all output to to be unbuffered. +.TP 8 .B -l\fIlogfile\fP This flag specifies a logfile where all MCI output goes. Specify logfile as '\-' to send log output to . $display and