add ports function to Cam.py for convenience
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Apr 2019 23:17:42 +0000 (00:17 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Apr 2019 23:17:42 +0000 (00:17 +0100)
TLB/src/Cam.py

index ecb4902b20156e46105ffd399c5b5a0fa7e987b3..64ccdcaaa91ad04652a35969a9ff855312bf00ef 100644 (file)
@@ -111,10 +111,14 @@ class Cam():
 
         return m
 
+    def ports(self):
+        return [self.enable, self.write_enable,
+                     self.data_in, self.data_mask,
+                     self.read_warning, self.single_match,
+                     self.multiple_match, self.match_address]
+
+
 if __name__ == '__main__':
     cam = Cam(4, 4)
-    main(cam, ports=[cam.enable, cam.write_enable,
-                     cam.data_in, cam.data_mask,
-                     cam.read_warning, cam.single_match,
-                     cam.multiple_match, cam.match_address])
+    main(cam, ports=cam.ports())