From 7e8916552c6ab446c6be5e4712c9c5882c5abafc Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 5 Jul 2020 20:01:59 +0100 Subject: [PATCH] remove unneeded imports --- src/nmutil/iocontrol.py | 4 +++- src/nmutil/nmoperator.py | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) 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 -- 2.30.2