add name to DFI Interface (helps gtkwave traces)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 20 Feb 2022 01:04:53 +0000 (01:04 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 20 Feb 2022 01:04:53 +0000 (01:04 +0000)
gram/dfii.py
gram/phy/dfi.py

index f3e98849048eacad14a2a82826b64d2e9ad7fb97..07a0a21363caa8d863c74bdc931ed17e0f9f0bad 100644 (file)
@@ -61,9 +61,15 @@ class DFIInjector(Elaboratable):
     def __init__(self, csr_bank, addressbits, bankbits, nranks, databits, nphases=1):
         self._nranks = nranks
 
-        self._inti = dfi.Interface(addressbits, bankbits, nranks, databits, nphases)
-        self.slave = dfi.Interface(addressbits, bankbits, nranks, databits, nphases)
-        self.master = dfi.Interface(addressbits, bankbits, nranks, databits, nphases)
+        self._inti = dfi.Interface(addressbits, bankbits,
+                                   nranks, databits, nphases,
+                                   name="inti")
+        self.slave = dfi.Interface(addressbits, bankbits,
+                                   nranks, databits, nphases,
+                                   name="slave")
+        self.master = dfi.Interface(addressbits, bankbits,
+                                    nranks, databits, nphases,
+                                   name="master")
 
         self._control = csr_bank.csr(4, "w")  # sel, clk_en, odt, reset
 
index 7e58b990ba68a8a254d892201dafc2252128762d..c2bdbbf2acc73c29df65d34b3ef35b3d449f6304 100644 (file)
@@ -32,11 +32,13 @@ def phase_description(addressbits, bankbits, nranks, databits):
 
 
 class Interface:
-    def __init__(self, addressbits, bankbits, nranks, databits, nphases=1):
+    def __init__(self, addressbits, bankbits, nranks, databits, nphases=1,
+                       name=None):
         self.phases = []
         for p in range(nphases):
-            p = Record(phase_description(
-                addressbits, bankbits, nranks, databits))
+            p = Record(phase_description(addressbits, bankbits,
+                                         nranks, databits),
+                       name=name)
             self.phases += [p]
             p.reset.reset = 1