Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

verilator include

Added by alex al 3 months ago

Hi,

I'v got a question about linting verilog project with verilator on ubuntu.

I'v got 2 files: 1)top.sv
`include "definitions.sv" 
import gmii_router_definitions::*;

module gmii_router (
        input clk,
        input rst,
        input switch_table src_MAC_table
    );

endmodule
2)definitions.sv
package gmii_router_definitions;
    parameter MAC_TABLE_SIZE = 4;
    parameter PORT_NUMBER = 4;
    parameter BYTE = 8;

    typedef struct packed {
        reg [6*BYTE-1:0] mac_number;
    } mac_val;

    typedef struct packed {
        mac_val [MAC_TABLE_SIZE-1:0] mac_number_per_port;
    } mac_val_per_port;

    typedef struct packed {
        mac_val_per_port [PORT_NUMBER-1:0] main_switch_table ;
    } switch_table;

endpackage

When I tried to lint it with verilator I'v got:

verilator --lint-only top.sv definitions.sv
%Warning-IGNINC: top.sv:22: Ignore include file: definitions.sv
                 ... Use "/* verilator lint_off IGNINC */" and lint_on around source to disable this message.
%Error: top.sv:23: syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER or STRING
%Error: Exiting due to 1 error(s), 1 warning(s)
%Error: Command Failed /usr/local/bin/verilator_bin --lint-only top.sv definitions.sv

I'v tried
 verilator --lint-only --relative-includes top.sv definitions.sv
%Warning-IGNINC: top.sv:22: Ignore include file: definitions.sv
                 ... Use "/* verilator lint_off IGNINC */" and lint_on around source to disable this message.
%Error: top.sv:23: syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER or STRING
%Error: Exiting due to 1 error(s), 1 warning(s)
%Error: Command Failed /usr/local/bin/verilator_bin --lint-only --relative-includes top.sv definitions.sv
And Finally

So how can I use include in my code to validate it by verilator? What parameters I should add?

Thank you!


Replies (1)

RE: verilator include - Added by Wilson Snyder 3 months ago

IGNINC isn't a (mainline) Verilator warning. You must be using Verilator code you locally modified, so I can't know how to answer your question, sorry.

    (1-1/1)