2019-05-14 01:31:24 +02:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
|
//
|
2026-01-27 02:24:34 +01:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain.
|
|
|
|
|
// SPDX-FileCopyrightText: 2019 Wilson Snyder
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2019-05-14 01:31:24 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
module t ( /*AUTOARG*/
|
|
|
|
|
// Outputs
|
|
|
|
|
out,
|
|
|
|
|
// Inputs
|
|
|
|
|
clk,
|
|
|
|
|
in
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
input clk;
|
|
|
|
|
input [2:0] in;
|
|
|
|
|
output [2:0] out;
|
|
|
|
|
|
|
|
|
|
logic [2:0] r_in;
|
|
|
|
|
always_ff @(posedge clk) r_in <= in;
|
|
|
|
|
|
|
|
|
|
// verilog_format: off
|
|
|
|
|
flop p0 (.clk(clk), .d(r_in[0]), .q(out[0]));
|
|
|
|
|
flop p2 (.clk(r_in[1]), .d(clk), .q(out[1]));
|
|
|
|
|
flop p1 (.clk(clk), .d(r_in[2]), .q(out[2]));
|
|
|
|
|
// verilog_format: on
|
2019-05-14 01:31:24 +02:00
|
|
|
|
|
|
|
|
endmodule
|
|
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
module flop (
|
|
|
|
|
input d,
|
|
|
|
|
input clk,
|
|
|
|
|
output logic q
|
|
|
|
|
);
|
2019-05-14 01:31:24 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
// verilator no_inline_module
|
2019-05-14 01:31:24 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
always_ff @(posedge clk) begin
|
|
|
|
|
q <= d;
|
|
|
|
|
end
|
2019-05-14 01:31:24 +02:00
|
|
|
endmodule
|