SystemVerilog function与Verilog中的function具有相同的特性。
函数的主要目的是返回一个可以在表达式中使用且不消耗仿真时间的值。
@、#、fork-join或waitmodule tb;
// There are two ways to call the function:
initial begin
// 1. Call function and assign value to a variable, and then use variable
int s = sum(3, 4);
$