Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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:
 

jbeniston

Advanced Member level 1
Joined
May 5, 2005
Messages
462
Helped
106
Reputation
214
Reaction score
74
Trophy points
1,308
Activity points
3,432
Because that's no legal syntax.

Just do:

reg [7:0] mem [0:3] = '{'h0,'h1,'h0,'h0};
 

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.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top