ocpixml
Description
The ocpixml command-line tool is used to manage the artifact
description XML that exists inside an OpenCPI artifact
file generated by the ocpidev build operation.
It can also be used to parse any standalone XML file.
The artifact description XML describes the contents of
an executable binary (an artifact resulting from building
an RCC or HDL worker or a component unit test)
or a “bitstream” executable (an artifact resulting from
building an HDL assembly)
and is attached during the build process to the generated
executable or bitstream (.bitz or .gz) artifact file.
The ocpixml tool can be used to manipulate
the artifact description XML attached to an artifact file.
For convenience, options can occur anywhere in the command.
When invoked without options and verbs, ocpixml displays help information.
Usage
$ ocpixml
Usage for ocpixml (executed from /home/user/opencpi/build/autotools/target-rocky9/staging/bin/ocpixml):
Options are:
Long name Letter Datatype Multiple? Description
log-level l ULong No <log-level>.
set log level during execution, overriding OCPI_LOG_LEVEL
top t String Yes <top-element>.
specify allowable top-level elements
attribute a String Yes <attribute>.
specify attribute to print, one per line
if name starts with ?, it is optional (blank line output)
otherwise its an error if attr is missing
if no attributes are specified top element name is printed
silent s Bool No <silent>.
Long options are of the form: --<long-name>[=<value>]
Short options are of the form: -<letter>[<value>] or -<letter> <value>
Boolean options have no value; their presence indicates 'true'. Other types require values.
This program performs functions relating to the XML inside artifact files.
Usage is: ocpixml [<options>] <command> <file> [<file2>]
Commands are:
get - extract the XML from the file to standard output.
strip - remove the XML from the file while copying artifact to <file2>.
add - add the XML file <file2> to the file, in place. file2 can be '-' for standard input.
parse - parse top-level attributes from an XML file
Examples
Add the content of the XML file named
MyFile.xmlto the artifact file namedmyartifact1.bitzand only output exit status:ocpixml -s add myartifact1.bitz MyFile.xml
Add standard input to the artifact file named
myartifact1.gz:ocpixml add myartifact1.gz -
Extract the XML metadata from the artifact file named
myartifact1.bitzand write it tostdout:ocpixml get myartifact1.bitz
Parse the top-level
element1and the attributesattr1andattr2from the XML file namedMyFile.xmland write them tostdout. Generate an error ifelement1andattr1are not present. Generate a blank line ifattr2is not present:ocpixml -t element1 -a attr1 -a ?attr2 parse MyFile.xml
Remove the XML metadata from the artifact file named
myartifact1.gzand copy the results to the artifact file namedmynewartifact1.gz:ocpixml strip myartifact1.gz mynewartifact1.gz