Closed t-aras closed 7 months ago
I have found another case where this rule fails:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package pkg_test is
-- Helper function
function function1 (
constant ADDR : std_logic_vector
) return std_logic_vector;
function function2 (
constant MY_ADDR : natural
) return std_logic_vector;
end package pkg_test;
package body pkg_test is
function function1 (
constant ADDR : std_logic_vector
) return std_logic_vector is
begin
return ADDR;
end function function1;
function function2 (
constant MY_ADDR : natural
) return std_logic_vector is
variable addr : std_logic_vector(31 downto 0);
begin
addr := std_logic_vector(to_unsigned(MY_ADDR, addr'length));
return addr;
end function function2;
end package body pkg_test;
with following error message:
================================================================================
File: ./pkg_test.vhd
================================================================================
Phase 6 of 7... Reporting
Total Rules Checked: 702
Total Violations: 1
Error : 1
Warning : 0
----------------------------+------------+------------+--------------------------------------
Rule | severity | line(s) | Solution
----------------------------+------------+------------+--------------------------------------
variable_011 | Error | 32 | Change "ADDR" to "addr"
----------------------------+------------+------------+--------------------------------------
NOTE: Refer to online documentation at https://vhdl-style-guide.readthedocs.io/en/latest/index.html for more information.
Good Afternoon @t-aras ,
I pushed an update for this issue to the issue-551
branch. When you get a chance could you check it on your end and let me know if it resolves the issues on your end?
Just and FYI, there are three other issues related to this one: #551, #775 and #1023 . I will close this issue when all four are resolved.
Thanks,
--Jeremy
Morning @t-aras ,
Just wanted to ping you on this issue to see if you had time to check it out.
Thanks,
--Jeremy
Afternoon @t-aras ,
I just wanted to let you know that I will be merging to this master and closing the issue. If you find additional problem, please create another issue.
Regards,
--Jeremy
Dear @jeremiah-c-leary
Sorry for the very late reply. I just tested this fix and this one is also working. Thank you for this fix too! Much appreciated!
Best @t-aras
Environment Version 3.15.0 OS: CentOS
Describe the bug The rule
variable_011
fails with multiple procedures in the same file. When a variable and parameter, both in different procedures, have the same name (let's sayaddr
) but different capitalization, rulevariable_011
takes the capitalization of the variable also for the procedure whereaddr
is used as a parameter.To Reproduce Use example file here:
This triggers following error:
Expected behavior I would expect no error at all. The capitalization of the parameters is consistent within its scope (ADDR, INSN_BASE). It seems that vsg is confused by other procedures in the same file that use a variable
addr
.