top_tf.v 382 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
module top;
    task foo;
        $display("task foo() called");
    endtask
    function bar;
        input [2:0] n;
        bar = baz(n + 1);
    endfunction
    function baz;
        input [2:0] n;
        baz = n * 2;
    endfunction
13
    localparam PARAM = 37;
14 15
    initial foo();
    initial $display("bar(0) = %d", bar(0));
16
    initial $display("PARAM = %d", PARAM);
17
endmodule