代码片段:ILA自动循环触发后保存数据

调试FPGA时,可能需要多次采集数据用于比较,由于Vivado支持Tcl语句,因此可以将采集与保存写入循环,从而解放双手,以下是代码片段。

for {set a 10} {$a < 20} {incr a} {
    run_hw_ila [get_hw_ilas -of_objects [get_hw_devices fpga] -filter {CELL_NAME=~"inst_data"}]
    wait_on_hw_ila [get_hw_ilas -of_objects [get_hw_devices fpga] -filter {CELL_NAME=~"inst_data"}]
    display_hw_ila_data [upload_hw_ila_data [get_hw_ilas -of_objects [get_hw_devices fpga] -filter {CELL_NAME=~"inst_data"}]]
    write_hw_ila_data -csv_file [format "C:\\Users\\a\\Desktop\\TEST_DATA\\data%d_ad1.csv" $a] hw_ila_data_1
}

代码高亮截图:

加入讨论