verilator/test_regress/t/t_flag_csplit_eval.pl
Geza Lore 60d5f0e86b
Emit model implementation as loose methods. (#3006)
This patch introduces the concept of 'loose' methods, which semantically
are methods, but are declared as global functions, and are passed an
explicit 'self' pointer. This enables these methods to be declared
outside the class, only when they are needed, therefore removing the
header dependency. The bulk of the emitted model implementation now uses
loose methods.
2021-06-13 14:33:11 +01:00

41 lines
1.1 KiB
Perl
Executable File

#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
sub check_evals {
my $got = 0;
foreach my $file (glob("$Self->{obj_dir}/*.cpp")) {
my $fh = IO::File->new("<$file");
local $/; undef $/;
my $wholefile = <$fh>;
if ($wholefile =~ /___eval[0-9]+/) {
++$got;
}
}
$got >= 3 or error("Too few _eval functions found: $got");
}
scenarios(vlt_all => 1);
compile(
v_flags2 => ["--output-split 1 --output-split-cfuncs 1 --exe ../$Self->{main_filename}"],
# verilator_make_gmake => 0,
);
# Very slow to compile, so generally skip it
execute(
check_finished => 1,
);
check_evals();
ok(1);
1;