build.dsl: style. NFC.
authorwhitequark <cz@m-labs.hk>
Wed, 24 Apr 2019 15:02:30 +0000 (15:02 +0000)
committerwhitequark <cz@m-labs.hk>
Wed, 24 Apr 2019 15:02:30 +0000 (15:02 +0000)
nmigen/build/dsl.py

index 7fcdb9456cac4305a4cce597ad80c754ddf71755..9205a1bf5825b3977a3477393b83c17c73361ada 100644 (file)
@@ -27,7 +27,7 @@ class DiffPairs:
                             "and {!r} do not"
                             .format(self.p, self.n))
 
-        self.dir = self.p.dir
+        self.dir = dir
 
     def __repr__(self):
         return "(diffpairs {} {})".format(self.p, self.n)
@@ -73,9 +73,10 @@ class Subsignal:
 
 class Resource(Subsignal):
     def __init__(self, name, number, *io, extras=()):
-        self.number = number
         super().__init__(name, *io, extras=extras)
 
+        self.number = number
+
     def __repr__(self):
         return "(resource {} {} {} {})".format(self.name, self.number,
                                                " ".join(map(repr, self.io)),