2013-05-28 03:39:19 +02:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
|
//
|
2020-03-21 16:24:24 +01:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain, for
|
|
|
|
|
// any use, without warranty, 2013 by Wilson Snyder.
|
|
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2013-05-28 03:39:19 +02:00
|
|
|
|
|
|
|
|
interface ifc;
|
|
|
|
|
integer ok;
|
|
|
|
|
integer bad;
|
|
|
|
|
modport out_modport (output ok);
|
|
|
|
|
endinterface
|
|
|
|
|
|
2024-10-08 01:14:41 +02:00
|
|
|
module t (/*AUTOARG*/);
|
2013-05-28 03:39:19 +02:00
|
|
|
|
|
|
|
|
integer cyc=1;
|
|
|
|
|
|
|
|
|
|
ifc itop();
|
|
|
|
|
|
|
|
|
|
counter_ansi c1 (.isub(itop),
|
2018-10-27 16:03:28 +02:00
|
|
|
.i_value(4'h4));
|
2013-05-28 03:39:19 +02:00
|
|
|
|
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
|
|
module counter_ansi
|
|
|
|
|
(
|
|
|
|
|
ifc.out_modport isub,
|
|
|
|
|
input logic [3:0] i_value
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
always @* begin
|
|
|
|
|
isub.ok = i_value;
|
|
|
|
|
isub.bad = i_value; // Illegal access
|
|
|
|
|
end
|
|
|
|
|
endmodule
|