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)
committerStaf Verhaegen <staf@stafverhaegen.be>
Wed, 21 Apr 2021 17:43:57 +0000 (19:43 +0200)
c4m/nmigen/jtag/tap.py

index 9edbbd29254edfef03db3db85e576c526e707606..745afe0f817b609f660d1518420fbfb4e706c8b2 100755 (executable)
@@ -602,7 +602,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
 
@@ -618,6 +618,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
@@ -626,6 +627,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(
@@ -638,8 +641,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))