## Introduction This file will describe the xml of the vpd template file format used to describe the contents of a VPD image ## High Level Description The template VPD format is XML, used to describe the contents of a binary VPD image. The template file is fed into createVpd.py. It in turn interprets that XML, error checks it and creates a binary VPD image. The template consists of 3 levels * `` - information about the overall VPD image * `` - information about a record in `` * `` - information about a keyword contained in a `` The XML Hierarchy looks like the following: ``` xml .. .. ``` ## `` This section covers the required tags in the section of the template description The top level `` tag is required in all template files, whether it is a top level manifest description of a full image or simply a record level description. The tag requirements in the section depend upon usage. ### Tags included in the `` section `` Used to define the output name of the files created by the tool. This information is not stuck into the binary VPD image. If the special name of FILENAME is given, then the name of the top level manifest file will be used for the name on any output files. Can be used only once in the top level description Cannot be included in single record definitions `` Used to define the maximum size of the binary image. If the create image will exceede this size, an error is generated by the tool. Can be used only once in the top level description Cannot be included in single record definitions `` The hex value to be stuck in for the VD keyword in the VHDR Can be used only once in the top level description Cannot be included in single record definitions ``` xml .. ``` Defines the creation of a record within VPD. Please see the section on the `` tag for more information on valid fields and syntax When creating a top level VPD template, at least 1 `` must be defined. When creating a record only template description, only 1 `` tag can be used. It is not allowed to include different records in a record only template. A sample `` section would look like this: ``` xml simple 16kb 01 ``` ## `` The record tag is used to describe the information that will go into a VPD record. You can specify this information 3 different ways. * By defining the keywords to go in the record using the `` tag * By pointing to a different file with the `` tag. That file contains the record definition that uses the `` tag * By pointing to a fully created binary representation of the record using the `` tag One 1 of these 3 tags can be given at a time and the creation program checks to make sure that is the case. ``` xml ``` The name attribute is required in a `````` and must be 4 characters long. ### Tags included in the `` `` A text description of the contents/purpose of a record. Only 1 `` is allowed per record ``` xml .. ``` Defines a keyword within a record. Please see the `` section of the document for further descriptions. `` Contains the name or path and name to a file describing the record `` Contains the name or path and name to the binary version of a record. It is assumed that this file is correctly formatted and only minimally checked to make sure the record names match. A sample `` section would look like this: ``` xml The NAME record ``` The inclusion of a record tvpd file would look like this: ``` xml record-NAME.tvpd ``` The inclusion of a record binary file would look like this: ``` xml record-NAME.bin ``` ## `` The `` tag is used to describe the contents of a keyword within a record. ``` xml .. ``` The name attribute is required and only 2 characters long ### Tags included in the `` `` Contains the name or path and name to a file describing the keyword This tag is mutually exclusive from the ``, ``, `` and `` below `` A description of the contents of the keyword. Only 1 tag allowed per keyword. `` The format of the data in the `` tag. It can be three different values * hex * ascii * bin hex and ascii data are both specified within the `` tag. When using the bin type, the `` tag is a reference to a binary file that contains just data for the keyword `` The length of the keyword. If the data given is shorter than the keyword, the data will be right padded with zeros. If the data is longer than the ``, then an error is generated. `` The data to go into the keyword. It is checked to make sure it matches the format specified. For example, that hex data has only valid hex characters. Sample keyword sections would look like this: For hex data: ``` xml The name keyword hex 4 01AEF78DB ``` For ascii data: ``` xml The name keyword ascii 4 NAME ``` For bin data: ``` xml The name keyword bin 4 name.bin ``` The inclusion of a keyword ktvpdfile would look like this: ``` xml vini-nm.xml ``` ## Examples Please see the examples dir in this repo for complete representations multiple types of template files