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

Problem with nested package imports #591

Closed
veripoolbot opened this issue Dec 17, 2012 · 2 comments
Closed

Problem with nested package imports #591

veripoolbot opened this issue Dec 17, 2012 · 2 comments
Assignees

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Dec 17, 2012


Author Name: Jeremy Bennett (@jeremybennett)
Original Redmine Issue: 591 from https://www.veripool.org
Original Date: 2012-12-17
Original Assignee: Wilson Snyder (@wsnyder)


The following is I believe valid System Verilog:

package pkg2;
    parameter PARAM2 = 16;
endpackage // pkg2

package pkg1;
    import pkg2::*;
    parameter PARAM1 = 8;
endpackage // pkg1

module t (/*AUTOARG*/
    // Inputs
    clk
    );
    input clk;

    import pkg1::*;

    reg [PARAM1:0] bus1;
endmodule

Yet when I attempt to compile with verilator I get an error message:

%Error: t/t_package_param.v:21: Duplicate declaration of variable: PARAM1
%Error: t/t_package_param.v:15: ... Location of original declaration
%Error: Exiting due to 1 error(s)

The line numbers refer respectively to the declaration of PARAM1 and PARAM2. For some reason Verilator believes that PARAM1 is a duplicate definition of PARAM2.

Please pull the test case from branch package-params at git@github.com:jeremybennett/verilator.git

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 18, 2012


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-12-18T00:07:37Z


It works if they are 'localparam' which in most usages is what they probably should be, but that's something for lint to worry about.

Simple enough. Fixed in git towards 3.844.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jan 10, 2013


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-01-10T03:26:11Z


In 3.844.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.