Language Feature Restrictions


Sigasi Studio 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 243). 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 (event and value denied)
architecture 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 (event allowed)
architecture 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 abc denied
library abc;    -- Library 'abc' is prohibited
  • Library ieee allowed
library 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_std and work.user_package denied)
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;       -- Package 'numeric_std' is prohibited
use work.user_package.all;      -- Ignored because work
  • Check packages in allow mode (ieee.numeric_std and work.user_package allowed)
library 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 work
  • Check packages in denied mode, with the current file mapped to the library memory (memory.ram_cell denied)
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 library

Prohibited 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_on

Rule 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...]