Nhiều nhà thiết kế sử dụng Excel ở một số giai đoạn của FPGA thiết kế mới. Dễ dàng xuất dữ liệu từ bảng báo cáo Quartus II sang tệp CSV mà bạn có thể mở trong Excel.
Quy trình đơn giản này xuất dữ liệu từ một bảng báo cáo được chỉ định và ghi vào một tệp. Một dự án phải được mở khi bạn gọi thủ tục này. Một ví dụ về cách sử dụng nó trong một kịch bản sau.
proc panel_to_csv { panel_name csv_file } {
set fh [open $csv_file w]
load_report
set num_rows [get_number_of_rows -name $panel_name]
# Go through all the rows in the report file, including the
# row with headings, and write out the comma-separated data
for { set i 0 } { $i < $num_rows } { incr i } {
set row_data [get_report_panel_row -name $panel_name -row $i]
puts $fh [join $row_data ","]
}
unload_report
close $fh
}
Đây là một lệnh sử dụng quy trình. Chạy lệnh này tại dấu nhắc lệnh hệ thống với lệnh dưới đây.
load_package report
package require cmdline
proc panel_to_csv { panel_name csv_file } {
set fh [open $csv_file w]
load_report
set num_rows [get_number_of_rows -name $panel_name]
# Go through all the rows in the report file, including the
# row with headings, and write out the comma-separated data
for { set i 0 } { $i < $num_rows } { incr i } {
set row_data [get_report_panel_row -name $panel_name -row $i]
puts $fh [join $row_data ","]
}
unload_report
close $fh
}
set options {\
{ "project.arg" "" "Project name" } \
{ "revision.arg" "" "Revision name" } \
{ "panel.arg" "" "Panel name" } \
{ "file.arg" "" "Output file name"} \
}
array set opts [::cmdline::getoptions quartus(args) $options]
project_open $opts(project) -revision $opts(revision)
panel_to_csv $opts(panel) $opts(file)
unload_report
Bạn có thể chạy lệnh này tại một dấu nhắc lệnh với lệnh sau.
quartus_sh -t script.tcl -project <project name> -revision <revision name> -panel <panel name> -file <file name>
Hãy đảm bảo bạn trích dẫn tham số tên bảng điều khiển một cách chính xác nếu bạn nhập nó tại dấu nhắc lệnh hệ thống. Một số ký tự, chẳng hạn như thanh dọc (|) có nghĩa đặc biệt tại một command shell.