Aug 3, 2011 #1 C 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:
Hi All, Why is it not possible to initialize array like reg [7:0] mem [0:3] = '{'h0,'h1,2{'h0}}; :smile:
Aug 6, 2011 #2 J jbeniston Advanced Member level 1 Joined May 5, 2005 Messages 460 Helped 106 Reputation 214 Reaction score 73 Trophy points 1,308 Activity points 3,494 Because that's no legal syntax. Just do: reg [7:0] mem [0:3] = '{'h0,'h1,'h0,'h0};
Aug 6, 2011 #3 W wsong0210 Member level 3 Joined Mar 11, 2009 Messages 59 Helped 22 Reputation 44 Reaction score 21 Trophy points 1,288 Location Manchester, UK Activity points 1,670 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.
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.