Vivadoのtclコンソールに以下の様に記載することでブロックデザインを書きだすことができる.
write_bd_tcl [Path]/[file_name].tcl
ブロックデザインを書きだしたtclから再現する際にはVivadoのTool→Run Tcl Scriptで先ほどのファイルを指定すればよい.
ここでの注意点は,Run Tcl Scriptをする前に,自作IPなどあればIP Catalogに事前に追加しておく必要がある.
以下に,Vivado2023.1で出力したwrite_bd_tclのhelpを載せる.
write_bd_tcl -help
write_bd_tcl
Description:
Export the current design to a Tcl file on disk.
Syntax:
write_bd_tcl [-force] [-bd_name <arg>] [-no_mig_contents] [-no_ip_version]
[-ignore_minor_versions] [-bd_folder <arg>] [-boundary_of <arg>]
[-check_ips <arg>] [-hier_blks <arg>] [-include_layout]
[-exclude_layout] [-keep_paths_as_is] [-make_local]
[-no_project_wrapper] [-exclude_pfm] [-updated_pfm_attrs]
[-quiet] [-verbose] <tcl_filename>
Returns:
TCL_OK, TCL_ERROR if failed.
Usage:
Name Description
-------------------------------------
[-force] Flag to overwrite existing file.
[-bd_name] Name for block diagram. By default will use
current block diagram's name.
[-no_mig_contents] Flag to not include MIG PRJ contents into
generated Tcl script, but instead will load PRJ
from working directory. Default is to include MIG
PRJ contents in Tcl script.
[-no_ip_version] Flag to not include the IP version as part of the
IP VLNV in create_bd_cell commands. NOTE - this
may have implications if there are major IP
version changes.
[-ignore_minor_versions] Use this flag to create the cells in the design
using their latest minor version. For example, a
project contains versions of blk_mem_gen IP like
7.3, 7.4, 8.3, 8.4. In the design there is a
blk_mem_gen_v7.4. With this flag, write_bd_tcl
will generate the line: create_bd_cell -type ip
-vlnv xilinx.com:ip:blk_mem_gen:7.* bmg_0_v7.
When the generated Tcl script is sourced, the
cell bmg_0_v7 will use the latest blk_mem_gen_v7.
[-bd_folder] Remote BD feature - Specify the folder where the
design will be generated when Tcl script is
sourced.
[-boundary_of] Will generate only the boundary (external
interfaces and external ports) of the given
current design or hierarchical block by the Tcl
script. Will not include any cell objects or
connections. If this argument is used, other
arguments/flags will be ignored. Use '/' for
current design.
[-check_ips] By default value = true, therefore, will check if
IPs/modules exist in the IP catalog or project
before continuing to reconstruct the design.
Valid values are (true/false), (yes/no), or
(1/0).
[-hier_blks] Comma separated list of hierarchical blocks in
the design that will be generated by the Tcl
script. Will include any sub-hierachical blocks
within the specified blocks too. This option will
not create the top-level design portion.
[-include_layout] By default will NOT include the GUI layout of the
design. Use this argument to include the layout
information in the generated Tcl script.
[-exclude_layout] NOTE - This flag will be obsolete in a near
future release, but is currently supported for
backwards compatibility. Use this argument to not
include the layout information in the generated
Tcl script.
[-keep_paths_as_is] Flag to leave path values as is and to not
convert relative paths to be absolute paths.
Absolute paths will remain as absolute. (Default
= false)
[-make_local] Use this flag when you want to write your remote
BD out as a local BD.
[-no_project_wrapper] This option is used to write the BD create TCL
procs without any project wrapper.
[-exclude_pfm] Use this flag to exclude pfm attributes for this
design
[-updated_pfm_attrs] Use this flag to update the pfms to remove
connected ports/interfaces from the values.
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution
<tcl_filename> Name of exported Tcl file
Categories:
IPIntegrator
Description:
Export the current IP integrator subsystem design as a Tcl script file to
the disk.
Note: Any directory in the path specified by the <name> option must already
exist, or the script will not be created.
The Tcl script file lets you recreate, reuse, and customize IP integrator
subsystem designs without having to archive the original subsystem design.
When working with a new software release, you must use the output script
from the write_bd_tcl command to create a block design in the same software
release as the Tcl script was generated. This ensures the availability of
the needed versions of any IP used in the script. You can then migrate the
created block design into a new software release.
This command returns TCL_OK if successful, or TCL_ERROR if it fails, unless
-quiet is specified.
Arguments:
-force - (Optional) Overwrite an existing bd_tcl file of the same name if
it already exists.
-bd_name <arg> - (Optional) Specify the name to assign to the block diagram
in the bd_tcl file. When the Tcl script is run, the new block diagram will
be created with the specified name. By default, the current name of the
block diagram will be used.
-no_mig_contents - (Optional) Do not include memory IP PRJ contents into
the generated Tcl script. By default this content will be included in the
Tcl script.
-no_ip_version - (Optional) Do not include the Version in the
Vendor:Library:Name:Version (VLNV) value that specifies the IP for
create_bd_cell commands in the write_bd_tcl file. This allows a bd_tcl
script to create a new block diagram using the latest version of the IP
from the Vivado IP catalog.
Note: This can have significant design implications when IP used in a block
design have undergone major version changes from when the bd_tcl file was
written to when it is used.
-ignore_minor_versions - (Optional) Do not include the minor version in the
IP VLNV. This lets the bd_tcl script use the latest minor revision of an
IP, while preserving the major version. For example, an IP blk_mem_gen_v7.4
will be written as -vlnv xilinx.com:ip:blk_mem_gen:7.*.
-bd_folder <arg> - (Optional) Specify the directory where the block diagram
will be generated when the bd_tcl script is run. This lets you specify the
block design to be created outside of the directory structure of a project
where the bd_tcl script is being run.
-check_ips [ true | false ] - (Optional) A boolean argument that adds a
check to the Tcl script to ensure that all required IP are found before
starting the process of creating the block diagram when the script is run.
If any IP are missing, the script will error out rather than attempting to
create the block design. The default value is true.
-hier_blks <arg> - (Optional) Only generate the write_bd_tcl script for
specified hierarchical blocks or modules of the block design.
Note: Hierarchical block modules must be specified as bd_cell objects as
returned by get_bd_cells for example. In addition, if the specified
bd_cells are not hierarchical blocks, then no Tcl script will be generated.
-include_layout - (Optional) Include the graphical layout data of the block
design in the output Tcl script. This preserves the current layout of the
block design in the Vivado IP integrator design canvas in the output Tcl
script. This option is ignored when used with the -hier_blks option, as the
layout information is written from the top-level of the block design.
-make_local - (Optional) Specify this option when the block diagram is
remote from the current project, but you want to make it local to the
project when running the script to recreate it.
-no_project_wrapper - (Optional) Write a Tcl script to recreate the block
diagram without creating the top-level wrapper for the design.
-exclude_pfm - (Optional) Use this flag to exclude PFM properties used in
defining a Vitis platform from the created bd_tcl script.
-quiet - (Optional) Execute the command quietly, returning no messages from
the command. The command also returns TCL_OK regardless of any errors
encountered during execution.
Note: Any errors encountered on the command-line, while launching the
command, will be returned. Only errors occurring inside the command will be
trapped.
-verbose - (Optional) Temporarily override any message limits and return
all messages from this command.
Note: Message limits can be defined with the set_msg_config command.
<tcl_filename> - Specify the name of the Tcl file to write. A suffix of
.tcl will be supplied if no file suffix is specified.
Note: If the path is not specified as part of the file name, the file will
be written into the current working directory, or the directory from which
the tool was launched.
Example:
The following example creates a Tcl script from the current IP integrator
subsystem design:
write_bd_tcl C:/Data/myDesign.tcl
This example creates a Tcl script from the current IP integrator subsystem
design, specifies a new name for the block diagram, specifies that IP
versions should not be included, and also indicates a folder to write the
block diagram to when it is created by running the output bd_tcl script:
write_bd_tcl -bd_name newMB1 -no_ip_version \
-bd_folder C:/Block_Designs projMB1
Note: The file suffix of .tcl will be appended to the specified file name,
resulting in a file name of projMB1.tcl.
The following example creates a Tcl script for the specified hierarchical
block cell, overwriting any existing script of the same name:
write_bd_tcl -force -hier_blks [get_bd_cells myHier] \
-include_layout C:/Data/myHier.tcl
Note: The -include_layout option is ignored in this example, due to the use
of the -hier_blks option.
See Also:
* create_bd_design
* open_bd_design
* save_bd_design
コメント
ためになった