system verilog - Copy a packed array to unpacked array -


i wrote code copying packed array unpacked array below:

module m1;  bit [2:0] temp; bit temp1[2:0]; initial begin temp=3'b011; temp1='{temp}; end  endmodule 

but showing error: "too few assignment pattern items given assignment"
solution please.

packed array , unpacked array different data structure, cannot directly assigned type.

using assignment pattern array must either positional based or index based. example,

temp1 = '{temp[2], temp[1], temp[0]}; 

the solution using streaming operator @ lhs of assignment.

{>>{temp1}} = temp; 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -