hdlConvertor icon indicating copy to clipboard operation
hdlConvertor copied to clipboard

Handling extraneous commas (SystemVerilog)

Open the-moog opened this issue 3 years ago • 1 comments

Existing code, which synthesises and simulates fine in Xilinx and Synopsys toolchains fails with hdlConverter.

The issue is extraneous commas in module parameter definitions and module instance signal connections.

This can be caused by `ifdefs removing parameters and are unused in a particular build.

e.g. module X (input a, input b,); // Fails module X (input a, input b); // Works

Similarly

X instX (.x(a), .y(b),); //Fails X instX (.x(a), .y(b)); //Works

the-moog avatar Nov 26 '21 12:11 the-moog

What you request is non conform to verilog and systemVerilog standard.

I cannot confirm your claim see my log produced by Cadence, Mentor/Siemens and Synopsys. dc_shell.log xrun.log questa.log

None of them consider this file has a valid syntax.

my test.sv file:

module test (input a, input b,);
endmodule

If that's due to preprocessor result better for you to include this trailing comma in the macro directive body in order to produce legal verilog or systemVerilog code.

Thomasb81 avatar Nov 26 '21 18:11 Thomasb81