-from ..hdl.ast import (Signal, Statement, Delay as Delay,
+from ..hdl.ast import (Signal, Delay as Delay,
Tick as Tick, Passive as Passive, Assign, Value)
from typing import Any, Iterable, Generator, Union, Callable, Optional
-__all__ = ["Simulator", "Delay", "Tick", "Passive", "DeadlineError"]
+__all__ = ["Simulator", "Delay", "Tick", "Passive"]
ProcessCommand = Union[Delay, Tick, Passive, Assign, Value]
ProcessGenerator = Generator[ProcessCommand, Union[int, None], None]
from abc import ABCMeta, abstractmethod
-from typing import Union, Tuple, Any, Iterable, Optional, Mapping
+from typing import (Union, Tuple, Any, Iterable, Optional, Mapping, overload,
+ List)
from collections.abc import MutableSequence
__all__ = [
- "Value", "Const", "C", "AnyConst", "AnySeq", "Operator", "Mux", "Part",
- "Slice", "Cat", "Repl", "Array", "ArrayProxy", "Sample", "Past", "Stable",
- "Rose", "Fell", "Signal", "ClockSignal", "ResetSignal", "Statement",
- "Assign", "Assert", "Assume", "Switch", "Delay", "Tick", "Passive",
- "ValueKey", "ValueDict", "ValueSet", "SignalKey", "SignalDict", "SignalSet"
+ "Value", "Const", "C", "Mux", "Cat", "Repl", "Array", "ArrayProxy",
+ "Signal", "ClockSignal", "ResetSignal", "Statement", "Assign", "Assert",
+ "Assume", "Switch", "Delay", "Tick", "Passive"
]
ValueOrLiteral = Union[int, bool, 'Value']
class Value(metaclass=ABCMeta):
@staticmethod
- def wrap(obj: Any) -> 'Value':
+ def wrap(obj: ValueOrLiteral) -> 'Value':
...
def __invert__(self) -> 'Value':
def bool(self) -> 'Value':
...
+ # noinspection PyMethodParameters
def implies(premise: ValueOrLiteral,
conclusion: ValueOrLiteral) -> 'Value':
...
C = Const
+# noinspection PyPep8Naming
def Mux(sel: ValueOrLiteral,
val1: ValueOrLiteral,
val0: ValueOrLiteral) -> Value:
...
+# noinspection PyShadowingBuiltins
class Signal(Value):
nbits: int
signed: bool
class Passive(Property):
pass
+
+
+class Array(MutableSequence):
+ def __init__(self, iterable: Iterable = ()):
+ ...
+
+ @overload
+ def __getitem__(self, index: int) -> Any:
+ ...
+
+ @overload
+ def __getitem__(self, index: Value) -> 'ArrayProxy':
+ ...
+
+ def __len__(self) -> int:
+ ...
+
+ def __setitem__(self, index: int, value: Any) -> None:
+ ...
+
+ def __delitem__(self, index: int) -> None:
+ ...
+
+ def insert(self, index: int, value: Any) -> None:
+ ...
+
+
+class ArrayProxy(Value):
+ def __init__(self, elems: Union[Array, List[Any]], index: ValueOrLiteral):
+ ...
+
+ def __getattr__(self, attr: Any) -> Any:
+ ...
+
+ def __getitem__(self, index: Any) -> Any:
+ ...
+
+ def shape(self) -> Tuple[int, bool]:
+ ...
-from typing import Optional, Generator, Any, Tuple, Iterable, Union, List
+from typing import Optional, Generator, Any, Tuple, Iterable, Union
from .ast import Signal, Statement
from .cd import ClockDomain
+# noinspection PyProtectedMember
from .dsl import FSM
__all__ = ["Fragment", "Instance", "DriverConflict"]
pass
+# noinspection PyShadowingBuiltins
class Fragment:
@staticmethod
def get(obj: Any, platform: Any) -> 'Fragment':
class Instance(Fragment):
+ # noinspection PyShadowingBuiltins
def __init__(self, type: str, **kwargs: Any):
...