Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions docs/projects/adrv9001/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,51 @@ the HDL repository.
$cd hdl/projects/adrv9001/zcu102
$make

TX clock source selection (build-time)
-------------------------------------------------------------------------------
Two environment parameters control which clock drives each TX SSI interface.
These are read in ``system_project.tcl`` and forwarded to the ``axi_adrv9001``
IP as ``CONFIG.USE_RX_CLK_FOR_TX1/2``.

``USE_RX_CLK_FOR_TX1``: Clock source for TX1

- ``0`` = TX1 dedicated SSI reference clock
- ``1`` = RX1 SSI clock
- ``2`` = RX2 SSI clock

``USE_RX_CLK_FOR_TX2``: Clock source for TX2

- ``0`` = TX2 dedicated SSI reference clock
- ``1`` = RX1 SSI clock
- ``2`` = RX2 SSI clock

Examples
-------------------------------------------------------------------------------
- Drive TX1 from RX1 and TX2 from RX2:

.. code-block:: bash

make USE_RX_CLK_FOR_TX1=1 USE_RX_CLK_FOR_TX2=2

- Drive TX channels from RX1:

.. code-block:: bash

make USE_RX_CLK_FOR_TX1=1 USE_RX_CLK_FOR_TX2=1

- LVDS interface with TX2 driven by RX1 clock:

.. code-block:: bash

make CMOS_LVDS_N=0 USE_RX_CLK_FOR_TX1=2

Notes
-------------------------------------------------------------------------------
- Defaults: ``system_project.tcl`` defaults both to ``0`` (dedicated TX clocks).
But, for LVDS builds on ZCU102, ``system_bd.tcl`` sets TX1=1 and TX2=2 to use
RX clocks by default.
- Related IP parameters are also described in :ref:`axi_adrv9001` (library docs).

A more comprehensive build guide can be found in the :ref:`build_hdl` user guide.

Resources
Expand Down
40 changes: 40 additions & 0 deletions docs/projects/jupiter_sdr/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,46 @@ the HDL repository.
$cd hdl/projects/jupiter_sdr
$make

TX clock source selection (build-time)
-------------------------------------------------------------------------------
Two environment parameters control which clock drives each TX SSI interface.
These are read in ``system_project.tcl`` and forwarded to the ``axi_adrv9001``
IP as ``CONFIG.USE_RX_CLK_FOR_TX1/2``.

``USE_RX_CLK_FOR_TX1``: Clock source for TX1

- ``0`` = TX1 dedicated SSI reference clock
- ``1`` = RX1 SSI clock
- ``2`` = RX2 SSI clock

``USE_RX_CLK_FOR_TX2``: Clock source for TX2

- ``0`` = TX2 dedicated SSI reference clock
- ``1`` = RX1 SSI clock
- ``2`` = RX2 SSI clock

Examples
-------------------------------------------------------------------------------
- Drive TX1 from RX1 and TX2 from RX2:

.. code-block:: bash

make USE_RX_CLK_FOR_TX1=1 USE_RX_CLK_FOR_TX2=2

- Drive TX channels from RX1:

.. code-block:: bash

make USE_RX_CLK_FOR_TX1=1 USE_RX_CLK_FOR_TX2=1

Notes
-------------------------------------------------------------------------------
- Defaults: ``system_project.tcl`` defaults both to ``0`` (dedicated TX clocks).
But, for LVDS builds on ZCU102, ``system_bd.tcl`` sets TX1=1 and TX2=2 to use
RX clocks by default.
- Related IP parameters are also described in :ref:`axi_adrv9001` (library docs).


A more comprehensive build guide can be found in the :ref:`build_hdl` user guide.

Resources
Expand Down
6 changes: 6 additions & 0 deletions projects/adrv9001/common/adrv9001_bd.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ create_bd_port -dir O tdd_sync_cntr

# adrv9001

set USE_RX_CLK_FOR_TX1 $ad_project_params(USE_RX_CLK_FOR_TX1)
set USE_RX_CLK_FOR_TX2 $ad_project_params(USE_RX_CLK_FOR_TX2)

ad_ip_instance axi_adrv9001 axi_adrv9001
ad_ip_parameter axi_adrv9001 CONFIG.CMOS_LVDS_N $ad_project_params(CMOS_LVDS_N)
ad_ip_parameter axi_adrv9001 CONFIG.EXT_SYNC 1
ad_ip_parameter axi_adrv9001 CONFIG.USE_RX_CLK_FOR_TX1 $USE_RX_CLK_FOR_TX1
ad_ip_parameter axi_adrv9001 CONFIG.USE_RX_CLK_FOR_TX2 $USE_RX_CLK_FOR_TX2

# dma for rx1

Expand Down
21 changes: 20 additions & 1 deletion projects/adrv9001/zc706/system_project.tcl
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
###############################################################################
## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved.
## Copyright (C) 2020-2023, 2025 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################

source ../../../scripts/adi_env.tcl
source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl
source $ad_hdl_dir/projects/scripts/adi_board.tcl

# The get_env_param procedure retrieves parameter value from the environment if exists,
# other case returns the default value specified in its second parameter field.
#
# How to use over-writable parameters from the environment:
#
# e.g.
# make USE_RX_CLK_FOR_TX1=0 USE_RX_CLK_FOR_TX2=0
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it might sound redundant, I would add a line with the parameter name and description, before the available value options (for both USE_RX_CLK_FOR_TX1 and USE_RX_CLK_FOR_TX2).
Keep the comments section uninterrupted by tcl commands and "set" the parameters after the comments section.

Here is a good example: https://github.com/analogdevicesinc/hdl/blob/main/projects/ad4630_fmc/zed/system_project.tcl#L15-L20

# 0 = Tx1 SSI reference clock
# 1 = Rx1 clocks
# 2 = Rx2 clocks
set USE_RX_CLK_FOR_TX1 [get_env_param USE_RX_CLK_FOR_TX1 0]
# 0 = Tx2 SSI reference clock
# 1 = Rx1 clocks
# 2 = Rx2 clocks
set USE_RX_CLK_FOR_TX2 [get_env_param USE_RX_CLK_FOR_TX2 0]

adi_project adrv9001_zc706 0 [list \
CMOS_LVDS_N 1 \
USE_RX_CLK_FOR_TX1 $USE_RX_CLK_FOR_TX1 \
USE_RX_CLK_FOR_TX2 $USE_RX_CLK_FOR_TX2 \
]

adi_project_files adrv9001_zc706 [list \
Expand Down
13 changes: 12 additions & 1 deletion projects/adrv9001/zcu102/system_project.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
## Copyright (C) 2020-2023 Analog Devices, Inc. All rights reserved.
## Copyright (C) 2020-2023,2025 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################

Expand All @@ -25,8 +25,19 @@ source $ad_hdl_dir/projects/scripts/adi_board.tcl

set CMOS_LVDS_N [get_env_param CMOS_LVDS_N 1]

# 0 = Tx1 SSI reference clock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, add param name & description before the enumerated possible values.

# 1 = Rx1 clocks
# 2 = Rx2 clocks
set USE_RX_CLK_FOR_TX1 [get_env_param USE_RX_CLK_FOR_TX1 0]
# 0 = Tx2 SSI reference clock
# 1 = Rx1 clocks
# 2 = Rx2 clocks
set USE_RX_CLK_FOR_TX2 [get_env_param USE_RX_CLK_FOR_TX2 0]

adi_project adrv9001_zcu102 0 [list \
CMOS_LVDS_N $CMOS_LVDS_N \
USE_RX_CLK_FOR_TX1 $USE_RX_CLK_FOR_TX1 \
USE_RX_CLK_FOR_TX2 $USE_RX_CLK_FOR_TX2 \
]

adi_project_files {} [list \
Expand Down
21 changes: 20 additions & 1 deletion projects/adrv9001/zed/system_project.tcl
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
###############################################################################
## Copyright (C) 2014-2023 Analog Devices, Inc. All rights reserved.
## Copyright (C) 2020-2023, 2025 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################

source ../../../scripts/adi_env.tcl
source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl
source $ad_hdl_dir/projects/scripts/adi_board.tcl

# The get_env_param procedure retrieves parameter value from the environment if exists,
# other case returns the default value specified in its second parameter field.
#
# How to use over-writable parameters from the environment:
#
# e.g.
# make USE_RX_CLK_FOR_TX1=0 USE_RX_CLK_FOR_TX2=0
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

# 0 = Tx1 SSI reference clock
# 1 = Rx1 clocks
# 2 = Rx2 clocks
set USE_RX_CLK_FOR_TX1 [get_env_param USE_RX_CLK_FOR_TX1 0]
# 0 = Tx2 SSI reference clock
# 1 = Rx1 clocks
# 2 = Rx2 clocks
set USE_RX_CLK_FOR_TX2 [get_env_param USE_RX_CLK_FOR_TX2 0]

adi_project adrv9001_zed 0 [list \
CMOS_LVDS_N 1 \
USE_RX_CLK_FOR_TX1 $USE_RX_CLK_FOR_TX1 \
USE_RX_CLK_FOR_TX2 $USE_RX_CLK_FOR_TX2 \
]
adi_project_files adrv9001_zed [list \
"system_top.v" \
Expand Down