ocpidev-primitive — manage an OpenCPI HDL primitive.
The hdl primitive noun represents an OpenCPI primitive, which is an HDL asset
at a level that is lower than HDL workers and that can be used as building
blocks for workers or other primitives. HDL primitives are useful when there is lower-level code
that is reused or shared in different HDL workers or when workers import
non-OpenCPI code modules that should be left untouched.
An HDL primitive is either:
HDL primitive library, which is a collection of HDL
primitive modules compiled from source code into a library
from which individual modules can be used as needed by HDL workers or other primitives or cores.
HDL primitive core, which is a single primitive module that can be
built and/or synthesized from source code, imported from a third party
presynthesized and possibly encrypted, or generated by vendor-specific
FPGA synthesis tools like Xilinx CoreGen and Altera MegaWizard.
In a project, an HDL primitive resides in its own directory <name> in the
hdl/primitives/ subdirectory. An HDL primitive cannot have the same
name as a worker. The directory contains the HDL primitive’s XML file, <primitive-name>.xml, and
its source code (Verilog or VHDL, with possible pre-built files
for HDL primitive cores). The ocpidev create operation for an HDL primitive
creates an initial version of the <primitive-name>.xml file and, for primitive libraries, an initial <name>_pkg.vhd file. These can then be edited as
necessary for the HDL primitive.
For details on how to develop an HDL primitive, see the chapter "HDL Primitives" in the OpenCPI HDL Development Guide.
Verbs that can operate on an HDL primitive are:
build
clean
create
delete
Note that an asset’s name is implied by the directory you’re in when
you issue the ocpidev command. For an HDL primitive, this means that you can
perform operations (verbs) on the HDL primitive without having to specify its
name when you issue the ocpidev command from inside the HDL primitive directory.
The ocpidev tool can also operate on a plural primitives noun.
The syntax is:
ocpidev [<options>] [build|clean] primitives
where the build and clean operations and any specified options
are applied to all HDL primitives in a project.
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_ultra, zynq_ise, spartan3adsp.
-d <directory>
-v, --verbose
--exclude-platform=<platform>, -Q <platform>+
--only-platform=<platform>, -G <platform>+
-T <target>+
-Z <target>+
-k
-B <file>
-M <module>
create operation.
-H
bsv, fixed_float, ocpi and util).
-J
-f
--hdl-platform=<platform>+
--hdl-target=<target>+
Inside the project or the project’s hdl/primitives/ directory,
create an HDL primitive core named myprimcore where the top module
of the core will be mytopmod:
ocpidev -M mytopmod create hdl primitive core myprimcore
Inside the project or the project’s hdl/primitives/ directory,
create an HDL primitive library named myprimlib
and indicate that it does not depend on any other primitive
libraries:
ocpidev -H create hdl primitive library myprimlib
In the project that contains the HDL primitive, compile
the source code for the HDL primitive core named myprimcore
for the Zynq architecture:
ocpidev build hdl primitive core myprimcore --hdl-target=zynq
Inside the project, remove the compiled HDL primitive code for all HDL primitives in the project:
ocpidev clean hdl primitives