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

Emphasise that read_verilog doesn't lint #4705

Merged
merged 4 commits into from
Nov 18, 2024
Merged

Conversation

KrystalDelusion
Copy link
Member

@KrystalDelusion KrystalDelusion commented Nov 5, 2024

What are the reasons/motivation for this change?
Users are often confused and/or surprised when the read_verilog frontend runs into syntactical edge cases that it doesn't handle well.

Explain how this is achieved.
Mention Verilator (and verilator --lint-only) in a few places and reiterate that read_verilog does not lint, and you should lint your code before trying to use it.

If applicable, please suggest to reviewers how they can test the change.
Preview available on readthedocs. Note that preview builds show todos, which are normally hidden.

Link to verilator in the introduction.
Include `verilator --lint-only fifo.v` in the example synth doc.
Fix linter warnings in fifo.v.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the relation to the docs change? Is this to make verilator linting happy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah verilator gave lint warnings so I figured it was easy enough to fix them (and this wasn't a guided tutorial of how to fix it yourself)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it does make the first image slightly more complex
image
(left is preview, right is latest)


// async reset
// increment address when enabled
always @(posedge clk or posedge rst)
if (rst)
addr <= 0;
else if (en) begin
if (addr == MAX_DATA-1)
if ({'0, addr} == MAX_DATA-1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not include this change, it's fine to get some linting messages from verilator IMO (gives people some idea of what to expect from verilator too).

README.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not perform any syntax checking

Is an exaggeration. Maybe: "does not perform robust syntax checking"?

Copy link
Member

@nakengelhardt nakengelhardt Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it more as a statement of intent. read_verilog doesn't try to check if the input is correct or not, it just proceeds assuming it is correct. If that turns out to be a wrong assumption it will sometimes error out, but often not in a way that is particularly useful for the user for finding the problem. Sometimes it will also just continue, and end up with who knows what netlist. Given the history of this code and the alternatives, we think it would be a waste of effort to change that.

@KrystalDelusion KrystalDelusion merged commit 22e214e into main Nov 18, 2024
35 checks passed
@KrystalDelusion KrystalDelusion deleted the docs-preview-lintonly branch November 18, 2024 14:57
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

Successfully merging this pull request may close these issues.

4 participants