CDO Utility

The CDO utility (cdoutil) is a program that allows to process CDO files in various ways. CDO files are binary files created in the Vivado® Design Suite for Versal™ devices based on user configuration for clocks, PLLs, and MIO. CDOs are part of the PDI, and are loaded/executed by the PLM. For Zynq® devices and Zynq® UltraScale+™ MPSoCs, the configuration is part of ps7/psu_init.c/h files, which are compiled along with the FSBL.

Accessing

The cdoutil is available as part of the Vivado Design Suite/Vitis™ unified software platform/Bootgen installation at <INSTALL_DIR>/bin/cdoutil.

Usage

The general command line syntax for cdoutil is:

cdoutil <options> <input(s)>

The default function of cdoutil is to decode the input file and print out the CDO.

Command Line Options

There are a number of options to change the default behavior:

Table 1. Command Line Options
Option Description
-address-filter-file <path> Specify address filter file
-annotate Annotate source output with details of commands
-device <type> Specify device name, default is s80
-help Print help information
-output-binary-be Output CDO commands in big endian binary format
-output-binary-le Output CDO commands in little endian binary format
-output-file <path> Specify output file, default is stdout
-output-modules Output list of modules used by input file(s)
-output-raw-be Output CDO commands in big endian raw format
-output-raw-le Output CDO commands in little endian raw format
-output-source Output CDO commands in source format (default)
-remove-comments Remove comments from input
-rewrite-block Rewrite block write commands to multiple write commands
-rewrite-sequential Rewrite sequential write commands to a single block write command
-verbose Print log information
Note: -output-raw-be is preferred as the Vivado Design Suite produces CDOs in big endian raw format. -output-raw-le, -output-binary-be, and -output-binary-le are not preferred options.

Address Filter File

The address filter file is specified using the -address-filter-file <path>. The purpose of this file is to specify modules that should be removed from the configuration. The address filter file is text file where each line starting with the dash (minus) character specifies a address range for which all initializations should be removed. Example:

# Remove configuration of UART0
-UART0

The list of modules used in a design can be generated using the -output-modules option. This can be a useful starting point for the address filter file.

Examples

Converting Binary to Source without Annotations

cdoutil -output-file test.txt test.bin

Example output:

version 2.0
write 0xfca50000 0
write 0xfca50010 0
write 0xfca50018 0x1
write 0xfca5001c 0
write 0xfca50020 0
write 0xfca50024 0xffffffff

Converting Binary to Source with Annotations

cdoutil -annotate -output-file test.txt test.bin

Example output:

version 2.0
# PCIEA_ATTRIB_0.MISC_CTRL.slverr_enable[0]=0x0
write 0xfca50000 0
# PCIEA_ATTRIB_0.ISR.{dpll_lock_timeout_err[1]=0x0, addr_decode_err[0]=0x0}
write 0xfca50010 0
# PCIEA_ATTRIB_0.IER.{dpll_lock_timeout_err[1]=0x0, addr_decode_err[0]=0x1}
write 0xfca50018 0x1
# PCIEA_ATTRIB_0.IDR.{dpll_lock_timeout_err[1]=0x0, addr_decode_err[0]=0x0}
write 0xfca5001c 0
# PCIEA_ATTRIB_0.ECO_0.eco_0[31:0]=0x0
write 0xfca50020 0
# PCIEA_ATTRIB_0.ECO_1.eco_1[31:0]=0xffffffff
write 0xfca50024 0xffffffff

Editing Binary CDO File

cdoutil -annotate -output-file test.txt test.bin
vim text.txt
cdoutil -output-binary-be -output-file test-new.bin test.txt

Make sure .bif file is using test-new.bin instead of test.bin, then rerun bootgen to create the .pdi file.

Converting Source to Binary

cdoutil -output-binary-be -output-file test.bin test.txt