more declaration of singleton objects
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Jun 2020 00:04:02 +0000 (01:04 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 20 Jun 2020 00:04:02 +0000 (01:04 +0100)
nmigen_soc/wishbone/bus.py

index 2d9296c..580af84 100644 (file)
@@ -225,8 +225,11 @@ class Decoder(Elaboratable):
         Bus providing access to subordinate buses.
     """
 
-    def __init__(self, *, addr_width, data_width, granularity=None, features=frozenset(),
+    def __init__(self, *, addr_width, data_width, granularity=None,
+                features=None,
                  alignment=0):
+        if features is None:
+            features = frozenset()
         self.bus = Interface(addr_width=addr_width, data_width=data_width,
                              granularity=granularity, features=features,
                              alignment=alignment)
@@ -373,8 +376,11 @@ class Arbiter(Elaboratable):
         Shared bus to which the selected initiator gains access.
     """
 
-    def __init__(self, *, addr_width, data_width, granularity=None, features=frozenset(),
+    def __init__(self, *, addr_width, data_width, granularity=None,
+                features=None,
                  scheduler="rr"):
+        if features is None:
+            features = frozenset()
         self.bus = Interface(addr_width=addr_width, data_width=data_width,
                              granularity=granularity, features=features)
         self._itors = []