Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16602 Discussions

module cannot be declared more than once

Altera_Forum
Honored Contributor II
15,312 Views

After generating the .qsys file when I am trying to run the top module verilog file in quartus II it is giving error :Error (10228): Verilog HDL error at gmmpipe.v(6): module "gmmpipe" cannot be declared more than once. I gave gmm_accelerator.v and gmmpipe.v module during qsys generation .In includes the gmmpipe.v module. I am attaching both the module. How to fix this error? Please help.

0 Kudos
12 Replies
Altera_Forum
Honored Contributor II
8,361 Views

check those 

 

- QuartusII refer to current directory, library( settings ), Files( settings). 

- module "gmmpipe" does not mean filename, if two of your files have same name ( or two in one file ) this error is occurred. 

 

how are those?
0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

gmm_accelerator.v includes gmmpipe.v in this way- 

 

`ifndef GMM_PIPES 

`include "gmmpipe.v" 

`endif 

 

what does it mean?
0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

In gmmpipe.v file there are two different modules named gmmpipe1 and gmmpipe2 .But as I know the module name should be same as the file name. 

So I divided this file into two files of gmmpipe1.v and gmmpipe2.v and included them in gmm_accelerator.v . But still it is giving the same error.How can I fix?
0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

are you sure gmmpipe module isnt also declared in another .v file somewhere?

0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

I answer the question 3 post before. 

 

the 'if' statement means that if GMM_PIPES is "not" defined, your compiler include gmmpipe.v. 

once gmmpipe.v is included, this file will not be included anymore, because GMM_PIPES is defined in gmmpipe.v 

 

and you say that you didn't find gmmpipe module inside of gmmpipe.v. 

did you check other files? 

if you have *.v files on same directory of project-itself, whole files are read by QuartusII.
0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

Yes,I checked all the files on the same directory of project itself. gmmpipe is not declared in another .v file.

0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

if you can upload whole project in zip. 

I may be able to check the error.
0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

Hi, 

 

Whenever you generate QSYS system, all verilog source files are copied into folder/submodules where folder will have same name as of your QSYS system in your project. So there will be one copy of your file in that submodules folder. 

 

If you have your original file also added in your project, then you may see this error. 

 

One thing you can do is Double click on that error and see to which file it points. In this way, you may be able to find it out. 

 

Hope this helps. 

 

Cheers, 

Bhaumik
0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

Hi Bhaumik, 

 

No, I didn't add the original file in my project in quartus II. I added only qsys_system.qip file in my project.
0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

Hi Akira, 

I am attaching the zip file.
0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

Your file is being included twice. Once by your include statement, and other time because it is mentioned in the list of files in the project. Remove the file from the project and it should work.

0 Kudos
Altera_Forum
Honored Contributor II
8,361 Views

I agree with Galfonz 

 

I have checked verilog files. 

I did not find multiple declaration of gmmpipe twice. 

 

follow Galfonz's instruction.
0 Kudos
Reply