Use BB instance for bidirectionnal IOs
authorJean THOMAS <git0@pub.jeanthomas.me>
Thu, 18 Jun 2020 15:18:56 +0000 (17:18 +0200)
committerJean THOMAS <git0@pub.jeanthomas.me>
Thu, 18 Jun 2020 15:18:56 +0000 (17:18 +0200)
gram/phy/ecp5ddrphy.py

index 5f5ae85ad181456cd8598743dcab673fbded3a89..a65f05350fc60a5a06680079ebf336ef7bf86a89 100644 (file)
@@ -11,7 +11,6 @@ import math
 from nmigen import *
 from nmigen.lib.cdc import FFSynchronizer
 from nmigen.utils import log2_int
-from nmigen.compat.fhdl.specials import Tristate
 
 from lambdasoc.periph import Peripheral
 
@@ -377,7 +376,11 @@ class ECP5DDRPHY(Peripheral, Elaboratable):
                                 dqs_pattern.postamble),
                          o_Q=dqs_oe_n
                          ),
-                Tristate(self.pads.dqs.io[i], dqs, ~dqs_oe_n, dqs_i),
+                Instance("BB",
+                        i_I=dqs,
+                        i_T=dqs_oe_n,
+                        o_O=dqs_i,
+                        io_B=self.pads.dqs.io[i]),
             ]
 
             for j in range(8*i, 8*(i+1)):
@@ -470,7 +473,11 @@ class ECP5DDRPHY(Peripheral, Elaboratable):
                                     dqs_pattern.postamble),
                              o_Q=dq_oe_n,
                              ),
-                    Tristate(self.pads.dq.io[j], dq_o, ~dq_oe_n, dq_i),
+                    Instance("BB",
+                        i_I=dq_o,
+                        i_T=dq_oe_n,
+                        o_O=dq_i,
+                        io_B=self.pads.dq.io[j]),
                 ]
 
         # Read Control Path ------------------------------------------------------------------------