From 7afe06a60c46bb91d499c635f0a8d4f3827de0ae Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Tue, 5 Sep 2023 16:50:49 +0800 Subject: [PATCH] clock/gowin_gw5a: change allowed frequency range for GW5A- prefix When targeting GW5A-25 ES, the Gowin IDE has a more strict frequency range. Change the range when GW5A- is matched to this. Signed-off-by: Icenowy Zheng --- litex/soc/cores/clock/gowin_gw5a.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/litex/soc/cores/clock/gowin_gw5a.py b/litex/soc/cores/clock/gowin_gw5a.py index 79de44f96..c5d00f217 100644 --- a/litex/soc/cores/clock/gowin_gw5a.py +++ b/litex/soc/cores/clock/gowin_gw5a.py @@ -36,7 +36,9 @@ class GW5APLL(LiteXModule): @staticmethod def get_vco_freq_range(device): vco_freq_range = None - if device.startswith('GW5A-') or device.startswith('GW5AT-') or device.startswith('GW5AST-'): + if device.startswith('GW5A-'): + vco_freq_range = (800e6, 1600e6) # As restricted by Gowin toolchain 1.9.9b3 + elif device.startswith('GW5A-') or device.startswith('GW5AT-') or device.startswith('GW5AST-'): vco_freq_range = (800e6, 2000e6) # datasheet values if vco_freq_range is None: raise ValueError(f"Unsupported device {device}.") @@ -45,7 +47,9 @@ class GW5APLL(LiteXModule): @staticmethod def get_pfd_freq_range(device): pfd_freq_range = None - if device.startswith('GW5A-') or device.startswith('GW5AT-') or device.startswith('GW5AST-'): + if device.startswith('GW5A-'): + pfd_freq_range = (19e6, 400e6) # As restricted by Gowin toolchain 1.9.9b3 + elif device.startswith('GW5AT-') or device.startswith('GW5AST-'): pfd_freq_range = (10e6, 400e6) # datasheet values if pfd_freq_range is None: raise ValueError(f"Unsupported device {device}.")