add way to bypass PLL for ECP5 and sim
[soc.git] / src / soc / simple / issuer.py
index aafae394e101cb4d9ab9aff0080a0b6e896cf36e..64350c96ab1bc7a93ee089a4c68dd28afcc457b3 100644 (file)
@@ -447,15 +447,23 @@ class TestIssuerInternal(Elaboratable):
 class TestIssuer(Elaboratable):
     def __init__(self, pspec):
         self.ti = TestIssuerInternal(pspec)
+
         self.pll = DummyPLL()
         self.clksel = ClockSelect()
 
+        # PLL direct clock or not
+        self.pll_en = hasattr(pspec, "use_pll") and pspec.pll_en
+
     def elaborate(self, platform):
         m = Module()
         comb = m.d.comb
 
-        # TestIssuer runs at internal clock rate
-        m.submodules.ti = ti = DomainRenamer("intclk")(self.ti)
+        if self.pll_en:
+            # TestIssuer runs at internal clock rate
+            m.submodules.ti = ti = DomainRenamer("intclk")(self.ti)
+        else:
+            # TestIssuer runs at direct clock
+            m.submodules.ti = ti = self.ti
         # ClockSelect runs at PLL output internal clock rate
         m.submodules.clksel = clksel = DomainRenamer("pllclk")(self.clksel)
         m.submodules.pll = pll = self.pll