Intel® Quartus® Prime Pro Edition User Guide: 设计约束

ID 683143
日期 10/16/2019
Public
文档目录

1.2.5. Tcl-only脚本流程

作为.sdc.qsf文件的替代,您可以在Tcl脚本内执行所有设计分配和时序约束。在这种情况下,自动执行编译和自定义结果报告的脚本也包含设计约束。

您可以将设计的内容导出到一个程序可执行的Tcl (.tcl)文件,然后在尝试其他约束条件后使用生成的脚本还原设置。

要将约束导出为可执行的Tcl脚本,请单击Project > Generate Tcl File for Project

blinking_led_generated.tcl文件

# Quartus Prime: Generate Tcl File for Project # File: blinking_led_generated.tcl # Generated on: Wed May 10 10:14:44 2017 # Load Quartus Prime Tcl Project package package require ::quartus::project set need_to_close_project 0 set make_assignments 1 # Check that the right project is open if {[is_project_open]} { if {[string compare $quartus(project) "blinking_led"]} { puts "Project blinking_led is not open" set make_assignments 0 } } else { # Only open if not already open if {[project_exists blinking_led]} { project_open -revision blinking_led blinking_led } else { project_new -revision blinking_led blinking_led } set need_to_close_project 1 } # Make assignments if {$make_assignments} { set_global_assignment -name SYSTEMVERILOG_FILE top.sv set_global_assignment -name SYSTEMVERILOG_FILE blinking_led.sv set_global_assignment -name SDC_FILE blinking_led.sdc set_global_assignment -name SDC_FILE jtag.sdc set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files set_global_assignment -name LAST_QUARTUS_VERSION "17.1.0 Pro Edition" set_global_assignment -name TEXT_FILE blinking_led_generated.txt set_global_assignment -name FAMILY "Arria 10" set_global_assignment -name TOP_LEVEL_ENTITY top set_global_assignment -name DEVICE 10AS066N3F40E2SG set_location_assignment PIN_AN18 -to clock set_location_assignment PIN_AR23 -to led_zero_on set_location_assignment PIN_AM21 -to led_two_on set_location_assignment PIN_AR22 -to led_one_on set_location_assignment PIN_AL20 -to led_three_on set_instance_assignment -name IO_STANDARD "1.8 V" -to led_zero_on set_instance_assignment -name IO_STANDARD "1.8 V" -to led_one_on set_instance_assignment -name IO_STANDARD "1.8 V" -to led_two_on set_instance_assignment -name IO_STANDARD "1.8 V" -to led_three_on set_instance_assignment -name SLEW_RATE 1 -to led_zero_on set_instance_assignment -name SLEW_RATE 1 -to led_one_on set_instance_assignment -name SLEW_RATE 1 -to led_two_on set_instance_assignment -name SLEW_RATE 1 -to led_three_on set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to clock set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to led_zero_on set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to led_one_on set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to led_two_on set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to led_three_on # Commit assignments export_assignments # Close project if {$need_to_close_project} { project_close } }

示例:

  • 打开工程
  • 分配约束
  • 将分配写入到QSF文件中
  • 关闭工程