function_range_cast.sv 245 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
module top;
    localparam type T = int unsigned;
    wire [T'(32'sd32) - 1:0] x;
    function automatic [T'(32'sd32) - 1:0] foo;
        input reg [T'(32'sd32) - 1:0] inp;
        foo = inp;
    endfunction
    assign x = foo(1'sb1);
endmodule