2006-08-26 11:35:28 +00:00
|
|
|
// DESCRIPTION: Verilator Test: Top level main for invoking model
|
|
|
|
//
|
2015-01-07 23:25:53 +00:00
|
|
|
// Copyright 2003-2015 by Wilson Snyder. This program is free software; you can
|
2006-08-26 11:35:28 +00:00
|
|
|
// redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 21:07:57 +00:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
// Version 2.0.
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
module sim_main;
|
|
|
|
/*verilator public_module*/
|
2008-06-10 01:25:10 +00:00
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
reg clk;
|
|
|
|
reg check;
|
|
|
|
wire done;
|
|
|
|
|
|
|
|
vgen vgen (/*AUTOINST*/
|
|
|
|
// Outputs
|
|
|
|
.done (done),
|
|
|
|
// Inputs
|
|
|
|
.clk (clk),
|
|
|
|
.check (check));
|
|
|
|
|
|
|
|
integer i;
|
|
|
|
|
|
|
|
initial begin
|
|
|
|
check = 1'b0;
|
|
|
|
clk = 1'b0;
|
|
|
|
for (i=0; i<10*vgen.CYCLES; i=i+1) begin
|
|
|
|
#5;
|
|
|
|
clk = ~clk;
|
|
|
|
#5;
|
|
|
|
clk = ~clk;
|
|
|
|
end
|
|
|
|
check = 1'b1;
|
|
|
|
for (i=0; i<10; i=i+1) begin
|
|
|
|
#5;
|
|
|
|
clk = ~clk;
|
|
|
|
#5;
|
|
|
|
clk = ~clk;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
endmodule
|