ocpidev-worker — manage an OpenCPI worker.
The worker noun represents an OpenCPI worker, which is a specific
implementation of a component with source code written according
to an OpenCPI authoring model. An authoring model represents
a way to implement a component in a specific language - for example,
C++ or VHDL - using a specific OpenCPI API between the component
and its execution environment.
A worker is described by an OpenCPI Worker Description (OWD), which is an XML file that specifies the component that the worker implements, the language used for its source code, and any additional property and port information that fine-tunes the component specification (OCS) for the worker.
A skeleton OpenCPI worker asset document is also created along with the skeleton OWD and other worker asset files to allow for worker documentation development to occur during the overall worker development process. Unless suppressed by an option, compiling the worker or the asset that contains it (e.g., project, library) also compiles its asset document into viewable HTML format. The chapter "Documenting OpenCPI Assets" in the OpenCPI Documentation Writer Guide provides more information about this feature and how to write a worker asset document.
In a project, a worker (along with its asset document) generally resides in its own directory within a component library. However, some authoring models allow multiple workers to reside in one worker directory.
The workers that implement a component usually reside in the same library as the component, although command options allow them to be created in different libraries or even different projects.
Several types of worker exist:
Verbs that can operate on a worker are:
build
--doc-only and --no-doc options to control
the asset document building function.
clean
--doc-only and --no-doc options to control
the asset document cleaning function.
create
.<authoring-model-suffix>
in the library specified in a -l, -h, or -P option or in the
library in which ocpidev create is run.
The general-purpose option -d <directory>
can be used to create the worker under a different directory.
Note that multiple workers that implement the same component must
have different names and at least one of the names must be different
from the name implied by the component specification.
delete
show
utilization
Within the worker’s directory are its OWD
(named <name>-<authoring-model-suffix>.xml), its worker
asset document (named the same as the OWD but with the .rst suffix
instead of .xml) and its primary source code file
(named <name>.<auth-model-language-suffix>, for example, .c, .cc
or vhd). The ocpidev create operation produces initial versions
of these files that can then be edited as necessary to produce the worker
implementation.
The ocpidev build operation creates additional files in a worker’s directory,
such as architecture-independent source code and XML files, in a directory
named gen, viewable HTML output from the worker document, in the
subdirectory gen/doc, and architecture-specific object
and binary files for the compilation target being built,
in a directory named target-<platform>; for example,
target-centos7 or target-xsim.
These are the files that the ocpidev clean operation removes.
For general information on how to develop a worker, see the chapters "Introduction to Worker Development" and "Developing Workers" in the OpenCPI Component Development Guide. For detailed information on the OpenCPI authoring models and how to use them to develop worker source code, see the OpenCPI RCC Development Guide, the OpenCPI HDL Development Guide, and the OpenCPI OpenCL Development Guide (OpenCL is currently an experimental authoring model). For information on how to develop worker documentation, see the chapter "Documenting OpenCPI Assets" in the OpenCPI Documentation Writer Guide.
Note that an asset’s name is implied by the directory you’re in when
you issue the ocpidev command. For workers, this means that you can
perform operations (verbs) on the worker without having to specify its
name when you issue the ocpidev command from inside the worker directory.
The ocpidev tool can also operate on a plural workers noun.
The syntax is:
ocpidev [<options>] [show|utilization] workers
The verbs that can be performed on the workers noun are:
show
show
formatting options can be specified.
utilization
utilization options can be specified.
In addition to the options common to all OpenCPI tools (see opencpi(1)), the options described below can be specified for operations on workers. In the following descriptions, a plus sign (+) after the option indicates that it can be specified more than once on the command line.
Keywords for platforms supported by OpenCPI that can be specified in the <platform> argument to an option can be found in the tables of supported systems and platforms in the OpenCPI User Guide.
Keywords for HDL architectures supported by OpenCPI that can be specified
in the <target> argument include isim, modelsim,
xsim, zynq, zynq_ultra, zynq_ise, spartan3adsp.
-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.
-A <directory>, --xml-include=<directory>+
-G <platform>, --only-platform=<platform>+
OnlyPlatforms OWD attribute in
the OpenCPI Component Development Guide.
-I <directory>, --include-dir=<directory>+
-L <language>, --language=<language>
O <file>, --other=<file>+
.<authoring-language-suffix> file.
P <hdl-platform>, --platform=<hdl-platform>
devices/
library for the specified HDL platform in the project.
See ocpidev-device(1)
for more information about this option.
-Q <platform>, --exclude-platform=<platform>+
ExcludePlatforms= OWD attribute
in the OpenCPI Component Development Guide.
-S <spec>, --spec=<spec>
ocpidev create operation
searches for a component spec whose name matches
the name of the worker being created. Use the -S
option to specify a different component spec name to search for.
The operation searches for a component spec in the component
directory in the same library as the worker, in the specs/ directory
in the same library as the worker (for backward compatibility with
earlier OpenCPI releases), in the top-level specs/ directory in the
project, and in other projects, if the --depend (-D) option
was specified when the project containing the worker/test was created.
-k, --keep
-y <component-library>, --comp-lib=<component-library>+
-R <prereq-library>, --rcc-static=<prereq-library>+
-V <slave-worker>, --slave-worker=<slave-worker>
-W <worker>, --worker=<worker>+
-r <prereq-library>, --rcc-dynamic=<prereq-library>+
-C <core>, --core=<core>+
-T <target>, --only-target=<target>+
OnlyTargets OWD attribute in the OpenCPI
Component Development Guide.
-Y <primitive-library>, --prim-lib=<primitive-library>+
-Z <target>, --exclude-target=<target>+
ExcludeTargets OWD attribute in
the OpenCPI Component Development Guide.
-f
--doc-only
--no-doc
--hdl-rcc-platform=<platform>+
--rcc-platform
<platform> is also not used), the current development software
platform is used as the single RCC platform used for building.
--optimize
--rcc-platform=<platform>+
--hdl-rcc-platform <platform>
is also not used), the current development software platform
is used as the single RCC platform used for building.
--hdl-platform=<hdl-platform>+
--hdl-target=<target>+
-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.
-P <hdl-platform-directory>, --platform=<hdl-platform-directory>
--format={table|latex}
table sends the information to stdout in tabular format.
Specifying latex bypasses stdout and writes all output to
utilization.inc files in the directories for the assets on
which it operates.
--hdl-platform=<platform>+
--hdl-target=<target>+
Create the skeleton files
for a C++ RCC worker named mycomp that implements
the mycomp spec:
ocpidev create worker mycomp.rcc
Create the skeleton files
for an HDL worker named fft_fast that implements the
fft component spec located in the component directory
fft.comp/fft-comp.xml in the same library as the worker.
ocpidev create worker fft_fast.hdl -S fft
In the worker’s directory, compile the worker’s source code and worker asset document:
ocpidev build worker
In the worker’s directory, compile the worker’s source code, but not its worker asset document:
ocpidev build worker --no-doc
In the project that contains the worker, compile
the source code for the RCC worker
named myworker for the adi_plutosdr0_32 platform
and generate the worker asset document:
ocpidev build worker myworker.rcc --rcc-platform=adi_plutosdr0_32
In the project that contains the worker, compile
the source code for the RCC worker
named myworker for the RCC platform side of the Zynq SoC chip family
and generate the worker asset document:
ocpidev build worker myworker.rcc --hdl-rcc-platform=zynq
Inside the worker’s directory, remove the compiled
worker source code and worker asset document for the worker
named myworker:
ocpidev clean worker
Inside the worker’s directory, remove the compiled
worker asset document for the worker named myworker
and do not remove the compiled worker source code:
ocpidev clean worker --doc-only
Display information about the current worker:
ocpidev show worker
Display information about all workers in all registered projects:
ocpidev show workers
Show FPGA resource usage information for a single HDL worker myworker using
build results from all platforms:
ocpidev utilization worker myworker
Show FPGA resource usage information for a single HDL worker myworker using
build results from the xsim platform:
ocpidev utilization worker myworker --hdl-platform xsim
Show FPGA resource usage information for all HDL workers in the current project or library:
ocpidev utilization workers
Show FPGA resource usage information for a single HDL worker named myworker using
build results from the HDL target named zynq_ultra:
ocpidev utilization worker myworker --hdl-target zynq_ultra
Inside the assets project’s components library, show
FPGA resource usage information for the complex_mixer HDL worker in the dsp_comps
component library using build results from all platforms:
ocpidev utilization worker complex_mixer.hdl -l dsp_comps
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 HDL Development Guide: https://opencpi.gitlab.io/releases/latest/docs/OpenCPI_HDL_Development_Guide.pdf
See the OpenCPI Platform Development Guide: https://opencpi.gitlab.io/releases/latest/docs/OpenCPI_Platform_Development_Guide.pdf
See the OpenCPI RCC Development Guide: https://opencpi.gitlab.io/releases/latest/docs/OpenCPI_RCC_Development_Guide.pdf
See the OpenCPI Documentation Writer Guide: https://opencpi.gitlab.io/releases/latest/docs/OpenCPI_Documentation_Writer_Guide.pdf