program_device
Programs an FPGA by loading a .bit bitstream, automating the open hardware manager, connect, and program steps via Vivado.
Instructions
编程 FPGA 设备。封装 open_hw_manager → connect → program 多步操作。
只烧 .bit 进 FPGA(掉电即丢)。要掉电自启动须烧 SPI flash,见下面配方。
烧 flash 配方(2019.1,run_tcl 逐步执行):
查 flash 型号:
get_cfgmem_parts -of [lindex [get_hw_devices] 0](或按板上 flash 用 -filter 选,如 mt25ql128-spi-x1_x2_x4)生成 .mcs:
write_cfgmem -format mcs -size 16 -interface SPIx4 -loadbit {up 0x0 <top>.bit} -force out.mcs建 cfgmem 对象:
create_hw_cfgmem -hw_device [current_hw_device] [lindex [get_cfgmem_parts <part>] 0]设属性四件套:
set_property PROGRAM.FILES {out.mcs} [current_hw_cfgmem]PROGRAM.ERASE 1 / PROGRAM.CFG_PROGRAM 1 / PROGRAM.VERIFY 1
烧写:
program_hw_cfgmem烧后
boot_hw_device [current_hw_device]或断电重启从 flash 加载。 (Zynq 用 .bin:write_cfgmem -format bin -interface SMAPx32 ...)
Args: bitstream_path: 比特流文件路径(.bit 文件)。 target: 目标设备过滤器,默认 "*"(第一个可用设备)。 hw_server_url: 硬件服务器地址,默认 "localhost:3121"。 session_id: 目标会话 ID。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | * | |
| session_id | No | default | |
| hw_server_url | No | localhost:3121 | |
| bitstream_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |