chipsalliance / Cores-VeeR-EH1

VeeR EH1 core
Apache License 2.0
823 stars 221 forks source link

Change 'function' into 'function automatic' to fix verilator 5.0 compilation abort #119

Open tomverbeure opened 1 year ago

tomverbeure commented 1 year ago

Verilator 5.0 has a new IMPLICITSTATIC warning.

When running the default make -f tools/Makefile, it errors out with the following errors:


%Warning-IMPLICITSTATIC: /home/tom/projects/Cores-VeeR-EH1-tvb/testbench/dasm.svi:26:17: Function/task's lifetime implicitly set to static
                                                                                       : ... Suggest use 'function automatic' or 'function static'
   26 | function string dasm(input[31:0] opcode, input[31:0] pc, input[4:0] regn, input[31:0] regv, input tid=0);
      |                 ^~~~
                         /home/tom/projects/Cores-VeeR-EH1-tvb/testbench/tb_top.sv:1103:1: ... note: In file included from tb_top.sv
                         ... For warning description see https://verilator.org/warn/IMPLICITSTATIC?v=5.009
                         ... Use "/* verilator lint_off IMPLICITSTATIC */" and lint_on around source to disable this message.
%Warning-IMPLICITSTATIC: /home/tom/projects/Cores-VeeR-EH1-tvb/testbench/dasm.svi:34:17: Function/task's lifetime implicitly set to static
                                                                                       : ... Suggest use 'function automatic' or 'function static'
   34 | function string dasm16( input[31:0] opcode, input[31:0] pc, input tid=0);
      |                 ^~~~~~
                         /home/tom/projects/Cores-VeeR-EH1-tvb/testbench/tb_top.sv:1103:1: ... note: In file included from tb_top.sv
...

This PR replaces `function` by `function automatic` in `dasm.svi`.

After this, `make -f tools/Makefile` finishes without issues.