Open zapta opened 1 week ago
Do we need to add this library file to the verilator command?
~/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v
Original repo: https://github.com/YosysHQ/yosys/blob/main/techlibs/ice40/cells_sim.v
It seems that the yosys library file need to be to the verilator command in order to provide the SB_IO definition. However, that library file has lint errors on its own
$ verilator --lint-only ~/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:1497:21: syntax error, unexpected '=', expecting ','
1497 | input [15:0] MASK = 16'h 0000,
| ^
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:1533:2: syntax error, unexpected generate
1533 | generate
| ^~~~~~~~
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:1607:2: syntax error, unexpected initial
1607 | initial begin
| ^~~~~~~
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:1736:21: syntax error, unexpected '=', expecting ','
1736 | input [15:0] MASK = 16'h 0000,
| ^
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:1761:2: syntax error, unexpected IDENTIFIER
1761 | SB_RAM40_4K #(
| ^~~~~~~~~~~
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:1872:21: syntax error, unexpected '=', expecting ','
1872 | input [15:0] MASK = 16'h 0000,
| ^
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:1897:2: syntax error, unexpected IDENTIFIER
1897 | SB_RAM40_4K #(
| ^~~~~~~~~~~
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:2008:21: syntax error, unexpected '=', expecting ','
2008 | input [15:0] MASK = 16'h 0000,
| ^
%Error: /Users/user/.apio/packages/tools-oss-cad-suite/share/yosys/ice40/cells_sim.v:2033:2: syntax error, unexpected IDENTIFIER
2033 | SB_RAM40_4K #(
| ^~~~~~~~~~~
%Error: Exiting due to 9 error(s)
Here is something that seems to worked for me. Need to be implemented. This is for the ice40, i presume it's similar for the other architectures.
--bbox-unsup -DNO_ICE40_DEFAULT_ASSIGNMENTS verilator.vlt <yosys-path>/share/yosys/ice40/cells_sim.v
`verilator_config
lint_off -rule COMBDLY -file "*/yosys/ice40/cells_sim.v"
lint_off -rule WIDTHEXPAND -file "*/yosys/ice40/cells_sim.v"
EDIT: It's possible that the -D flag will not be necessary with newer version of verilator. Per https://github.com/verilator/verilator/issues/5440.
I have a verilog module that uses an ICE40 SB_IO built in primitive (see below). When running
apio lint
I get the error below. Does apio provide a way to fix or suppress that error? For example, suppressing lint in that file, or providing the path to the library with the SB_IO definition.If there is no solution, or a workaround, we should make this issue a feature request.
Error log:
Verilog module that uses SB_IO: