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

var. name who start with "if" will cause mistake #32

Open
andythebreaker opened this issue Apr 7, 2023 · 0 comments
Open

var. name who start with "if" will cause mistake #32

andythebreaker opened this issue Apr 7, 2023 · 0 comments

Comments

@andythebreaker
Copy link

andythebreaker commented Apr 7, 2023

for example i have a code:

if (ifmap[6] == 1) begin
                            p = p + ({{24{1'b1}}, (ifmap[7]?((~((~(ifmap-1)) << 1))+1):(ifmap<<1))})<<i;
                            end else begin
                                p = p + ({24'b0, (ifmap[7]?((~((~(ifmap-1)) << 1))+1):(ifmap<<1))})<<i;
                            end
                            $display("\\011 = >2/");
                        end

where ifmap is a input, but [ericsonj ](https://github.com/ericsonj)/ [verilog-format](https://github.com/ericsonj/verilog-format) will see it as if and map, which is not correct!
the out come is like:

if (if map[6] == 1) begin
                            p = p + ({{24{1'b1}}, (ifmap[7]?((~((~(ifmap-1)) << 1))+1):(ifmap<<1))})<<i;
                            end else begin
                                p = p + ({24'b0, (ifmap[7]?((~((~(ifmap-1)) << 1))+1):(ifmap<<1))})<<i;
                            end
                            $display("\\011 = >2/");
                        end

the correct version need to be like if (ifmap[6] == 1) begin

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