Tests: Convert t_loop into test_regress format

This commit is contained in:
Wilson Snyder 2009-07-21 10:42:10 -04:00
parent b92f57eacb
commit 584cfa4d4a
4 changed files with 23 additions and 12 deletions

18
test_regress/t/t_for_loop.pl Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/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.
compile (
);
execute (
check_finished=>1,
);
ok(1);
1;

View File

@ -3,15 +3,12 @@
// This file ONLY is placed into the Public Domain, for any use, // This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2003 by Wilson Snyder. // without warranty, 2003 by Wilson Snyder.
module t_loop (/*AUTOARG*/ module t (/*AUTOARG*/
// Outputs
passed,
// Inputs // Inputs
clk clk
); );
input clk; input clk;
output passed; reg passed; initial passed = 0;
reg [7:0] cyc; initial cyc=0; reg [7:0] cyc; initial cyc=0;
reg [31:0] loops; reg [31:0] loops;
@ -53,8 +50,8 @@ module t_loop (/*AUTOARG*/
end end
if (loops !== 100000) $stop; if (loops !== 100000) $stop;
// //
$write("[%0t] t_loop: Passed\n",$time); $write("*-* All Finished *-*\n");
passed <= 1'b1; $finish;
end end
end end

View File

@ -80,11 +80,7 @@ module t (/*AUTOARG*/
// Inputs // Inputs
.clk (clk), .clk (clk),
.fastclk (fastclk)); .fastclk (fastclk));
t_loop tloop assign passedv[15] = 1'b1;
(.passed (passedv[15]),
/*AUTOINST*/
// Inputs
.clk (clk));
assign passedv[16] = 1'b1; assign passedv[16] = 1'b1;
assign passedv[17] = 1'b1; assign passedv[17] = 1'b1;
assign passedv[18] = 1'b1; assign passedv[18] = 1'b1;