2017-04-29 02:03:38 +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: 2017 John Stevenson
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2017-04-29 02:03:38 +02:00
|
|
|
|
|
|
|
|
typedef logic [63:0] uid_t;
|
|
|
|
|
typedef logic [31:0] value_t;
|
|
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
interface the_intf #(
|
|
|
|
|
parameter M = 5
|
|
|
|
|
);
|
|
|
|
|
logic valid;
|
|
|
|
|
uid_t uid;
|
|
|
|
|
value_t [M-1:0] values;
|
2017-04-29 02:03:38 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
modport i(output valid, output uid, output values);
|
|
|
|
|
modport t(input valid, input uid, input values);
|
2017-04-29 02:03:38 +02:00
|
|
|
endinterface
|
|
|
|
|
|
|
|
|
|
module Contemplator #(
|
2026-03-08 23:26:40 +01:00
|
|
|
parameter IMPL = 0,
|
|
|
|
|
parameter M = 5,
|
|
|
|
|
parameter N = 1
|
|
|
|
|
) (
|
2017-04-29 02:03:38 +02:00
|
|
|
input logic clk,
|
2026-03-08 23:26:40 +01:00
|
|
|
the_intf.i out[N-1:0]
|
|
|
|
|
);
|
2017-04-29 02:03:38 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
the_intf #(.M(M)) inp[N-1:0] ();
|
2017-04-29 02:03:38 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
DeepThought #(
|
|
|
|
|
.N(N)
|
|
|
|
|
) ultimateAnswerer (
|
|
|
|
|
.src(inp),
|
|
|
|
|
.dst(out)
|
|
|
|
|
);
|
2017-04-29 02:03:38 +02:00
|
|
|
endmodule
|
|
|
|
|
|
|
|
|
|
module DeepThought #(
|
2026-03-08 23:26:40 +01:00
|
|
|
parameter N = 1
|
|
|
|
|
) (
|
2017-04-29 02:03:38 +02:00
|
|
|
the_intf.t src[N-1:0],
|
|
|
|
|
the_intf.i dst[N-1:0]
|
2026-03-08 23:26:40 +01:00
|
|
|
);
|
2017-04-29 02:03:38 +02:00
|
|
|
endmodule
|
|
|
|
|
|
|
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
module t ( /*AUTOARG*/
|
|
|
|
|
// Inputs
|
|
|
|
|
clk
|
|
|
|
|
);
|
|
|
|
|
input clk;
|
2017-04-29 02:03:38 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
localparam M = 5;
|
|
|
|
|
localparam N = 1;
|
2017-04-29 02:03:38 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
the_intf #(.M(M)) out0[N-1:0] ();
|
|
|
|
|
the_intf #(.M(M)) out1[N-1:0] ();
|
2017-04-29 02:03:38 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
Contemplator #(
|
|
|
|
|
.IMPL(0),
|
|
|
|
|
.M(M),
|
|
|
|
|
.N(N)
|
|
|
|
|
) contemplatorOfTheZerothKind (
|
|
|
|
|
.clk(clk),
|
|
|
|
|
.out(out0)
|
|
|
|
|
);
|
2017-04-29 02:03:38 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
Contemplator #(
|
|
|
|
|
.IMPL(1),
|
|
|
|
|
.M(M),
|
|
|
|
|
.N(N)
|
|
|
|
|
) contemplatorOfTheFirstKind (
|
|
|
|
|
.clk(clk),
|
|
|
|
|
.out(out1)
|
|
|
|
|
);
|
|
|
|
|
initial begin
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2017-04-29 02:03:38 +02:00
|
|
|
|
|
|
|
|
endmodule
|