ocpidev-component — manage an OpenCPI component.
The component noun represents an OpenCPI component, which is a defined
function that has properties that configure and control it and ports
where data messages are sent and received and which support protocols
that define the allowed/expected messages.
A component is described by an OpenCPI Component Specification (OCS), which is an XML file that defines the component’s properties and ports and usually references one or more OpenCPI Protocol Specifications (OPS) in the port definitions. An OCS is also referred to as a "component spec" or "spec file". The OCS establishes the interface requirements for all worker implementations of the component in any authoring model. At present, a component consists of only the OCS XML file. For more information about a component’s XML structure, see the chapter "Component Specifications" in the OpenCPI Component Development Guide.
In a project, a component resides in a specs/ directory located
either in a component library or at the top level of a project and
is named <component-name>-spec.xml.
Note that components with an older naming format <name>_spec.xml also exist;
for example, some of the components in the built-in OpenCPI projects assets and core.
In general, the workers that implement the component and any unit tests created for the component reside in the same library as the component, although a component’s worker implementations can be created in different libraries or even different projects.
Verbs that can operate on a component are:
create
delete
show
The ocpidev tool can also operate on a plural components noun.
The syntax is:
ocpidev [<options>] show components
where show is the only valid verb and the options that can be specified
are -d <directory> and the show verb options.
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 component. When neither one of these options
is used, the location is the components library
and thus is an error if other component libraries exist.
-n
-f
global-scope
--json
--local-scope
--simple
--table
-P <hdl-platform-directory>
Create a component with the name mycomp. The component
specification will be placed in the default location components/specs/:
ocpidev create component mycomp
Create a component named mycomp in the library named
myutilcomps. The component specification will be placed in
the specs directory in myutilcomps sublibrary
within the components library (components/myutilcomps/specs/):
ocpidev create component mycomp -l myutilcomps
Delete a component named mydevcomp from the
devices library underneath the project’s hdl library
(deletes it from hdl/devices/specs/):
ocpidev delete component mydevcomp --hdl-library=devices
Inside the assets project, display information about
the component named capture in the specs directory
of the base_comps library in the components library:
ocpidev show component capture -l components/base_comps
Inside the assets project, display information about
the component named qadc in the specs directory
of the devices library in the hdl library:
ocpidev show component qadc --hdl-library=devices
Inside the assets project, display information about
all components that are local to the assets project:
ocpidev show components --local-scope
Display information about all components local
to the project /home/workspace/MyProject:
ocpidev show components --local-scope -d /home/workspace/MyProject