2014-07-22 02:44:33 +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: 2014 Jonathon Donaldson
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2014-07-22 02:44:33 +02:00
|
|
|
|
|
|
|
|
package my_funcs;
|
2026-03-10 02:38:29 +01:00
|
|
|
function automatic int simple_func(input int value);
|
|
|
|
|
begin
|
|
|
|
|
simple_func = value;
|
|
|
|
|
end
|
|
|
|
|
endfunction
|
2014-07-22 02:44:33 +02:00
|
|
|
endpackage
|
|
|
|
|
|
|
|
|
|
package my_module_types;
|
2026-03-10 02:38:29 +01:00
|
|
|
import my_funcs::*;
|
2014-07-22 02:44:33 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
localparam MY_PARAM = 3;
|
|
|
|
|
localparam MY_PARAM2 /*verilator public*/ = simple_func(12);
|
2014-07-22 02:44:33 +02:00
|
|
|
endpackage
|
|
|
|
|
|
|
|
|
|
module t
|
|
|
|
|
import my_module_types::*;
|
2026-03-10 02:38:29 +01:00
|
|
|
(
|
|
|
|
|
input i_clk,
|
|
|
|
|
input [MY_PARAM-1:0] i_d,
|
2014-07-22 02:44:33 +02:00
|
|
|
output logic [MY_PARAM-1:0] o_q
|
2026-03-10 02:38:29 +01:00
|
|
|
);
|
2014-07-22 02:44:33 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
always_ff @(posedge i_clk) o_q <= i_d;
|
2014-07-22 02:44:33 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
initial begin
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2014-07-22 02:44:33 +02:00
|
|
|
endmodule
|