tests: Simplify includes; HARNESS_UPDATE_GOLDEN to whitespace fix
This commit is contained in:
parent
32874fa848
commit
e403db5877
|
|
@ -31,6 +31,7 @@ CPPFLAGS += -DVERILATOR=1
|
||||||
# Needed by tracing routines
|
# Needed by tracing routines
|
||||||
CPPFLAGS += -DVL_DEBUG=1
|
CPPFLAGS += -DVL_DEBUG=1
|
||||||
CPPFLAGS += -DVM_PREFIX=$(VM_PREFIX)
|
CPPFLAGS += -DVM_PREFIX=$(VM_PREFIX)
|
||||||
|
CPPFLAGS += -DVM_PREFIX_INCLUDE="<$(VM_PREFIX).h>"
|
||||||
CPPFLAGS += $(CPPFLAGS_DRIVER)
|
CPPFLAGS += $(CPPFLAGS_DRIVER)
|
||||||
CPPFLAGS += $(CPPFLAGS_DRIVER2)
|
CPPFLAGS += $(CPPFLAGS_DRIVER2)
|
||||||
CPPFLAGS += $(CPPFLAGS_ADD)
|
CPPFLAGS += $(CPPFLAGS_ADD)
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,7 @@
|
||||||
// without warranty, 2010 by Wilson Snyder.
|
// without warranty, 2010 by Wilson Snyder.
|
||||||
|
|
||||||
#include <verilated.h>
|
#include <verilated.h>
|
||||||
#ifdef T_CLK_2IN_VEC
|
#include VM_PREFIX_INCLUDE
|
||||||
# include "Vt_clk_2in_vec.h"
|
|
||||||
#else
|
|
||||||
# include "Vt_clk_2in.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
unsigned int main_time = false;
|
unsigned int main_time = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,19 @@ my $Debug;
|
||||||
my %files = %{get_manifest_files($root)};
|
my %files = %{get_manifest_files($root)};
|
||||||
|
|
||||||
foreach my $file (sort keys %files) {
|
foreach my $file (sort keys %files) {
|
||||||
my $contents = file_contents("$root/$file");
|
my $filename = "$root/$file";
|
||||||
|
my $contents = file_contents($filename);
|
||||||
if ($file =~ /\.out$/) {
|
if ($file =~ /\.out$/) {
|
||||||
# Ignore golden files
|
# Ignore golden files
|
||||||
} elsif ($contents =~ /[\001\002\003\004\005\006]/) {
|
} elsif ($contents =~ /[\001\002\003\004\005\006]/) {
|
||||||
# Ignore binrary files
|
# Ignore binrary files
|
||||||
} elsif ($contents =~ /[ \t]\n/) {
|
} elsif ($contents =~ /[ \t]\n/) {
|
||||||
|
if ($ENV{HARNESS_UPDATE_GOLDEN}) {
|
||||||
|
$contents =~ s/[ \t]+\n/\n/g;
|
||||||
|
$warns{$file} = "Updated whitespace at $file";
|
||||||
|
write_wholefile($filename, $contents);
|
||||||
|
next;
|
||||||
|
}
|
||||||
my @lines = split(/\n/, $contents);
|
my @lines = split(/\n/, $contents);
|
||||||
my $line_no = 0;
|
my $line_no = 0;
|
||||||
foreach my $line (@lines) {
|
foreach my $line (@lines) {
|
||||||
|
|
@ -37,7 +44,13 @@ foreach my $file (sort keys %files) {
|
||||||
|
|
||||||
if (keys %warns) {
|
if (keys %warns) {
|
||||||
# First warning lists everything as that's shown in the driver summary
|
# First warning lists everything as that's shown in the driver summary
|
||||||
|
if ($ENV{HARNESS_UPDATE_GOLDEN}) {
|
||||||
|
$Self->error("Updated files with whitespace errors: ",join(' ',sort keys %warns));
|
||||||
|
$Self->error("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden");
|
||||||
|
} else {
|
||||||
$Self->error("Files have whitespace errors: ",join(' ',sort keys %warns));
|
$Self->error("Files have whitespace errors: ",join(' ',sort keys %warns));
|
||||||
|
$Self->error("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden");
|
||||||
|
}
|
||||||
foreach my $file (sort keys %warns) {
|
foreach my $file (sort keys %warns) {
|
||||||
$Self->error($warns{$file});
|
$Self->error($warns{$file});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,7 @@
|
||||||
// This file ONLY is placed into the Public Domain, for any use,
|
// This file ONLY is placed into the Public Domain, for any use,
|
||||||
// without warranty, 2008 by Lane Brooks
|
// without warranty, 2008 by Lane Brooks
|
||||||
|
|
||||||
#if defined(T_MEM_MULTI_IO2_CC)
|
#include VM_PREFIX_INCLUDE
|
||||||
# include "Vt_mem_multi_io2_cc.h"
|
|
||||||
#elif defined(T_MEM_MULTI_IO2_SC)
|
|
||||||
# include "Vt_mem_multi_io2_sc.h"
|
|
||||||
#else
|
|
||||||
# error "Unknown test"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VM_PREFIX* tb = NULL;
|
VM_PREFIX* tb = NULL;
|
||||||
bool pass = true;
|
bool pass = true;
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,7 @@
|
||||||
// This file ONLY is placed into the Public Domain, for any use,
|
// This file ONLY is placed into the Public Domain, for any use,
|
||||||
// without warranty.
|
// without warranty.
|
||||||
|
|
||||||
#if defined(T_MEM_MULTI_IO3_CC)
|
#include VM_PREFIX_INCLUDE
|
||||||
# include "Vt_mem_multi_io3_cc.h"
|
|
||||||
#elif defined(T_MEM_MULTI_IO3_SC)
|
|
||||||
# include "Vt_mem_multi_io3_sc.h"
|
|
||||||
#else
|
|
||||||
# error "Unknown test"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VM_PREFIX* tb = NULL;
|
VM_PREFIX* tb = NULL;
|
||||||
bool pass = true;
|
bool pass = true;
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,7 @@
|
||||||
#include <verilated.h>
|
#include <verilated.h>
|
||||||
#include <verilated_vcd_c.h>
|
#include <verilated_vcd_c.h>
|
||||||
|
|
||||||
#if defined(T_TRACE_CAT)
|
#include VM_PREFIX_INCLUDE
|
||||||
# include "Vt_trace_cat.h"
|
|
||||||
#elif defined(T_TRACE_CAT_REOPEN)
|
|
||||||
# include "Vt_trace_cat_reopen.h"
|
|
||||||
#elif defined(T_TRACE_CAT_RENEW)
|
|
||||||
# include "Vt_trace_cat_renew.h"
|
|
||||||
#else
|
|
||||||
# error "Unknown test"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
unsigned long long main_time = 0;
|
unsigned long long main_time = 0;
|
||||||
double sc_time_stamp() {
|
double sc_time_stamp() {
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,7 @@
|
||||||
#include <verilated.h>
|
#include <verilated.h>
|
||||||
#include <verilated_vcd_c.h>
|
#include <verilated_vcd_c.h>
|
||||||
|
|
||||||
#if defined(T_TRACE_TIMESCALE)
|
#include VM_PREFIX_INCLUDE
|
||||||
# include "Vt_trace_timescale.h"
|
|
||||||
#else
|
|
||||||
# error "Unknown test"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
unsigned long long main_time = 0;
|
unsigned long long main_time = 0;
|
||||||
double sc_time_stamp() {
|
double sc_time_stamp() {
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,7 @@
|
||||||
// This file ONLY is placed into the Public Domain, for any use,
|
// This file ONLY is placed into the Public Domain, for any use,
|
||||||
// without warranty, 2008 by Lane Brooks
|
// without warranty, 2008 by Lane Brooks
|
||||||
|
|
||||||
#ifdef T_COND
|
#include VM_PREFIX_INCLUDE
|
||||||
# include "Vt_tri_gate_cond.h"
|
|
||||||
#elif defined(T_BUFIF0)
|
|
||||||
# include "Vt_tri_gate_bufif0.h"
|
|
||||||
#elif defined(T_BUFIF1)
|
|
||||||
# include "Vt_tri_gate_bufif1.h"
|
|
||||||
#elif defined(T_NOTIF0)
|
|
||||||
# include "Vt_tri_gate_notif0.h"
|
|
||||||
#elif defined(T_NOTIF1)
|
|
||||||
# include "Vt_tri_gate_notif1.h"
|
|
||||||
#elif defined(T_PMOS)
|
|
||||||
# include "Vt_tri_gate_pmos.h"
|
|
||||||
#elif defined(T_NMOS)
|
|
||||||
# include "Vt_tri_gate_nmos.h"
|
|
||||||
#else
|
|
||||||
# error "Unknown test"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VM_PREFIX* tb = NULL;
|
VM_PREFIX* tb = NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,6 @@
|
||||||
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
||||||
|
|
||||||
#ifdef T_VAR_PINS_CC
|
#include VM_PREFIX_INCLUDE
|
||||||
# include "Vt_var_pins_cc.h"
|
|
||||||
#elif defined(T_VAR_PINS_SC1)
|
|
||||||
# include "Vt_var_pins_sc1.h"
|
|
||||||
#elif defined(T_VAR_PINS_SC2)
|
|
||||||
# include "Vt_var_pins_sc2.h"
|
|
||||||
#elif defined(T_VAR_PINS_SC32)
|
|
||||||
# include "Vt_var_pins_sc32.h"
|
|
||||||
#elif defined(T_VAR_PINS_SC64)
|
|
||||||
# include "Vt_var_pins_sc64.h"
|
|
||||||
#elif defined(T_VAR_PINS_SCUI)
|
|
||||||
# include "Vt_var_pins_scui.h"
|
|
||||||
#elif defined(T_VAR_PINS_SC_UINT)
|
|
||||||
# include "Vt_var_pins_sc_uint.h"
|
|
||||||
#elif defined(T_VAR_PINS_SC_BIGUINT)
|
|
||||||
# include "Vt_var_pins_sc_biguint.h"
|
|
||||||
#elif defined(T_VAR_PINS_SC_UINT_BIGUINT)
|
|
||||||
# include "Vt_var_pins_sc_uint_biguint.h"
|
|
||||||
#else
|
|
||||||
# error "Unknown test"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VM_PREFIX* tb = NULL;
|
VM_PREFIX* tb = NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ foreach my $dfile (glob("$Self->{obj_dir}/*.d")) {
|
||||||
foreach my $file (sort keys %hit) {
|
foreach my $file (sort keys %hit) {
|
||||||
if (!$hit{$file}
|
if (!$hit{$file}
|
||||||
&& $file !~ /_sc/) {
|
&& $file !~ /_sc/) {
|
||||||
$Self->error("Include file not covered by t_include_all test: ",$file);
|
$Self->error("Include file not covered by t_verilated_all test: ",$file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7,7 +7,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
|
|
||||||
top_filename("t/t_include_all.v");
|
top_filename("t/t_verilated_all.v");
|
||||||
|
|
||||||
my $root = "..";
|
my $root = "..";
|
||||||
|
|
||||||
|
|
@ -7,7 +7,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||||
# Version 2.0.
|
# Version 2.0.
|
||||||
|
|
||||||
top_filename("t/t_include_all.v");
|
top_filename("t/t_verilated_all.v");
|
||||||
|
|
||||||
my $root = "..";
|
my $root = "..";
|
||||||
|
|
||||||
Loading…
Reference in New Issue