File tree Expand file tree Collapse file tree 10 files changed +21
-0
lines changed
main/scala/dfhdl/compiler/stages/verilog
lib/src/test/resources/ref
docExamples.ugdemos.demo4.LRShiftFlatSpec
docExamples.ugdemos.demo5.LRShiftDirectSpec Expand file tree Collapse file tree 10 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,15 @@ protected trait VerilogTypePrinter extends AbstractTypePrinter:
5656 dfType.entries.view
5757 .map((n, v) => s " ` ${enumName}_ ${n}: $funcName = \" ${enumName}_ ${n}\" ; " )
5858 .mkString(" \n " ).hindent(2 )
59+ // workaround for verilator bug: https://github.com/verilator/verilator/issues/6893
5960 s """ |function [8* ${maxCharWidth}:1] $funcName;
61+ | /* verilator lint_off UNUSEDSIGNAL */
6062 | input [ ${dfType.width - 1 }:0] value;
6163 | case (value)
6264 | ${cases}
6365 | default: $funcName = "?";
6466 | endcase
67+ | /* verilator lint_on UNUSEDSIGNAL */
6568 |endfunction """ .stripMargin
6669 end csDFEnumToStringFuncDcl
6770 def csDFEnumDcl (dfType : DFEnum , global : Boolean ): String =
Original file line number Diff line number Diff line change @@ -1163,13 +1163,15 @@ class PrintVerilogCodeSpec extends StageSpec:
11631163 | `define MyEnum_B 1
11641164 | `define MyEnum_C 2
11651165 | function [8*8:1] MyEnum_to_string;
1166+ | /* verilator lint_off UNUSEDSIGNAL */
11661167 | input [1:0] value;
11671168 | case (value)
11681169 | `MyEnum_A: MyEnum_to_string = "MyEnum_A";
11691170 | `MyEnum_B: MyEnum_to_string = "MyEnum_B";
11701171 | `MyEnum_C: MyEnum_to_string = "MyEnum_C";
11711172 | default: MyEnum_to_string = "?";
11721173 | endcase
1174+ | /* verilator lint_on UNUSEDSIGNAL */
11731175 | endfunction
11741176 | parameter bar = {param, "!"};
11751177 | parameter param2 = {2{param}};
Original file line number Diff line number Diff line change 1717`define ALUSel_COPY1 10
1818
1919function [8 * 12 : 1 ] ALUSel_to_string ;
20+ /* verilator lint_off UNUSEDSIGNAL */
2021 input [3 : 0 ] value;
2122 case (value)
2223 `ALUSel_ADD : ALUSel_to_string = " ALUSel_ADD" ;
@@ -32,6 +33,7 @@ function [8*12:1] ALUSel_to_string;
3233 `ALUSel_COPY1 : ALUSel_to_string = " ALUSel_COPY1" ;
3334 default : ALUSel_to_string = " ?" ;
3435 endcase
36+ /* verilator lint_on UNUSEDSIGNAL */
3537endfunction
3638`undef ALU_DEFS_MODULE
3739`endif
Original file line number Diff line number Diff line change 1717`define ALUSel_COPY1 10
1818
1919function [8 * 12 : 1 ] ALUSel_to_string ;
20+ /* verilator lint_off UNUSEDSIGNAL */
2021 input [3 : 0 ] value;
2122 case (value)
2223 `ALUSel_ADD : ALUSel_to_string = " ALUSel_ADD" ;
@@ -32,6 +33,7 @@ function [8*12:1] ALUSel_to_string;
3233 `ALUSel_COPY1 : ALUSel_to_string = " ALUSel_COPY1" ;
3334 default : ALUSel_to_string = " ?" ;
3435 endcase
36+ /* verilator lint_on UNUSEDSIGNAL */
3537endfunction
3638`undef ALU_DEFS_MODULE
3739`endif
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module UART_Tx#(
2323 `define Status_StopBit 8
2424 `define Status_Finalize 16
2525 function [8 * 15 :1 ] Status_to_string;
26+ /* verilator lint_off UNUSEDSIGNAL */
2627 input [4 :0 ] value;
2728 case (value)
2829 `Status_Idle: Status_to_string = "Status_Idle" ;
@@ -32,6 +33,7 @@ module UART_Tx#(
3233 `Status_Finalize: Status_to_string = "Status_Finalize" ;
3334 default : Status_to_string = "?" ;
3435 endcase
36+ /* verilator lint_on UNUSEDSIGNAL */
3537 endfunction
3638 reg [4 :0 ] status;
3739 reg [clog2(BIT_CLOCKS) - 1 :0 ] bitClkCnt;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ module UART_Tx(
2222 `define Status_StopBit 8
2323 `define Status_Finalize 16
2424 function [8 * 15 :1 ] Status_to_string;
25+ /* verilator lint_off UNUSEDSIGNAL */
2526 input [4 :0 ] value;
2627 case (value)
2728 `Status_Idle: Status_to_string = "Status_Idle" ;
@@ -31,6 +32,7 @@ module UART_Tx(
3132 `Status_Finalize: Status_to_string = "Status_Finalize" ;
3233 default : Status_to_string = "?" ;
3334 endcase
35+ /* verilator lint_on UNUSEDSIGNAL */
3436 endfunction
3537 input wire clk;
3638 input wire rst;
Original file line number Diff line number Diff line change 88`define ShiftDir_Right 1
99
1010function [8 * 14 : 1 ] ShiftDir_to_string ;
11+ /* verilator lint_off UNUSEDSIGNAL */
1112 input [0 : 0 ] value;
1213 case (value)
1314 `ShiftDir_Left : ShiftDir_to_string = " ShiftDir_Left" ;
1415 `ShiftDir_Right : ShiftDir_to_string = " ShiftDir_Right" ;
1516 default : ShiftDir_to_string = " ?" ;
1617 endcase
18+ /* verilator lint_on UNUSEDSIGNAL */
1719endfunction
1820`undef LRSHIFTFLAT_DEFS_MODULE
1921`endif
Original file line number Diff line number Diff line change 88`define ShiftDir_Right 1
99
1010function [8 * 14 : 1 ] ShiftDir_to_string ;
11+ /* verilator lint_off UNUSEDSIGNAL */
1112 input [0 : 0 ] value;
1213 case (value)
1314 `ShiftDir_Left : ShiftDir_to_string = " ShiftDir_Left" ;
1415 `ShiftDir_Right : ShiftDir_to_string = " ShiftDir_Right" ;
1516 default : ShiftDir_to_string = " ?" ;
1617 endcase
18+ /* verilator lint_on UNUSEDSIGNAL */
1719endfunction
1820`undef LRSHIFTFLAT_DEFS_MODULE
1921`endif
Original file line number Diff line number Diff line change 88`define ShiftDir_Right 1
99
1010function [8 * 14 : 1 ] ShiftDir_to_string ;
11+ /* verilator lint_off UNUSEDSIGNAL */
1112 input [0 : 0 ] value;
1213 case (value)
1314 `ShiftDir_Left : ShiftDir_to_string = " ShiftDir_Left" ;
1415 `ShiftDir_Right : ShiftDir_to_string = " ShiftDir_Right" ;
1516 default : ShiftDir_to_string = " ?" ;
1617 endcase
18+ /* verilator lint_on UNUSEDSIGNAL */
1719endfunction
1820`undef LRSHIFTDIRECT_DEFS_MODULE
1921`endif
Original file line number Diff line number Diff line change 88`define ShiftDir_Right 1
99
1010function [8 * 14 : 1 ] ShiftDir_to_string ;
11+ /* verilator lint_off UNUSEDSIGNAL */
1112 input [0 : 0 ] value;
1213 case (value)
1314 `ShiftDir_Left : ShiftDir_to_string = " ShiftDir_Left" ;
1415 `ShiftDir_Right : ShiftDir_to_string = " ShiftDir_Right" ;
1516 default : ShiftDir_to_string = " ?" ;
1617 endcase
18+ /* verilator lint_on UNUSEDSIGNAL */
1719endfunction
1820`undef LRSHIFTDIRECT_DEFS_MODULE
1921`endif
You can’t perform that action at this time.
0 commit comments