2019-11-20 03:43:45 +00:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
//
|
|
|
|
// Copyright 2010 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.
|
2020-03-21 15:24:24 +00:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2019-11-20 03:43:45 +00:00
|
|
|
|
|
|
|
module t (/*AUTOARG*/
|
|
|
|
// Inputs
|
2021-02-04 00:29:24 +00:00
|
|
|
clk
|
2019-11-20 03:43:45 +00:00
|
|
|
);
|
2021-02-04 00:29:24 +00:00
|
|
|
input clk;
|
2019-11-20 03:43:45 +00:00
|
|
|
|
|
|
|
reg [31:0] count /*verilator public_flat_rd */;
|
|
|
|
|
|
|
|
integer status;
|
|
|
|
|
|
|
|
// Test loop
|
|
|
|
initial begin
|
|
|
|
count = 0;
|
|
|
|
end
|
|
|
|
|
|
|
|
always @(posedge clk) begin
|
2021-02-03 23:30:15 +00:00
|
|
|
`ifdef TEST_VERBOSE
|
|
|
|
$display("[%0t] clk", $time);
|
|
|
|
`endif
|
2019-11-20 03:43:45 +00:00
|
|
|
count <= count + 2;
|
|
|
|
if (count == 1000) begin
|
2021-02-03 23:30:15 +00:00
|
|
|
// See C++ code: $write("*-* All Finished *-*\n");
|
2019-11-20 03:43:45 +00:00
|
|
|
$finish;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
endmodule : t
|