reduce GPIO down to 4
[pinmux.git] / src / spec / testing_stage1.py
index be212529fbc1dde42bc06bbb0a080c8c405957d9..d15412bea7d83e5563d48075b5291ad4ab0700ee 100644 (file)
@@ -20,7 +20,7 @@ from copy import deepcopy
 def dummy_pinset():
     # sigh this needs to come from pinmux.
     gpios = []
-    for i in range(16):
+    for i in range(4):
         gpios.append("%d*" % i)
     return {'uart': ['tx+', 'rx-'],
             'gpio': gpios,
@@ -174,7 +174,8 @@ class DummyPlatform(TemplatedPlatform):
         end_ports = len(self._ports)
 
         # now make a corresponding (duplicate) request to the pad manager
-        # BUT, if it doesn't exist, don't sweat it
+        # BUT, if it doesn't exist, don't sweat it: all it means is, the
+        # application did not request Boundary Scan for that resource.
         pad_start_ports = len(self.pad_mgr._ports)
         try:
             pvalue = self.pad_mgr.request(name, number, dir=dir, xdr=xdr)
@@ -194,9 +195,12 @@ class DummyPlatform(TemplatedPlatform):
         # each of these returns a tuple (res, pin, port, attrs)
         for pad, core in zip(pads, core):
             pin = pad[1]
+            corepin = core[1]
             if pin is None: continue # skip when pin is None
+            assert corepin is not None # if pad was None, core should be too
             print ("iter", pad, pin.name)
             assert pin.name not in self.padlookup # no overwrites allowed!
+            assert pin.name == corepin.name # has to be the same!
             self.padlookup[pin.name] = core
 
         # finally return the value just like ResourceManager.request()