diff --git a/vsg/tests/vhdlFile/subtype_declaration/classification_results.txt b/vsg/tests/vhdlFile/subtype_declaration/classification_results.txt index 166df7e6..f82994a8 100644 --- a/vsg/tests/vhdlFile/subtype_declaration/classification_results.txt +++ b/vsg/tests/vhdlFile/subtype_declaration/classification_results.txt @@ -147,13 +147,62 @@ 28 | -------------------------------------------------------------------------------- -29 | begin - +29 | subtype t_data_axi_stream_m2s is t_axi_stream_m2s( + + + + + -------------------------------------------------------------------------------- -30 | +30 | st_keep(T_AXI_RANGE) + + + + +-------------------------------------------------------------------------------- +31 | ); + + +-------------------------------------------------------------------------------- +32 | -------------------------------------------------------------------------------- -31 | end architecture RTL; +33 | subtype t_data_axi_stream_m2s is t_axi_stream_m2s( + + + + + +-------------------------------------------------------------------------------- +34 | st_strb2(0 downto 0), + + + + + + + +-------------------------------------------------------------------------------- +35 | st_keep(T_AXI_RANGE) + + + + +-------------------------------------------------------------------------------- +36 | ); + + +-------------------------------------------------------------------------------- +37 | + +-------------------------------------------------------------------------------- +38 | begin + +-------------------------------------------------------------------------------- +39 | + +-------------------------------------------------------------------------------- +40 | end architecture RTL; diff --git a/vsg/tests/vhdlFile/subtype_declaration/classification_test_input.vhd b/vsg/tests/vhdlFile/subtype_declaration/classification_test_input.vhd index 9c6ce582..a9f25646 100644 --- a/vsg/tests/vhdlFile/subtype_declaration/classification_test_input.vhd +++ b/vsg/tests/vhdlFile/subtype_declaration/classification_test_input.vhd @@ -26,6 +26,15 @@ architecture RTL of FIFO is ) ); + subtype t_data_axi_stream_m2s is t_axi_stream_m2s( + st_keep(T_AXI_RANGE) + ); + + subtype t_data_axi_stream_m2s is t_axi_stream_m2s( + st_strb2(0 downto 0), + st_keep(T_AXI_RANGE) + ); + begin end architecture RTL; diff --git a/vsg/vhdlFile/classify/range.py b/vsg/vhdlFile/classify/range.py index f6a9a2cd..b21e5b94 100644 --- a/vsg/vhdlFile/classify/range.py +++ b/vsg/vhdlFile/classify/range.py @@ -14,6 +14,10 @@ def detect(iToken, lObjects): def check_for_range_attribute_name(iToken, lObjects): + + if single_token_enclosed_in_parenthesis(iToken, lObjects): + return True + iParens = 0 for iIndex in range(iToken, len(lObjects)): iParens = utils.update_paren_counter(iIndex, lObjects, iParens) @@ -26,6 +30,10 @@ def check_for_range_attribute_name(iToken, lObjects): return False +def single_token_enclosed_in_parenthesis(iToken, lObjects): + return utils.are_next_consecutive_tokens([None, ')'], iToken, lObjects) + + def token_is_matching_close_parenthesis(iParens): if iParens == -1: return True