cores/clock/xilinx_common: Add BUFH support and lower buf parameter before use to allow user to specify it in upper or lower case.

This commit is contained in:
Florent Kermarrec 2023-06-13 13:23:47 +02:00
parent 3a7aaf5124
commit 57840c63a3
1 changed files with 3 additions and 0 deletions

View File

@ -53,10 +53,13 @@ class XilinxClocking(Module, AutoCSR):
else:
clkout_buf = Signal()
self.comb += cd.clk.eq(clkout_buf)
buf = buf.lower()
if buf == "bufg":
self.specials += Instance("BUFG", i_I=clkout, o_O=clkout_buf)
elif buf == "bufr":
self.specials += Instance("BUFR", i_I=clkout, o_O=clkout_buf)
elif buf == "bufh":
self.specials += Instance("BUFH", i_I=clkout, o_O=clkout_buf)
elif buf == "bufgce":
if ce is None:
raise ValueError("BUFGCE requires user to provide a clock enable ce Signal")