vhdl-style-guide/docs/comment_rules.rst

88 lines
1.3 KiB
ReStructuredText

.. include:: icons.rst
Comment Rules
-------------
comment_004
###########
|phase_2| |error|
This rule checks for at least a single space before inline comments.
**Violation**
.. code-block:: vhdl
wr_en <= '1';--Write data
rd_en <= '1'; -- Read data
**Fix**
.. code-block:: vhdl
wr_en <= '1'; --Write data
rd_en <= '1'; -- Read data
comment_010
###########
|phase_4| |error|
This rule checks the indent lines starting with comments.
**Violation**
.. code-block:: vhdl
-- Libraries
libary ieee;
-- Define architecture
architecture rtl of fifo is
-- Define signals
signal wr_en : std_logic;
signal rd_en : std_Logic;
begin
**Fix**
.. code-block:: vhdl
-- Libraries
libary ieee;
-- Define architecture
architecture rtl of fifo is
-- Define signals
signal wr_en : std_logic;
signal rd_en : std_Logic;
begin
comment_011
###########
|phase_1| |disabled| |error|
This rule checks for in-line comments and moves them to the line above.
The indent of the comment will be set to the indent of the current line.
.. NOTE:: This rule is disabled by default.
**Violation**
.. code-block:: vhdl
a <= b; -- Assign signal
**Fix**
.. code-block:: vhdl
-- Assign signal
a <= b;