struct_tern.sv 238 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
module Example(flag, out);
    typedef struct packed {
        logic a, b;
    } T;
    output T out;
    input logic flag;
    assign out =
        flag
        ? '{ a: 1'b1, b: 1'b0 }
        : '{ a: 1'b1, b: 1'b1 }
        ;
endmodule