targets: efinix_ti375_c529_dev_kit: move cpu eth

don't create clockdomains and plls tor the vexiiriscv cpu eth,
if they are not activated or used.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit is contained in:
Fin Maaß 2025-01-21 10:07:15 +01:00
parent 10ce757361
commit 63d3adcb9e
No known key found for this signature in database

View file

@ -48,16 +48,12 @@ class _CRG(LiteXModule):
self.cd_usb = ClockDomain()
self.cd_video = ClockDomain()
self.cd_cpu = ClockDomain()
self.cd_eth = ClockDomain()
self.cd_eth_90 = ClockDomain()
self.cd_eth_rx = ClockDomain()
self.cd_rst = ClockDomain(reset_less=True)
# # #
# Clk/Rst.
clk100 = platform.request("clk100")
clk25 = platform.request("clk25")
rst_n = platform.request("user_btn", 0)
self.comb += self.cd_rst.clk.eq(clk100)
@ -81,33 +77,11 @@ class _CRG(LiteXModule):
pll.create_clkout(None, 800e6) # LPDDR4 ctrl
pll.create_clkout(self.cd_video, 40e6)
# PLL eth tx
self.pll2 = pll2 = TITANIUMPLL(platform)
self.comb += pll2.reset.eq(~rst_n)
pll2.register_clkin(clk25, 25e6)
# You can use CLKOUT0 only for clocks with a maximum frequency of 4x
# (integer) of the reference clock. If all your system clocks do not fall within
# this range, you should dedicate one unused clock for CLKOUT0.
pll2.create_clkout(None, 25e6, with_reset=True)
pll2.create_clkout(self.cd_eth, 125e6)
pll2.create_clkout(self.cd_eth_90, 125e6, phase=90)
# PLL eth rx
self.pll3 = pll3 = TITANIUMPLL(platform)
self.comb += pll3.reset.eq(~rst_n)
self.eth_clocks = eth_clocks = platform.request("eth_clocks")
pll3.register_clkin(eth_clocks.rx, 125e6)
# You can use CLKOUT0 only for clocks with a maximum frequency of 4x
# (integer) of the reference clock. If all your system clocks do not fall within
# this range, you should dedicate one unused clock for CLKOUT0.
pll3.create_clkout(None, 125e6, with_reset=True)
pll3.create_clkout(self.cd_eth_rx, 125e6,phase =270)
platform.add_false_path_constraints(self.cd_cpu.clk, self.cd_usb.clk)
platform.add_false_path_constraints(self.cd_cpu.clk, self.cd_sys.clk)
platform.add_false_path_constraints(self.cd_cpu.clk, self.cd_video.clk)
platform.add_false_path_constraints(self.cd_sys.clk, self.cd_usb.clk)
platform.add_false_path_constraints(self.cd_sys.clk, self.cd_eth.clk)
# BaseSoC ------------------------------------------------------------------------------------------
@ -277,28 +251,57 @@ class BaseSoC(SoCCore):
# CPU-ETH -----------------------------------------------------------------------------
if hasattr(self.cpu, "eth_tx_ref_clk"):
self.cd_eth = ClockDomain()
self.cd_eth_90 = ClockDomain()
self.cd_eth_rx = ClockDomain()
clk25 = platform.request("clk25")
# PLL eth tx
self.pll2 = pll2 = TITANIUMPLL(platform)
self.comb += pll2.reset.eq(ResetSignal())
pll2.register_clkin(clk25, 25e6)
# You can use CLKOUT0 only for clocks with a maximum frequency of 4x
# (integer) of the reference clock. If all your system clocks do not fall within
# this range, you should dedicate one unused clock for CLKOUT0.
pll2.create_clkout(None, 25e6, with_reset=True)
pll2.create_clkout(self.cd_eth, 125e6)
pll2.create_clkout(self.cd_eth_90, 125e6, phase=90)
# PLL eth rx
self.pll3 = pll3 = TITANIUMPLL(platform)
self.comb += pll3.reset.eq(ResetSignal())
self.eth_clocks = eth_clocks = platform.request("eth_clocks")
pll3.register_clkin(eth_clocks.rx, 125e6)
# You can use CLKOUT0 only for clocks with a maximum frequency of 4x
# (integer) of the reference clock. If all your system clocks do not fall within
# this range, you should dedicate one unused clock for CLKOUT0.
pll3.create_clkout(None, 125e6, with_reset=True)
pll3.create_clkout(self.cd_eth_rx, 125e6,phase =270)
platform.add_false_path_constraints(self.crg.cd_sys.clk, self.cd_eth.clk)
eth = platform.request("eth")
eth_clocks = self.crg.eth_clocks
# eth_clocks = platform.request("eth_clocks")
self.comb += self.cpu.eth_tx_ref_clk .eq(self.crg.cd_eth.clk)
self.specials += DDROutput(i1=self.cpu.eth_tx_clk[0], i2=self.cpu.eth_tx_clk[1], o=eth_clocks.tx, clk=self.crg.cd_eth_90.clk)
self.specials += DDROutput(i1=self.cpu.eth_tx_ctl[0], i2=self.cpu.eth_tx_ctl[1], o=eth.tx_ctl, clk=self.crg.cd_eth.clk)
self.comb += self.cpu.eth_tx_ref_clk .eq(self.cd_eth.clk)
self.specials += DDROutput(i1=self.cpu.eth_tx_clk[0], i2=self.cpu.eth_tx_clk[1], o=eth_clocks.tx, clk=self.cd_eth_90.clk)
self.specials += DDROutput(i1=self.cpu.eth_tx_ctl[0], i2=self.cpu.eth_tx_ctl[1], o=eth.tx_ctl, clk=self.cd_eth.clk)
for i in range(4):
self.specials += DDROutput(i1=self.cpu.eth_tx_d[0+i], i2=self.cpu.eth_tx_d[4+i], o=eth.tx_data[i], clk=self.crg.cd_eth.clk)
self.specials += DDROutput(i1=self.cpu.eth_tx_d[0+i], i2=self.cpu.eth_tx_d[4+i], o=eth.tx_data[i], clk=self.cd_eth.clk)
# Rx using pll
self.comb += self.cpu.eth_rx_clk .eq(self.crg.cd_eth_rx.clk)
self.specials += DDRInput(o1=self.cpu.eth_rx_ctl[0], o2=self.cpu.eth_rx_ctl[1], i=eth.rx_ctl, clk=self.crg.cd_eth_rx.clk)
self.comb += self.cpu.eth_rx_clk .eq(self.cd_eth_rx.clk)
self.specials += DDRInput(o1=self.cpu.eth_rx_ctl[0], o2=self.cpu.eth_rx_ctl[1], i=eth.rx_ctl, clk=self.cd_eth_rx.clk)
for i in range(4):
self.specials += DDRInput(o1=self.cpu.eth_rx_d[0+i], o2=self.cpu.eth_rx_d[4+i], i=eth.rx_data[i], clk=self.crg.cd_eth_rx.clk)
self.specials += DDRInput(o1=self.cpu.eth_rx_d[0+i], o2=self.cpu.eth_rx_d[4+i], i=eth.rx_data[i], clk=self.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_d[0], i2=self.cpu.eth_rx_d[4], o=debug_io.p0, clk=self.crg.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_d[1], i2=self.cpu.eth_rx_d[5], o=debug_io.p1, clk=self.crg.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_d[2], i2=self.cpu.eth_rx_d[6], o=debug_io.p2, clk=self.crg.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_d[3], i2=self.cpu.eth_rx_d[7], o=debug_io.p3, clk=self.crg.cd_eth_rx.clk)
# self.specials += DDROutput(i1=Signal(reset=1), i2=Signal(reset=0), o=debug_io.p4, clk=self.crg.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_ctl[0], i2=self.cpu.eth_rx_ctl[1], o=debug_io.p5, clk=self.crg.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_d[0], i2=self.cpu.eth_rx_d[4], o=debug_io.p0, clk=self.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_d[1], i2=self.cpu.eth_rx_d[5], o=debug_io.p1, clk=self.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_d[2], i2=self.cpu.eth_rx_d[6], o=debug_io.p2, clk=self.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_d[3], i2=self.cpu.eth_rx_d[7], o=debug_io.p3, clk=self.cd_eth_rx.clk)
# self.specials += DDROutput(i1=Signal(reset=1), i2=Signal(reset=0), o=debug_io.p4, clk=self.cd_eth_rx.clk)
# self.specials += DDROutput(i1=self.cpu.eth_rx_ctl[0], i2=self.cpu.eth_rx_ctl[1], o=debug_io.p5, clk=self.cd_eth_rx.clk)
# LPDDR4 SDRAM -----------------------------------------------------------------------------