2012-03-20 20:13:10 +00:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
//
|
2020-03-21 15:24:24 +00:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain, for
|
|
|
|
// any use, without warranty, 2012 by Wilson Snyder.
|
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2012-03-20 20:13:10 +00:00
|
|
|
|
|
|
|
module t (/*AUTOARG*/
|
|
|
|
// Outputs
|
|
|
|
q,
|
|
|
|
// Inputs
|
|
|
|
clk, d
|
|
|
|
);
|
|
|
|
input clk;
|
|
|
|
input [3:0] d;
|
|
|
|
output wire [3:0] q;
|
|
|
|
|
2020-01-14 23:51:20 +00:00
|
|
|
logic [3:0] between;
|
2012-03-20 20:13:10 +00:00
|
|
|
|
2020-01-14 23:51:20 +00:00
|
|
|
mod1 #(.WIDTH(4))
|
|
|
|
cell1 (.q(between),
|
|
|
|
.clk (clk),
|
|
|
|
.d (d[3:0]));
|
2012-03-20 20:13:10 +00:00
|
|
|
|
2020-01-14 23:51:20 +00:00
|
|
|
mod2
|
|
|
|
cell2 (.d(between),
|
|
|
|
.q (q[3:0]),
|
|
|
|
.clk (clk));
|
2012-03-20 20:13:10 +00:00
|
|
|
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module mod1
|
2020-01-14 23:51:20 +00:00
|
|
|
#(parameter WIDTH = 32)
|
|
|
|
(
|
|
|
|
input clk,
|
|
|
|
input [WIDTH-1:0] d,
|
|
|
|
output logic [WIDTH-1:0] q
|
2012-03-20 20:13:10 +00:00
|
|
|
);
|
2020-01-14 23:51:20 +00:00
|
|
|
|
|
|
|
localparam IGNORED = 1;
|
|
|
|
|
2012-03-20 20:13:10 +00:00
|
|
|
always @(posedge clk)
|
|
|
|
q <= d;
|
|
|
|
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module mod2
|
|
|
|
(
|
|
|
|
input clk,
|
|
|
|
input [3:0] d,
|
|
|
|
output wire [3:0] q
|
|
|
|
);
|
|
|
|
|
|
|
|
assign q = d;
|
|
|
|
|
|
|
|
endmodule
|