Continue to Site

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.

Need help with "expecting ')', found '['" error in

Status
Not open for further replies.

ikevin

Newbie level 5
Joined
Mar 1, 2010
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,353
Hi,

I have a 2-tap FIR filter module as shown below. However, Xilinx kept complaining

ERROR:HDLCompilers:26 - "filter_fir.v" line 6 expecting ')', found '['
ERROR:HDLCompilers:26 - "filter_fir..v" line 7 expecting ')', found '['

The lines that have error are shown in BOLD

module fir_filter (
input reset_b_in,
input system_clock_in,
input [15:0] signal_in,
output [15:0] signal_out,
input [15:0] weight_in [1:0],
output [15:0] weight_out [1:0]

);


reg [15:0] signal_in_after_tap1;
reg [31:0] sum;

assign weight_out = weight_in;
assign signal_out = sum[31:16]; // trucate the least significant 16-bits

always @ (posedge system_clock_in)
begin
if (~reset_b_in)
begin
sum <= 0;
end
else
begin
signal_in_after_tap1 <= signal_in;
sum <= weight_in[0]*signal_in + weight_in[1]*signal_in_after_tap1; // 32 bits
end
end

endmodule

EDITED: added comma.
 

Missing a comma after the line:
output [15:0] signal_out
 

    ikevin

    Points: 2
    Helpful Answer Positive Rating
When I pasted the code, I added bold and messed it up, but the comma is there in the code.

The error still occurs though :(
 

Maybe you can't pass arrays as inputs/outputs in your Verilog parser?
 

    ikevin

    Points: 2
    Helpful Answer Positive Rating
That's what I've been suspecting... since this is the first time I use multi-dimensional vector in Verilog (with Xilinx)
 

I'm pretty sure that's it.
 

Re: Need help with "expecting ')', found '['" erro

you are not suppose to use any multi dimentional array's in the input and output oorts
 

Re: Need help with "expecting ')', found '['" erro

Try this one.......

module fir_filter (
input reset_b_in,
input system_clock_in,
input [15:0] signal_in,
input [15:0] weight_in [1:0],
output [15:0] weight_out [1:0],

output [15:0] signal_out
);


reg [15:0] signal_in_after_tap1;
reg [31:0] sum;


//assign weight_out = weight_in;
assign weight_out [0] [15:0] = weight_in [0] [15:0];
assign weight_out [1] [15:0] = weight_in [1] [15:0];


assign signal_out = sum[31:16]; // trucate the least significant 16-bits

always @ (posedge system_clock_in)
begin
if (~reset_b_in)
begin
sum <= 0;
end
else
begin
signal_in_after_tap1 <= signal_in;
sum <= weight_in[0]*signal_in + weight_in[1]*signal_in_after_tap1; // 32 bits
end
end

endmodule

HTH
--
Shitansh Vaghela
 

Re: Need help with "expecting ')', found '['" erro

HI shitansh

multi dimentional array's in the input and output list is not acceptable by verilog...

Regards
Kalyan
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top