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. For more information about the structure of an OCS, see the chapter "Component Specifications" in the OpenCPI Component Development Guide.
A skeleton OpenCPI component asset document is also created along with the component specification to allow for component documentation development to occur during the overall component development process. Unless suppressed by an option, building the component or the asset that contains it builds viewable HTML output of the component asset document. The chapter "Documenting OpenCPI Assets" in the OpenCPI Documentation Writer Guide provides more information about this feature and how to write a component asset document.
In a project, a component and its asset document reside in
a <name>.comp directory located in a component library.
The component spec is named <name>-comp.xml.
The component asset document has the same name as the component spec
but with the .rst suffix instead of .xml.
In general, the workers that implement the component and any component unit test suites 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 addition to the options common to all OpenCPI tools (see opencpi(1)), the options described below can be specified for operations on components. In the following descriptions, a plus sign (+) after the option indicates that it can be specified more than once on the command line.
-h <hdl-library>, --hdl-library=<hdl-library>
hdl
directory located at the top level of a project. Valid values
are one of: devices, cards, adapters.
See ocpidev-device(1)
for more information about this option.
-l <component-library>, --library=<component-library>
components directory
at the top level of a project.
-k, --keep
-n, --no-control
-f
-P <hdl-platform-directory>, --platform=<hdl-platform-directory>
global-scope
--local-scope is not used.
--json
--local-scope
--simple
--table
--simple or --json are not used.
Create a skeleton component specification and component asset document for a
component named mycomp. The component specification and component asset document
are placed in the default location components/mycomp.comp/.
ocpidev create component mycomp
Create a skeleton component specification and component asset document
named mycomp in the library named
myutilcomps. The component specification and the component asset document
are placed in the mycomp.comp directory in the myutilcomps sublibrary
within the components library (components/myutilcomps/mycomp.comp/):
ocpidev create component mycomp -l myutilcomps
Delete all files for a component named mydevcomp
from the devices library underneath the project’s hdl library
(deletes the directory hdl/devices/mydevcomp.comp/):
ocpidev delete component mydevcomp -h devices
Inside the MyProject project, display information about
the component named mycomp in the
myutilcomps sublibrary in the components library:
ocpidev show component mycomp -l components/myutilcomps
Inside the assets project, display information about
the component named mydevcomp in the devices library
in the hdl library:
ocpidev show component mycomp -h 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
Component specifications created in earlier OpenCPI releases
reside in a specs/ directory located either in a component library
or at the top level of a project and are named
<name>-spec.xml or <name>_spec.xml.
The following option to the ocpidev create operation for a component is
provided for backward compatibility with the component spec structure used
in earlier OpenCPI releases:
ocpidev create component <name> --file-only
The --file-only option directs ocpidev to create a component spec named
<name>-spec.xml in a specs/ directory in a component library.
No component asset document is created.
See the main web site: https://www.opencpi.org
See the OpenCPI Component Development Guide: https://opencpi.gitlab.io/releases/latest/docs/OpenCPI_Component_Development_Guide.pdf
See the OpenCPI Documentation Writer Guide: https://opencpi.gitlab.io/releases/latest/docs/OpenCPI_Documentation_Writer_Guide.pdf