forked from github/verilator
e5b1fdf668
Squashed commit of the following: commit c1eeda7d472fc14a0ffd5c1712ae7f7c614073a1 Author: Iztok Jeras <iztok.jeras@gmail.com> Date: Tue Mar 20 16:39:44 2012 +0100 - fixed assignment operator in t_array_packed_write_read.v from = to <= - added tests for enumerations (existing tests do not use methods like next(), num(), ...) - added t_sv_bus_mux_demux test, with packed arrays, structures and unions
54 lines
1.1 KiB
Systemverilog
54 lines
1.1 KiB
Systemverilog
// DESCRIPTION: Verilator: Verilog Test module
|
|
//
|
|
// This file ONLY is placed into the Public Domain, for any use,
|
|
// without warranty, 2012 by Iztok Jeras.
|
|
|
|
module t (/*AUTOARG*/
|
|
// Inputs
|
|
clk
|
|
);
|
|
|
|
input clk;
|
|
|
|
parameter SIZE = 8;
|
|
|
|
integer cnt = 0;
|
|
|
|
logic [SIZE-1:0] vld_for;
|
|
logic vld_if = 1'b0;
|
|
logic vld_else = 1'b0;
|
|
|
|
genvar i;
|
|
|
|
// event counter
|
|
always @ (posedge clk) begin
|
|
cnt <= cnt + 1;
|
|
end
|
|
|
|
// finish report
|
|
always @ (posedge clk)
|
|
if (cnt==SIZE) begin : if_cnt_finish
|
|
$write("*-* All Finished *-*\n");
|
|
$finish;
|
|
end : if_cnt_finish_bad
|
|
|
|
generate
|
|
for (i=0; i<SIZE; i=i+1) begin : generate_for
|
|
always @ (posedge clk)
|
|
if (cnt == i) vld_for[i] <= 1'b1;
|
|
end : generate_for_bad
|
|
endgenerate
|
|
|
|
generate
|
|
if (SIZE>0) begin : generate_if_if
|
|
always @ (posedge clk)
|
|
vld_if <= 1'b1;
|
|
end : generate_if_if_bad
|
|
else begin : generate_if_else
|
|
always @ (posedge clk)
|
|
vld_else <= 1'b1;
|
|
end : generate_if_else_bad
|
|
endgenerate
|
|
|
|
endmodule : t_bad
|