typeof.v 480 Bytes
Newer Older
1 2 3 4 5 6 7 8
module top;
    function f;
        input x;
        begin
            f = 1'b1 ^ x;
            $display("f(%b) called", x);
        end
    endfunction
9 10 11 12
    task t;
        input x;
        $display("t(%b) called", x);
    endtask
13 14 15 16 17 18 19 20

    initial begin : block
        reg x;
        x = f(0);
        $display("%b", x);
        $display("%b", 32'd1);
        $display("%b", 32'd1);
        $display("%b", 32'd3);
21 22 23
        x = f(1);
        x = f(0);
        t(1);
24 25
    end
endmodule