-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
phy/Ultrascale/1000BaseX: Switch to LiteICLink's ChannelPLL for more …
…flexibility/simplicity. LiteICLink's ChannelPLL directly computes the CPLL/DIV parameters.
- Loading branch information
1 parent
8f521d8
commit 80ba793
Showing
3 changed files
with
39 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# | ||
# This file is part of LiteEth. | ||
# | ||
# Copyright (c) 2019-2023 Florent Kermarrec <[email protected]> | ||
# Copyright (c) 2019-2024 Florent Kermarrec <[email protected]> | ||
# Copyright (c) 2018 Sebastien Bourdeauducq <[email protected]> | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
|
||
|
@@ -11,6 +11,8 @@ | |
|
||
from litex.gen import * | ||
|
||
from liteiclink.serdes.gth4_ultrascale import GTHChannelPLL | ||
|
||
from liteeth.common import * | ||
from liteeth.phy.pcs_1000basex import * | ||
|
||
|
@@ -69,6 +71,10 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e | |
rx_data = Signal(20) | ||
rx_reset_done = Signal() | ||
|
||
pll = GTHChannelPLL(refclk, refclk_freq, self.linerate) | ||
self.submodules.pll = pll | ||
print(pll) | ||
|
||
gth_params = dict( | ||
p_ACJTAG_DEBUG_MODE = 0b0, | ||
p_ACJTAG_MODE = 0b0, | ||
|
@@ -136,11 +142,11 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e | |
p_CPLL_CFG1 = 0b0000000000100011, | ||
p_CPLL_CFG2 = 0b0000000000000010, | ||
p_CPLL_CFG3 = 0b000000, | ||
p_CPLL_FBDIV = {200e6: 5, 156.25e6: 4}[refclk_freq], | ||
p_CPLL_FBDIV_45 = {200e6: 5, 156.25e6: 4}[refclk_freq], | ||
p_CPLL_FBDIV = pll.config["n2"], | ||
p_CPLL_FBDIV_45 = pll.config["n1"], | ||
p_CPLL_INIT_CFG0 = 0b0000001010110010, | ||
p_CPLL_LOCK_CFG = 0b0000000111101000, | ||
p_CPLL_REFCLK_DIV = {200e6: 2, 156.25e6: 1}[refclk_freq], | ||
p_CPLL_REFCLK_DIV = pll.config["m"], | ||
p_CTLE3_OCAP_EXT_CTRL = 0b000, | ||
p_CTLE3_OCAP_EXT_EN = 0b0, | ||
p_DDI_REALIGN_WAIT = 15, | ||
|
@@ -332,7 +338,7 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e | |
p_RXOOB_CFG = 0b000000110, | ||
p_RXOOB_CLK_CFG = "PMA", | ||
p_RXOSCALRESET_TIME = 0b00011, | ||
p_RXOUT_DIV = {1.25e9 : 4, 3.125e9 : 2}[self.linerate], | ||
p_RXOUT_DIV = pll.config["d"], | ||
p_RXPCSRESET_TIME = 0b00011, | ||
p_RXPHBEACON_CFG = 0b0000000000000000, | ||
p_RXPHDLY_CFG = 0b0010000001110000, | ||
|
@@ -443,7 +449,7 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e | |
p_TXFIFO_ADDR_CFG = "LOW", | ||
p_TXGBOX_FIFO_INIT_RD_ADDR = 4, | ||
p_TXGEARBOX_EN = "FALSE", | ||
p_TXOUT_DIV = {1.25e9 : 4, 3.125e9 : 2}[self.linerate], | ||
p_TXOUT_DIV = pll.config["d"], | ||
p_TXPCSRESET_TIME = 0b00011, | ||
p_TXPHDLY_CFG0 = 0b0110000001110000, | ||
p_TXPHDLY_CFG1 = 0b0000000000001111, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# | ||
# This file is part of LiteEth. | ||
# | ||
# Copyright (c) 2019-2023 Florent Kermarrec <[email protected]> | ||
# Copyright (c) 2019-2024 Florent Kermarrec <[email protected]> | ||
# Copyright (c) 2018 Sebastien Bourdeauducq <[email protected]> | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
|
||
|
@@ -11,6 +11,8 @@ | |
|
||
from litex.gen import * | ||
|
||
from liteiclink.serdes.gty_ultrascale import GTYChannelPLL | ||
|
||
from liteeth.common import * | ||
from liteeth.phy.pcs_1000basex import * | ||
|
||
|
@@ -69,6 +71,10 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e | |
rx_data = Signal(20) | ||
rx_reset_done = Signal() | ||
|
||
pll = GTYChannelPLL(refclk, refclk_freq, self.linerate) | ||
self.submodules.pll = pll | ||
print(pll) | ||
|
||
gty_params = dict( | ||
p_ACJTAG_DEBUG_MODE = 0b0, | ||
p_ACJTAG_MODE = 0b0, | ||
|
@@ -137,11 +143,11 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e | |
p_CPLL_CFG1 = 0b0000000000101011, | ||
p_CPLL_CFG2 = 0b0000000000000010, | ||
p_CPLL_CFG3 = 0b0000000000000000, | ||
p_CPLL_FBDIV = {200e6: 5, 156.25e6: 4}[refclk_freq], | ||
p_CPLL_FBDIV_45 = {200e6: 5, 156.25e6: 4}[refclk_freq], | ||
p_CPLL_FBDIV = pll.config["n2"], | ||
p_CPLL_FBDIV_45 = pll.config["n1"], | ||
p_CPLL_INIT_CFG0 = 0b0000001010110010, | ||
p_CPLL_LOCK_CFG = 0b0000000111101000, | ||
p_CPLL_REFCLK_DIV = {200e6: 2, 156.25e6: 1}[refclk_freq], | ||
p_CPLL_REFCLK_DIV = pll.config["m"], | ||
p_CTLE3_OCAP_EXT_CTRL = 0b000, | ||
p_CTLE3_OCAP_EXT_EN = 0b0, | ||
p_DDI_CTRL = 0b00, | ||
|
@@ -355,7 +361,7 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e | |
p_RXOOB_CFG = 0b000000110, | ||
p_RXOOB_CLK_CFG = "PMA", | ||
p_RXOSCALRESET_TIME = 0b00011, | ||
p_RXOUT_DIV = {1.25e9 : 4, 3.125e9 : 2}[self.linerate], | ||
p_RXOUT_DIV = pll.config["d"], | ||
p_RXPCSRESET_TIME = 0b00011, | ||
p_RXPHBEACON_CFG = 0b0000000000000000, | ||
p_RXPHDLY_CFG = 0b0010000001110000, | ||
|
@@ -467,7 +473,7 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e | |
p_TXFIFO_ADDR_CFG = "LOW", | ||
p_TXGBOX_FIFO_INIT_RD_ADDR = 4, | ||
p_TXGEARBOX_EN = "FALSE", | ||
p_TXOUT_DIV = {1.25e9 : 4, 3.125e9 : 2}[self.linerate], | ||
p_TXOUT_DIV = pll.config["d"], | ||
p_TXPCSRESET_TIME = 0b00011, | ||
p_TXPHDLY_CFG0 = 0b0110000001110000, | ||
p_TXPHDLY_CFG1 = 0b0000000000001111, | ||
|