当前位置: 首页 > news >正文

TCL管理Vivado工程

文章目录

  • TCL管理Vivado工程
    • 1. 项目目录
    • 2. 导出脚本文件
    • 3. 修改TCL脚本
      • 3.1 project.tcl
      • 3.2 bd.tcl
    • 4. 工程恢复

TCL管理Vivado工程

工程结构
[图片]

[图片]

1. 项目目录

[图片]

  • config: 配置文件、coe文件等。
  • doc: 文档
  • fpga: 最后恢复的fpga工程目录
  • ip: ip文件
  • mcs: bit流文件等,方便直接使用
  • src: .v、.vh等源文件
  • tcl: 用来恢复工程的tcl脚本

2. 导出脚本文件

通过TCL Console 将目录切换到tcl目录。

  1. 生成新建工程tcl脚本
    在TCL Console执行

    write_project_tcl -use_bd_files {./project.tcl}
    
  2. 如果工程有bd文件,生成对应的tcl脚本用于恢复工程。
    ( 需要打开对应的bd文件,不打开会找不到)

    write_bd_tcl -no_ip_version {./bd.tcl}
    

    如果有多个bd文件,需要依次打开然后执行上述指令。
    -no_ip_version选项用于去除IP的版本信息,方便工程在高版本vivado中打开的情况。

  3. 生成IP文件脚本

    write_ip_tcl [get_ips ETH_RX_FIFO] {./ip.tcl}
    

    这里采用将原工程中ip的xci文件直接拷贝到ip目录中的方式。

  4. 添加仿真文件和约束文件
    将原工程的源文件、仿真文文件、约束文件拷贝到src目录下。
    [图片]

    • vcode中存放源文件
    • xdc中存放约束文件

3. 修改TCL脚本

3.1 project.tcl

  1. 修改工程路径
    将
    set origin_dir "."
    修改为
    set origin_dir [ file dirname [ info script ] ]  
    
  2. 修改_xil_proj_name_即可更改工程名字
    set _xil_proj_name_ "promanagement"
    
  3. 修改恢复后工程的存放路径( 这里希望生成的工程在fpga目录下)
    将
    # Create project
    create_project ${_xil_proj_name_} ./${_xil_proj_name_} -part xc7z020clg484-1
    修改为
    create_project ${_xil_proj_name_} ../fpga/${_xil_proj_name_} -part xc7z020clg484-1
    
  4. 修改block design相关的配置
    将
    set files [list \[file normalize "${origin_dir}/../../promanagement/promanagement.srcs/sources_1/bd/system/system.bd" ]\[file normalize "${origin_dir}/../../promanagement/promanagement.srcs/sources_1/bd/system/hdl/system_wrapper.v" ]\[file normalize "${origin_dir}/../../promanagement/promanagement.srcs/sources_1/new/top.v" ]\
    ]
    set imported_files [import_files -fileset sources_1 $files]# Set 'sources_1' fileset file properties for remote files
    # None# Set 'sources_1' fileset file properties for local files
    set file "system/system.bd"
    set file_obj [get_files -of_objects [get_filesets sources_1] [list "*$file"]]
    set_property -name "registered_with_manager" -value "1" -objects $file_obj
    修改为
    # Create block design
    source $origin_dir/bd.tcl# Generate the wrapper
    set design_name [get_bd_designs]
    make_wrapper -files [get_files $design_name.bd] -top -import
    set files [list \[file normalize "${origin_dir}/../src/vcode/top.v" ]\
    ]
    set imported_files [import_files -fileset sources_1 $files]
    
  5. 修改v文件配置
    在上一步的修改内容中实际上已经进行了配置
  6. 修改ip文件配置
    将
    set files [list \[file normalize "${origin_dir}/../../promanagement/promanagement.srcs/sources_1/ip/clk_wiz_0/clk_wiz_0.xci" ]\
    ]
    修改为
    set files [list \[file normalize "${origin_dir}/../ip/clk_wiz_0/clk_wiz_0.xci" ] \
    ]
    
  7. 修改约束文件配置
    将
    set file "new/top.xdc"
    set file_obj [get_files -of_objects [get_filesets constrs_1] [list "*$file"]]
    set file "[file normalize "$origin_dir/../../promanagement/promanagement.srcs/constrs_1/new/top.xdc"]"
    修改为
    set file "xdc/top.xdc"
    set file_obj [get_files -of_objects [get_filesets constrs_1] [list "*$file"]]
    set file "[file normalize "$origin_dir/../src/xdc/top.xdc"]"
    

3.2 bd.tcl

将
set list_projs [get_projects -quiet]
if { $list_projs eq "" } {create_project project_1 myproj -part xc7z020clg484-1
}
注释掉

4. 工程恢复

source project.tcl
http://www.lryc.cn/news/319967.html

相关文章:

  • R语言:microeco:一个用于微生物群落生态学数据挖掘的R包,第四:trans_beta class
  • Excel文件导入导出,SpringBoot整合EasyExcel批量导入导出,采用的JDBC+EasyExcel(附带整个Demo)
  • Git——本地使用详解
  • 深度学习pytorch——Tensor维度变换(持续更新)
  • Selenium-webdriver_manager判断是否已经下载过驱动(复用缓存驱动)
  • 【SQL】1174. 即时食物配送 II (窗口函数row_number; group by写法;对比;定位错因)
  • mvcc介绍
  • 强化PaaS平台应用安全:关键策略与措施
  • K8s 集群高可用master节点ETCD挂掉如何恢复?
  • 【Godot 4.2】常见几何图形、网格、刻度线点求取函数及原理总结
  • 如何利用POI导出报表
  • 自动部署SSL证书到阿里云腾讯云CDN
  • 【系统性】 循序渐进学C++
  • rust - 一个日志缓存记录的通用实现
  • elasticsearch(RestHighLevelClient API操作)(黑马)
  • 用尾插的思想实现移除链表中的元素
  • 【Kubernetes】k8s删除master节点后重新加入集群
  • HCIP—OSPF虚链路实验
  • RAxML-NG安装与使用-raxml-ng-v1.2.0(bioinfomatics tools-013)
  • Tomcat内存马
  • pytorch之诗词生成3--utils
  • OpenAI的ChatGPT企业版专注于安全性、可扩展性和定制化。
  • JS06-class对象
  • 深度学习1650ti在win10安装pytorch复盘
  • Node.js与webpack(三)
  • 测试覆盖率那些事
  • Etcd 介绍与使用(入门篇)
  • Docker 安装 LogStash
  • Selenium笔记
  • ChatGPT :确定性AI源自于确定性数据