Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUTOINST cannot find module endif when ifdef used around module parameters #1243

Closed
veripoolbot opened this issue Nov 16, 2017 · 2 comments
Closed

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Michael Smith
Original Redmine Issue: 1243 from https://www.veripool.org


I have a FIFO instantiated in some 3rd party code that uses `ifdef around the parameter values. When I expand the AUTOS, I get the error message:

Updating AUTOs...
verilog-modi-lookup: top_mac_ffsgpcs.v:596: Can't locate ``endif' module definition (Expanded macro to endif)
Check the verilog-library-directories variable.
I looked in (if not listed, doesn't exist): /data/digital/...

The code snippet in question is:

tx_ffid
         `ifdef MTIPM10_IPARAMETER      // use instance parameters instead package parameters
         #(.EG_FIFO(EG_FIFO), .EG_ADDR(EG_ADDR)) // TX FIFO size
         `endif

         U_TXFF (

           .sec_mem_rm_i(sec_mem_rm_i[5:0]),
           .bot_mem_pd_i(bot_mem_pd_i),
           .sec_mem_ds_i(sec_mem_ds_i),
           .test_mode_i(test_mode_i),

		/*AUTOINST*/);


Thanks for your help,
Michael

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Michael Smith
Original Date: 2017-11-16T16:28:59Z


Confusing rendition of the code due to re-formatting. Hopefully this is better:

tx_ffid
         `ifdef MTIPM10_IPARAMETER      // use instance parameters instead package parameters
         #(.EG_FIFO(EG_FIFO), .EG_ADDR(EG_ADDR)) // TX FIFO size
         `endif

         U_TXFF (

           .sec_mem_rm_i(sec_mem_rm_i[5:0]),
           .bot_mem_pd_i(bot_mem_pd_i),
           .sec_mem_ds_i(sec_mem_ds_i),
           .test_mode_i(test_mode_i),

		/*AUTOINST*/);

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-11-16T17:01:31Z


Thanks for the good bug description. Unfortunately as described in the documentation verilog-mode AUTOS are ignorant of `ifdefs.

There's simply too many different styles and cases to consider to start supporting them, so once you have them you basically get what falls out.

The workaround in your example is to put the ifdef inside the #()'s, e.g.

tx_ffid
         #(
`ifdef MTIPM10_IPARAMETER      // use instance parameters instead package parameters
           .EG_FIFO(EG_FIFO), .EG_ADDR(EG_ADDR) // TX FIFO size
`endif
         )

         U_TXFF (

           .sec_mem_rm_i(sec_mem_rm_i[5:0]),
           .bot_mem_pd_i(bot_mem_pd_i),
           .sec_mem_ds_i(sec_mem_ds_i),
           .test_mode_i(test_mode_i),

                 /*AUTOINST*/);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant