_toolchain,build.plat,vendor.*: add required_tools list and checks.

This commit is contained in:
Emily 2019-08-31 00:27:22 +01:00 committed by whitequark
parent 4e91710933
commit c4e8ac734f
8 changed files with 75 additions and 22 deletions

View file

@ -20,10 +20,11 @@ __all__ = ["Platform", "TemplatedPlatform"]
class Platform(ResourceManager, metaclass=ABCMeta):
resources = abstractproperty()
connectors = abstractproperty()
default_clk = None
default_rst = None
resources = abstractproperty()
connectors = abstractproperty()
default_clk = None
default_rst = None
required_tools = abstractproperty()
def __init__(self):
super().__init__(self.resources, self.connectors)
@ -63,6 +64,9 @@ class Platform(ResourceManager, metaclass=ABCMeta):
build_dir="build", do_build=True,
program_opts=None, do_program=False,
**kwargs):
for tool in self.required_tools:
require_tool(tool)
plan = self.prepare(elaboratable, name, **kwargs)
if not do_build:
return plan
@ -73,6 +77,9 @@ class Platform(ResourceManager, metaclass=ABCMeta):
self.toolchain_program(products, name, **(program_opts or {}))
def has_required_tools(self):
return all(has_tool(name) for name in self.required_tools)
@abstractmethod
def create_missing_domain(self, name):
# Simple instantiation of a clock domain driven directly by the board clock and reset.