mirror of
https://github.com/verilator/verilator.git
synced 2025-04-05 12:12:39 +00:00
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
|
||||
CPPFLAGS += -DVL_DEBUG=1
|
||||
CPPFLAGS += -DVM_PREFIX=$(VM_PREFIX)
|
||||
CPPFLAGS += -DVM_PREFIX_INCLUDE="<$(VM_PREFIX).h>"
|
||||
CPPFLAGS += $(CPPFLAGS_DRIVER)
|
||||
CPPFLAGS += $(CPPFLAGS_DRIVER2)
|
||||
CPPFLAGS += $(CPPFLAGS_ADD)
|
||||
|
@ -6,11 +6,7 @@
|
||||
// without warranty, 2010 by Wilson Snyder.
|
||||
|
||||
#include <verilated.h>
|
||||
#ifdef T_CLK_2IN_VEC
|
||||
# include "Vt_clk_2in_vec.h"
|
||||
#else
|
||||
# include "Vt_clk_2in.h"
|
||||
#endif
|
||||
#include VM_PREFIX_INCLUDE
|
||||
|
||||
unsigned int main_time = false;
|
||||
|
||||
|
@ -14,12 +14,19 @@ my $Debug;
|
||||
my %files = %{get_manifest_files($root)};
|
||||
|
||||
foreach my $file (sort keys %files) {
|
||||
my $contents = file_contents("$root/$file");
|
||||
my $filename = "$root/$file";
|
||||
my $contents = file_contents($filename);
|
||||
if ($file =~ /\.out$/) {
|
||||
# Ignore golden files
|
||||
} elsif ($contents =~ /[\001\002\003\004\005\006]/) {
|
||||
# Ignore binrary files
|
||||
} 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 $line_no = 0;
|
||||
foreach my $line (@lines) {
|
||||
@ -37,7 +44,13 @@ foreach my $file (sort keys %files) {
|
||||
|
||||
if (keys %warns) {
|
||||
# First warning lists everything as that's shown in the driver summary
|
||||
$Self->error("Files have whitespace errors: ",join(' ',sort keys %warns));
|
||||
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("To auto-fix: HARNESS_UPDATE_GOLDEN=1 {command} or --golden");
|
||||
}
|
||||
foreach my $file (sort keys %warns) {
|
||||
$Self->error($warns{$file});
|
||||
}
|
||||
|
@ -3,13 +3,7 @@
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2008 by Lane Brooks
|
||||
|
||||
#if defined(T_MEM_MULTI_IO2_CC)
|
||||
# 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
|
||||
#include VM_PREFIX_INCLUDE
|
||||
|
||||
VM_PREFIX* tb = NULL;
|
||||
bool pass = true;
|
||||
|
@ -3,13 +3,7 @@
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty.
|
||||
|
||||
#if defined(T_MEM_MULTI_IO3_CC)
|
||||
# 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
|
||||
#include VM_PREFIX_INCLUDE
|
||||
|
||||
VM_PREFIX* tb = NULL;
|
||||
bool pass = true;
|
||||
|
@ -8,15 +8,7 @@
|
||||
#include <verilated.h>
|
||||
#include <verilated_vcd_c.h>
|
||||
|
||||
#if defined(T_TRACE_CAT)
|
||||
# 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
|
||||
#include VM_PREFIX_INCLUDE
|
||||
|
||||
unsigned long long main_time = 0;
|
||||
double sc_time_stamp() {
|
||||
|
@ -8,11 +8,7 @@
|
||||
#include <verilated.h>
|
||||
#include <verilated_vcd_c.h>
|
||||
|
||||
#if defined(T_TRACE_TIMESCALE)
|
||||
# include "Vt_trace_timescale.h"
|
||||
#else
|
||||
# error "Unknown test"
|
||||
#endif
|
||||
#include VM_PREFIX_INCLUDE
|
||||
|
||||
unsigned long long main_time = 0;
|
||||
double sc_time_stamp() {
|
||||
|
@ -3,23 +3,7 @@
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2008 by Lane Brooks
|
||||
|
||||
#ifdef T_COND
|
||||
# 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
|
||||
#include VM_PREFIX_INCLUDE
|
||||
|
||||
VM_PREFIX* tb = NULL;
|
||||
|
||||
|
@ -1,26 +1,6 @@
|
||||
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
||||
|
||||
#ifdef T_VAR_PINS_CC
|
||||
# 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
|
||||
#include VM_PREFIX_INCLUDE
|
||||
|
||||
VM_PREFIX* tb = NULL;
|
||||
|
||||
|
@ -36,7 +36,7 @@ foreach my $dfile (glob("$Self->{obj_dir}/*.d")) {
|
||||
foreach my $file (sort keys %hit) {
|
||||
if (!$hit{$file}
|
||||
&& $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
|
||||
# Version 2.0.
|
||||
|
||||
top_filename("t/t_include_all.v");
|
||||
top_filename("t/t_verilated_all.v");
|
||||
|
||||
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
|
||||
# Version 2.0.
|
||||
|
||||
top_filename("t/t_include_all.v");
|
||||
top_filename("t/t_verilated_all.v");
|
||||
|
||||
my $root = "..";
|
||||
|
Loading…
Reference in New Issue
Block a user