def __iter__(self):
for x in self.fields.values(): # remember: fields is an OrderedDict
- if isinstance(x, Record):
+ if hasattr(x, 'ports'):
+ yield from x.ports()
+ elif isinstance(x, Record):
for f in x.fields.values():
yield f
elif isinstance(x, Iterable):
Records.
"""
-from nmigen import Signal, Cat, Const, Mux, Module, Value, Elaboratable
-from nmigen.cli import verilog, rtlil
-from nmigen.lib.fifo import SyncFIFO, SyncFIFOBuffered
+from nmigen import Signal, Cat, Value
from nmigen.hdl.ast import ArrayProxy
from nmigen.hdl.rec import Record, Layout
from abc import ABCMeta, abstractmethod
from collections.abc import Sequence, Iterable
-from collections import OrderedDict
-from nmutil.queue import Queue
import inspect