-
Notifications
You must be signed in to change notification settings - Fork 18
/
gates.xsd
93 lines (76 loc) · 3.09 KB
/
gates.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?xml version="1.0" encoding="UTF-8" ?>
<!-- gates.xsd
Schema definition for sboxgates state files.
Copyright (c) 2020 Marcus Dansarie
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="gate_type_type">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:enumeration value="FALSE" />
<xs:enumeration value="AND" />
<xs:enumeration value="A_AND_NOT_B" />
<xs:enumeration value="A" />
<xs:enumeration value="NOT_A_AND_B" />
<xs:enumeration value="B" />
<xs:enumeration value="XOR" />
<xs:enumeration value="OR" />
<xs:enumeration value="NOR" />
<xs:enumeration value="XNOR" />
<xs:enumeration value="NOT_B" />
<xs:enumeration value="A_OR_NOT_B" />
<xs:enumeration value="NOT_A" />
<xs:enumeration value="NOT_A_OR_B" />
<xs:enumeration value="NAND" />
<xs:enumeration value="TRUE" />
<xs:enumeration value="NOT" />
<xs:enumeration value="IN" />
<xs:enumeration value="LUT" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="gatenum_type">
<xs:restriction base="xs:nonNegativeInteger">
<xs:maxExclusive value="500" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="function_type">
<xs:restriction base="xs:hexBinary">
<xs:length value="1" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="bit_type">
<xs:restriction base="xs:nonNegativeInteger">
<xs:maxExclusive value="8" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="input_type">
<xs:attribute name="gate" type="gatenum_type" use="required" />
</xs:complexType>
<xs:complexType name="output_type">
<xs:attribute name="bit" type="bit_type" use="required" />
<xs:attribute name="gate" type="gatenum_type" use="required" />
</xs:complexType>
<xs:complexType name="gate_type">
<xs:sequence>
<xs:element name="input" type="input_type" minOccurs="0" maxOccurs="3" />
</xs:sequence>
<xs:attribute name="type" type="gate_type_type" use="required" />
<xs:attribute name="function" type="function_type" />
</xs:complexType>
<xs:complexType name="state">
<xs:sequence>
<xs:element name="output" type="output_type" minOccurs="1" maxOccurs="8" />
<xs:element name="gate" type="gate_type" minOccurs="1" maxOccurs="500" />
</xs:sequence>
</xs:complexType>
<xs:element name="gates" type="state" />
</xs:schema>