Sigasi lets users restrict the usage of language features.
Prohibited keyword or operator
Keywords and operators can be restricted using a list of keywords and operators that cannot be used (rule 245). For example:
Following keywords and operators are not allowed: **, after
if a**2=4 then -- Operator '**' is prohibited
a <= 8 after 5 ns; -- Keyword 'after' is prohibited
end if;Prohibited attribute
Attributes can be restricted using a list of attributes that cannot be used (rule 244). These attributes can be configured in two modes: deny and allow, and can also include checks for user-defined attributes. For example:
Check attributes in deny mode (
eventandvaluedenied)VHDLarchitecture RTL of prohibited_attribute is begin a : process is type myEnum is (a, b, c, d); constant constB : myEnum := myEnum'value("b"); -- Attribute 'value' is prohibited begin if clk'event then -- Attribute 'event' is prohibited report "event" severity note; end if; if clk'low = '1' then -- Attribute 'low' is allowed report "low" severity note; end if; end process a; end architecture RTL;Check attributes in allow mode (
eventallowed)VHDLarchitecture RTL of allowed_attribute is begin a : process is type myEnum is (a, b, c, d); constant constB : myEnum := myEnum'value("b"); -- Attribute 'value' is prohibited begin if clk'event then -- Attribute 'event' is allowed report "event" severity note; end if; end process a; end architecture RTL;
Prohibited library
Libraries can be restricted using a list of denied or allowed libraries that will be reported in the use clause (rule 248). Using the current work library is always allowed regardless of configuration. For example:
Library
abcdeniedVHDLlibrary abc; -- Library 'abc' is prohibitedLibrary
ieeeallowedVHDLlibrary abc; -- Only library 'ieee' is allowed
Prohibited package
Packages can be restricted using a list of denied or allowed packages that will be reported in the use clause (rule 246). Using packages from the work library or the current work library is always allowed regardless of configuration. For example:
Check packages in deny mode (
ieee.numeric_stdandwork.user_packagedenied)VHDLlibrary ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; -- Package 'numeric_std' is prohibited use work.user_package.all; -- Ignored because workCheck packages in allow mode (
ieee.numeric_stdandwork.user_packageallowed)VHDLlibrary ieee; use ieee.std_logic_1164.all; -- Package 'std_logic_1164' is prohibited use ieee.numeric_std.all; use work.user_package.all; -- Ignored because workCheck packages in denied mode, with the current file mapped to the library memory (
memory.ram_celldenied)
library ieee, memory;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use memory.ram_cell.all; -- Ignored because mapped to the same libraryProhibited pragma
Pragmas can be restricted using a list of pragmas that will be reported when they are used (rule 247). For example:
The following pragma is not allowed: vhdl_comp_off
-- vhdl_comp_off -- Pragma 'vhdl_comp_off' is prohibited
assert (rst_lvl = 0) or (rst_lvl = 1)
report "rst_lvl should be 0 or 1"
severity failure;
-- vhdl_comp_onRule configuration
These rules can be disabled for your project, or their severity and parameters can be modified in the project linting settings. Alternatively, they can be manually configured with the following template:
244/severity/${path}={error|warning|info|ignore}
244/params/check_mode/${path}={deny|allow}
244/params/attributes/${path}=[attribute...]
244/params/user_attributes/${path}={true|false}
245/severity/${path}={error|warning|info|ignore}
245/params/keywords_and_operators/${path}=[keyword...]
246/severity/${path}={error|warning|info|ignore}
246/params/check_mode/${path}={deny|allow}
246/params/packages/${path}=[package...]
247/severity/${path}={error|warning|info|ignore}
247/params/pragmas/${path}=[pragma...]
248/severity/${path}={error|warning|info|ignore}
248/params/check_mode/${path}={deny|allow}
248/params/libraries/${path}=[library...]