Skip to content
Snippets Groups Projects
Commit 50f540ed authored by Paweł Szostek's avatar Paweł Szostek
Browse files

Fetch all modules only -f is specified explicitly

parent 0a0baf09
Branches
Tags
No related merge requests found
No preview for this file type
...@@ -195,14 +195,20 @@ class ModulePool(list): ...@@ -195,14 +195,20 @@ class ModulePool(list):
self.modules.append(new_module) self.modules.append(new_module)
return True return True
def fetch_all(self): def fetch_all(self, unfetched_only = False):
fetcher = self.ModuleFetcher() fetcher = self.ModuleFetcher()
from copy import copy from copy import copy
fetch_queue = copy(self.modules) fetch_queue = copy(self.modules)
while len(fetch_queue) > 0: while len(fetch_queue) > 0:
cur_mod = fetch_queue.pop() cur_mod = fetch_queue.pop()
new_modules = fetcher.fetch_single_module(cur_mod) if unfetched_only:
if cur_mod.isfetched:
new_modules = cur_mod.submodules()
else:
new_modules = fetcher.fetch_single_module(cur_mod)
else:
new_modules = fetcher.fetch_single_module(cur_mod)
for mod in new_modules: for mod in new_modules:
if not self.__contains(mod): if not self.__contains(mod):
......
...@@ -38,7 +38,7 @@ class HdlmakeKernel(object): ...@@ -38,7 +38,7 @@ class HdlmakeKernel(object):
tm = self.top_module tm = self.top_module
if not self.modules_pool.is_everything_fetched(): if not self.modules_pool.is_everything_fetched():
self.fetch() self.fetch(unfetched_only = True)
if tm.action == "simulation": if tm.action == "simulation":
self.generate_modelsim_makefile() self.generate_modelsim_makefile()
...@@ -52,9 +52,9 @@ class HdlmakeKernel(object): ...@@ -52,9 +52,9 @@ class HdlmakeKernel(object):
p.rawprint("Allowed actions are:\n\tsimulation\n\tsynthesis") p.rawprint("Allowed actions are:\n\tsimulation\n\tsynthesis")
quit() quit()
def fetch(self): def fetch(self, unfetched_only = False):
p.rawprint("Fetching needed modules...") p.rawprint("Fetching needed modules...")
self.modules_pool.fetch_all() self.modules_pool.fetch_all(unfetched_only)
p.vprint(str(self.modules_pool)) p.vprint(str(self.modules_pool))
def generate_modelsim_makefile(self): def generate_modelsim_makefile(self):
......
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