From 227f39952a4529cea7f5da76c361bf6b650adff3 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Sun, 21 Apr 2019 18:31:56 -0700 Subject: [PATCH] add Elaboratable --- nmigen/__init__.pyi | 4 +++- nmigen/hdl/ir.pyi | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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): -- 2.30.2