Updates for instantiations:
1) Fixed issue where instantiations were not detected inside generates
This commit is contained in:
parent
a1382a3474
commit
bcd22a5a72
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
architecture ARCH of ENTITY is
|
||||
|
||||
begin
|
||||
|
||||
GENERATE_1 : for CONDITION in 0 to 7 generate
|
||||
|
||||
U_INST1 : INST1
|
||||
port map (
|
||||
PORT_1 => w_port_1,
|
||||
PORT_2 => w_port_2,
|
||||
PORT_3 => w_port_3
|
||||
);
|
||||
|
||||
end generate;
|
||||
|
||||
end architecture ARCH;
|
||||
|
||||
|
|
@ -5,6 +5,7 @@ from vsg import vhdlFile
|
|||
|
||||
oFile = vhdlFile.vhdlFile(os.path.join(os.path.dirname(__file__),'..','instantiation','instantiation_test_input.vhd'))
|
||||
oFileGeneric = vhdlFile.vhdlFile(os.path.join(os.path.dirname(__file__),'..','instantiation','instantiation_generic_test_input.vhd'))
|
||||
oFileGenerate = vhdlFile.vhdlFile(os.path.join(os.path.dirname(__file__),'..','instantiation','instantiation_generate_test_input.vhd'))
|
||||
|
||||
|
||||
class testVhdlFileInstantiationAssignments(unittest.TestCase):
|
||||
|
|
@ -102,5 +103,15 @@ class testVhdlFileInstantiationAssignments(unittest.TestCase):
|
|||
# Compare
|
||||
self.assertEqual(lActual, lExpected)
|
||||
|
||||
def test_isInstantiation_assignment_inside_generate(self):
|
||||
lExpected = [8]
|
||||
# Generic actual list
|
||||
lActual = []
|
||||
for iIndex, oLine in enumerate(oFileGenerate.lines):
|
||||
if oLine.isInstantiationDeclaration:
|
||||
lActual.append(iIndex)
|
||||
# Compare
|
||||
self.assertEqual(lActual, lExpected)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -409,7 +409,8 @@ class vhdlFile():
|
|||
oLine.isSequentialEnd = True
|
||||
|
||||
# Check instantiation statements
|
||||
if fInsideArchitecture and not fInsideProcess and not oLine.isConcurrentBegin and not fInsideComponent and not fInsideGenerate and not fInsideFunction:
|
||||
# if fInsideArchitecture and not fInsideProcess and not oLine.isConcurrentBegin and not fInsideComponent and not fInsideGenerate and not fInsideFunction:
|
||||
if fInsideArchitecture and not fInsideProcess and not oLine.isConcurrentBegin and not fInsideComponent and not oLine.isGenerateKeyword and not fInsideFunction:
|
||||
if re.match('^\s*\w+\s*:\s*\w+', oLine.line):
|
||||
oLine.isInstantiationDeclaration = True
|
||||
oLine.indentLevel = iCurrentIndentLevel
|
||||
|
|
|
|||
Loading…
Reference in New Issue