class AlteraQuartusPlatform(GenericPlatform):
def build(self, fragment, build_dir="build", build_name="top",
quartus_path="/opt/Altera", run=True):
+ self.finalize(fragment)
tools.mkdir_noerror(build_dir)
os.chdir(build_dir)
name = self.__module__.split(".")[-1]
self.name = name
self.sources = []
+ self.finalized = False
def request(self, *args, **kwargs):
return self.constraint_manager.request(*args, **kwargs)
def add_platform_command(self, *args, **kwargs):
return self.constraint_manager.add_platform_command(*args, **kwargs)
+ def finalize(self, fragment, *args, **kwargs):
+ if self.finalized:
+ raise ConstraintError("Already finalized")
+ self.do_finalize(fragment, *args, **kwargs)
+ self.finalized = True
+
+ def do_finalize(self, fragment, *args, **kwargs):
+ """overload this and e.g. add_platform_command()'s after the
+ modules had their say"""
+ pass
+
def add_source(self, filename, language=None):
if language is None:
language = tools.language_by_filename(filename)
def build(self, fragment, build_dir="build", build_name="top",
ise_path="/opt/Xilinx", source=True, run=True):
+ self.finalize(fragment)
tools.mkdir_noerror(build_dir)
os.chdir(build_dir)