-
Notifications
You must be signed in to change notification settings - Fork 895
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,15 @@ module addr_gen | |
) ( input en, clk, rst, | ||
output reg [AWIDTH-1:0] addr | ||
); | ||
initial addr <= 0; | ||
initial addr = 0; | ||
|
||
// 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). |
||
addr <= 0; | ||
else | ||
addr <= addr + 1; | ||
|
@@ -57,7 +57,7 @@ module fifo | |
); | ||
|
||
// status signals | ||
initial count <= 0; | ||
initial count = 0; | ||
|
||
always @(posedge clk or posedge rst) begin | ||
if (rst) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is an exaggeration. Maybe: "does not perform robust syntax checking"?
There was a problem hiding this comment.
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.