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
|
2019-08-12 07:37:18 -06:00
|
|
|
from .xfrm import DomainRenamer, ResetInserter, EnableInserter, \
|
|
|
|
CEInserter # deprecated
|