override Platform.add_resources() so as to be able to add
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Nov 2021 15:25:41 +0000 (15:25 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Nov 2021 15:25:41 +0000 (15:25 +0000)
resources to the Boundary Scan pad_mgr

src/spec/testing_stage1.py

index 3def0b0c8cfe5dfbe8dd21fbe21416e0658d5dfc..70a96cb2b8928e26cb0ffb2160228dff8f5aca1c 100644 (file)
@@ -156,13 +156,11 @@ class DummyPlatform(TemplatedPlatform):
     default_clk = "clk" # should be picked up / overridden by platform sys.clk
     default_rst = "rst" # should be picked up / overridden by platform sys.rst
     def __init__(self, pinset):
+        self.pad_mgr = ResourceManager([], [])
         super().__init__()
         # create set of pin resources based on the pinset, this is for the core
         resources = create_resources(pinset)
         self.add_resources(resources)
-        # make a *second* - identical - set of pin resources for the IO ring
-        padres = deepcopy(resources)
-        self.pad_mgr = ResourceManager(padres, [])
         # allocate all resources, right now, so that a lookup can be created
         # between core IO names and pads
         self.core = {}
@@ -182,6 +180,14 @@ class DummyPlatform(TemplatedPlatform):
             print ("iter", pad)
             self.padlookup[pad[0].name] = core
 
+    def add_resources(self, resources, no_boundary_scan=False):
+        super().add_resources(resources)
+        if no_boundary_scan:
+            return
+        # make a *second* - identical - set of pin resources for the IO ring
+        padres = deepcopy(resources)
+        self.pad_mgr.add_resources(padres)
+
     # XXX these aren't strictly necessary right now but the next
     # phase is to add JTAG Boundary Scan so it maaay be worth adding?
     # at least for the print statements