Commit 4b77a820 authored by Will Kamp's avatar Will Kamp

Add architecture to vhdl parser, so that dependencies are generated between the…

Add architecture to vhdl parser, so that dependencies are generated between the architecture and the entity which may be in different files.
Causes problem in new_dep_solver when entity and architecture are in the same file because now a file will depends on itself (which it technically does). When re-expressing the VHDL dependencies as file dependencies we avoid creating the circular dependency to itself.
parent b499ce25
......@@ -98,7 +98,8 @@ def solve(fileset):
# if dep_file is investigated_file:
# continue
if dep_file.satisfies(rel):
investigated_file.depends_on.add(dep_file)
if dep_file is not investigated_file:
investigated_file.depends_on.add(dep_file)
satisfied_by.add(dep_file)
if len(satisfied_by) > 1:
logging.warning("Relation %s satisfied by multpiple (%d) files: %s",
......
......@@ -80,7 +80,16 @@ class VHDLParser(DepParser):
dep_file.add_relation(DepRelation("%s.%s" % (dep_file.library, s.group(1).lower()),
DepRelation.PROVIDE,
DepRelation.ENTITY))
re.subn(entity_pattern, do_entity, buf)
re.subn(entity_pattern, do_entity, buf)
#new architecture
architecture_pattern = re.compile("^\s*architecture\s+(\w+)\s+of\s+(\w+)\s+is", re.DOTALL | re.MULTILINE | re.IGNORECASE )
def do_architecture(s) :
logging.debug("found architecture %s of entity %s.%s" % ( s.group(1), dep_file.library, s.group(2) ) )
dep_file.add_relation(DepRelation("%s.%s" % (dep_file.library, s.group(2).lower()),
DepRelation.USE,
DepRelation.ENTITY))
re.subn(architecture_pattern, do_architecture, buf)
#new package
package_pattern = re.compile("^\s*package\s+(\w+)\s+is", re.DOTALL | re.MULTILINE | re.IGNORECASE )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment