Forum Discussion
We dont have any reference directly related you requirement. But below are flow how you can achieve that that I could think of and snippet example.
1. enable_disable_ip_callback is the procedure that gets executed during the elaboration phase.
2. qsys_instance_name and ip_name variables are set to the names of your Qsys instance and IP, respectively.
3. The user input is simulated with the variable user_input. You should replace it with your actual user input handling mechanism.
4. The set_property commands enable or disable the IP based on the user input.
5. Finally, the add_elaboration_callback command registers the elaboration callback procedure.
You can integrate this script into your Quartus project and execute it during synthesis/elaboration. Make sure to replace "my_qsys_instance" and "my_ip" with your actual Qsys instance and IP names, respectively, and modify the user input handling according to your requirements.
# Define elaboration callback procedure
proc enable_disable_ip_callback { args } {
set qsys_instance_name "my_qsys_instance"
set ip_name "my_ip"
# Check if the current instance is the desired Qsys instance
if {[lindex $args 0] eq $qsys_instance_name} {
# Get the handle to the desired IP
set ip_handle [lindex $args 1]
# Check user input (0 for disable, 1 for enable)
set user_input 1 ;# For demonstration, set it to enable by default
# You can replace this with your actual user input handling mechanism
if {$user_input == 0} {
# Disable IP
set_property -dict [list CONFIG.enabled 0] $ip_handle
puts "Disabled $ip_name in $qsys_instance_name"
} elseif {$user_input == 1} {
# Enable IP
set_property -dict [list CONFIG.enabled 1] $ip_handle
puts "Enabled $ip_name in $qsys_instance_name"
} else {
puts "Invalid user input!"
}
}
}
# Register the elaboration callback
add_elaboration_callback enable_disable_ip_callback
How can I integrate this script into my Quartus project and execute it during synthesis/elaboration.
Also, if I enable the ip , will the rtl be generated corresponding to that ip because ip generation happens initially and script will execute in elaboration process right?
Will correct me if I am wrong.
Thanks