hdl.ast: add an explicit Shape class, included in prelude.
Shapes have long been a part of nMigen, but represented using tuples.
This commit adds a Shape class (using namedtuple for backwards
compatibility), and accepts anything castable to Shape (including
enums, ranges, etc) anywhere a tuple was accepted previously.
In addition, `signed(n)` and `unsigned(n)` are added as aliases for
`Shape(n, signed=True)` and `Shape(n, signed=False)`, transforming
code such as `Signal((8, True))` to `Signal(signed(8))`.
These aliases are also included in prelude.
Preparation for #225.
2019-10-11 06:52:41 -06:00
|
|
|
from .ast import Shape, unsigned, signed
|
2019-06-04 02:18:50 -06:00
|
|
|
from .ast import Value, Const, C, Mux, Cat, Repl, Array, Signal, ClockSignal, ResetSignal
|
|
|
|
from .dsl import Module
|
|
|
|
from .cd import ClockDomain
|
|
|
|
from .ir import Elaboratable, Fragment, Instance
|
|
|
|
from .mem import Memory
|
|
|
|
from .rec import Record
|
2020-01-12 06:59:26 -07:00
|
|
|
from .xfrm import DomainRenamer, ResetInserter, EnableInserter
|
2019-10-21 04:39:21 -06:00
|
|
|
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
"Shape", "unsigned", "signed",
|
|
|
|
"Value", "Const", "C", "Mux", "Cat", "Repl", "Array", "Signal", "ClockSignal", "ResetSignal",
|
|
|
|
"Module",
|
|
|
|
"ClockDomain",
|
|
|
|
"Elaboratable", "Fragment", "Instance",
|
|
|
|
"Memory",
|
|
|
|
"Record",
|
|
|
|
"DomainRenamer", "ResetInserter", "EnableInserter",
|
|
|
|
]
|