data/full_repos/permissive/143278/ivltests/cast_real.v
 line:23: before: ";"
1: b'%Warning-WIDTH: data/full_repos/permissive/143278/ivltests/cast_real.v:35: Operator ITORD expects 32 bits on the LHS, but LHS\'s VARREF \'l\' generates 4 bits.\n                                                                         : ... In instance cast_real\n    b = real\'(l);\n        ^~~~\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/143278/ivltests/cast_real.v:38: Operator ITORD expects 32 bits on the LHS, but LHS\'s VARREF \'sl\' generates 4 bits.\n                                                                         : ... In instance cast_real\n    c = real\'(sl);\n        ^~~~\n%Error: Exiting due to 2 warning(s)\n'
module cast_real();
    int i;
    logic [3:0] l;
    logic signed [3:0] sl;
    real a, b, c, d, e;

initial begin

    i = 5;
    a = real'(i);


    l = 4'b1010;
    b = real'(l);

    sl = 4'b1010;
    c = real'(sl);


    d = real'(11);
    e = real'(-7);

    if (a != 5.0)
    begin
        $display("FAILED #1 a = %f", a);
        $finish();
    end

    if (b != 10.0)
    begin
        $display("FAILED #2 b = %f", b);
        $finish();
    end

    if (c != -6.0)
    begin
        $display("FAILED #3 c = %f", c);
        $finish();
    end

    if (d != 11.0)
    begin
        $display("FAILED #4 d = %f", d);
        $finish();
    end

    if (e != -7.0)
    begin
        $display("FAILED #5 e = %f", e);
        $finish();
    end

    $display("PASSED");
end
endmodule
module cast_real();

    int i;
    logic [3:0] l;
    logic signed [3:0] sl;
    real a, b, c, d, e;

initial begin

    i = 5;
    a = real'(i);


    l = 4'b1010;
    b = real'(l);

    sl = 4'b1010;
    c = real'(sl);


    d = real'(11);
    e = real'(-7);

    if (a != 5.0)
    begin
        $display("FAILED #1 a = %f", a);
        $finish();
    end

    if (b != 10.0)
    begin
        $display("FAILED #2 b = %f", b);
        $finish();
    end

    if (c != -6.0)
    begin
        $display("FAILED #3 c = %f", c);
        $finish();
    end

    if (d != 11.0)
    begin
        $display("FAILED #4 d = %f", d);
        $finish();
    end

    if (e != -7.0)
    begin
        $display("FAILED #5 e = %f", e);
        $finish();
    end

    $display("PASSED");
end
endmodule