Compare commits

...
2 Commits
Author SHA1 Message Date
Gatsby Van af260c1610 docs(platform/xilinx): update path descriptions in documentation 2024-11-06 00:33:15 +08:00
Gatsby Van caa636018b refactor: make paths relative to current working directory
- Allows configuration files to be placed in separate folders, with paths in config files now relative to the config file's location.
- Added `cd /d "%~dp0"` at the beginning of the `.bat` template to ensure paths are based on the script's location, enhancing portability and consistency.
2024-11-06 00:32:04 +08:00
3 changed files with 11 additions and 7 deletions
+7 -5
View File
@@ -44,7 +44,7 @@
- **project_name**: 项目名称,例如 `"demo"`。
- **version**: 项目版本,例如 `"0.0.0"`。
- **hw_design**: 硬件设计文件(`.hdf` 或 `.xsa` 文件)路径(相对配置文件路径),例如 `"demo_v0.0.0.hdf"`。
- **hw_design**: 硬件设计文件(`.hdf` 或 `.xsa` 文件)路径(相对档案工作路径),例如 `"demo_v0.0.0.hdf"`。
### *fsbl_patch* (TODO)
@@ -172,7 +172,7 @@
}
```
- **sources**: 源文件列表,应为相对当前配置文件的路径,可使用通配符。例如,`"src/*"` 会将配置文件所在目录下的 `src` 文件夹中的所有文件复制或链接到相应工程目录下的 `src` 文件夹中。
- **sources**: 源文件列表,可使用通配符。例如,`"src/*"` 会将当前工作路径下的 `src` 文件夹中的所有文件复制或链接到相应工程目录下的 `src` 文件夹中。
- **target_cpu**: 目标 CPU ID[^2];
- **os**: 操作系统类型[^1],必须与 BSP/Domain 匹配;
- **language**: 编程语言,"C" 或 "C++";
@@ -188,12 +188,12 @@
- `compiler-misc`: 其他编译器选项;
- `compiler-optimization`: 编译优化选项;
- `linker-misc`: 链接器选项;
- `linker-script`: 链接脚本路径;
- `linker-script`: 链接脚本路径[^3];
- `define-compiler-symbols`: 自定义的编译器宏定义符号列表;
- `undef-compiler-symbols`: 要取消定义的符号列表;
- `include-path`: 包含文件路径;
- `include-path`: 包含文件路径[^3];
- `libraries`: 需要链接的库;
- `library-search-path`: 库搜索路径;
- `library-search-path`: 库搜索路径[^3];
以下配置添加了一个名为 `demo_app` 的 Application 工程,该工程没有指定 BSP/Domain 但能够通过 `bsp_lib` 和 `bsp_config` 自动生成一个名为 `standalone_ps7_cortexa9_0` 的 BSP/Domain 工程。
@@ -239,3 +239,5 @@
[^1]: 具体可配置项取决于对应 IDE 版本;
[^2]: 具体可选 CPU ID 取决于硬件型号;
[^3]: 相对对应工程的文件夹的路径;
+2 -2
View File
@@ -437,10 +437,10 @@ _info "Working at $ws"
set config_file_id [open $config_file r]
set config_data [read $config_file_id]
close $config_file_id
set root [file dirname [file normalize $config_file]]
set root [pwd]
set config [json::json2dict $config_data]
set project_name [dict get $config project_name]
set hw_file [file normalize [file join [file dirname $config_file] [dict get $config hw_design]]]
set hw_file [file normalize [file join $root [dict get $config hw_design]]]
_info "Starting process: $function"
_info "Project name: $project_name"
+2
View File
@@ -1,4 +1,6 @@
@echo off
cd /d "%~dp0"
set "platform=xilinx"
set "platform_ver=2019.1"
set "work_dir=%~dp0build"