Open tcsunhao opened 5 months ago
The introduction of individual “conditions” element or something like that can be implemented in a backward compatible way.
Here is one NXP manifest dependency example:
NXP manifest schema: sdk_manifest_v3.14.txt
See line 1661: <complexType name="componentDependenciesType">
Moving component dependencies directly into component description body is relatively easy to implement, however that will break backward and forward compatibility for several tools, in particular :
uVision, CMSIS-Toolbox, packchk: all share the same C++ RTE Model
Arm DS , IAR Embedded Workbench (Java/Eclipse RTE Model)
MDK Arm CMSIS csolution VS Code Extension
Readability can be improved by applying the following rules when constructing conditions:
Here is an example of readable conditions:
<component Cclass="Device" Cgroup="SDK Drivers" CSub="common" Cversion="2.4.0" condition="Device.SDK_Drivers.common">
<!-- component body -->
</component>
<!-- ... -->
<conditions>
<condition id="Device.SDK_Drivers.common">
<description> Dedicated condition for Device.SDK Drivers.common component</description>
<require condition="Device.SDK_Drivers.common_Device"/>
<require condition="Device.SDK_Drivers.common_Toolchain"/>
<!-- component dependencies -->
<require condition="Device.SDK_Drivers.common_Dependencies_Require"/>
<require condition="Device.SDK_Drivers.common_Dependencies_Accept"/>
<require condition="Device.SDK_Drivers.common_Dependencies_Deny"/>
</condition>
<condition id="Device.SDK_Drivers.common_Device">
<description> Optional device condition to enable Device.SDK Drivers.common component</description>
<require Dname="MIMXRT1064*"/>
</condition>
<condition id="Device.SDK_Drivers.common_Toolchain">
<description> Toolchain condition to enable Device.SDK Drivers.common component or its files </description>
<accept Tcompiler="ARM"/>
<accept Tcompiler="GCC"/>
</condition>
<condition id="Device.SDK_Drivers.common_Dependencies_Require">
<description> Required dependencies by Device.SDK Drivers.common component </description>
<require Class="CMSIS" Cgroup="Core"/>
<require Class="Device" Cgroup="SDK Drivers" Csub="clock"/>
</condition>
<condition id="Device.SDK_Drivers.common_Dependencies_accept">
<description> Accepted dependencies by Device.SDK Drivers.common component </description>
<accept Class="Device" Cgroup="SDK Utilities" Csub="assert"/>
<accept Class="Device" Cgroup="SDK Utilities" Csub="assert_lite"/>
</condition>
<condition id="Device.SDK_Drivers.common_Dependencies_deny">
<description> Denied dependencies by Device.SDK Drivers.common component</description>
<deny Class="CMSIS" Cgroup="SDK Drivers" CSub="another_common"/>
</condition>
</conditions>
Thanks @edriouk, your suggestions indeed improve the readability to a certain extent. About op3, honestly, we cannot guarantee about that.
In existing pdsc, the dependencies of components are specified through "condition" mechanism. On component level, just a condition refer id is provided, the detailed definitions of the condition are defined in "conditions" element. If user needs to know details of one component dependency, he needs to search up to down, down to up, many times in the "conditions" to figure out the whole picture which is quite inconvenient. When he/she tries to update it, sometimes it is possible. Here is snap of existing NXP DFP conditions:![image](https://github.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/assets/3381677/d09a526f-3c33-49aa-b673-5d313cf1079a)
Suggested way to improve:
The same way applies to "files" element.
We believe that an human easily readable and editable pdsc files can better populate OCP solution especially in directly github repo daily development usage (not ready packs way)
GitHub repository as pack source