在 2023.2 版的全新 Vitis Unified IDE 中,不再生成 DeviceID 作为索引参数用于独立 BSP 驱动程序内的外设初始化。
在 Vitis Unified IDE 中,xparameter.h 文件不包含 DeviceID。在先前版本的 Vitis 中,许多外设驱动程序的 API 和示例代码都依靠 DeviceID 作为输入参数。以下截屏中的 zdma 驱动程序正是其中一个例子。

2023.2 版本的 zdma 驱动程序如下所示。
此全新 IDE 会定义 SDT 并使用新的 API 和示例代码,其中以 BaseAddress 作为输入参数。
要将应用从更低版本的 Vitis 移植到 Vitis 2023.2 Unified IDE,您需要更新应用中的 API。

更新步骤:
1. 在 Vitis Unified IDE 中打开已移植的应用组件
2. 右键单击使用 DeviceID 作为参数的函数名称,然后选中“Go to definition”(转至定义)

3. 将应用代码中当前的函数 API 替换为不使用 DeviceID 的函数 API。
为了与传统 Vitis IDE 支持的独立 BSP 保持兼容,可使用预编译来支持在传统 Vitis IDE 中使用 DeviceID 的场景,以及在 Vitis Unified IDE 中 DeviceID 不适用的场景。
您只需更改 API 并传递正确的参数。对应 BaseAddress 可在 xparameters.h 文件中找到。