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

未声明的wire reg 可以随意使用等bug #64

Open
720lhy opened this issue Aug 24, 2023 · 1 comment
Open

未声明的wire reg 可以随意使用等bug #64

720lhy opened this issue Aug 24, 2023 · 1 comment

Comments

@720lhy
Copy link

720lhy commented Aug 24, 2023

module dff(
    input clk,
    input res_n,
    input d,
    output reg q
);
      wire test;

    always@(posedge clk or negedge res_n) begin
        if(!res_n)
            q <= 0;
        else if (res_high) begin
            q <= 1;
            test <= 1'b1;        //wire 赋值不会报错
        end
        else
            q <= d;
    end
    assign q = res_n;      //对reg assign 不会报错
    assign test3 = q;        //对未声明的test3 可以随意使用  
endmodule
@720lhy
Copy link
Author

720lhy commented Aug 24, 2023

image
Windows11,其余语法检查正常生效

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