VERILOG2002: Unused task or function formal arguments should be removed
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| MEDIUM | - | - | Intentionality | Logical | 10min | synthesis, vscode, simulation, linter, dead-code |
Description
Unused task or function formal arguments should be removed.
Noncompliant code example
function [7:0] sum (input [7:0] a, b, c); // Noncompliant: 'c' is unused
begin
sum = a + b;
end
endfunction
task [7:0] sum;
input [7:0] a, b;
output [7:0] c, d; // Noncompliant: 'd' is unused
begin
c = a + b;
end
endtask
Compliant solution
function [7:0] sum (input [7:0] a, b);
begin
sum = a + b;
end
endfunction
task [7:0] sum;
input [7:0] a, b;
output [7:0] c;
begin
c = a + b;
end
endtask
Parameters
No parameters.