ocpidev-protocol — manage an OpenCPI protocol.
The protocol noun represents an OpenCPI protocol,
which describes the set of messages that are allowed to flow
between the ports of components.
A protocol is described by an OpenCPI Protocol Specification (OPS), which is an XML file that describes the set of messages defined in the protocol, as well as some top-level attributes for the protocol. Operation elements in the OPS describe the messages that can be used, while argument elements describe the individual fields of a message. A protocol is specified in the port element of a component spec (OCS). In a connection between component ports, the specs of both ports, in their port elements, refer to the same OPS. At present, a protocol consists of only the OPS XML file.
For more information about a protocol’s XML structure, see the chapter "Protocol Specifications" in the OpenCPI Component Development Guide.
In a project, a protocol resides in a specs/ directory
located either in a component library or at the top level of a project
and is named <name>-prot.xml. Note that protocols with older
naming formats like <name>_protocol.xml and <name>-protocol.xml
also exist; for example, some of the protocols in the built-in
OpenCPI core project (../projects/core/specs/) use these formats.
Verbs that can operate on a protocol are:
create
delete
In the descriptions below, a plus sign (+) after the option indicates that it can be specified more than once on the command line.
--hdl-library=<hdl-library>
hdl/
directory located at the top level of a project.
--library=<component-library>, -l <component-library>
components directory
at the top level of a project.
-d <directory>
specs/ directory of the project
instead of the specs/ directory of a component library.
The -l and -p options specify the location
of the protocol. When neither one of these options
is used, the location is the components library
and thus is an error if other component libraries exist.
Create a protocol spec with the name myprotocol. The protocol
spec will be placed in the default location components/specs/:
ocpidev create protocol myprotocol
Create a protocol named myprotocol in the component library
named myutilcomps. The protocol spec will be placed in
the specs directory in myutilcomps sublibrary
within the components library (components/myutilcomps/specs/):
ocpidev create protocol myprotocol -l myutilcomps
Inside the project MyProject, create a protocol spec with the
name myprotocol in the project’s specs/ directory.
The protocol spec will be placed in MyProject/specs/:
ocpidev create protocol myprotocol -p
Delete a protocol named MyAdapterProtocol from
a project’s adapters library (deletes it
from hdl/adapters/specs/):
ocpidev delete protocol MyAdapterProtocol --hdl-library=adapters