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.
In a project, a worker 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
clean
create
.<authoring-model-suffix>
under the current working directory where ocpidev
is executed. 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>.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 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).
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 the descriptions below, 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 platforms in the OpenCPI User Guide.
Keywords for architectures supported by OpenCPI that can be specified
in the <target> argument to an option include isim, modelsim,
xsim, stratix4, stratix5, virtex5, virtex6, zynq,
zynq_is, spartan3adsp.
--hdl-library=<hdl-library>
hdl/ directory of the project
in which to operate on the worker. Valid values are
only one of: devices, cards, adapters.
See ocpidev-device(1)
for more information about this option.
--library=<component-library>, -l <component-library>
components directory
at the top level of a project.
-d <directory>
-v, --verbose
--exclude-platform=<platform>, -Q <platform>+
ExcludePlatforms= OWD attribute
in the OpenCPI Component Development Guide.
--only-platform=<platform>, -G <platform>+
OnlyPlatforms OWD attribute in
the OpenCPI Component Development Guide.
-A <directory>+
-I <directory>+
-L <language>
-O <file>+
.<authoring-language-suffix> file.
-P <hdl-platform>
devices/
library for the specified HDL platform in the project.
See ocpidev-device(1)
for more information about this option.
-S <component-spec>
-spec or <name>_spec
depending on what ocpidev finds in the specs directory
of the library or project (or libraries specified with the -y
option or other projects specified by the -D option when the
project that contains the worker was created).
-T <target>+
OnlyTargets OWD attribute in the OpenCPI
Component Development Guide.
-Y <primitive-library>+
-Z <target>+
ExcludeTargets OWD attribute in
the OpenCPI Component Development Guide.
-k
-y <component-library>+
-R <prereq-library>+
-W <worker>+
-V <worker>
-r <prereq-library>+
-C <core>+
-f
--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.
--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.
--optimimize
--hdl-platform=<hdl-platform>+
--hdl-target=<target>+
--global-scope
-local-scope is not used.
--json
--local-scope
--simple
--table
--simple or --json are not used.
-P <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>+
-P <hdl-platform-directory>
Create an HDL worker named myworker that implements
the component named mycomp. (If the worker is named
mycomp, you can omit the -S option because the default
component spec name is <worker-name>-spec.xml).
ocpidev create worker myworker.hdl -S mycomp-spec
Create a C++ RCC worker named mycomp that implements
the mycomp spec:
ocpidev create worker mycomp.rcc -L c++
In the worker’s directory, compile the worker’s source code:
ocpidev build worker
In the project that contains the worker, compile
the source code for the RCC worker named myworker
for the centOS7 platform:
ocpidev build worker myworker.rcc --rcc-platform=centos7
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:
ocpidev build worker myworker.rcc --hdl-rcc-platform=zynq
Inside the worker’s directory, remove the compiled
worker source code for the worker named myworker:
ocpidev clean worker
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 virtex6:
ocpidev utilization worker myworker --hdl-target virtex6
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