Docs: Mention verilator for linting

Link to verilator in the introduction.
Include `verilator --lint-only fifo.v` in the example synth doc.
Fix linter warnings in fifo.v.
This commit is contained in:
Krystine Sherwin 2024-11-05 13:29:45 +13:00
parent 52c231dd64
commit b14a651142
No known key found for this signature in database
3 changed files with 16 additions and 3 deletions

View File

@ -5,7 +5,7 @@ module addr_gen
) ( input en, clk, rst, ) ( input en, clk, rst,
output reg [AWIDTH-1:0] addr output reg [AWIDTH-1:0] addr
); );
initial addr <= 0; initial addr = 0;
// async reset // async reset
// increment address when enabled // increment address when enabled
@ -13,7 +13,7 @@ module addr_gen
if (rst) if (rst)
addr <= 0; addr <= 0;
else if (en) begin else if (en) begin
if (addr == MAX_DATA-1) if ({'0, addr} == MAX_DATA-1)
addr <= 0; addr <= 0;
else else
addr <= addr + 1; addr <= addr + 1;
@ -57,7 +57,7 @@ module fifo
); );
// status signals // status signals
initial count <= 0; initial count = 0;
always @(posedge clk or posedge rst) begin always @(posedge clk or posedge rst) begin
if (rst) if (rst)

View File

@ -30,6 +30,14 @@ First, let's quickly look at the design we'll be synthesizing:
.. todo:: fifo.v description .. todo:: fifo.v description
While the open source `read_verilog` frontend generally does a pretty good job
at processing valid Verilog input, it does not provide very good error handling
or reporting. Using an external tool such as `verilator`_ before running Yosys
is highly recommended. We can quickly check the Verilog syntax of our design by
calling ``verilator --lint-only fifo.v``.
.. _verilator: https://www.veripool.org/verilator/
Loading the design Loading the design
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

View File

@ -69,9 +69,14 @@ Things you can't do
- Check out `nextpnr`_ for that - Check out `nextpnr`_ for that
- Rely on built-in syntax checking
- Use an external tool like `verilator`_ instead
.. todo:: nextpnr for FPGAs, consider mentioning openlane, vpr, coriolis .. todo:: nextpnr for FPGAs, consider mentioning openlane, vpr, coriolis
.. _nextpnr: https://github.com/YosysHQ/nextpnr .. _nextpnr: https://github.com/YosysHQ/nextpnr
.. _verilator: https://www.veripool.org/verilator/
The Yosys family The Yosys family
---------------- ----------------