From: Luke Kenneth Casson Leighton Date: Sun, 5 Jul 2020 19:01:59 +0000 (+0100) Subject: remove unneeded imports X-Git-Tag: 24jan2021_ls180~44 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e8916552c6ab446c6be5e4712c9c5882c5abafc;p=nmutil.git remove unneeded imports --- diff --git a/src/nmutil/iocontrol.py b/src/nmutil/iocontrol.py index f83d315..bdbd055 100644 --- a/src/nmutil/iocontrol.py +++ b/src/nmutil/iocontrol.py @@ -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): diff --git a/src/nmutil/nmoperator.py b/src/nmutil/nmoperator.py index fd50d2f..4f060c7 100644 --- a/src/nmutil/nmoperator.py +++ b/src/nmutil/nmoperator.py @@ -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