set_property CFGBVS value [current_design]

       在 Vivado 中,set_property CFGBVS value [current_design] 命令用于设置 FPGA 配置 Bank 电压选择。以下是详细说明:

一、命令语法

set_property CFGBVS <value> [current_design]

二、CFGBVS 可选值

Value描述适用电压范围典型应用
GND接地方1.8V-3.3V7系列FPGA 3.3V配置
VCCO_0Bank 0 VCCO2.5V-3.3V7系列FPGA 2.5V/3.3V配置

三、使用方法

1. 在 XDC 约束文件中(推荐)

# constraints.xdc

# 对于3.3V配置Bank
set_property CFGBVS GND [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]

# 对于2.5V配置Bank
set_property CFGBVS VCCO_0 [current_design]
set_property CONFIG_VOLTAGE 2.5 [current_design]

2. 完整的配置电压设置

# 3.3V 配置 - 7系列FPGA
set_property CFGBVS GND [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property CONFIG_MODE SPI [current_design]
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 1 [current_design]

# 2.5V 配置 - 7系列FPGA
set_property CFGBVS VCCO_0 [current_design]
set_property CONFIG_VOLTAGE 2.5 [current_design]
set_property CONFIG_MODE SPI [current_design]
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]

3. 在 Tcl 控制台中使用

# 设置CFGBVS
set_property CFGBVS GND [current_design]

# 验证设置
get_property CFGBVS [current_design]

四、CFGBVS 详细说明

1. CFGBVS = GND(3.3V 配置)

# 3.3V 配置场景
set_property CFGBVS GND [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property IOSTANDARD LVCMOS33 [get_ports {spi_cs_n spi_sck spi_mosi}]

# 适用情况:
# - Bank 0 VCCO = 3.3V
# - 使用3.3V SPI Flash
# - 传统外设接口

2. CFGBVS = VCCO_0(2.5V 配置)

# 2.5V 配置场景
set_property CFGBVS VCCO_0 [current_design]
set_property CONFIG_VOLTAGE 2.5 [current_design]
set_property IOSTANDARD LVCMOS25 [get_ports {spi_cs_n spi_sck spi_mosi}]

# 适用情况:
# - Bank 0 VCCO = 2.5V
# - 使用2.5V SPI Flash
# - 现代外设接口

五、不同系列 FPGA 的 CFGBVS 设置

1. 7系列 FPGA (Artix-7, Kintex-7, Virtex-7)

# 3.3V 配置
set_property CFGBVS GND [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]

# 2.5V 配置
set_property CFGBVS VCCO_0 [current_design]
set_property CONFIG_VOLTAGE 2.5 [current_design]

# 注意:7系列不支持1.8V配置Bank

2. UltraScale/UltraScale+ 系列

# UltraScale 系列通常不需要显式设置CFGBVS
# 配置电压自动检测
set_property CONFIG_VOLTAGE 1.8 [current_design]  # 直接设置电压即可
set_property CONFIG_MODE SPI [current_design]

3. Zynq-7000 系列

# 与7系列相同
set_property CFGBVS GND [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property CONFIG_MODE SPI [current_design]

六、验证配置的方法

1. 检查属性设置

# 查看CFGBVS设置
get_property CFGBVS [current_design]

# 查看配置电压
get_property CONFIG_VOLTAGE [current_design]

# 查看所有配置相关属性
report_property [current_design] | findstr -i "CFGBVS\|CONFIG_VOLTAGE"

2. 生成 DRC 检查报告

# 运行DRC检查
report_drc -file drc_report.rpt

# 检查电压配置警告
grep -i "voltage\|cfgbvs" drc_report.rpt

七、常见配置组合

3.3V 系统完整配置

# 传统3.3V系统
set_property CFGBVS GND [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property CONFIG_MODE SPI [current_design]
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 1 [current_design]
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]
set_property IOSTANDARD LVCMOS33 [get_ports {spi_*}]

2.5V 系统完整配置

# 现代2.5V系统
set_property CFGBVS VCCO_0 [current_design]
set_property CONFIG_VOLTAGE 2.5 [current_design]
set_property CONFIG_MODE SPI [current_design]
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
set_property BITSTREAM.CONFIG.CONFIGRATE 66 [current_design]
set_property IOSTANDARD LVCMOS25 [get_ports {spi_*}]

八、调试和故障排除

1. CFGBVS 设置错误的症状

# 常见错误:CFGBVS与CONFIG_VOLTAGE不匹配

# 错误示例:3.3V配置但CFGBVS=VCCO_0
set_property CFGBVS VCCO_0 [current_design]  # 错误!
set_property CONFIG_VOLTAGE 3.3 [current_design]

# 正确示例:3.3V配置需要CFGBVS=GND
set_property CFGBVS GND [current_design]     # 正确!
set_property CONFIG_VOLTAGE 3.3 [current_design]

2. 自动检测和修复

# 自动设置CFGBVS的Tcl过程
proc auto_set_cfgbvs {} {
    set config_voltage [get_property CONFIG_VOLTAGE [current_design]]
    
    if {$config_voltage == 3.3} {
        set_property CFGBVS GND [current_design]
        puts "已设置 CFGBVS GND 用于 3.3V 配置"
    } elseif {$config_voltage == 2.5} {
        set_property CFGBVS VCCO_0 [current_design]
        puts "已设置 CFGBVS VCCO_0 用于 2.5V 配置"
    } else {
        puts "警告:不支持的配置电压 $config_voltage"
    }
}

# 使用自动设置
auto_set_cfgbvs

九、重要注意事项

  1. 7系列专用:CFGBVS 主要是 7 系列 FPGA 的特性

  2. 电压匹配:CFGBVS 必须与 CONFIG_VOLTAGE 匹配

  3. 硬件一致性:必须与实际的 Bank 0 VCCO 电压一致

  4. UltraScale:UltraScale 系列通常不需要此设置

十、最佳实践

# 设计开始时根据硬件设置
if {[get_property FAMILY [current_design]] == "artix7"} {
    # 根据硬件原理图设置
    set_property CFGBVS GND [current_design]        # 3.3V硬件
    set_property CONFIG_VOLTAGE 3.3 [current_design]
} elseif {[get_property FAMILY [current_design]] == "kintex7"} {
    set_property CFGBVS VCCO_0 [current_design]     # 2.5V硬件
    set_property CONFIG_VOLTAGE 2.5 [current_design]
}

# 生成比特流前验证
if {[get_property CFGBVS [current_design]] == ""} {
    puts "警告:未设置CFGBVS,可能影响7系列FPGA配置"
}

       CFGBVS 是 7 系列 FPGA 配置的关键设置,确保正确的电压检测和配置接口工作。错误的 CFGBVS 设置会导致配置失败或硬件损坏。

我用了这个代码 # 器件与电压配置 set_property PART xc7a35tfgg484-2 [current_design] set_property CFGBVS VCCO [current_design] set_property CONFIG_VOLTAGE 3.3 [current_design] # 全局时钟约束 create_clock -name sys_clk -period 20 [get_ports clk] ; # 周期需按实际修改 set_property PACKAGE_PIN R4 [get_ports clk] set_property IOSTANDARD LVCMOS33 [get_ports clk] ; # 明确Bank34电压 # 复位信号约束 set_property PACKAGE_PIN U2 [get_ports rst_n] set_property IOSTANDARD LVCMOS33 [get_ports rst_n] set_false_path -to [get_ports rst_n] ; # 声明异步复位 # 位选信号 sel[5:0](Bank 35) set_property IOSTANDARD LVCMOS33 [get_ports {sel[5:0]}] set_property PACKAGE_PIN G18 [get_ports {sel[5]}] set_property PACKAGE_PIN H18 [get_ports {sel[4]}] set_property PACKAGE_PIN G17 [get_ports {sel[3]}] set_property PACKAGE_PIN H13 [get_ports {sel[2]}] set_property PACKAGE_PIN H17 [get_ports {sel[1]}] set_property PACKAGE_PIN J15 [get_ports {sel[0]}] # 段选信号 seg[7:0](Bank 35) set_property IOSTANDARD LVCMOS33 [get_ports {seg[7:0]}] set_property PACKAGE_PIN H15 [get_ports {seg[0]}] set_property PACKAGE_PIN G16 [get_ports {seg[1]}] set_property PACKAGE_PIN L13 [get_ports {seg[2]}] set_property PACKAGE_PIN G15 [get_ports {seg[3]}] set_property PACKAGE_PIN K13 [get_ports {seg[4]}] set_property PACKAGE_PIN G13 [get_ports {seg[5]}] set_property PACKAGE_PIN H14 [get_ports {seg[6]}] set_property PACKAGE_PIN J14 [get_ports {seg[7]}] 还是报错显示 [DRC NSTD-1] Unspecified I/O Standard: 14 out of 16 logical ports use I/O standard (IOSTANDARD) value 'DEFAULT', instead of a user assigned specific value. This may cause I/O contention or incompatibility with the board power or connectivity affecting performance, signal integrity or in extreme cases cause damage to the device or the components to which it is connected. To correct this violation, specify all I/O standards. This design will fail to generate a bitstream unless all logical ports have a user specified I/O standard value defined. To allow bitstream creation with unspecified I/O standard values (not recommended), use this command: set_property SEVERITY {Warning} [get_drc_checks NSTD-1]. NOTE: When using the Vivado Runs infrastructure (e.g. launch_runs Tcl command), add this command to a .tcl file and add that file as a pre-hook for write_bitstream step for the implementation run. Problem ports: seg[7:0], and sel[5:0]. [Vivado 12-1345] Error(s) found during DRC. Bitgen not run. 其中I/O Ports里面seg和sel的I/O Std显示default(LVCMOS18) Bank15 fixed是打勾
06-22
[DRC NSTD-1] Unspecified I/O Standard: 2 out of 60 logical ports use I/O standard (IOSTANDARD) value 'DEFAULT', instead of a user assigned specific value. This may cause I/O contention or incompatibility with the board power or connectivity affecting performance, signal integrity or in extreme cases cause damage to the device or the components to which it is connected. To correct this violation, specify all I/O standards. This design will fail to generate a bitstream unless all logical ports have a user specified I/O standard value defined. To allow bitstream creation with unspecified I/O standard values (not recommended), use this command: set_property SEVERITY {Warning} [get_drc_checks NSTD-1]. NOTE: When using the Vivado Runs infrastructure (e.g. launch_runs Tcl command), add this command to a .tcl file and add that file as a pre-hook for write_bitstream step for the implementation run. Problem ports: clk_25m_n, and clk_25m_p. 约束文件如下 ################################################################################ ## 时钟和复位 ################################################################################ ################################################################################ ## 时钟约束 (外部晶振 + Clock Wizard) ################################################################################ # 1. 外部晶振输入约束 (25MHz) ################################################################################ ## 时钟约束 (外部差分晶振) ################################################################################ # 差分时钟约束 set_property PACKAGE_PIN N21 [get_ports clk_25m_p] set_property PACKAGE_PIN N22 [get_ports clk_25m_n] # 添加N端约束 set_property IOSTANDARD LVDS33 [get_ports clk_25m_p] # 使用LVDS标准 set_property IOSTANDARD LVDS33 [get_ports clk_25m_n] # 使用LVDS标准 set_property DIFF_TERM TRUE [get_ports clk_25m_p] # 启用差分终端 set_property DIFF_TERM TRUE [get_ports clk_25m_n] # 启用差分终端 # 创建差分时钟约束 create_clock -period 40.000 -name clk_25m -waveform {0.000 20.000} [get_ports clk_25m_p] # 复位信号保持不变 set_property PACKAGE_PIN L25 [get_ports rst_n] set_property IOSTANDARD LVCMOS33 [get_ports rst_n] set_property PULLUP true [get_ports rst_n] #connect_debug_port dbg_hub/clk [get_nets clk_25m_p] ################################################################################ ## JTAG 接口 ################################################################################ set_property PACKAGE_PIN AB25 [get_ports jtag_tck] set_property IOSTANDARD LVCMOS33 [get_ports jtag_tck] set_property PACKAGE_PIN AA25 [get_ports jtag_tms] set_property IOSTANDARD LVCMOS33 [get_ports jtag_tms] set_property PACKAGE_PIN Y26 [get_ports jtag_tdi] set_property IOSTANDARD LVCMOS33 [get_ports jtag_tdi] set_property PACKAGE_PIN K26 [get_ports jtag_tdo] set_property IOSTANDARD LVCMOS33 [get_ports jtag_tdo] ################################################################################ ## Tester 接口 ################################################################################ # 测试模式输出 (Bank 14) - 双重约束确保覆盖 set_property IOSTANDARD LVCMOS33 [get_ports {test_pattern[*]}] foreach pin [get_ports {test_pattern[*]}] { set_property IOSTANDARD LVCMOS33 $pin } set_property PACKAGE_PIN F15 [get_ports {test_pattern[0]}] set_property PACKAGE_PIN G19 [get_ports {test_pattern[1]}] set_property PACKAGE_PIN F20 [get_ports {test_pattern[2]}] set_property PACKAGE_PIN H16 [get_ports {test_pattern[3]}] set_property PACKAGE_PIN G16 [get_ports {test_pattern[4]}] set_property PACKAGE_PIN C17 [get_ports {test_pattern[5]}] set_property PACKAGE_PIN B17 [get_ports {test_pattern[6]}] set_property PACKAGE_PIN E16 [get_ports {test_pattern[7]}] set_property PACKAGE_PIN D16 [get_ports {test_pattern[8]}] set_property PACKAGE_PIN A17 [get_ports {test_pattern[9]}] set_property PACKAGE_PIN A18 [get_ports {test_pattern[10]}] set_property PACKAGE_PIN B19 [get_ports {test_pattern[11]}] set_property PACKAGE_PIN A19 [get_ports {test_pattern[12]}] set_property PACKAGE_PIN E17 [get_ports {test_pattern[13]}] set_property PACKAGE_PIN E18 [get_ports {test_pattern[14]}] set_property PACKAGE_PIN D18 [get_ports {test_pattern[15]}] set_property DRIVE 8 [get_ports {test_pattern[15:0]}] # 测试状态输入 (Bank 16) - 双重约束确保覆盖 set_property IOSTANDARD LVCMOS33 [get_ports {test_status[*]}] foreach pin [get_ports {test_status[*]}] { set_property IOSTANDARD LVCMOS33 $pin } set_property PACKAGE_PIN H17 [get_ports {test_status[0]}] set_property PACKAGE_PIN H14 [get_ports {test_status[1]}] set_property PACKAGE_PIN H15 [get_ports {test_status[2]}] set_property PACKAGE_PIN G17 [get_ports {test_status[3]}] set_property PACKAGE_PIN F17 [get_ports {test_status[4]}] set_property PACKAGE_PIN F18 [get_ports {test_status[5]}] set_property PACKAGE_PIN F19 [get_ports {test_status[6]}] set_property PACKAGE_PIN G15 [get_ports {test_status[7]}] set_property PULLDOWN true [get_ports {test_status[7:0]}] # 双向探测总线 (Bank 15) - 双重约束确保覆盖 set_property IOSTANDARD LVCMOS33 [get_ports {probe_bus[*]}] foreach pin [get_ports {probe_bus[*]}] { set_property IOSTANDARD LVCMOS33 $pin } set_property PACKAGE_PIN K18 [get_ports {probe_bus[0]}] set_property PACKAGE_PIN K15 [get_ports {probe_bus[1]}] set_property PACKAGE_PIN J16 [get_ports {probe_bus[2]}] set_property PACKAGE_PIN J14 [get_ports {probe_bus[3]}] set_property PACKAGE_PIN J15 [get_ports {probe_bus[4]}] set_property PACKAGE_PIN K16 [get_ports {probe_bus[5]}] set_property PACKAGE_PIN K17 [get_ports {probe_bus[6]}] set_property PACKAGE_PIN M14 [get_ports {probe_bus[7]}] set_property PACKAGE_PIN L14 [get_ports {probe_bus[8]}] set_property PACKAGE_PIN M15 [get_ports {probe_bus[9]}] set_property PACKAGE_PIN M16 [get_ports {probe_bus[10]}] set_property PACKAGE_PIN M17 [get_ports {probe_bus[11]}] set_property PACKAGE_PIN J19 [get_ports {probe_bus[12]}] set_property PACKAGE_PIN H19 [get_ports {probe_bus[13]}] set_property PACKAGE_PIN L17 [get_ports {probe_bus[14]}] set_property PACKAGE_PIN L18 [get_ports {probe_bus[15]}] set_property PACKAGE_PIN K20 [get_ports {probe_bus[16]}] set_property PACKAGE_PIN J20 [get_ports {probe_bus[17]}] set_property PACKAGE_PIN J18 [get_ports {probe_bus[18]}] set_property PACKAGE_PIN H18 [get_ports {probe_bus[19]}] set_property PACKAGE_PIN G20 [get_ports {probe_bus[20]}] set_property PACKAGE_PIN G21 [get_ports {probe_bus[21]}] set_property PACKAGE_PIN K21 [get_ports {probe_bus[22]}] set_property PACKAGE_PIN J21 [get_ports {probe_bus[23]}] set_property PACKAGE_PIN H21 [get_ports {probe_bus[24]}] set_property PACKAGE_PIN H22 [get_ports {probe_bus[25]}] set_property PACKAGE_PIN J23 [get_ports {probe_bus[26]}] set_property PACKAGE_PIN H23 [get_ports {probe_bus[27]}] set_property PACKAGE_PIN G22 [get_ports {probe_bus[28]}] set_property PACKAGE_PIN F22 [get_ports {probe_bus[29]}] set_property PACKAGE_PIN J24 [get_ports {probe_bus[30]}] set_property PACKAGE_PIN H24 [get_ports {probe_bus[31]}] set_property DRIVE 12 [get_ports {probe_bus[31:0]}] ################################################################################ ## 配置约束 ################################################################################ set_property CFGBVS VCCO [current_design] set_property CONFIG_VOLTAGE 3.3 [current_design] set_property BITSTREAM.CONFIG.CONFIGRATE 33 [current_design] set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
08-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值