Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- Is there a Tcl script so can automate the running of two projects one after the other --- Quote End --- Yes, you just use a loop in Tcl. For example, I have a board that has four FPGAs. Each one has an ID register and slight differences in functionality. When the design is compiled, I create a timestamp, and then run a loop where each is synthesized. Here's the basics of the code ...
# -----------------------------------------------------------------# Build the design# -----------------------------------------------------------------
puts " - Building the design for the 4 FPGAs"
# Build timestamp# Use the same timestamp for each of the four FPGAs.# Timestamp is in UTC seconds.
set timestamp
puts " - Build timestamp $timestamp (0x)"
# Time the build
set start_build
# Create configurations for each FPGA
for {set fpga_num 0} {$fpga_num < 4} {incr fpga_num} {
# Time the per FPGA build
set start_fpga
# Create a working folder
set dwork $qwork/data$fpga_num
if {!} {
puts " - Creating the FPGA#$fpga_num work folder; $dwork"
file mkdir $dwork
}
cd $dwork
# Create a new project
project_new -overwrite "data"
# Add the files
data_files
# Setup the pinout and default constraints
set device_type 0
set tx_enable 1
set rx_terminate 1
data_pinout $device_type $fpga_num $tx_enable $rx_terminate
# Timing constraints
data_timing_constraints
# Setup the generics
set_parameter -name FPGA_NUM $fpga_num
set_parameter -name TIMESTAMP $timestamp
# Process the design
puts " - Processing the design for FPGA#$fpga_num"
execute_flow -compile
# Use one of the following to save the settings
project_close# export_assignments
# Copy the RBF file
puts " - Renaming the RBF file data$fpga_num.rbf"
file copy -force "data.rbf" "$qwork/data$fpga_num.rbf"
set end_fpga
set str ]
puts " - FPGA$fpga_num build time: $str minutes"
}
set end_build
set str ]
puts " - *** Total build time: $str minutes ***"
# Create the single DATA-FPGA configuration file
cd $qwork
puts " - Creating the configuration file data_basic.bin"
exec cat data0.rbf data1.rbf data2.rbf data3.rbf > data_basic.bin
You should be able to implement something like this. Cheers, Dave