compile_c - 2024.2 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
UG835
Release Date
2024-11-13
Version
2024.2 English

Compile C code into RTL

Syntax

compile_c [‑force] [‑quiet] [‑verbose] <objects>

Usage

Name Description
[-force] Force generate product state regeneration
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution
<objects> The objects which need C to RTL conversion

Description

In IP cores that are imported from AMD Vivado™ HLS, the compile_c command detects C, C++, and SystemC files and converts those files to RTL for synthesis by the Vivado Design Suite.

This lets you use Vivado HLS to describe IP cores in a high-level language, like C or C++ rather than RTL.

When HLS-based IP cores are generated, they only deliver the C source. When the HLS-based IP is synthesized, either in the out-of-context flow, or with the top-level design, the compile_c command launches Vivado HLS to convert the C source files into RTL, and import the resulting RTL sources back into the design prior to synthesis.

Note: The compile_c command is automatically called by the Vivado Design Suite when it encounters IP with C code from the Vivado HLS system. You should not need to manually call this command.

Arguments

-force - (Optional) Force regeneration of the RTL in the HLS-based IP.

-quiet - (Optional) Execute the command quietly, returning no messages from the command. The command also returns TCL_OK regardless of any errors encountered during execution.
Note: Any errors encountered on the command-line, while launching the command, will be returned. Only errors occurring inside the command will be trapped.
-verbose - (Optional) Temporarily override any message limits and return all messages from this command.
Note: Message limits can be defined with the set_msg_config command.

<objects> - (Required) Specify the IP objects in the current project to convert files from C, C++, or SystemC to RTL code.

Example

The following example gets the C-language files from the specified IP object and converts them to RTL:

compile_c [get_ips instance_name]

See Also