diff --git a/docs/concurrent_rules.rst b/docs/concurrent_rules.rst new file mode 100644 index 00000000..e6155770 --- /dev/null +++ b/docs/concurrent_rules.rst @@ -0,0 +1,23 @@ +Concurrent Rules +---------------- + +concurrent_005 +############## + +This rule checks for labels on concurrent assignments. +Labels on concurrents are optional and do not provide additional information. + +**Violation** + +.. code-block:: vhdl + + WR_EN_OUTPUT : WR_EN <= q_wr_en; + RD_EN_OUTPUT : RD_EN <= q_rd_en; + +**Fix** + +.. code-block:: vhdl + + WR_EN <= q_wr_en; + RD_EN <= q_rd_en; + diff --git a/docs/if_rules.rst b/docs/if_rules.rst new file mode 100644 index 00000000..588dcef7 --- /dev/null +++ b/docs/if_rules.rst @@ -0,0 +1,21 @@ +If Rules +-------- + +if_012 +###### + +This rule checks for code after the **then** keyword. +Moving sequential statements to their own line makes the code easier to comprehend. + +**Violation** + +.. code-block:: vhdl + + if (a = '1' and b = '0') then c <= (others => '0') + +**Fix** + +.. code-block:: vhdl + + if (a = '1' and b = '0') then + c <= (others => '0') diff --git a/docs/process_rules.rst b/docs/process_rules.rst index 4093e77f..c4a380fa 100644 --- a/docs/process_rules.rst +++ b/docs/process_rules.rst @@ -1,6 +1,30 @@ Process Rules ------------- +process_010 +########### + +This rule checks the "begin" keyword is on it's own line. +Moving the begin to it's own line helps define the transition between the process declarative region and the sequential statements. + +**Violation** + +.. code-block:: vhdl + + PROC_A : process (rd_en, wr_en, data_in, data_out, + rd_full, wr_full + ) is begin + +**Fix** + +.. code-block:: vhdl + + PROC_A : process (rd_en, wr_en, data_in, data_out, + rd_full, wr_full + ) is + begin + + process_028 ########### diff --git a/docs/rules.rst b/docs/rules.rst index 016bf771..9bff902e 100644 --- a/docs/rules.rst +++ b/docs/rules.rst @@ -5,9 +5,11 @@ The rules are divided into catagories depending on the part of the VHDL code bei .. include:: architecture_rules.rst .. include:: component_rules.rst +.. include:: concurrent_rules.rst .. include:: constant_rules.rst .. include:: entity_rules.rst .. include:: generic_rules.rst +.. include:: if_rules.rst .. include:: instantiation_rules.rst .. include:: process_rules.rst .. include:: subtype_rules.rst diff --git a/vsg/rules/if_statement/rule_012.py b/vsg/rules/if_statement/rule_012.py index e6cdb033..df1448f3 100644 --- a/vsg/rules/if_statement/rule_012.py +++ b/vsg/rules/if_statement/rule_012.py @@ -6,7 +6,9 @@ import re class rule_012(rule.rule): - '''If rule 012 checks for code after the "then" keyword.''' + ''' + If rule 012 checks for code after the "then" keyword. + ''' def __init__(self): rule.rule.__init__(self)