Name

ocpidev-primitive — manage an OpenCPI HDL primitive.

Synopsis

ocpidev [<options>] <verb> hdl primitive {core|library} <name>

DESCRIPTION

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:

  • An 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.
  • An 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
Compile the HDL primitive source code, creating files and directories as required.
clean
Remove all generated and compiled files for the HDL primitive.
create
Create the named HDL primitive, creating files and directories as required.
delete
Remove all directories and files associated with the named HDL primitive.

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.

OPTIONS

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.

Options That Apply to All Operations (Verbs) on HDL Primitives

-d <directory>
Specify the directory in which the command should be run. Analogous to the -C option in the POSIX make command.
-v, --verbose
Describe what is happening in command execution in more detail.

Options When Creating HDL Primitives

--exclude-platform=<platform>, -Q <platform>+
Do not build the HDL primitive for the specified HDL platform.
--only-platform=<platform>, -G <platform>+
Only build the HDL primitive for the specified HDL platform.
-T <target>+
Only build the HDL primitive for the specified HDL architecture.
-Z <target>+
Do not build the HDL primitive for the specified HDL architecture.
-k
Keep files and directories created after an HDL primitive creation fails. Normally, all such files and directories are removed on any failure.

Options When Creating HDL Primitive Cores

-B <file>
Specify the name of a prebuilt core file created by a vendor-specific core generator tool; for example, a *.ngc or *.qxp file.
-M <module>
Specify the name of the top module at the core. If this option is not specified, the default module name used is the name of the core specified in the <name> argument to the create operation.

Options When Creating HDL Primitive Libraries

-H
Specify that the HDL primitive library being created does not depend on any other HDL primitive libraries. By default, HDL primitive libraries are assumed to depend on the built-in HDL primitive libraries (currently bsv, fixed_float, ocpi and util).
-J
Specify that the HDL primitive library being created should not be elaborated when built. Using this option results in a slight time savings at the cost of catching elaboration errors in the build process.

Options When Deleting HDL Primitives

-f
Force deletion: do not ask for confirmation when deleting an HDL primitive. Normally, you are asked to confirm a deletion.

Options When Building HDL Primitives

--hdl-platform=<platform>+
Build the HDL primitive for the specified platform.
--hdl-target=<target>+
Build the HDL primitive for the specified HDL architecture. If HDL targets are specified and no HDL platforms are specified, containers are not built for HDL assemblies or component unit test suites.

EXAMPLES

  1. 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
  2. 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
  3. 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
  4. Inside the project, remove the compiled HDL primitive code for all HDL primitives in the project:

    ocpidev clean hdl primitives

BUGS

See https://www.opencpi.org/report-defects

RESOURCES

See the main web site: https://www.opencpi.org

SEE ALSO

ocpidev(1) ocpidev-assembly(1) ocpidev-build(1) ocpidev-clean(1) ocpidev-create(1) ocpidev-delete(1) ocpidev-device(1) ocpidev-library(1) ocpidev-platform(1) ocpidev-project(1) ocpidev-worker(1)

COPYING

Copyright (C) 2020 OpenCPI www.opencpi.org. OpenCPI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.