refactor(platform/xilinx): strengthen parameter validation

This commit is contained in:
Gatsby Van
2024-11-04 20:36:33 +08:00
parent af92cd0a53
commit eb3ca273b4
+8
View File
@@ -268,6 +268,13 @@ proc _create_app {app_name app_config platform_name is_vitis} {
# Configure BSP/Domain for application
if {[dict exists $app_config bsp] && [dict get $app_config bsp] ne ""} {
set bsp_name [dict get $app_config bsp]
if {![dict exists $::config bsps]} {
_error "BSP configuration missing" "The 'bsps' section is not found in the configuration."
} elseif {![dict exists [dict get $::config bsps] $bsp_name]} {
_error "BSP configuration missing" "No configuration found for BSP '$bsp_name' in the 'bsps' section."
} else {
_info "Configuring BSP '$bsp_name' for application '$app_name'."
}
} else {
set bsp_config [dict create]
set bsp_config [dict set bsp_config target_cpu $cpu]
@@ -280,6 +287,7 @@ proc _create_app {app_name app_config platform_name is_vitis} {
set bsp_cfg [dict get $app_config bsp_config]
set bsp_config [dict merge $bsp_config [dict create config $bsp_cfg]]
}
_info "Creating BSP $bsp_name for Application $app_name ..."
_configure_bsp $bsp_name $bsp_config $platform_name $is_vitis
}