remove unneeded imports
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 5 Jul 2020 19:01:59 +0000 (20:01 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 5 Jul 2020 19:01:59 +0000 (20:01 +0100)
src/nmutil/iocontrol.py
src/nmutil/nmoperator.py

index f83d315b092bdd41935881a10ffde09d22369f56..bdbd055e41cf2a0f3337ab2aa66d2ee4d127d0dc 100644 (file)
@@ -121,7 +121,9 @@ class RecordObject(Record):
 
     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):
index fd50d2f53e7c8292985752df7afffdefa4e04417..4f060c7986346fb52fad31092b553d9eec10a228 100644 (file)
@@ -9,16 +9,12 @@
     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