DeviceTree - schema介绍

GitHub - devicetree-org/dt-schema: Devicetree schema tools

Devicetree Schema Tools / 设备树模式工具

dtschema 模块包含使用 json-schema ( JSON Schema  )词汇表验证 Devicetree 模式的工具和模式数据。这些工具使用 DT 绑定模式文件验证 Devicetree 文件。工具还能验证 DT 绑定模式文件。模式文件采用与 JSON 兼容的 YAML 子集编写,具有人机可读性。

The dtschema module contains tools and schema data for Devicetree schema validation using the json-schema vocabulary. The tools validate Devicetree files using DT binding schema files. The tools also validate the DT binding schema files. Schema files are written in a JSON compatible subset of YAML to be both human and machine readable.

1,Data Model / 数据模型

要了解验证是如何工作的,就必须了解模式数据是如何组织和使用的。如果您正在阅读这篇文章,我想您已经熟悉 Devicetree 和 .dts 文件格式了。

在这个资源库中,你会发现两种数据文件:模式和元模式。

To understand how validation works, it is important to understand how schema data is organized and used. If you're reading this, I assume you're already familiar with Devicetree and the .dts file format.

In this repository you will find 2 kinds of data files; Schemas and Meta-Schemas.

Devicetree Schemas / 设备树模式

Found under ./dtschema/schemas

Devicetree 模式描述了 Devicetree 数据的格式。原始 Devicetree 文件格式非常开放,不限制数据的编码方式。所以,编写devietree时很容易犯错误。模式文件对可以放入 Devicetree 的数据施加了限制。

该资源库包含 "核心 "模式,其中包括 DT 规范中定义的 DT 属性以及 GPIO、时钟和 PHY 绑定等常见绑定。

该资源库不包含特定设备绑定。这些绑定目前与 Devicetree 文件(.dts)一起保存在 Linux 内核树中。

验证时,该工具将加载所有能找到的模式文件,然后遍历 Devicetree 的所有节点。对于每个节点,工具将确定哪些模式适用,并确保节点数据与模式约束相匹配。未通过模式测试的节点将显示错误。不匹配任何模式的节点会发出警告。

如何把下面xml转成dataframe,并且取出PB_SETUPFILE、ORIG_LOTID <?xml version="1.0"?> <MapData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:semi-org:xsd.E142-1.V0505.SubstrateMap_TDS E142-1-V0505-Schema-Extension.xsd urn:semi-org:xsd.E142-1.V0505.SubstrateMap_MWH E142-1-V0505-Schema-Extension.xsd urn:semi-org:xsd.E142-1.V0505.SubstrateMap E142-1-V0505-Schema.xsd" xmlns:tds="urn:semi-org:xsd.E142-1.V0505.SubstrateMap_TDS" xmlns="urn:semi-org:xsd.E142-1.V0505.SubstrateMap"> <Layouts> <Layout LayoutId="WaferLayout" DefaultUnits="mm" TopLevel="true"> <Dimension X="1" Y="1"/> <DeviceSize X="300" Y="300" Units="mm"/> <ChildLayouts> <ChildLayout LayoutId="DieMap"/> </ChildLayouts> </Layout> <Layout LayoutId="DieMap" DefaultUnits="mm" ProductId="0045"> <Dimension X="94" Y="92"/> <DeviceSize X="3.086" Y="3.127" Units="mm"/> <StepSize X="3.086" Y="3.127" Units="mm"/> </Layout> </Layouts> <Substrates> <Substrate SubstrateType="Wafer" SubstrateId="A002109_20"> <LotId>A002109</LotId> <CarrierType></CarrierType> <CarrierId></CarrierId> <SlotNumber>0</SlotNumber> <SubstrateNumber>92</SubstrateNumber> <GoodDevices>6824</GoodDevices> <SupplierName></SupplierName> <Status></Status> <AliasIds> <AliasId Type="SE_DESCRIPTOR" Value="A002109-092-20250925-160459"/> <AliasId Type="MWH_PROCESS_STEP" Value="FinalMerge"/> <AliasId Type="MWH_PROCESS_STEP_STATUS" Value="MERGE"/> <AliasId Type="PB_PROBERNAME" Value="MERGE"/> <AliasId Type="PB_SETUPFILE" Value="OQA_0045"/> <AliasId Type="PB_TESTSYSTEM" Value="NA"/> <AliasId Type="START_DATE_TIME" Value="2025-09-25 16:04:59"/> <AliasId Type="END_DATE_TIME" Value="2025-09-25 16:04:59"/> <AliasId Type="ORIG_LOTID" Value="A002109"/> <AliasId Type="FlatType" Value="N"/> <AliasId Type="SWT_JobName" Value="OQA_0045"/> <AliasId Type="MERGE_DATE" Value="2025-09-25"/> <AliasId Type="MERGE_TIME" Value="16:04:59"/> <AliasId Type="MapIndexID" Value="717"/> </AliasIds> </Substrate> </Substrates>
09-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值