can we initailise an array in verilog

Status
Not open for further replies.

cccvamshikr

Newbie level 3
Joined
Jan 7, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
can we intialise the array in verilog. I mean

input in1;
input in2;
wire w1[1:0] = {in1,in2}

is this a valid syntax.
Thanks in advance...
 

Initializing implies constant expressions, not input signals. If the inputs are connected to a constant in your design hierarchy, it may possibly work.
 
Thanks for the answer...But how can we use arrays in the design.......if i want to delcare an array as an output how can i declare that..
example: output [15:0]w1 [1:0];
wire w1[1:0];
is this a valid syntax.
 

Standard Verilog doesn't allow structurized signals, e.g. arrays or records, for interfaces. You have to convert them to one dimensional bit vectors for in-and output.
 
Thank you..thanks alot for the answer...iam parsing the verilog code...thatswhy iam facing these type of problems...
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…