Skip to content

Instantly share code, notes, and snippets.

@Laksen
Created July 15, 2018 12:04
Show Gist options
  • Save Laksen/dc3fdf65a7eb6bb1186c46381215ac55 to your computer and use it in GitHub Desktop.
Save Laksen/dc3fdf65a7eb6bb1186c46381215ac55 to your computer and use it in GitHub Desktop.
VPR XML Schemas
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="named_value">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="port">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="port_rotation_map">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="port_group">
<xs:sequence>
<xs:element name="port" type="port" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="block">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="inputs">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="port" type="port"/>
<xs:element name="port_rotation_map" type="port_rotation_map"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="outputs" type="port_group"/>
<xs:element name="clocks" type="port_group"/>
<xs:element name="attributes">
<xs:complexType>
<xs:sequence>
<xs:element name="attribute" type="named_value" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="parameters">
<xs:complexType>
<xs:sequence>
<xs:element name="parameter" type="named_value" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="block" type="block"/>
</xs:choice>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="instance" type="xs:string"/>
<xs:attribute name="mode" type="xs:string"/>
</xs:complexType>
<xs:element name="block" type="block"/>
</xs:schema>
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="channel">
<xs:attribute name="chan_width_max" type="xs:int" use="required"/>
<xs:attribute name="x_min" type="xs:int" use="required"/>
<xs:attribute name="y_min" type="xs:int" use="required"/>
<xs:attribute name="x_max" type="xs:int" use="required"/>
<xs:attribute name="y_max" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="x_list">
<xs:attribute name="index" type="xs:int" use="required"/>
<xs:attribute name="info" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="y_list">
<xs:attribute name="index" type="xs:int" use="required"/>
<xs:attribute name="info" type="xs:int" use="required"/>
</xs:complexType>
<xs:simpleType name="switch_type">
<xs:restriction base="xs:string">
<xs:enumeration value="mux"/>
<xs:enumeration value="tristate"/>
<xs:enumeration value="pass_gate"/>
<xs:enumeration value="short"/>
<xs:enumeration value="buffer"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="timing">
<xs:attribute name="R" type="xs:decimal"/>
<xs:attribute name="Cin" type="xs:decimal"/>
<xs:attribute name="Cout" type="xs:decimal"/>
<xs:attribute name="Tdel" type="xs:decimal"/>
</xs:complexType>
<xs:complexType name="sizing">
<xs:attribute name="mux_trans_size" type="xs:int" use="required"/>
<xs:attribute name="buf_size" type="xs:decimal" use="required"/>
</xs:complexType>
<xs:complexType name="switch">
<xs:choice maxOccurs="unbounded">
<xs:element name="timing" type="timing"/>
<xs:element name="sizing" type="sizing"/>
</xs:choice>
<xs:attribute name="id" type="xs:int" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="switch_type"/>
</xs:complexType>
<xs:complexType name="segment_timing">
<xs:attribute name="R_per_meter" type="xs:decimal"/>
<xs:attribute name="C_per_meter" type="xs:decimal"/>
</xs:complexType>
<xs:complexType name="segment">
<xs:sequence>
<xs:element name="timing" type="segment_timing" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:int" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="pin">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="ptc" type="xs:int" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="pin_class">
<xs:sequence>
<xs:element name="pin" type="pin" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="type" type="pin_type" use="required"/>
</xs:complexType>
<xs:complexType name="block_type">
<xs:sequence>
<xs:element name="pin_class" type="pin_class" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:int" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="width" type="xs:int" use="required"/>
<xs:attribute name="height" type="xs:int" use="required"/>
</xs:complexType>
<xs:simpleType name="pin_type">
<xs:restriction base="xs:string">
<xs:enumeration value="OPEN"/>
<xs:enumeration value="OUTPUT"/>
<xs:enumeration value="INPUT"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="grid_loc">
<xs:attribute name="x" type="xs:int" use="required"/>
<xs:attribute name="y" type="xs:int" use="required"/>
<xs:attribute name="block_type_id" type="xs:int" use="required"/>
<xs:attribute name="width_offset" type="xs:int" use="required"/>
<xs:attribute name="height_offset" type="xs:int" use="required"/>
</xs:complexType>
<xs:simpleType name="node_type">
<xs:restriction base="xs:string">
<xs:enumeration value="CHANX"/>
<xs:enumeration value="CHANY"/>
<xs:enumeration value="SOURCE"/>
<xs:enumeration value="SINK"/>
<xs:enumeration value="OPIN"/>
<xs:enumeration value="IPIN"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="node_direction">
<xs:restriction base="xs:string">
<xs:enumeration value="INC_DIR"/>
<xs:enumeration value="DEC_DIR"/>
<xs:enumeration value="BI_DIR"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="loc_side">
<xs:restriction base="xs:string">
<xs:enumeration value="LEFT"/>
<xs:enumeration value="RIGHT"/>
<xs:enumeration value="TOP"/>
<xs:enumeration value="BOTTOM"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="node_loc">
<xs:attribute name="xlow" type="xs:int" use="required"/>
<xs:attribute name="ylow" type="xs:int" use="required"/>
<xs:attribute name="xhigh" type="xs:int" use="required"/>
<xs:attribute name="yhigh" type="xs:int" use="required"/>
<xs:attribute name="side" type="loc_side"/>
<xs:attribute name="ptc" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="node_timing">
<xs:attribute name="R" type="xs:decimal" use="required"/>
<xs:attribute name="C" type="xs:decimal" use="required"/>
</xs:complexType>
<xs:complexType name="node_segment">
<xs:attribute name="segment_id" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="node">
<xs:choice maxOccurs="unbounded">
<xs:element name="loc" type="node_loc"/>
<xs:element name="timing" type="node_timing"/>
<xs:element name="segment" type="node_segment"/>
</xs:choice>
<xs:attribute name="id" type="xs:int" use="required"/>
<xs:attribute name="type" type="node_type" use="required"/>
<xs:attribute name="direction" type="node_direction"/>
<xs:attribute name="capacity" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="edge">
<xs:attribute name="src_node" type="xs:int" use="required"/>
<xs:attribute name="sink_node" type="xs:int" use="required"/>
<xs:attribute name="switch_id" type="xs:int" use="required"/>
</xs:complexType>
<xs:element name="rr_graph">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="channels">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="channel" type="channel"/>
<xs:element name="x_list" type="x_list"/>
<xs:element name="y_list" type="y_list"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="switches">
<xs:complexType>
<xs:sequence>
<xs:element name="switch" type="switch" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="segments">
<xs:complexType>
<xs:sequence>
<xs:element name="segment" type="segment" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="block_types">
<xs:complexType>
<xs:sequence>
<xs:element name="block_type" type="block_type" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="grid">
<xs:complexType>
<xs:sequence>
<xs:element name="grid_loc" type="grid_loc" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rr_nodes">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="node" type="node"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="rr_edges">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="edge" type="edge"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="tool_name" type="xs:string"/>
<xs:attribute name="tool_version" type="xs:string"/>
<xs:attribute name="tool_comment" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment