mirror of
https://github.com/verilator/verilator.git
synced 2025-01-07 15:17:36 +00:00
41 lines
748 B
Verilog
41 lines
748 B
Verilog
// DESCRIPTION: Verilator: Verilog Test module
|
|
//
|
|
// This file ONLY is placed into the Public Domain, for any use,
|
|
// without warranty, 2012 by Wilson Snyder.
|
|
|
|
module t (/*AUTOARG*/
|
|
// Inputs
|
|
clk
|
|
);
|
|
input clk;
|
|
|
|
logic foo; initial foo = 0;
|
|
|
|
// dut #(.W(4)) udut(.*);
|
|
dut #(.W(4)) udut(.clk(clk),
|
|
.foo(foo)); // Assigning logic to logic array
|
|
|
|
endmodule
|
|
|
|
module dut
|
|
#(parameter W = 1)
|
|
(input logic clk,
|
|
input logic foo[W-1:0]);
|
|
|
|
genvar i;
|
|
generate
|
|
for (i = 0; i < W; i++) begin
|
|
suba ua(.clk(clk), .foo(foo[i]));
|
|
end
|
|
endgenerate
|
|
endmodule
|
|
|
|
module suba
|
|
(input logic clk,
|
|
input logic foo);
|
|
|
|
always @(posedge clk)
|
|
$display("foo=%b", foo);
|
|
|
|
endmodule
|