Array initialization in SystemVerilog

Status
Not open for further replies.

chandan_c9

Newbie level 3
Joined
May 13, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
Hi All,

Why is it not possible to initialize array like reg [7:0] mem [0:3] = '{'h0,'h1,2{'h0}};
:smile:
 

Because that's no legal syntax.

Just do:

reg [7:0] mem [0:3] = '{'h0,'h1,'h0,'h0};
 
I think this is because the 2{'h0} can be assigned to something like reg [0:3][7:0] mem only.
If you put [0:3] after mem, you must assign them separately.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…