mirror of
https://github.com/verilator/verilator.git
synced 2025-01-25 15:54:05 +00:00
60d5f0e86b
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.
28 lines
1003 B
Perl
Executable File
28 lines
1003 B
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 2021 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
|
|
|
|
scenarios(vlt => 1);
|
|
|
|
compile();
|
|
|
|
if ($Self->{vlt_all}) {
|
|
# The word 'this' (but only the whole word 'this' should have been replaced
|
|
# in the contents.
|
|
my $file = "$Self->{obj_dir}/$Self->{VM_PREFIX}.cpp";
|
|
my $text = file_contents($file);
|
|
error("$file has 'this->clk'") if ($text =~ m/\bthis->clk\b/);
|
|
error("$file does not have 'xthis'") if ($text !~ m/\bxthis\b/);
|
|
error("$file does not have 'thisx'") if ($text !~ m/\bthisx\b/);
|
|
error("$file does not have 'xthisx'") if ($text !~ m/\bxthisx\b/);
|
|
}
|
|
|
|
ok(1);
|
|
1;
|