Make port rule 010 use case_rule as a base.

This commit is contained in:
Michał Kruszewski 2019-10-07 13:46:59 +02:00
parent ee89f6c246
commit c63da7b0d5
4 changed files with 27 additions and 11 deletions

View File

@ -1,12 +1,14 @@
from vsg.rules import uppercase_word_rule
from vsg.rules import case_rule
from vsg import utils
class rule_010(uppercase_word_rule):
class rule_010(case_rule):
'''
Port rule 010 checks port names are uppercase.
Port rule 010 checks port names have proper case.
'''
def __init__(self):
uppercase_word_rule.__init__(self, 'port', '010', 'isPortDeclaration', 0)
self.solution = 'Uppercase port name.'
case_rule.__init__(self, 'port', '010', 'isPortDeclaration', utils.extract_port_name)
self.case = 'upper'
self.solution = 'Change port name to ' + self.case + 'case'

View File

@ -193,13 +193,13 @@ entity SPI_MASTER is
DI_I : in std_logic_vector(N - 1 downto 0) := (others => 'X'); -- parallel data in (clocked on rising spi_clk after last bit)
WREN_I : in std_logic := 'X'; -- user data write enable, starts transmission when interface is idle
WR_ACK_O : out std_logic; -- write acknowledge
DO_VALID_O : out std_logic; -- do_o data valid signal, valid during one spi_clk rising edge.
DO_VALID_O : out std_logic; -- DO_O data valid signal, valid during one spi_clk rising edge.
DO_O : out std_logic_vector(N - 1 downto 0); -- parallel output (clocked on rising spi_clk after last bit)
--- debug ports: can be removed or left unconnected for the application circuit ---
SCK_ENA_O : out std_logic; -- debug: internal sck enable signal
SCK_ENA_CE_O : out std_logic; -- debug: internal sck clock enable signal
DO_TRANSFER_O : out std_logic; -- debug: internal transfer driver
WREN_O : out std_logic; -- debug: internal state of the wren_i pulse stretcher
WREN_O : out std_logic; -- debug: internal state of the WREN_I pulse stretcher
RX_BIT_REG_O : out std_logic; -- debug: internal rx bit
STATE_DBG_O : out std_logic_vector(3 downto 0); -- debug: internal state register
CORE_CLK_O : out std_logic;

View File

@ -155,14 +155,14 @@ entity SPI_SLAVE is
SPI_MOSI_I : in std_logic := 'X'; -- spi bus mosi input
SPI_MISO_O : out std_logic := 'X'; -- spi bus spi_miso_o output
DI_REQ_O : out std_logic; -- preload lookahead data request line
DI_I : in std_logic_vector(N - 1 downto 0) := (others => 'X'); -- parallel load data in (clocked in on rising edge of clk_i)
DI_I : in std_logic_vector(N - 1 downto 0) := (others => 'X'); -- parallel load data in (clocked in on rising edge of CLK_I)
WREN_I : in std_logic := 'X'; -- user data write enable
WR_ACK_O : out std_logic; -- write acknowledge
DO_VALID_O : out std_logic; -- do_o data valid strobe, valid during one clk_i rising edge.
DO_O : out std_logic_vector(N - 1 downto 0); -- parallel output (clocked out on falling clk_i)
DO_VALID_O : out std_logic; -- DO_O data valid strobe, valid during one CLK_I rising edge.
DO_O : out std_logic_vector(N - 1 downto 0); -- parallel output (clocked out on falling CLK_I)
--- debug ports: can be removed for the application circuit ---
DO_TRANSFER_O : out std_logic; -- debug: internal transfer driver
WREN_O : out std_logic; -- debug: internal state of the wren_i pulse stretcher
WREN_O : out std_logic; -- debug: internal state of the WREN_I pulse stretcher
RX_BIT_NEXT_O : out std_logic; -- debug: internal rx bit
STATE_DBG_O : out std_logic_vector(3 downto 0); -- debug: internal state register
SH_REG_DBG_O : out std_logic_vector(N - 1 downto 0) -- debug: internal shift register

View File

@ -638,6 +638,20 @@ def extract_entity_identifier(oLine):
extract_component_identifier = extract_entity_identifier;
def extract_port_name(oLine):
'''
Returns the port name.
Parameters:
oLine: (line object)
Returns: (one element list of strings)
'''
sLine = oLine.line.replace('(', ' ')
return [sLine.split()[0]]
def remove_comment_attributes_from_line(oLine):
'''
Sets all comment attributes on a line to indicate no comment is present.