From d182ecb2d3636b327a42b40de8210db68d3bb6ba Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 18 Jan 2010 20:37:20 -0500 Subject: [PATCH] Support spaces in verilator flags --- bin/verilator | 5 ++++- src/V3Options.cpp | 4 ++-- test_regress/driver.pl | 7 +++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/verilator b/bin/verilator index f9e477841..c73027190 100755 --- a/bin/verilator +++ b/bin/verilator @@ -57,7 +57,10 @@ push @ARGV, (split ' ',$ENV{VERILATOR_TEST_FLAGS}||""); # We sneak a look at the flags so we can do some pre-environment checks # All flags will hit verilator... -@Opt_Verilator_Sw = @ARGV; +foreach my $sw (@ARGV) { + $sw = "'$sw'" if $sw =~ m![^---a-zA-Z0-9_/\\:.+]!; + push @Opt_Verilator_Sw, $sw; +} Getopt::Long::config ("no_auto_abbrev","pass_through"); if (! GetOptions ( diff --git a/src/V3Options.cpp b/src/V3Options.cpp index c923d6820..6987d4bc6 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -449,7 +449,7 @@ inline bool V3Options::wildmatchi(const char* s, const char* p) { return true; } } - return(*s == '\0' || *s == '['); + return (*s == '\0'); } bool V3Options::wildmatch(const char* s, const char* p) { @@ -467,7 +467,7 @@ bool V3Options::wildmatch(const char* s, const char* p) { return true; } } - return(*s == '\0' || *s == '['); + return (*s == '\0'); } string V3Options::downcase(const string& str) { diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 73ff5b9fd..ec3cd3b43 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -965,6 +965,13 @@ sub files_identical { warn ("%Warning: Line ".($l+1)." mismatches; $fn1 != $fn2\n" ."F1: ".($l1[$l]||"*EOF*\n") ."F2: ".($l2[$l]||"*EOF*\n")); + if ($ENV{HARNESS_UPDATE_GOLDEN}) { # Update golden files with current + warn "%Warning: HARNESS_UPDATE_GOLDEN set: cp $fn1 $fn2\n"; + eval "use File::Copy;"; + File::Copy::copy($fn1,$fn2); + } else { + warn "To update reference: HARNESS_UPDATE_GOLDEN=1 {command}\n"; + } return 0; } }