ocpidev-device — manage an OpenCPI HDL device worker.
The hdl device noun represents an OpenCPI HDL device worker,
which is a special type of HDL application worker designed to
support specific external hardware attached to an HDL platform
or card, such as an ADC, flash memory or I/O device.
While an application worker is a component implementation that requires only abstracted data interfaces, an HDL device worker is an HDL component implementation written to the HDL authoring model that directly controls and attaches to a physical device. An HDL device worker generally implements the device manufacturer’s data sheet, providing access and visibility to the device’s native registers and capabilities. HDL device workers allow OpenCPI to use the devices attached to an HDL platform and are developed as part of enabling an HDL platform for OpenCPI. The OpenCPI Platform Development Guide provides details on how to develop an HDL device worker.
An HDL device worker can be supported by:
These support workers can be HDL platform-independent or HDL platform-specific.
An HDL device worker (and its support workers) are OpenCPI workers and are thus described by an OpenCPI Worker Description (OWD). For an HDL device worker:
clock_gen-spec) and must be
the OpenCPI-defined emulator-spec if the OWD describes
an HDL device emulator worker. The OpenCPI-defined OCSes are located in
the top-level specs/ directory of the core project.
An HDL subdevice worker OWD also specifies the device worker(s) that the HDL subdevice worker supports and how it connects to each supported HDL device worker.
The OpenCPI Platform Development Guide provides more information about the XML structure of HDL device worker, subdevice worker and emulator worker OWDs, while the OpenCPI HDL Development Guide provides information about the XML structure of an HDL worker OWD.
In a project, an HDL device worker resides in its own directory
<name>.hdl and can be located in the following places
depending on its intended use:
hdl/devices/. This library contains HDL device workers
that can be used on different HDL platforms and cards.
It can also contain RCC-based HDL device proxy workers, HDL
subdevice workers and HDL device emulator workers for one
or more HDL device workers in the library.
platforms/<hdl-platform>/devices/.
This library contains HDL device workers, proxies,
subdevices and emulators that function only on that platform.
hdl/cards/. This subdirectory
contains HDL device workers, proxies, subdevices and emulators
that are specific to or can only be used on cards,
rather than those that are generally useful on
different platforms and cards.
Verbs that can operate on an HDL device worker are:
build
clean
create
delete
Note that the utilization verb can be used with the worker noun to display
an HDL device worker’s FPGA usage statistics. See ocpidev-worker(1)
for more information.
Within the HDL device worker’s directory are the
OWD (named <name>.xml) and its primary source code file (named
<name>.vhd. The ocpidev create operation produces initial versions
of these files that can then be edited as necessary to produce the HDL device
worker implementation.
The ocpidev build operation for an HDL device worker creates additional
files in the 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-<hdl-platform>; for example, target-zed or target-xsim.
These are the files that the ocpidev clean operation removes.
Note that an asset’s name is implied by the directory you’re in when
you issue the ocpidev command. For HDL device workers, this means that you can
perform operations (verbs) on the HDL device worker without having to specify its
name when you issue the ocpidev command from inside the HDL device worker directory.
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>, -h <hdl-library>
hdl/ directory of the project
in which to operate on the HDL device worker.
Valid values are only one of: devices, cards, adapters.
-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>+
-C <core>+
-E <hdl-device>
-I <directory>+
-O <file>+
.vhd file.
-P <hdl-platform>
devices/
library for the specified HDL platform in the project.
-S <component-spec>
-T <target>+
OnlyTargets OWD attribute in the OpenCPI
Component Development Guide.
-U <hdl-device>+
-Y <primitive-library>+
-Z <target>+
ExcludeTargets OWD attribute in
the OpenCPI Component Development Guide.
-k
-y <component-library>+
At the top level of the project, create a platform-specific HDL
device worker named mydevworker that implements
the mydevcomp OCS and runs on the HDL platform myplatform.
(The OCS does not need to be specified on the command line if
the HDL device worker has the same name as the component spec.)
The HDL device worker directory mydevworker.hdl is created in the HDL
library /hdl/platforms/myplatform/devices/:
ocpidev create hdl device mydevworker.hdl -S mydevcomp-spec -P myplatform
At the top level of the project, create a platform-independent HDL device worker
named mydevcomp that implements the mydevcomp OCS.
The HDL device worker directory
mydevcomp.hdl is created in the HDL library hdl/devices/:
ocpidev create hdl device mydevcomp.hdl --hdl-library=devices
Inside the project’s hdl/devices/ directory, create a platform-independent
HDL emulator device worker named myemulator to support the HDL device
worker mydevice:
ocpidev create hdl device myemulator.hdl -E mydevice -S emulator-spec
Inside the project’s hdl/devices/ directory, create a platform-independent
HDL subdevice worker named mysubdevice to support the HDL device
worker mydevice:
ocpidev create hdl device myemulator.hdl -U mydevice
Inside the HDL device worker’s directory, compile its source code:
ocpidev build hdl device
Inside the hdl/devices/ directory in the project, compile
the source code for the HDL device worker
named mydevice for the zed and xsim platforms:
ocpidev build device mydevice.hdl --hdl-platform=zed --hdl-platform=xsim
Inside the directory for the HDL device worker
named mydevice for the myplatform platform
(hdl/platforms/myplatform/devices/mydevice.hdl/),
compile the device worker’s source code for
for the Zynq HDL architecture:
ocpidev build hdl device mydevice.hdl --hdl-target=zynq
Inside the HDL device worker’s directory, remove the compiled
source code for the HDL device worker named mydevice:
ocpidev clean hdl device