Repository: jeremiah-c-leary/vhdl-style-guide (language: python)

Issue:
Generic map case rules apply only to component insantiations, and not other instances where generic maps can be used
**Environment**
v3.27.0

**Describe the bug**
Generic maps can be used in package instantiations, subprogram instantiations, blocks and component instantiations. However, most generic map rules only apply to component instantiations.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a file tes.vhd with the following contents
```vhdl
PACKAGE MY_PKG_G IS NEW MY_PKG
GENERIC MAP (G_TEST => C_TEST);

ARCHITECTURE RTL OF TEST IS

FUNCTION MY_FUNC IS NEW MY_FUNC
GENERIC MAP (G_TEST => C_TEST);

BEGIN

  CMP_G_TEST : COMPONENT TEST
GENERIC MAP (G_TEST => C_TEST);

  MY_BLOCK : BLOCK IS

GENERIC (G_TEST : BOOLEAN);
GENERIC MAP (G_TEST => C_TEST);

  BEGIN

  END BLOCK MY_BLOCK;

END ARCHITECTURE RTL;
```
2. Run `vsg -f test.vhd --fix`
3. Observe the following output
```vhdl
PACKAGE MY_PKG_G IS NEW MY_PKG
GENERIC MAP (
G_TEST => C_TEST
);

architecture rtl of test is

function MY_FUNC IS NEW MY_FUNC
GENERIC MAP (
G_TEST => C_TEST
);

begin

  cmp_g_test : component test
    generic map (
      g_test => C_TEST
    );

  my_block : block is

    generic (
      g_test : BOOLEAN
    );
GENERIC MAP (
G_TEST => C_TEST
);

  begin

  end block my_block;

end architecture rtl;
```
Note that the component instantiation is now nicely formatted, while the others are not.

**Expected behavior**
I expect the generic map rules to act on all of these instances.



Discussion / hints:

Fix patch:
diff --git a/vsg/rules/generic_map/rule_001.py b/vsg/rules/generic_map/rule_001.py
index 78fd247b2..ec30923c5 100644
--- a/vsg/rules/generic_map/rule_001.py
+++ b/vsg/rules/generic_map/rule_001.py
@@ -1,17 +1,14 @@
 # -*- coding: utf-8 -*-
 
 from vsg import token
-from vsg.rules import token_case_in_range_bounded_by_tokens
+from vsg.rules import token_case
 
 lTokens = []
 lTokens.append(token.generic_map_aspect.generic_keyword)
 lTokens.append(token.generic_map_aspect.map_keyword)
 
-oStart = token.component_instantiation_statement.label_colon
-oEnd = token.component_instantiation_statement.semicolon
 
-
-class rule_001(token_case_in_range_bounded_by_tokens):
+class rule_001(token_case):
     """
     This rule checks the **generic map** keywords have proper case.
 
@@ -31,5 +28,5 @@ class rule_001(token_case_in_range_bounded_by_tokens):
     """
 
     def __init__(self):
-        super().__init__(lTokens, oStart, oEnd)
+        super().__init__(lTokens)
         self.groups.append("case::keyword")
diff --git a/vsg/rules/generic_map/rule_002.py b/vsg/rules/generic_map/rule_002.py
index 5d397c5b1..629200052 100644
--- a/vsg/rules/generic_map/rule_002.py
+++ b/vsg/rules/generic_map/rule_002.py
@@ -5,8 +5,8 @@
     token_case_formal_part_of_association_element_in_map_between_tokens,
 )
 
-oStart = token.component_instantiation_statement.instantiation_label
-oEnd = token.component_instantiation_statement.semicolon
+oStart = token.generic_map_aspect.generic_keyword
+oEnd = token.generic_map_aspect.close_parenthesis
 
 sMapType = "generic"
 


Test patch:
diff --git a/tests/generic_map/rule_001_test_input.fixed_lower.vhd b/tests/generic_map/rule_001_test_input.fixed_lower.vhd
index f57d8a368..d5286c8af 100644
--- a/tests/generic_map/rule_001_test_input.fixed_lower.vhd
+++ b/tests/generic_map/rule_001_test_input.fixed_lower.vhd
@@ -1,6 +1,26 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +35,6 @@ begin
       PORT_3 => w_port_3
     );
 
-  -- Violations below
-
   U_INST1 : INST1
     generic map (
       G_GEN_1 => 1,
@@ -38,4 +56,64 @@ begin
       G_GEN_3 => 3
     );
 
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_001_test_input.fixed_upper.vhd b/tests/generic_map/rule_001_test_input.fixed_upper.vhd
index 8fcb9932e..14fe08d44 100644
--- a/tests/generic_map/rule_001_test_input.fixed_upper.vhd
+++ b/tests/generic_map/rule_001_test_input.fixed_upper.vhd
@@ -1,6 +1,26 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    GENERIC MAP (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    GENERIC MAP (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    GENERIC MAP (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    GENERIC MAP (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +35,6 @@ begin
       PORT_3 => w_port_3
     );
 
-  -- Violations below
-
   U_INST1 : INST1
     GENERIC MAP (
       G_GEN_1 => 1,
@@ -38,4 +56,64 @@ begin
       G_GEN_3 => 3
     );
 
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    GENERIC MAP (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    GENERIC MAP (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    GENERIC MAP (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    GENERIC MAP (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  GENERIC MAP (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  GENERIC MAP (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  GENERIC MAP (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  GENERIC MAP (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_001_test_input.vhd b/tests/generic_map/rule_001_test_input.vhd
index 0f14ffcfd..0e7d2e58c 100644
--- a/tests/generic_map/rule_001_test_input.vhd
+++ b/tests/generic_map/rule_001_test_input.vhd
@@ -1,6 +1,26 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    GENERIC MAP (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    GENERIC map (
+      g_test => c_test
+    );
+
+  function my_func is new my_func
+    generic MAP (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +35,6 @@ begin
       PORT_3 => w_port_3
     );
 
-  -- Violations below
-
   U_INST1 : INST1
     GENERIC MAP (
       G_GEN_1 => 1,
@@ -38,4 +56,64 @@ begin
       G_GEN_3 => 3
     );
 
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    GENERIC MAP (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    generic MAP (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+  my_block : block is
+    GENERIC (
+      g_test : BOOLEAN
+    );
+    generic MAP (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  GENERIC MAP (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  GENERIC map (
+    g_test => c_test
+  );
+
+package my_pkg_g is new my_pkg
+  generic MAP (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_002_test_input.fixed_lower.vhd b/tests/generic_map/rule_002_test_input.fixed_lower.vhd
index 499d0010e..cc1392b2c 100644
--- a/tests/generic_map/rule_002_test_input.fixed_lower.vhd
+++ b/tests/generic_map/rule_002_test_input.fixed_lower.vhd
@@ -1,31 +1,96 @@
 
-architecture ARCH of ENTITY1 is
+package my_pkg_g is new my_pkg
+  generic map (
+    g_gen_1(3 downto 0) => 3,
+    g_gen_2(2 downto 1) => 4,
+    g_gen_3 => 5
+  );
+
+architecture rtl of test is
+
+function my_func is new my_func
+  generic map (
+    g_gen_1(3 downto 0) => 3,
+    g_gen_2(2 downto 1) => 4,
+    g_gen_3 => 5
+  );
 
 begin
 
-  U_INST1 : INST1
+  u_inst1 : inst1
     generic map (
       g_gen_1(3 downto 0) => 3,
       g_gen_2(2 downto 1) => 4,
       g_gen_3 => 5
     )
     port map (
-      PORT_1(3 downto 0) => w_port_1,
-      PORT_2 => w_port_2,
-      PORT_3(2 downto 1) => w_port_3
+      port_1(3 downto 0) => w_port_1,
+      port_2 => w_port_2,
+      port_3(2 downto 1) => w_port_3
     );
 
-  -- Violations below
-  U_INST1 : INST1
+  my_block : block is
+
+    generic (
+      g_test : boolean
+    );
     generic map (
       g_gen_1(3 downto 0) => 3,
       g_gen_2(2 downto 1) => 4,
       g_gen_3 => 5
+    );
+
+  begin
+
+  end block my_block;
+
+end architecture rtl;
+
+  -- Violations below
+
+PACKAGE MY_PKG_G IS NEW MY_PKG
+  GENERIC MAP (
+    g_gen_1(3 DOWNTO 0) => 3,
+    g_gen_2(2 DOWNTO 1) => 4,
+    g_gen_3 => 5
+  );
+
+ARCHITECTURE RTL OF TEST IS
+
+FUNCTION MY_FUNC IS NEW MY_FUNC
+  GENERIC MAP (
+    g_gen_1(3 DOWNTO 0) => 3,
+    g_gen_2(2 DOWNTO 1) => 4,
+    g_gen_3 => 5
+  );
+
+BEGIN
+
+  U_INST1 : INST1
+    GENERIC MAP (
+      g_gen_1(3 DOWNTO 0) => 3,
+      g_gen_2(2 DOWNTO 1) => 4,
+      g_gen_3 => 5
     )
-    port map (
-      port_1(3 downto 0) => w_port_1,
-      port_2 => w_port_2,
-      port_3(2 downto 1) => w_port_3
+    PORT MAP (
+      PORT_1(3 DOWNTO 0) => W_PORT_1,
+      PORT_2 => W_PORT_2,
+      PORT_3(2 DOWNTO 1) => W_PORT_3
+    );
+
+  MY_BLOCK : BLOCK IS
+
+    GENERIC (
+      G_TEST : BOOLEAN
     );
+    GENERIC MAP (
+      g_gen_1(3 DOWNTO 0) => 3,
+      g_gen_2(2 DOWNTO 1) => 4,
+      g_gen_3 => 5
+    );
+
+  BEGIN
+
+  END BLOCK MY_BLOCK;
 
-end architecture ARCH;
+END ARCHITECTURE RTL;
diff --git a/tests/generic_map/rule_002_test_input.fixed_upper.vhd b/tests/generic_map/rule_002_test_input.fixed_upper.vhd
index 46c2fc078..14184d08c 100644
--- a/tests/generic_map/rule_002_test_input.fixed_upper.vhd
+++ b/tests/generic_map/rule_002_test_input.fixed_upper.vhd
@@ -1,31 +1,96 @@
 
-architecture ARCH of ENTITY1 is
+package my_pkg_g is new my_pkg
+  generic map (
+    G_GEN_1(3 downto 0) => 3,
+    G_GEN_2(2 downto 1) => 4,
+    G_GEN_3 => 5
+  );
+
+architecture rtl of test is
+
+function my_func is new my_func
+  generic map (
+    G_GEN_1(3 downto 0) => 3,
+    G_GEN_2(2 downto 1) => 4,
+    G_GEN_3 => 5
+  );
 
 begin
 
-  U_INST1 : INST1
+  u_inst1 : inst1
     generic map (
       G_GEN_1(3 downto 0) => 3,
       G_GEN_2(2 downto 1) => 4,
       G_GEN_3 => 5
     )
     port map (
-      PORT_1(3 downto 0) => w_port_1,
-      PORT_2 => w_port_2,
-      PORT_3(2 downto 1) => w_port_3
+      port_1(3 downto 0) => w_port_1,
+      port_2 => w_port_2,
+      port_3(2 downto 1) => w_port_3
     );
 
-  -- Violations below
-  U_INST1 : INST1
+  my_block : block is
+
+    generic (
+      g_test : boolean
+    );
     generic map (
       G_GEN_1(3 downto 0) => 3,
       G_GEN_2(2 downto 1) => 4,
       G_GEN_3 => 5
+    );
+
+  begin
+
+  end block my_block;
+
+end architecture rtl;
+
+  -- Violations below
+
+PACKAGE MY_PKG_G IS NEW MY_PKG
+  GENERIC MAP (
+    G_GEN_1(3 DOWNTO 0) => 3,
+    G_GEN_2(2 DOWNTO 1) => 4,
+    G_GEN_3 => 5
+  );
+
+ARCHITECTURE RTL OF TEST IS
+
+FUNCTION MY_FUNC IS NEW MY_FUNC
+  GENERIC MAP (
+    G_GEN_1(3 DOWNTO 0) => 3,
+    G_GEN_2(2 DOWNTO 1) => 4,
+    G_GEN_3 => 5
+  );
+
+BEGIN
+
+  U_INST1 : INST1
+    GENERIC MAP (
+      G_GEN_1(3 DOWNTO 0) => 3,
+      G_GEN_2(2 DOWNTO 1) => 4,
+      G_GEN_3 => 5
     )
-    port map (
-      port_1(3 downto 0) => w_port_1,
-      port_2 => w_port_2,
-      port_3(2 downto 1) => w_port_3
+    PORT MAP (
+      PORT_1(3 DOWNTO 0) => W_PORT_1,
+      PORT_2 => W_PORT_2,
+      PORT_3(2 DOWNTO 1) => W_PORT_3
+    );
+
+  MY_BLOCK : BLOCK IS
+
+    GENERIC (
+      G_TEST : BOOLEAN
     );
+    GENERIC MAP (
+      G_GEN_1(3 DOWNTO 0) => 3,
+      G_GEN_2(2 DOWNTO 1) => 4,
+      G_GEN_3 => 5
+    );
+
+  BEGIN
+
+  END BLOCK MY_BLOCK;
 
-end architecture ARCH;
+END ARCHITECTURE RTL;
diff --git a/tests/generic_map/rule_002_test_input.vhd b/tests/generic_map/rule_002_test_input.vhd
index 03583d527..09af694f4 100644
--- a/tests/generic_map/rule_002_test_input.vhd
+++ b/tests/generic_map/rule_002_test_input.vhd
@@ -1,31 +1,96 @@
 
-architecture ARCH of ENTITY1 is
+package my_pkg_g is new my_pkg
+  generic map (
+    g_gen_1(3 downto 0) => 3,
+    g_gen_2(2 downto 1) => 4,
+    g_gen_3 => 5
+  );
+
+architecture rtl of test is
+
+function my_func is new my_func
+  generic map (
+    g_gen_1(3 downto 0) => 3,
+    g_gen_2(2 downto 1) => 4,
+    g_gen_3 => 5
+  );
 
 begin
 
-  U_INST1 : INST1
+  u_inst1 : inst1
     generic map (
-      G_GEN_1(3 downto 0) => 3,
-      G_GEN_2(2 downto 1) => 4,
-      G_GEN_3 => 5
+      g_gen_1(3 downto 0) => 3,
+      g_gen_2(2 downto 1) => 4,
+      g_gen_3 => 5
     )
     port map (
-      PORT_1(3 downto 0) => w_port_1,
-      PORT_2 => w_port_2,
-      PORT_3(2 downto 1) => w_port_3
+      port_1(3 downto 0) => w_port_1,
+      port_2 => w_port_2,
+      port_3(2 downto 1) => w_port_3
     );
 
-  -- Violations below
-  U_INST1 : INST1
+  my_block : block is
+
+    generic (
+      g_test : boolean
+    );
     generic map (
       g_gen_1(3 downto 0) => 3,
       g_gen_2(2 downto 1) => 4,
       g_gen_3 => 5
+    );
+
+  begin
+
+  end block my_block;
+
+end architecture rtl;
+
+  -- Violations below
+
+PACKAGE MY_PKG_G IS NEW MY_PKG
+  GENERIC MAP (
+    G_GEN_1(3 DOWNTO 0) => 3,
+    G_GEN_2(2 DOWNTO 1) => 4,
+    G_GEN_3 => 5
+  );
+
+ARCHITECTURE RTL OF TEST IS
+
+FUNCTION MY_FUNC IS NEW MY_FUNC
+  GENERIC MAP (
+    G_GEN_1(3 DOWNTO 0) => 3,
+    G_GEN_2(2 DOWNTO 1) => 4,
+    G_GEN_3 => 5
+  );
+
+BEGIN
+
+  U_INST1 : INST1
+    GENERIC MAP (
+      G_GEN_1(3 DOWNTO 0) => 3,
+      G_GEN_2(2 DOWNTO 1) => 4,
+      G_GEN_3 => 5
     )
-    port map (
-      port_1(3 downto 0) => w_port_1,
-      port_2 => w_port_2,
-      port_3(2 downto 1) => w_port_3
+    PORT MAP (
+      PORT_1(3 DOWNTO 0) => W_PORT_1,
+      PORT_2 => W_PORT_2,
+      PORT_3(2 DOWNTO 1) => W_PORT_3
+    );
+
+  MY_BLOCK : BLOCK IS
+
+    GENERIC (
+      G_TEST : BOOLEAN
     );
+    GENERIC MAP (
+      G_GEN_1(3 DOWNTO 0) => 3,
+      G_GEN_2(2 DOWNTO 1) => 4,
+      G_GEN_3 => 5
+    );
+
+  BEGIN
+
+  END BLOCK MY_BLOCK;
 
-end architecture ARCH;
+END ARCHITECTURE RTL;
diff --git a/tests/generic_map/rule_003_test_input.fixed.vhd b/tests/generic_map/rule_003_test_input.fixed.vhd
index 29e967515..d080c0cc8 100644
--- a/tests/generic_map/rule_003_test_input.fixed.vhd
+++ b/tests/generic_map/rule_003_test_input.fixed.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,6 +20,32 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map(
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map(
       G_GEN_1 => 3,
@@ -27,8 +58,35 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map(
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map(
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (
 
@@ -36,10 +94,28 @@ begin
       G_GEN_2 => 4,
       G_GEN_3 => 5
     )
-    port map (
+    port map
+    (
       PORT_1 => w_port_1,
       PORT_2 => w_port_2,
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_003_test_input.vhd b/tests/generic_map/rule_003_test_input.vhd
index 837bd592a..308dd9126 100644
--- a/tests/generic_map/rule_003_test_input.vhd
+++ b/tests/generic_map/rule_003_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,6 +20,32 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map(
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map(
       G_GEN_1 => 3,
@@ -27,8 +58,35 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map(
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map(
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map
+    (
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map
     (
@@ -36,10 +94,28 @@ begin
       G_GEN_2 => 4,
       G_GEN_3 => 5
     )
-    port map (
+    port map
+    (
       PORT_1 => w_port_1,
       PORT_2 => w_port_2,
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map
+    (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map
+  (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_004_test_input.fixed.vhd b/tests/generic_map/rule_004_test_input.fixed.vhd
index eac8fc072..bb72dafdd 100644
--- a/tests/generic_map/rule_004_test_input.fixed.vhd
+++ b/tests/generic_map/rule_004_test_input.fixed.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +20,34 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+);
+
+begin
+
   U_INST1 : INST1
     generic map (
       G_GEN_1 => 3,
@@ -27,13 +58,58 @@ begin
       PORT_1 => w_port_1,
       PORT_2 => w_port_2,
       PORT_3 => w_port_3
-    );
+);
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+);
+    generic map (
+      g_test => C_TEST
+);
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+);
+
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+);
+
+begin
 
   U_INST1 : INST1
     generic map (
-      G_GEN_1 => 1,
-      G_GEN_2 => 2,
-      G_GEN_3 => 3
+      G_GEN_1 => 3,
+      G_GEN_2 => 4,
+      G_GEN_3 => 5
+)
+    port map
+    (
+      PORT_1 => w_port_1,
+      PORT_2 => w_port_2,
+      PORT_3 => w_port_3);
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN);
+    generic map (
+      g_test => C_TEST
 );
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+);
diff --git a/tests/generic_map/rule_004_test_input.vhd b/tests/generic_map/rule_004_test_input.vhd
index e22d79914..e577164c4 100644
--- a/tests/generic_map/rule_004_test_input.vhd
+++ b/tests/generic_map/rule_004_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,23 +20,92 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+);
+
+begin
+
   U_INST1 : INST1
     generic map (
       G_GEN_1 => 3,
       G_GEN_2 => 4,
-      G_GEN_3 => 5)
+      G_GEN_3 => 5
+)
     port map (
       PORT_1 => w_port_1,
       PORT_2 => w_port_2,
       PORT_3 => w_port_3
-    );
+);
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+);
+    generic map (
+      g_test => C_TEST
+);
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+);
+
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test);
+
+begin
 
   U_INST1 : INST1
     generic map (
-      G_GEN_1 => 1,
-      G_GEN_2 => 2,
-      G_GEN_3 => 3);
+      G_GEN_1 => 3,
+      G_GEN_2 => 4,
+      G_GEN_3 => 5)
+    port map
+    (
+      PORT_1 => w_port_1,
+      PORT_2 => w_port_2,
+      PORT_3 => w_port_3);
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN);
+    generic map (
+      g_test => C_TEST);
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test);
diff --git a/tests/generic_map/rule_005_test_input.fixed.vhd b/tests/generic_map/rule_005_test_input.fixed.vhd
index 6d3480b36..eb087b747 100644
--- a/tests/generic_map/rule_005_test_input.fixed.vhd
+++ b/tests/generic_map/rule_005_test_input.fixed.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +20,34 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (
 G_GEN_1 => 3,
@@ -29,11 +60,57 @@ G_GEN_1 => 3,
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+g_test => c_test
+  );
+
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+  g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (
-   G_GEN_1 => 1,
-      G_GEN_2 => 2,
-      G_GEN_3 => 3
+  G_GEN_1 => 3,
+      G_GEN_2 => 4,
+      G_GEN_3 => 5
+    )
+    port map (
+      PORT_1 => w_port_1,
+      PORT_2 => w_port_2,
+      PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+  g_test => C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+  g_test => c_test
+  );
diff --git a/tests/generic_map/rule_005_test_input.vhd b/tests/generic_map/rule_005_test_input.vhd
index c8194ecf5..92184a1aa 100644
--- a/tests/generic_map/rule_005_test_input.vhd
+++ b/tests/generic_map/rule_005_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +20,33 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (G_GEN_1 => 3,
       G_GEN_2 => 4,
@@ -28,10 +58,51 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (g_test => c_test
+  );
+
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (  g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
-    generic map (   G_GEN_1 => 1,
-      G_GEN_2 => 2,
-      G_GEN_3 => 3
+    generic map (  G_GEN_1 => 3,
+      G_GEN_2 => 4,
+      G_GEN_3 => 5
+    )
+    port map (
+      PORT_1 => w_port_1,
+      PORT_2 => w_port_2,
+      PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (  g_test => C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (  g_test => c_test
+  );
diff --git a/tests/generic_map/rule_006_test_input.fixed.vhd b/tests/generic_map/rule_006_test_input.fixed.vhd
index 99565fd55..2b6f1efe0 100644
--- a/tests/generic_map/rule_006_test_input.fixed.vhd
+++ b/tests/generic_map/rule_006_test_input.fixed.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +20,34 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (
       G_GEN_1 => 3,
@@ -27,7 +58,33 @@ begin
       PORT_1 => w_port_1,
       PORT_2 => w_port_2,
       PORT_3 => w_port_3
-   );
+    );
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+begin
 
   U_INST1 : INST1
     generic map (
@@ -35,10 +92,25 @@ begin
       G_GEN_2 => 4,
       G_GEN_3 => 5
     )
-    port map   (
+    port map       (
       PORT_1 => w_port_1,
       PORT_2 => w_port_2,
       PORT_3 => w_port_3
-   );
+    );
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_006_test_input.vhd b/tests/generic_map/rule_006_test_input.vhd
index 19c33086e..963565b08 100644
--- a/tests/generic_map/rule_006_test_input.vhd
+++ b/tests/generic_map/rule_006_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +20,34 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map(
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map(
       G_GEN_1 => 3,
@@ -27,18 +58,59 @@ begin
       PORT_1 => w_port_1,
       PORT_2 => w_port_2,
       PORT_3 => w_port_3
-   );
+    );
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map(
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map(
+    g_test => c_test
+  );
+
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map       (
+      g_test => c_test
+    );
+
+begin
 
   U_INST1 : INST1
-    generic map    (
+    generic map       (
       G_GEN_1 => 3,
       G_GEN_2 => 4,
       G_GEN_3 => 5
     )
-    port map   (
+    port map       (
       PORT_1 => w_port_1,
       PORT_2 => w_port_2,
       PORT_3 => w_port_3
-   );
+    );
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map       (
+      g_test => C_TEST
+    );
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map       (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_007_test_input.fixed.vhd b/tests/generic_map/rule_007_test_input.fixed.vhd
index 833f4bcd6..5bf06a17d 100644
--- a/tests/generic_map/rule_007_test_input.fixed.vhd
+++ b/tests/generic_map/rule_007_test_input.fixed.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,8 +20,34 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (
       G_GEN_1 => 3,
@@ -24,9 +55,24 @@ begin
       G_GEN_3 => 5
     )
     port map (
-      PORT_1 =>   w_port_1,
+      PORT_1 =>    w_port_1,
       PORT_2 =>w_port_2,
-      PORT_3 =>  w_port_3
+      PORT_3 =>        w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_007_test_input.vhd b/tests/generic_map/rule_007_test_input.vhd
index 5572370f7..01821e4fa 100644
--- a/tests/generic_map/rule_007_test_input.vhd
+++ b/tests/generic_map/rule_007_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,18 +20,59 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test =>     c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (
       G_GEN_1 =>    3,
       G_GEN_2 =>4,
-      G_GEN_3 =>  5
+      G_GEN_3 =>        5
     )
     port map (
-      PORT_1 =>   w_port_1,
+      PORT_1 =>    w_port_1,
       PORT_2 =>w_port_2,
-      PORT_3 =>  w_port_3
+      PORT_3 =>        w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test =>C_TEST
+    );
+  begin
+  end block;
+
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test =>     c_test
+  );
diff --git a/tests/generic_map/rule_008_test_input.vhd b/tests/generic_map/rule_008_test_input.vhd
index 9c14d0e59..26309c072 100644
--- a/tests/generic_map/rule_008_test_input.vhd
+++ b/tests/generic_map/rule_008_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,18 +20,33 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
-  U_INST1 : INST1
-    generic map(
-      G_GEN_1 => 3,
-      4,
-      G_GEN_3 => 5
-    )
-    port map (w_port_1,
-      PORT_2 => w_port_2,
-      w_port_3
-   );
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      c_test
+    );
+
+begin
 
   U_INST1 : INST1
     generic map (
@@ -34,9 +54,25 @@ begin
       G_GEN_2 => 4,
       5
     )
-    port map (PORT_1 => w_port_1,
-      w_port_2,
+    port map (
+      w_port_1,
+      PORT_2 => w_port_2,
       w_port_3
-   );
+    );
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      C_TEST
+    );
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    c_test
+  );
diff --git a/tests/generic_map/rule_100_test_input.fixed.vhd b/tests/generic_map/rule_100_test_input.fixed.vhd
index 7da5719f6..701821fcb 100644
--- a/tests/generic_map/rule_100_test_input.fixed.vhd
+++ b/tests/generic_map/rule_100_test_input.fixed.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,10 +20,36 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
-    generic map(
+    generic map (
       G_GEN_1 => 3,
       G_GEN_2 => 4,
       G_GEN_3 => 5
@@ -27,6 +58,21 @@ begin
       PORT_1=> w_port_1,
       PORT_2=> w_port_2,
       PORT_3=> w_port_3
-   );
+    );
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_100_test_input.vhd b/tests/generic_map/rule_100_test_input.vhd
index 9f4d9fea9..3e4d829b8 100644
--- a/tests/generic_map/rule_100_test_input.vhd
+++ b/tests/generic_map/rule_100_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,10 +20,36 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test=> c_test
+    );
+
+begin
+
   U_INST1 : INST1
-    generic map(
+    generic map (
       G_GEN_1=> 3,
       G_GEN_2=> 4,
       G_GEN_3=> 5
@@ -27,6 +58,21 @@ begin
       PORT_1=> w_port_1,
       PORT_2=> w_port_2,
       PORT_3=> w_port_3
-   );
+    );
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test=> C_TEST
+    );
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test=> c_test
+  );
diff --git a/tests/generic_map/rule_600_test_input.vhd b/tests/generic_map/rule_600_test_input.vhd
index ef8df6e97..f029c6f6b 100644
--- a/tests/generic_map/rule_600_test_input.vhd
+++ b/tests/generic_map/rule_600_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      test_g => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,13 +20,39 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      test_g : BOOLEAN
+    );
+    generic map (
+      test_g => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    test_g => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (
-      GEN_1_W => 3,
-      GEN_2   => 4,
-      GEN_3_WR => 5
+      G_GEN_1 => 3,
+      G_GEN_2 => 4,
+      G_GEN_3 => 5
     )
     port map (
       PORT_1 => w_port_1,
@@ -29,5 +60,25 @@ begin
       PORT_3 => w_port_3
     );
 
+  U_INST2 : INST2
+  generic map (
+    GEN_1_W(W_GEN_1) => 3,
+    GEN_2_G(W_GEN_1) => 10
+  );
+
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
diff --git a/tests/generic_map/rule_601_test_input.vhd b/tests/generic_map/rule_601_test_input.vhd
index 798b69242..e30ff7356 100644
--- a/tests/generic_map/rule_601_test_input.vhd
+++ b/tests/generic_map/rule_601_test_input.vhd
@@ -1,6 +1,11 @@
 
 architecture ARCH of ENTITY1 is
 
+  function my_func is new my_func
+    generic map (
+      g_test => c_test
+    );
+
 begin
 
   U_INST1 : INST1
@@ -15,13 +20,39 @@ begin
       PORT_3 => w_port_3
     );
 
+  my_block : block is
+    generic (
+      g_test : BOOLEAN
+    );
+    generic map (
+      g_test => C_TEST
+    );
+  begin
+  end block;
+
+end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    g_test => c_test
+  );
+
   -- Violations below
 
+architecture ARCH of ENTITY1 is
+
+  function my_func is new my_func
+    generic map (
+      test_g => c_test
+    );
+
+begin
+
   U_INST1 : INST1
     generic map (
-      W_GEN_1 => 3,
-      GEN_2   => 4,
-      WR_GEN_3 => 5
+      GEN_1_G => 3,
+      GEN_2_G => 4,
+      GEN_3_G => 5
     )
     port map (
       PORT_1 => w_port_1,
@@ -30,9 +61,24 @@ begin
     );
 
   U_INST2 : INST2
+  generic map (
+    W_GEN_1(W_GEN_1) => 3,
+    G_GEN_2(W_GEN_1) => 10
+  );
+
+  my_block : block is
+    generic (
+      test_g : BOOLEAN
+    );
     generic map (
-      W_GEN_1(W_GEN_1) => 3,
-      G_GEN_2(W_GEN_1) => 10
+      test_g => C_TEST
     );
+  begin
+  end block;
 
 end architecture ARCH;
+
+package my_pkg_g is new my_pkg
+  generic map (
+    test_g => c_test
+  );
diff --git a/tests/generic_map/test_rule_001.py b/tests/generic_map/test_rule_001.py
index 7787b26a9..278911ff0 100644
--- a/tests/generic_map/test_rule_001.py
+++ b/tests/generic_map/test_rule_001.py
@@ -31,7 +31,7 @@ def test_rule_001_lower(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "001")
 
-        lExpected = [21, 21, 28, 35]
+        lExpected = [10, 10, 15, 20, 39, 39, 46, 53, 73, 73, 83, 93, 107, 107, 112, 117]
 
         oRule.analyze(self.oFile)
         self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
@@ -43,7 +43,7 @@ def test_rule_001_upper(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "001")
 
-        lExpected = [7, 7, 28, 35]
+        lExpected = [5, 5, 15, 20, 27, 27, 46, 53, 63, 63, 83, 93, 102, 102, 112, 117]
         oRule.analyze(self.oFile)
         self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
 
diff --git a/tests/generic_map/test_rule_002.py b/tests/generic_map/test_rule_002.py
index 44a8a7480..ebee76db1 100644
--- a/tests/generic_map/test_rule_002.py
+++ b/tests/generic_map/test_rule_002.py
@@ -31,7 +31,7 @@ def test_rule_002_lower(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "002")
 
-        lExpected = [8, 9, 10]
+        lExpected = [53, 54, 55, 62, 63, 64, 71, 72, 73, 87, 88, 89]
 
         oRule.analyze(self.oFile)
         self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
@@ -43,7 +43,7 @@ def test_rule_002_upper(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "002")
 
-        lExpected = [21, 22, 23]
+        lExpected = [4, 5, 6, 13, 14, 15, 22, 23, 24, 38, 39, 40]
         oRule.analyze(self.oFile)
         self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
 
diff --git a/tests/generic_map/test_rule_003.py b/tests/generic_map/test_rule_003.py
index 1d3480170..97fe9cb57 100644
--- a/tests/generic_map/test_rule_003.py
+++ b/tests/generic_map/test_rule_003.py
@@ -20,6 +20,7 @@ class test_generic_map_rule(unittest.TestCase):
     def setUp(self):
         self.oFile = vhdlFile.vhdlFile(lFile)
         self.assertIsNone(eError)
+        self.maxDiff = None
 
     def test_rule_003(self):
         oRule = generic_map.rule_003()
@@ -27,7 +28,7 @@ def test_rule_003(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "003")
 
-        lExpected = [33]
+        lExpected = [83, 91, 108, 118]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
diff --git a/tests/generic_map/test_rule_004.py b/tests/generic_map/test_rule_004.py
index c6424775d..7ed415725 100644
--- a/tests/generic_map/test_rule_004.py
+++ b/tests/generic_map/test_rule_004.py
@@ -20,6 +20,7 @@ class test_generic_map_rule(unittest.TestCase):
     def setUp(self):
         self.oFile = vhdlFile.vhdlFile(lFile)
         self.assertIsNone(eError)
+        self.maxDiff = None
 
     def test_rule_004(self):
         oRule = generic_map.rule_004()
@@ -27,7 +28,7 @@ def test_rule_004(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "004")
 
-        lExpected = [24, 35]
+        lExpected = [84, 92, 103, 111]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
diff --git a/tests/generic_map/test_rule_005.py b/tests/generic_map/test_rule_005.py
index 42ff7b85d..9bbc3f897 100644
--- a/tests/generic_map/test_rule_005.py
+++ b/tests/generic_map/test_rule_005.py
@@ -27,7 +27,7 @@ def test_rule_005(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "005")
 
-        lExpected = [21, 32]
+        lExpected = [45, 51, 65, 73, 79, 85, 99, 107]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
diff --git a/tests/generic_map/test_rule_006.py b/tests/generic_map/test_rule_006.py
index 7bd2ab52e..f9f456d7c 100644
--- a/tests/generic_map/test_rule_006.py
+++ b/tests/generic_map/test_rule_006.py
@@ -27,7 +27,7 @@ def test_rule_006(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "006")
 
-        lExpected = [21, 33]
+        lExpected = [45, 52, 67, 76, 83, 90, 105, 114]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
diff --git a/tests/generic_map/test_rule_007.py b/tests/generic_map/test_rule_007.py
index e6775cfe9..b624fd475 100644
--- a/tests/generic_map/test_rule_007.py
+++ b/tests/generic_map/test_rule_007.py
@@ -27,7 +27,7 @@ def test_rule_007(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "007")
 
-        lExpected = [22, 23, 24]
+        lExpected = [46, 53, 54, 55, 68, 77]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
diff --git a/tests/generic_map/test_rule_008.py b/tests/generic_map/test_rule_008.py
index eecd75b6f..f1901965a 100644
--- a/tests/generic_map/test_rule_008.py
+++ b/tests/generic_map/test_rule_008.py
@@ -23,7 +23,7 @@ def test_rule_008(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "008")
 
-        lExpected = [23, 33, 35]
+        lExpected = [46, 53, 55, 68, 77]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
diff --git a/tests/generic_map/test_rule_100.py b/tests/generic_map/test_rule_100.py
index ca636270d..fadb34d1b 100644
--- a/tests/generic_map/test_rule_100.py
+++ b/tests/generic_map/test_rule_100.py
@@ -23,7 +23,7 @@ def test_rule_100(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "100")
 
-        lExpected = [22, 23, 24]
+        lExpected = [46, 53, 54, 55, 68, 77]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
diff --git a/tests/generic_map/test_rule_600.py b/tests/generic_map/test_rule_600.py
index ae04d30ab..4c179a0d5 100644
--- a/tests/generic_map/test_rule_600.py
+++ b/tests/generic_map/test_rule_600.py
@@ -23,7 +23,7 @@ def test_rule_600(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "600")
 
-        lExpected = [22, 23, 24]
+        lExpected = [46, 53, 54, 55, 65, 74, 83]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
@@ -35,7 +35,7 @@ def test_rule_600_g_uppercase(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "600")
 
-        lExpected = [22, 23, 24]
+        lExpected = [46, 53, 54, 55, 65, 74, 83]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
diff --git a/tests/generic_map/test_rule_601.py b/tests/generic_map/test_rule_601.py
index fb29a7cba..2c329cfb3 100644
--- a/tests/generic_map/test_rule_601.py
+++ b/tests/generic_map/test_rule_601.py
@@ -23,7 +23,7 @@ def test_rule_601(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "601")
 
-        lExpected = [22, 23, 24, 34]
+        lExpected = [46, 53, 54, 55, 65, 74, 83]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
@@ -35,7 +35,7 @@ def test_rule_600_g_uppercase(self):
         self.assertEqual(oRule.name, "generic_map")
         self.assertEqual(oRule.identifier, "601")
 
-        lExpected = [22, 23, 24, 34]
+        lExpected = [46, 53, 54, 55, 65, 74, 83]
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))