Skip to content

Latest commit

 

History

History
515 lines (280 loc) · 7.69 KB

package_rules.rst

File metadata and controls

515 lines (280 loc) · 7.69 KB

Package Rules

package_001

This rule checks the indent of the package declaration.

Violation

library ieee;

  package FIFO_PKG is

Fix

library ieee;

package FIFO_PKG is

package_002

This rule checks for a single space between package and is keywords.

Violation

package   FIFO_PKG   is

Fix

package FIFO_PKG is

package_003

This rule checks for blank lines or comments above the package keyword.

The default style is no_code.

Violation

library ieee;
package FIFO_PKG is

Fix

library ieee;

package FIFO_PKG is

package_004

This rule checks the package keyword has proper case.

Violation

PACKAGE FIFO_PKG is

Fix

package FIFO_PKG is

package_005

This rule checks the is keyword is on the same line as the package keyword.

Violation

package FIFO_PKG
is

Fix

package FIFO_PKG is

package_006

This rule checks the end keyword has proper case.

Violation

END package fifo_pkg;

Fix

end package fifo_pkg;

package_007

This rule checks for the package keyword on the end package declaration.

Violation

end FIFO_PKG;

Fix

end package FIFO_PKG;

package_008

This rule checks the package name has proper case on the end package declaration.

Violation

end package FIFO_PKG;

Fix

end package fifo_pkg;

package_009

This rule checks for a single space between the end and package keywords and package name.

Violation

end   package   FIFO_PKG;

Fix

end package FIFO_PKG;

package_010

This rule checks the package name has proper case in the package declaration.

Violation

package FIFO_PKG is

Fix

package fifo_pkg is

package_011

This rule checks for a blank line below the package keyword.

Violation

package FIFO_PKG is
  constant width : integer := 32;

Fix

package FIFO_PKG is

  constant width : integer := 32;

package_012

This rule checks for blank lines or comments above the end package keyword.

Violation

constant depth : integer := 512;

end package FIFO_PKG;

Fix

constant depth : integer := 512;

end package FIFO_PKG;

package_013

This rule checks the is keyword has proper case.

Violation

package fifo_pkg IS

Fix

package fifo_pkg is

package_014

This rule checks the package name exists on the same line as the end package keywords.

Violation

end package;

Fix

end package fifo_pkg;

package_015

This rule checks the indent of the end package declaration.

Violation

package FIFO_PKG is

   end package fifo_pkg;

Fix

package fifo_pkg is

end package fifo_pkg;

package_016

This rule checks for valid suffixes on package identifiers. The default package suffix is _pkg.

Violation

package foo is

Fix

package foo_pkg is

package_017

This rule checks for valid prefixes on package identifiers. The default package prefix is pkg_.

Violation

package foo is

Fix

package pkg_foo is

package_018

This rule checks the package keyword in the end package has proper case.

Violation

end PACKAGE fifo_pkg;

Fix

end package fifo_pkg;

package_019

This rule checks the identifiers for all declarations are aligned in the package declarative region.

Violation

variable var1 : natural;
signal sig1 : natural;
constant c_period : time;

Fix

variable var1     : natural;
signal   sig1     : natural;
constant c_period : time;

package_400

This rule checks the colons are in the same column for all declarations in the package declarative part.

Violation

package my_package is

  signal   wr_en : std_logic;
  signal   rd_en   : std_logic;
  constant c_period : time;

end package my_package;

Fix

package my_package is

  signal   wr_en    : std_logic;
  signal   rd_en    : std_logic;
  constant c_period : time;

end package my_package;

package_401

This rule checks the alignment of inline comments in the package declarative part.

Violation

package my_package is

  signal   wr_en    : std_logic;  -- Comment 1
  signal   rd_en    : std_logic;     -- Comment 2
  constant c_period : time; -- Comment 3

end package my_package;

Fix

package my_package is

  signal   wr_en    : std_logic; -- Comment 1
  signal   rd_en    : std_logic; -- Comment 2
  constant c_period : time;      -- Comment 3

end package my_package;

package_402

This rule checks the colons are in the same column for all attribute specifications.

Violation

attribute mark_debug of wr_en : signal is "true";
attribute mark_debug of almost_empty : signal is "true";
attribute mark_debug of full : signal is "true";

Fix

attribute mark_debug of wr_en        : signal is "true";
attribute mark_debug of almost_empty : signal is "true";
attribute mark_debug of full         : signal is "true";