2) added qip files from pei and changed folder structure 3) added files generic_ip, .qip and related files
51 lines
1.6 KiB
Tcl
51 lines
1.6 KiB
Tcl
package require ::quartus::project
|
|
|
|
set project_name "pei_fpga_project"
|
|
set revision_name "pei_fpga_top"
|
|
set top_entity "pei_fpga_top"
|
|
|
|
set script_dir [file dirname [info script]]
|
|
set root_dir [file normalize [file join $script_dir ".."]]
|
|
set qip_file [file normalize [file join $script_dir "sources.qip"]]
|
|
set assignments_qsf [file normalize [file join $root_dir "constraints" "pei_fpga_top_assignments.qsf"]]
|
|
set sdc_file [file normalize [file join $root_dir "constraints" "pei_fpga_top.sdc"]]
|
|
|
|
if {[project_exists $project_name]} {
|
|
puts "Opening existing project: $project_name"
|
|
project_open $project_name -revision $revision_name
|
|
} else {
|
|
puts "Creating new project: $project_name"
|
|
project_new $project_name -revision $revision_name
|
|
}
|
|
|
|
# Base project definition
|
|
set_global_assignment -name FAMILY "Cyclone 10 LP"
|
|
set_global_assignment -name DEVICE "10CL010YU256C8G"
|
|
set_global_assignment -name TOP_LEVEL_ENTITY $top_entity
|
|
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
|
|
|
|
# Source file package
|
|
if {[file exists $qip_file]} {
|
|
set_global_assignment -name QIP_FILE $qip_file
|
|
} else {
|
|
post_message -type error "QIP file not found: $qip_file"
|
|
qexit -error
|
|
}
|
|
|
|
# Timing constraints
|
|
if {[file exists $sdc_file]} {
|
|
set_global_assignment -name SDC_FILE $sdc_file
|
|
} else {
|
|
puts "Warning: SDC file not found: $sdc_file"
|
|
}
|
|
|
|
# Extra project assignments migrated from the original QSF
|
|
if {[file exists $assignments_qsf]} {
|
|
source $assignments_qsf
|
|
} else {
|
|
puts "Warning: assignments QSF not found: $assignments_qsf"
|
|
}
|
|
|
|
export_assignments
|
|
project_close
|
|
puts "Quartus project generation complete."
|