add default features over-ride option to wishbone
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 9 Oct 2020 12:38:43 +0000 (13:38 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 9 Oct 2020 12:38:43 +0000 (13:38 +0100)
c4m/nmigen/jtag/tap.py

index 8beb7ed..638cee6 100755 (executable)
@@ -600,7 +600,7 @@ class TAP(Elaboratable):
 
 
     def add_wishbone(self, *, ircodes, address_width, data_width,
-                     granularity=None, domain="sync",
+                     granularity=None, domain="sync", features=None,
                      name=None, src_loc_at=0):
         """Add a wishbone interface
 
@@ -616,6 +616,7 @@ class TAP(Elaboratable):
           share a shift register of length data_width.
         address_width: width of the address
         data_width: width of the data
+        features: features required.  defaults to stall, lock, err, rty
 
         Returns:
         wb: nmigen_soc.wishbone.bus.Interface
@@ -624,6 +625,8 @@ class TAP(Elaboratable):
         if len(ircodes) != 3:
             raise ValueError("3 IR Codes have to be provided")
 
+        if features is None:
+            features={"stall", "lock", "err", "rty"}
         if name is None:
             name = "wb" + str(len(self._wbs))
         sr_addr = self.add_shiftreg(
@@ -636,8 +639,7 @@ class TAP(Elaboratable):
         )
 
         wb = WishboneInterface(data_width=data_width, addr_width=address_width,
-                               granularity=granularity,
-                               features={"stall", "lock", "err", "rty"},
+                               granularity=granularity, features=features,
                                name=name, src_loc_at=src_loc_at+1)
 
         self._wbs.append((sr_addr, sr_data, wb, domain))