From: Jacob Lifshay Date: Mon, 22 Apr 2019 01:31:56 +0000 (-0700) Subject: add Elaboratable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;p=nmigen-type-annotations.git add Elaboratable --- diff --git a/nmigen/__init__.pyi b/nmigen/__init__.pyi index 14f0227..76e6d4b 100644 --- a/nmigen/__init__.pyi +++ b/nmigen/__init__.pyi @@ -10,6 +10,8 @@ from .hdl.ast import (Value as Value, ClockSignal as ClockSignal, ResetSignal as ResetSignal) from .hdl.cd import ClockDomain as ClockDomain -from .hdl.ir import Fragment as Fragment, Instance as Instance +from .hdl.ir import (Fragment as Fragment, + Instance as Instance, + Elaboratable as Elaboratable) from .hdl.mem import Memory as Memory from .hdl.rec import Record as Record diff --git a/nmigen/hdl/ir.pyi b/nmigen/hdl/ir.pyi index 6ae482f..e2321cc 100644 --- a/nmigen/hdl/ir.pyi +++ b/nmigen/hdl/ir.pyi @@ -2,9 +2,16 @@ from typing import Optional, Generator, Any, Tuple, Iterable, Union from .ast import Signal, Statement from .cd import ClockDomain # noinspection PyProtectedMember -from .dsl import FSM +from .dsl import FSM, Module +from abc import ABCMeta, abstractmethod -__all__ = ["Fragment", "Instance", "DriverConflict"] +__all__ = ["Fragment", "Instance", "DriverConflict", "Elaboratable"] + + +class Elaboratable(metaclass=ABCMeta): + @abstractmethod + def elaborate(self, platform: Any) -> Module: + ... class DriverConflict(UserWarning):