From fcf6374c3c1308a9489aaa276e53bdc35cdead55 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Thu, 24 Dec 2020 14:44:42 -0800 Subject: [PATCH] Remove inherit from object --- cocotbext/axi/axi_master.py | 6 +++--- cocotbext/axi/axil_master.py | 6 +++--- cocotbext/axi/axis.py | 8 ++++---- cocotbext/axi/memory.py | 2 +- cocotbext/axi/stream.py | 6 +++--- tests/axi/test_axi.py | 2 +- tests/axil/test_axil.py | 2 +- tests/axis/test_axis.py | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cocotbext/axi/axi_master.py b/cocotbext/axi/axi_master.py index e8990be..c276e02 100644 --- a/cocotbext/axi/axi_master.py +++ b/cocotbext/axi/axi_master.py @@ -47,7 +47,7 @@ AxiReadRespCmd = namedtuple("AxiReadRespCmd", ["address", "length", "size", "cyc AxiReadResp = namedtuple("AxiReadResp", ["address", "data", "resp", "user"]) -class AxiMasterWrite(object): +class AxiMasterWrite: def __init__(self, entity, name, clock, reset=None, max_burst_len=256): self.log = logging.getLogger(f"cocotb.{entity._name}.{name}") @@ -361,7 +361,7 @@ class AxiMasterWrite(object): self.in_flight_operations -= 1 -class AxiMasterRead(object): +class AxiMasterRead: def __init__(self, entity, name, clock, reset=None, max_burst_len=256): self.log = logging.getLogger(f"cocotb.{entity._name}.{name}") @@ -658,7 +658,7 @@ class AxiMasterRead(object): self.in_flight_operations -= 1 -class AxiMaster(object): +class AxiMaster: def __init__(self, entity, name, clock, reset=None, max_burst_len=256): self.write_if = None self.read_if = None diff --git a/cocotbext/axi/axil_master.py b/cocotbext/axi/axil_master.py index 861e64b..9f70b3f 100644 --- a/cocotbext/axi/axil_master.py +++ b/cocotbext/axi/axil_master.py @@ -43,7 +43,7 @@ AxiLiteReadRespCmd = namedtuple("AxiLiteReadRespCmd", ["address", "length", "cyc AxiLiteReadResp = namedtuple("AxiLiteReadResp", ["address", "data", "resp"]) -class AxiLiteMasterWrite(object): +class AxiLiteMasterWrite: def __init__(self, entity, name, clock, reset=None): self.log = logging.getLogger(f"cocotb.{entity._name}.{name}") @@ -228,7 +228,7 @@ class AxiLiteMasterWrite(object): self.in_flight_operations -= 1 -class AxiLiteMasterRead(object): +class AxiLiteMasterRead: def __init__(self, entity, name, clock, reset=None): self.log = logging.getLogger(f"cocotb.{entity._name}.{name}") @@ -398,7 +398,7 @@ class AxiLiteMasterRead(object): self.in_flight_operations -= 1 -class AxiLiteMaster(object): +class AxiLiteMaster: def __init__(self, entity, name, clock, reset=None): self.write_if = None self.read_if = None diff --git a/cocotbext/axi/axis.py b/cocotbext/axi/axis.py index be70a74..f78bc1f 100644 --- a/cocotbext/axi/axis.py +++ b/cocotbext/axi/axis.py @@ -33,7 +33,7 @@ from cocotb.bus import Bus from .version import __version__ -class AxiStreamFrame(object): +class AxiStreamFrame: def __init__(self, tdata=b'', tkeep=None, tid=None, tdest=None, tuser=None): self.tdata = bytearray() self.tkeep = None @@ -216,7 +216,7 @@ class AxiStreamFrame(object): return bytes(self.tdata) -class AxiStreamSource(object): +class AxiStreamSource: _signals = ["tdata"] _optional_signals = ["tvalid", "tready", "tlast", "tkeep", "tid", "tdest", "tuser"] @@ -433,7 +433,7 @@ class AxiStreamSource(object): await RisingEdge(self.clock) -class AxiStreamSink(object): +class AxiStreamSink: _signals = ["tdata"] _optional_signals = ["tvalid", "tready", "tlast", "tkeep", "tid", "tdest", "tuser"] @@ -647,7 +647,7 @@ class AxiStreamSink(object): await RisingEdge(self.clock) -class AxiStreamMonitor(object): +class AxiStreamMonitor: _signals = ["tdata"] _optional_signals = ["tvalid", "tready", "tlast", "tkeep", "tid", "tdest", "tuser"] diff --git a/cocotbext/axi/memory.py b/cocotbext/axi/memory.py index c2c26f3..8c9abb2 100644 --- a/cocotbext/axi/memory.py +++ b/cocotbext/axi/memory.py @@ -27,7 +27,7 @@ import mmap from .utils import hexdump, hexdump_lines, hexdump_str -class Memory(object): +class Memory: def __init__(self, size=1024, mem=None, *args, **kwargs): if mem is not None: self.mem = mem diff --git a/cocotbext/axi/stream.py b/cocotbext/axi/stream.py index b807ae1..74c5016 100644 --- a/cocotbext/axi/stream.py +++ b/cocotbext/axi/stream.py @@ -30,7 +30,7 @@ from cocotb.triggers import RisingEdge, Event, First, Timer from cocotb.bus import Bus -class StreamTransaction(object): +class StreamTransaction: _signals = ["data"] @@ -48,7 +48,7 @@ class StreamTransaction(object): return f"{type(self).__name__}({', '.join(f'{s}={int(getattr(self, s))}' for s in self._signals)})" -class StreamBase(object): +class StreamBase: _signals = ["data", "valid", "ready"] _optional_signals = [] @@ -108,7 +108,7 @@ class StreamBase(object): self.queue.clear() -class StreamPause(object): +class StreamPause: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/tests/axi/test_axi.py b/tests/axi/test_axi.py index a27a7b5..3235b0d 100644 --- a/tests/axi/test_axi.py +++ b/tests/axi/test_axi.py @@ -38,7 +38,7 @@ from cocotb.regression import TestFactory from cocotbext.axi import AxiMaster, AxiRam -class TB(object): +class TB: def __init__(self, dut): self.dut = dut diff --git a/tests/axil/test_axil.py b/tests/axil/test_axil.py index 049ffb8..73da9a0 100644 --- a/tests/axil/test_axil.py +++ b/tests/axil/test_axil.py @@ -38,7 +38,7 @@ from cocotb.regression import TestFactory from cocotbext.axi import AxiLiteMaster, AxiLiteRam -class TB(object): +class TB: def __init__(self, dut): self.dut = dut diff --git a/tests/axis/test_axis.py b/tests/axis/test_axis.py index d144e26..f513121 100644 --- a/tests/axis/test_axis.py +++ b/tests/axis/test_axis.py @@ -38,7 +38,7 @@ from cocotb.regression import TestFactory from cocotbext.axi import AxiStreamFrame, AxiStreamSource, AxiStreamSink, AxiStreamMonitor -class TB(object): +class TB: def __init__(self, dut): self.dut = dut