Skip to content

Commit

Permalink
Allow passing external_modules to magma
Browse files Browse the repository at this point in the history
  • Loading branch information
rsetaluri committed May 7, 2019
1 parent 06a6b59 commit 470d3e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gemstone/common/genesis_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class GenesisWrapper:
def __init__(self, interface, top_name, default_infiles,
system_verilog=False, type_map={}):
system_verilog=False, type_map={}, external_modules={}):
"""
`interface`: the generator params and default values
`top_name`: the name of the top module
Expand All @@ -31,6 +31,7 @@ def __init__(self, interface, top_name, default_infiles,
self.__default_infiles = default_infiles
self.__type_map = type_map
self.__cache = {}
self.__external_modules = external_modules

def generator(self, param_mapping: Dict[str, str] = None,
mode: str = "define"):
Expand Down Expand Up @@ -76,7 +77,8 @@ def define_wrapper(*args, **kwargs):
with open(outfile, "rb") as fd:
shutil.copyfileobj(fd, combined)
magma_defns = func(combined_filename, type_map=self.__type_map,
target_modules=[self.__top_name])
target_modules=[self.__top_name],
external_modules=self.__external_modules)
assert len(magma_defns) == 1
defn = magma_defns[0]
self.__cache[cache_key] = defn
Expand Down

0 comments on commit 470d3e9

Please sign in to comment.