3
\$\begingroup\$

I have a CORDIC module that I want to instantiate/generate 8 times, basically, I need 8 blocks of CORDIC. So, I have wrote the following statement block, but I get an error:

Error: Syntax error near cordic.

What am I doing wrong?

genvar k;
 generate
 for (k = 0; k < 8; k = k + 1)
 begin
 always @(posedge fpga_clk)
 begin
 cordic CDC(fpga_clk, rst, phase_word[k], sin_out[k], cos_out[k]);
 end
 end
 endgenerate
asked Aug 15, 2022 at 13:17
\$\endgroup\$
0

1 Answer 1

4
\$\begingroup\$

You cannot, and there is no need to put the cordic module instantiations inside an always block.

genvar k;
for (k = 0; k < 8; k = k + 1)
 begin : block
 cordic CDC(fpga_clk, rst, phase_word[k], sin_out[k], cos_out[k]);
 end

This create instances block[0].CDC through block[7].CDC of the cordic module. We assume that module already has always processes inside it, and they get instanced 8 times as well.

answered Aug 15, 2022 at 14:43
\$\endgroup\$
1
  • \$\begingroup\$ Thanks. I understood that there is no need of always block or clock edges to make copies of a module. @dave_59 \$\endgroup\$ Commented Aug 15, 2022 at 15:42

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.