From 584cfa4d4a4915896954bd00457b797c38eb9821 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 21 Jul 2009 10:42:10 -0400 Subject: [PATCH] Tests: Convert t_loop into test_regress format --- test_regress/t/t_EXAMPLE.v | 2 +- test_regress/t/t_for_loop.pl | 18 ++++++++++++++++++ test_v/t_loop.v => test_regress/t/t_for_loop.v | 9 +++------ test_v/t.v | 6 +----- 4 files changed, 23 insertions(+), 12 deletions(-) create mode 100755 test_regress/t/t_for_loop.pl rename test_v/t_loop.v => test_regress/t/t_for_loop.v (87%) diff --git a/test_regress/t/t_EXAMPLE.v b/test_regress/t/t_EXAMPLE.v index 059e8465d..3c2e1c20f 100644 --- a/test_regress/t/t_EXAMPLE.v +++ b/test_regress/t/t_EXAMPLE.v @@ -87,7 +87,7 @@ module Test (/*AUTOARG*/ // merge the output values into the result vector. input clk; - input [31:0] in; + input [31:0] in; output reg [31:0] out; always @(posedge clk) begin diff --git a/test_regress/t/t_for_loop.pl b/test_regress/t/t_for_loop.pl new file mode 100755 index 000000000..7058e622f --- /dev/null +++ b/test_regress/t/t_for_loop.pl @@ -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; diff --git a/test_v/t_loop.v b/test_regress/t/t_for_loop.v similarity index 87% rename from test_v/t_loop.v rename to test_regress/t/t_for_loop.v index b043c343e..1883418f3 100644 --- a/test_v/t_loop.v +++ b/test_regress/t/t_for_loop.v @@ -3,15 +3,12 @@ // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2003 by Wilson Snyder. -module t_loop (/*AUTOARG*/ - // Outputs - passed, +module t (/*AUTOARG*/ // Inputs clk ); input clk; - output passed; reg passed; initial passed = 0; reg [7:0] cyc; initial cyc=0; reg [31:0] loops; @@ -53,8 +50,8 @@ module t_loop (/*AUTOARG*/ end if (loops !== 100000) $stop; // - $write("[%0t] t_loop: Passed\n",$time); - passed <= 1'b1; + $write("*-* All Finished *-*\n"); + $finish; end end diff --git a/test_v/t.v b/test_v/t.v index 389cbf21a..cd62d092c 100644 --- a/test_v/t.v +++ b/test_v/t.v @@ -80,11 +80,7 @@ module t (/*AUTOARG*/ // Inputs .clk (clk), .fastclk (fastclk)); - t_loop tloop - (.passed (passedv[15]), - /*AUTOINST*/ - // Inputs - .clk (clk)); + assign passedv[15] = 1'b1; assign passedv[16] = 1'b1; assign passedv[17] = 1'b1; assign passedv[18] = 1'b1;