Function Rules¶
function_001¶
This rule checks the indentation of the function keyword.
Violation
architecture RTL of FIFO is
function overflow (a: integer) return integer is
function underflow (a: integer) return integer is
begin
Fix
architecture RTL of FIFO is
function overflow (a: integer) return integer is
function underflow (a: integer) return integer is
begin
function_002¶
This rule checks a single space exists after the function keyword.
Violation
function overflow (a: integer) return integer is
Fix
function overflow (a: integer) return integer is
function_003¶
This rule checks for a single space after the function name and the (.’
Violation
function overflow (a: integer) return integer is
function underflow(a: integer) return integer is
Fix
function overflow (a: integer) return integer is
function underflow (a: integer) return integer is
function_004¶
This rule checks the begin keyword has proper case.
Note
The default is lowercase.
Refer to the section Configuring Uppercase and Lowercase Rules for information on changing the default case.
Violation
function overflow (a: integer) return integer is
BEGIN
Fix
function overflow (a: integer) return integer is
begin
function_005¶
This rule checks the function keyword has proper case.
Note
The default is lowercase.
Refer to the section Configuring Uppercase and Lowercase Rules for information on changing the default case.
Violation
FUNCTION overflow (a: integer) return integer is
Fix
function overflow (a: integer) return integer is
function_006¶
This rule checks for a blank line above the function keyword.
Violation
architecture RTL of FIFO is
function overflow (a: integer) return integer is
Fix
architecture RTL of FIFO is
function overflow (a: integer) return integer is
function_007¶
This rule checks for a blank line below the end of the function declaration.
Violation
function overflow (a: integer) return integer is
end;
signal wr_en : std_logic;
Fix
function overflow (a: integer) return integer is
end;
signal wr_en : std_logic;
function_008¶
This rule checks the indent of function parameters on multiple lines.
Violation
function func_1 (a : integer; b : integer;
c : unsigned(3 downto 0);
d : std_logic_vector(7 downto 0);
e : std_logic) return integer is
begin
end;
Fix
function func_1 (a : integer; b : integer;
c : unsigned(3 downto 0);
d : std_logic_vector(7 downto 0);
e : std_logic) return integer is
begin
end;
function_009¶
This rule checks for a function parameter on the same line as the function keyword when the parameters are on multiple lines.
Violation
function func_1 (a : integer; b : integer;
c : unsigned(3 downto 0);
d : std_logic_vector(7 downto 0);
e : std_logic) return integer is
begin
end;
Fix
function func_1 (
a : integer; b : integer;
c : unsigned(3 downto 0);
d : std_logic_vector(7 downto 0);
e : std_logic) return integer is
begin
end;
function_010¶
This rule checks for consistent capitalization of function names.
Violation
architecture RTL of FIFO is
function func_1 ()
begin
OUT1 <= Func_1;
PROC1 : process () is
begin
sig1 <= FUNC_1;
end process;
end architecture RTL;
Violation
architecture RTL of FIFO is
function func_1 ()
begin
OUT1 <= func_1;
PROC1 : process () is
begin
sig1 <= func_1;
end process;
end architecture RTL;