Adds design source files to the current project.
The tool searches the current directory for any header files included in the
design source. To use header files stored in other directories, use the
-cflags option to include those directories to the
add_files [OPTIONS] <src_files>
<src_files>lists one or more supported source files.
- Specify the JSON file to be used for RTL blackbox. The information in this file is used by the HLS compiler during synthesizing and running C/C++ and co-simulation. See Adding RTL Blackbox Functions for more information.
- A string with any GCC compilation options.
- A string with any desired simulation compilation options.
Flags specified with this option are only applied to simulation compilation,
which includes C/C++ simulation and RTL co-simulation, not synthesis
compilation. This option does not impact the
- Specifies any files used as part of the design test bench.
These files are not synthesized. They are used when simulation is run by the
Do not use the
-tboption when adding source files for the design. Use separate
add_filescommands to add design files and simulation files.
Add three design files to the project.
add_files a.cpp add_files b.cpp add_files c.cpp
Add multiple files with a single command line.
add_files "a.cpp b.cpp c.cpp"
-tb option to add test
bench files to the project. This example adds multiple files with a single command,
- The test bench
- All data files read by the test bench:
add_files -tb "a_test.cpp input_stimuli.dat out.gold.dat"
If the test bench data files in the previous example are stored in a separate directory (for example
test_data), the directory can be added to the project in place of the individual data files.
add_files -tb a_test.cpp add_files -tb test_data