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

Instances named as modules #242

Open
arquer opened this issue Sep 28, 2024 · 0 comments
Open

Instances named as modules #242

arquer opened this issue Sep 28, 2024 · 0 comments

Comments

@arquer
Copy link

arquer commented Sep 28, 2024

Hi,
I see a problem where code navigation does not take me to a module definition when the instance name for that module matches the module's name.

To replicate just create a new file with the following contents:

module my_test_module (
    input logic clk,
    input logic rst,
    input logic a,
    output logic b
);

always @(posedge clk) begin
    if (rst) begin
        b <= 0;
    end else begin
        b <= a;
    end
end

endmodule





module my_other_test_module ();

    logi clk, rst, a, b;

    my_test_module my_test_module (
        .clk    (clk),
        .rst    (rst),
        .a      (a),
        .b      (b)
    );

endmodule

Now, the problem I see is that Ctrl + click on the module name "my_test_module" of the instance takes me to the instance itself.
If you modify the instance name and call it something else though, code navigation correctly takes you to the module definition:

module my_test_module (
    input logic clk,
    input logic rst,
    input logic a,
    output logic b
);

always @(posedge clk) begin
    if (rst) begin
        b <= 0;
    end else begin
        b <= a;
    end
end

endmodule





module my_other_test_module ();

    logi clk, rst, a, b;

    my_test_module another_name (
        .clk    (clk),
        .rst    (rst),
        .a      (a),
        .b      (b)
    );

endmodule

This seems like it should be pretty easy to solve?

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

No branches or pull requests

1 participant