Instantiation Rules¶
instantiation_001¶
This rule checks for the proper indentation of instantiations.
Violation
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
Fix
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
instantiation_002¶
This rule checks for a single space after the :.
Violation
U_FIFO :FIFO
Fix
U_FIFO : FIFO
instantiation_003¶
This rule checks for a single space before the :.
Violation
U_FIFO: FIFO
Fix
U_FIFO : FIFO
instantiation_004¶
This rule checks for a blank line above the instantiation.
Note
Comments are allowed above the instantiation.
Violation
WR_EN <= '1';
U_FIFO : FIFO
-- Instantiate another FIFO
U_FIFO2 : FIFO
Fix
WR_EN <= '1';
U_FIFO : FIFO
-- Instantiate another FIFO
U_FIFO2 : FIFO
instantiation_005¶
This rule checks the instantiation declaration and the port map keywords are not on the same line.
Violation
U_FIFO : FIFO port map (
Fix
U_FIFO : FIFO
port map (
instantiation_006¶
This rule checks the port map keywords have proper case.
Note
The default is lowercase.
Violation
PORT MAP (
Fix
port map (
instantiation_007¶
This rule checks the closing ) for the port map is on it’s own line.
Violation
WR_EN => wr_en);
Fix
WR_EN => wr_en
);
instantiation_008¶
This rule checks the instance name has proper case.
Note
The default is uppercase.
Refer to the section Configuring Uppercase and Lowercase Rules for information on changing the default case.
Violation
u_fifo : FIFO
Fix
U_FIFO : FIFO
instantiation_009¶
This rule checks the entity name has proper case.
Note
The default is uppercase.
Violation
U_FIFO : fifo
Fix
U_FIFO : FIFO
instantiation_010¶
This rule checks the alignment of the => operator for every port in instantiation.
Violation
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
Fix
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
instantiation_011¶
This rule checks the port name is uppercase. Indexes on ports will not be uppercased.
Violation
U_FIFO : FIFO
port map (
wr_en => wr_en,
rd_en => rd_en,
OVERFLOW => overflow,
underflow(c_index) => underflow
);
Fix
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow,
UNDERFLOW(c_index) => underflow
);
instantiation_012¶
This rule checks the instantiation declaration and the generic map keywords are not on the same line.
Violation
U_FIFO : FIFO generic map (
Fix
U_FIFO : FIFO
generic map (
instantiation_013¶
This rule checks the generic map keywords have proper case.
Note
The default is lowercase.
Violation
GENERIC MAP (
Fix
generic map (
instantiation_014¶
This rule checks for the closing parenthesis ) on generic maps are on their own line.
Violation
INSTANCE_NAME : ENTITY_NAME
generic map (
GENERIC_1 => 0,
GENERIC_2 => TRUE,
GENERIC_3 => FALSE)
Fix
INSTANCE_NAME : ENTITY_NAME
generic map (
GENERIC_1 => 0,
GENERIC_2 => TRUE,
GENERIC_3 => FALSE
)
instantiation_015¶
This rule checks the alignment of the => operator for every generic.
Violation
U_FIFO : FIFO
generic map (
DEPTH => 512,
WIDTH => 32
)
Fix
U_FIFO : FIFO
generic map (
DEPTH => 512,
WIDTH => 32
)
instantiation_016¶
This rule checks generic names have proper case.
Note
The default is uppercase.
Violation
U_FIFO : FIFO
generic map (
depth => 512,
width => 32
)
Fix
U_FIFO : FIFO
generic map (
DEPTH => 512,
WIDTH => 32
)
instantiation_017¶
This rule checks if the generic map keywords and a generic assignment are on the same line.
Violation
generic map (DEPTH => 512,
WIDTH => 32
)
Fix
generic map (
DEPTH => 512,
WIDTH => 32
)
instantiation_018¶
This rule checks for a single space between the map keyword and the (.
Violation
generic map(
generic map (
Fix
generic map (
generic map (
instantiation_019¶
This rule checks for a blank line below the end of the instantiation declaration.
Violation
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
U_RAM : RAM
Fix
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
U_RAM : RAM
instantiation_020¶
This rule checks for a port assignment on the same line as the port map keyword.
Violation
U_FIFO : FIFO
port map (WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
Fix
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
instantiation_021¶
This rule checks multiple port assignments on the same line.
Violation
port map (
WR_EN => w_wr_en, RD_EN => w_rd_en,
OVERFLOW => w_overflow
);
Fix
port map (
WR_EN => w_wr_en,
RD_EN => w_rd_en,
OVERFLOW => w_overflow
);
instantiation_022¶
This rule checks for a single space after the => operator in port maps.
Violation
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN =>rd_en,
OVERFLOW => overflow
);
Fix
U_FIFO : FIFO
port map (
WR_EN => wr_en,
RD_EN => rd_en,
OVERFLOW => overflow
);
instantiation_023¶
This rule checks for comments at the end of the port and generic assignments in instantiations. These comments represent additional maintainence. They will be out of sync with the entity at some point. Refer to the entity for port types, port directions and purpose.
Violation
WR_EN => w_wr_en; -- out : std_logic
RD_EN => w_rd_en; -- Reads data when asserted
Fix
WR_EN => w_wr_en;
RD_EN => w_rd_en;
instantiation_024¶
This rule checks for positional generics and ports. Positional ports and generics are subject to problems when the position of the underlying component changes.
Violation
port map (
WR_EN, RD_EN, OVERFLOW
);
Fix
Use explicit port mapping.
port map (
WR_EN => WR_EN;
RD_EN => RD_EN;
OVERFLOW => OVERFLOW
);
instantiation_025¶
This rule checks the ( is on the same line as the port map keywords.
Violation
port map
(
WR_EN => WR_EN,
RD_EN => RD_EN,
OVERFLOW => OVERFLOW
);
Fix
Use explicit port mapping.
port map (
WR_EN => WR_EN,
RD_EN => RD_EN,
OVERFLOW => OVERFLOW
);
instantiation_026¶
This rule checks the ( is on the same line as the generic map keywords.
Violation
generic map
(
WIDTH => 32,
DEPTH => 512
)
Fix
Use explicit port mapping.
generic map (
WIDTH => 32,
DEPTH => 512
)
instantiation_027¶
This rule checks the entity keyword has proper case in direct instantiations.
Note
The default is lowercase.
Violation
INSTANCE_NAME : ENTITY library.ENTITY_NAME
Fix
INSTANCE_NAME : entity library.ENTITY_NAME
instantiation_028¶
This rule checks the entity name has proper case in direct instantiations.
Note
The default is uppercase.
Violation
INSTANCE_NAME : entity library.entity_name
Fix
INSTANCE_NAME : entity library.ENTITY_NAME
instantiation_029¶
This rule checks for alignment of inline comments in an instantiation
Violation
WR_EN => write_enable, -- Wrte enable
RD_EN => read_enable, -- Read enable
OVERLFLOW => overflow, -- FIFO has overflowed
Fix
WR_EN => write_enable, -- Wrte enable
RD_EN => read_enable, -- Read enable
OVERLFLOW => overflow, -- FIFO has overflowed
instantiation_030¶
This rule checks for a single space after the => keyword in generic maps.
Violation
generic map
(
WIDTH => 32,
DEPTH => 512
)
Fix
generic map
(
WIDTH => 32,
DEPTH => 512
)
instantiation_031¶
This rule checks the component keyword has proper case in component instantiations that use the component keyword.
Note
The default is lowercase.
Violation
INSTANCE_NAME : COMPONENT ENTITY_NAME
Fix
INSTANCE_NAME : component ENTITY_NAME
Note
This rule is off by default. If this rule is desired, then enable this rule and disable instantiation_033.
{
"rule":{
"instantiation_031":{
"disable":"False"
},
"instantiation_033":{
"disable":"True"
}
}
}
instantiation_032¶
This rule checks for a single space after the component keyword if it is used.
Violation
INSTANCE_NAME : component ENTITY_NAME
INSTANCE_NAME : component ENTITY_NAME
INSTANCE_NAME : component ENTITY_NAME
Fix
INSTANCE_NAME : component ENTITY_NAME
INSTANCE_NAME : component ENTITY_NAME
INSTANCE_NAME : component ENTITY_NAME
Note
This rule is off by default. If this rule is desired, then enable this rule and disable instantiation_033.
{
"rule":{
"instantiation_032":{
"disable":"False"
},
"instantiation_033":{
"disable":"True"
}
}
}
instantiation_033¶
This rule checks for the component keyword and will remove it.
The component keyword is optional and does not provide clarity.
Violation
INSTANCE_NAME : component ENTITY_NAME
Fix
INSTANCE_NAME : ENTITY_NAME