I was wrong about the relevance to 291 of bit-stream casting --
>In particular, I think it was considered desirable
>for bit-stream casting to give the same result as copying, when
>copying is legal.
because for fixed-size types, the destination and source types must
have the same number of bits.
There is, however, some relevance to the streaming concatenation
of 7.18, because the left-hand side of a pack operation is
zero-padded if there are not enough bits from the right-hand side.
For example, in the following example, the left half of 'out3'
would initially be full of one bits, but then after in2 changes
the first time would always be full of zero bits.
parameter P = 12;
typedef integer T0[P];
typedef shortint T1[2*P];
typedef shortint T2[P];
module m(output T0 out1, out2, out3='1,
input T1 in1, input T2 in2);
assign out1 = T0'(in1);
for (genvar i = 0; i < P; i++) begin
assign out2[i] = in2[i];
end
always_comb out3 = { >> { in2 } };
endmodule:m
-- Brad
Received on Fri Nov 12 12:09:24 2004
This archive was generated by hypermail 2.1.8 : Fri Nov 12 2004 - 12:09:29 PST