2020-05-04 23:27:30 +00:00
|
|
|
#!/usr/bin/env perl
|
2020-03-08 13:18:12 +00:00
|
|
|
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
|
|
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
|
|
|
#
|
2020-03-21 15:24:24 +00:00
|
|
|
# Copyright 2004 by Wilson Snyder. This program is free software; you
|
|
|
|
# can redistribute it and/or modify it under the terms of either the GNU
|
2020-03-08 13:18:12 +00:00
|
|
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
# Version 2.0.
|
2020-03-21 15:24:24 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2020-03-08 13:18:12 +00:00
|
|
|
|
|
|
|
scenarios(simulator => 1);
|
|
|
|
|
|
|
|
$Self->{cycles} = ($Self->{benchmark} ? 100_000_000 : 100);
|
|
|
|
$Self->{sim_time} = $Self->{cycles} * 10 + 1000;
|
|
|
|
|
|
|
|
compile(
|
|
|
|
v_flags2 => ["+define+SIM_CYCLES=$Self->{cycles}",],
|
2021-09-08 03:50:28 +00:00
|
|
|
verilator_flags2 => ["-Wno-UNOPTTHREADS", "--stats"],
|
2020-03-08 13:18:12 +00:00
|
|
|
);
|
|
|
|
|
2021-02-21 09:11:33 +00:00
|
|
|
if ($Self->{vlt}) {
|
2021-08-18 18:15:02 +00:00
|
|
|
file_grep($Self->{stats}, qr/Optimizations, Const bit op reduction\s+(\d+)/i, 1058);
|
2021-02-21 09:11:33 +00:00
|
|
|
}
|
|
|
|
|
2020-03-08 13:18:12 +00:00
|
|
|
execute(
|
|
|
|
);
|
|
|
|
|
|
|
|
ok(1);
|
|
|
|
1;
|