From fca80e6fcd609a12804210316b15e680b8eaf67f Mon Sep 17 00:00:00 2001 From: "Walter F.J. Mueller" Date: Sun, 16 Apr 2017 14:41:20 +0200 Subject: [PATCH] tbrun: add --help option --- tools/bin/tbrun | 36 +++++++++++++++++++++++++++++++++--- tools/man/man1/tbrun.1 | 14 +++++++++----- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/tools/bin/tbrun b/tools/bin/tbrun index 10921e4b..29f1904c 100755 --- a/tools/bin/tbrun +++ b/tools/bin/tbrun @@ -1,7 +1,7 @@ #!/usr/bin/perl -w -# $Id: tbrun 808 2016-09-17 13:02:46Z mueller $ +# $Id: tbrun 875 2017-04-15 21:58:50Z mueller $ # -# Copyright 2016- by Walter F.J. Mueller +# Copyright 2016-2017 by Walter F.J. Mueller # # This program is free software; you may redistribute and/or modify it under # the terms of the GNU General Public License as published by the Free @@ -14,6 +14,7 @@ # # Revision History: # Date Rev Version Comment +# 2017-04-15 875 1.0.1 add --help option # 2016-09-17 808 1.0 Initial version # 2016-08-09 796 0.1 First draft # @@ -33,7 +34,8 @@ my %opts = (); GetOptions(\%opts, "tag=s@", "exclude=s@", "mode=s", "jobs=i", "tee=s", "tmax=i", "dry", "trace", "nomake", "norun", - "rlmon", "rbmon", "bwait=i", "swait=i" + "rlmon", "rbmon", "bwait=i", "swait=i", + "help" ) or die "bad options"; @@ -56,6 +58,7 @@ sub tpre; sub print_trace; sub run_tests_single; sub run_tests_multi; +sub print_usage; my @tlist; my @olist; @@ -89,6 +92,11 @@ $gblvars{ise_modes_nossim} = 'bsim,ISim_bsim'; # when ssim not available $gblvars{viv_modes} = '[bsor]sim,XSim_[bsorept]sim'; $gblvars{viv_modes_nossim} = 'bsim,XSim_bsim'; # when ssim not available +if ($opts{help}) { + print_usage(); + exit 0; +} + autoflush STDOUT 1 if -p STDOUT || -t STDOUT; my $ticker_on = -t STDOUT; @@ -828,3 +836,25 @@ sub run_tests_multi { return; } + +# ---------------------------------------------------------------------------- +sub print_usage { + print "usage: tbrun [options] [dcsfile]\n"; + print " --tag= list of tags to run (def='default')\n"; + print " --exclude= tag combinations to exclude\n"; + print " --mode= list of modes to run\n"; + print " --jobs= number of parallel jobs (def=1)\n"; + print " --tee= addition logfile for al stdout output\n"; + print " --dry dry run, prints only the generated commands\n"; + print " --trace prints additional information on job control\n"; + print " --nomake don't execute make step of test bench\n"; + print " --norun don't execute run step of test bench\n"; + print " --rlmon enable the rlink monitor\n"; + print " --rbmon enable the rbus monitor\n"; + print " --bwait=
startup wait for behavioral simulations (in ns)\n"; + print " --swait=
startup wait for post-* simulations (in ns)\n"; + print " --help print short help text\n"; + print "\n"; + print " If no [dcsfile] is specified 'tbrun.yml' is used\n"; + return; +} diff --git a/tools/man/man1/tbrun.1 b/tools/man/man1/tbrun.1 index d78c52f4..1579cd5b 100644 --- a/tools/man/man1/tbrun.1 +++ b/tools/man/man1/tbrun.1 @@ -1,11 +1,11 @@ .\" -*- nroff -*- -.\" $Id: tbrun.1 845 2017-01-15 14:58:27Z mueller $ +.\" $Id: tbrun.1 875 2017-04-15 21:58:50Z mueller $ .\" -.\" Copyright 2016- by Walter F.J. Mueller +.\" Copyright 2016-2017 by Walter F.J. Mueller .\" .\" ------------------------------------------------------------------ . -.TH TBRUN 1 2016-10-02 "Retro Project" "Retro Project Manual" +.TH TBRUN 1 2017-04-15 "Retro Project" "Retro Project Manual" .\" ------------------------------------------------------------------ .SH NAME tbrun \- test bench driver @@ -180,7 +180,7 @@ selected test. . \" -- --trace ----------------------------------- .IP \fB\-\-trace\fP -prints additional information on job control +prints additional information on job control. . .\" -- --nomake ---------------------------------- .IP \fB\-\-nomake\fP @@ -202,7 +202,7 @@ based test benches. \" -- --rbmon ----------------------------------- .IP \fB\-\-rbmon\fP enable the rbus monitor, will be forwarded to \fBtbrun_tbwrri\fP(1) -based test benches +based test benches. . .\" -- --bwait ---------------------------------- .IP \fB\-\-bwait=\fItwait\fR @@ -216,6 +216,10 @@ specifies startup wait for post-synthesis and higher simulations. \fItwait\fR must be an integer, time unit is 1 ns. Will be forwarded to \fBtbrun_tbwrri\fP(1) based test benches. . +. +\" -- --help ------------------------------------- +.IP \fB\-\-help\fP +print short help text. .\" ------------------------------------------------------------------ .SH EXAMPLES .IP "\fBtbrun" 4