Compare commits

...
7 Commits
6 changed files with 57 additions and 26 deletions
+9 -1
View File
@@ -153,6 +153,14 @@
这是因为源文件在导入时被直接链接或复制到了工程目录中,未触发 C++ Indexer 更新索引。此外,新版本的 Vitis 没有直接的命令或 UI 选项来重建或更新索引。最简单的解决方法是随意打开一个源文件,在任意行末输入一个空格并保存。IDE 会自动删除该空格,不会对源文件造成任何更改,但此操作可触发索引的自动更新。
2. 在 Windows 上运行 `.bat` 构建脚本时可能会出现以下错误:
```plaintext
Failed to create file symbolic link using mklink: 你没有足够的权限执行此操作。
```
这是因为 `tcl` 在 Windows 上只能为文件夹创建符号链接,无法直接为文件创建链接。为文件创建符号链接需要使用 `mklink` 命令,该命令要求管理员权限。解决方法是以管理员身份运行 `.bat` 脚本。
## 待办事项
- [x] 支持 Xilinx SDK 的 XSCT 接口
@@ -163,4 +171,4 @@
## 贡献指南
如果您对该项目有任何改进意见或功能需求,欢迎提交 issue 或 pull request,commit 格式请参考 [Angular convention](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional).
如果您对该项目有任何改进意见或功能需求,欢迎提交 issue 或 pull request,commit 格式请参考 [Angular convention](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit).
+12 -12
View File
@@ -30,16 +30,16 @@ else
endif
ifndef PROJECT
$(error "PROJECT variable needs to be set")
@$(error "PROJECT variable needs to be set")
endif
ifndef PLATFORM
$(error "PLATFORM variable needs to be set")
@$(error "PLATFORM variable needs to be set")
endif
ifndef BUILD_DIR
$(error "BUILD_DIR variable needs to be set")
@$(error "BUILD_DIR variable needs to be set")
endif
ifndef CONFIG_FILE
$(error "CONFIG_FILE variable needs to be set")
@$(error "CONFIG_FILE variable needs to be set")
endif
ifndef SCRIPT_DIR
CURRENT_FILE := $(lastword $(MAKEFILE_LIST))
@@ -66,15 +66,15 @@ endif
PHONY += all
ifneq ($(wildcard $(BUILD_LOCK)),)
all:
$(call print_build_type,$(PLATFORM))
@$(call print_build_type,$(PLATFORM))
$(MAKE) --no-print-directory build
$(call print,Done ($(notdir $(BUILD_DIR))))
@$(call print,Done ($(notdir $(BUILD_DIR))))
else
all:
$(call print_build_type,$(PLATFORM))
@$(call print_build_type,$(PLATFORM))
$(MAKE) --no-print-directory project
$(MAKE) --no-print-directory build
$(call print,Done ($(notdir $(BUILD_DIR))))
@$(call print,Done ($(notdir $(BUILD_DIR))))
endif
project: $(PLATFORM)_project
@@ -93,18 +93,18 @@ sdkopen: $(PLATFORM)_sdkopen
PHONY += clean
ifneq ($(wildcard $(BUILD_LOCK)),)
clean:
$(call print,Cleaning sdk build uploaded to board)
@$(call print,Cleaning sdk build uploaded to board)
$(MAKE) --no-print-directory $(PLATFORM)_sdkclean
else
clean:
$(call print,No project found, cleaning dummy files)
@$(call print,No project found, cleaning dummy files)
$(MAKE) --no-print-directory reset
endif
# Remove the whole build directory
PHONY += reset
reset: $(PLATFORM)_reset
$(call print,[Delete] $(BUILD_DIR))
$(call remove_dir,$(BUILD_DIR))
@$(call print,[Delete] $(BUILD_DIR))
@$(call remove_dir,$(BUILD_DIR))
.PHONY: $(PHONY)
+3 -1
View File
@@ -135,6 +135,7 @@
"target_cpu": "<cpu_id>",
"os": "<os_type>",
"language": "<language>",
"template": "<app_template>",
"bsp": "<bsp_name>",
"bsp_lib": {
"<lib_name>": {
@@ -175,7 +176,8 @@
- **target_cpu**: 目标 CPU ID[^2];
- **os**: 操作系统类型[^1],必须与 BSP/Domain 匹配;
- **language**: 编程语言,"C" 或 "C++";
- *bsp*: 应用所使用的 BSP 名称,若未指定则会自动创建名为 `<os>_<cpu_id>` 的 BSP/Domain.
- *template*: 所使用的应用模板名称,不指定则默认为对应语言的 “Empty Application”;
- *bsp*: 应用所使用的 BSP 名称,若未指定则会自动创建名为 `<app_name>_bsp` 的 BSP/Domain.
- *bsp_lib*: 针对自动创建的 BSP/Domain 所使用库的配置,与 [bsps](#bsps) 中 `libs` 对应;
- *bsp_config*: 针对自动创建的 BSP/Domain 配置与 [bsps](#bsps) 中 `config` 对应;
- *mem_layout*: 应用内存布局,包括堆栈大小和堆大小等;
+1
View File
@@ -31,6 +31,7 @@
"target_cpu": "<cpu_id>",
"os": "<os_type>",
"language": "<language>",
"template": "<app_template>",
"bsp": "<bsp_name>",
"bsp_lib": {
"<lib_name>": {
+26 -4
View File
@@ -81,6 +81,7 @@ proc _configure_bsp {bsp_name bsp_config platform_name is_vitis} {
if {$is_vitis} {
bsp regenerate
platform generate -domains "$bsp_name"
} else {
regenbsp -bsp $bsp_name
projects -build -type bsp -name $bsp_name
@@ -247,13 +248,33 @@ proc _update_app_build_config {app_name build_type build_config is_vitis} {
proc _create_app {app_name app_config platform_name is_vitis} {
set cpu [dict get $app_config target_cpu]
set os [dict get $app_config os]
set lang [dict get $app_config language]
set sources [dict get $app_config sources]
set bsp_name "${os}_${cpu}"
set bsp_name "${app_name}_bsp"
set lang [dict get $app_config language]
if { $lang ne "C" && $lang ne "C++" } {
_error "Unsupport language" "language should be C or C++"
}
if { [dict exists $app_config template] } {
set template [dict get $app_config template]
} elseif { !$is_vitis } {
set template "Empty Application"
} elseif { $lang eq "C++" } {
set template "Empty Application (C++)"
} else {
set template "Empty Application(C)"
}
# 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]
@@ -266,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
}
@@ -279,7 +301,7 @@ proc _create_app {app_name app_config platform_name is_vitis} {
-os $os \
-lang $lang \
-sysproj $::project_name \
-template "Empty Application($lang)"
-template "$template"
_info "Application '$app_name' created for Vitis."
} else {
sdk createapp -name $app_name \
@@ -288,7 +310,7 @@ proc _create_app {app_name app_config platform_name is_vitis} {
-proc $cpu \
-os $os \
-lang $lang \
-app "Empty Application"
-app "$template"
_info "Application '$app_name' created for Xilinx SDK."
}
+6 -8
View File
@@ -8,7 +8,7 @@ define tcl_util
endef
xilinx_sdkopen:
$(call print,Launching IDE...)
@$(call print,Launching IDE...)
@if [ "$(call check_command,vitis)" = "y" ]; then \
if [ "$(XILINX_VITIS_CLASSIC)" = "y" ]; then \
vitis -classic -workspace=$(BUILD_DIR); \
@@ -23,20 +23,18 @@ xilinx_sdkopen:
PHONY += xilinx_sdkbuild
xilinx_sdkbuild:
$(call print,[Build] SDK projects in $(BUILD_DIR))
@$(call print,[Build] SDK projects in $(BUILD_DIR))
$(call tcl_util, build) $(HIDE)
PHONY += xilinx_sdkclean
xilinx_sdkclean:
$(call print,[Delete] SDK artefacts from $(BUILD_DIR))
@$(call print,[Delete] SDK artefacts from $(BUILD_DIR))
$(call tcl_util, clean_project) $(HIDE)
xilinx_project:
@$(call print,Creating and configuring the IDE project)
$(call mk_dir,$(BUILD_DIR))
$(call print,Creating and configuring the IDE project)
$(call tcl_util, create_project) $(HIDE)
xilinx_reset: xilinx_clean_all
xilinx_clean_all:
$(call remove_dir,.Xil) $(HIDE)
xilinx_reset:
$(call remove_dir,.Xil) $(HIDE)