1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
#!/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
use IO::File;
use strict;
use vars qw($Self);
scenarios(vlt => 1);
my $length = 200;
my $long = "long_" x (($length + 4) / 5);
sub gen_top {
my $filename = shift;
my $fh = IO::File->new(">$filename")
or $Self->error("Can't write $filename");
$fh->print("// Generated by t_inst_long.pl\n");
$fh->print("module t;\n");
$fh->print("\n");
$fh->print(" ${long} inst ();\n");
$fh->print("\n");
$fh->print("endmodule\n");
$fh->close;
}
sub gen_sub {
my $filename = shift;
my $fh = IO::File->new(">$filename")
or $Self->error("Can't write $filename");
$fh->print("// Generated by t_inst_long.pl\n");
$fh->print("module ${long};\n");
$fh->print("\n");
$fh->print(" initial begin\n");
$fh->print(" \$write(\"*-* All Finished *-*\\n\");\n");
$fh->print(" \$finish;\n");
$fh->print(" end\n");
$fh->print("endmodule\n");
$fh->close;
}
top_filename("$Self->{obj_dir}/t_inst_long.v", $long);
gen_top($Self->{top_filename});
gen_sub("$Self->{obj_dir}/${long}.v");
lint(
fails => 1,
expect_filename => $Self->{golden_filename},
);
ok(1);
1;
|