はじめに
昨日は、xvlog コマンドについてみてみました。今日は、xsc コマンドについて、みていきます。
xsc コマンド
xsc コマンドを引数無しに実行すると、下記のようなメッセージが表示されます。
エラーメッセージとしては、Cファイルを指定ないよ。ということです。
Multi-threading is on. Using 6 slave threads. ERROR: [XSIM 43-4272] No C files specified. Usage: xsc [options] file... (Switches with double dash '--' can also be used with a single dash '-') Vivado Simulator xsc options: --gcc_compile_options arg Supply an additional option to the compiler. Multiple -gcc_compile_options switches can be used. --gcc_link_options arg Supply an additional option to the linker. Multiple -gcc_link_options switches can be used. -c [ --compile ] Generate the object files only from the source C files. The link stage is not run. -f [ --file ] arg Read additional options from the specified file -h [ --help ] Print this help message -i [ --input_file ] arg List of input files (one file per switch) for compiling or linking --shared Run only the linking stage to generate the shared library (.so) from the object files. --shared_systemc Run only the linking stage to generate the shared library (.dll) for SystemC from the object files. --static Run only the linking stage to generate a static library (.a) for SystemC from the object files. --exe Create executable for standalone SystemC. --version Print version of the Vivado Simulator xsc being used --print_gcc_version Print version of the C compiler used internally --debug Debug SystemC modules. This option is relevant only when used together with -exe option, otherwise is ignored --gcc_path Print path of the C compiler used internally --mt arg (=auto) Specifies the number of sub-compilation jobs which can be run in parallel. Choices are: auto: automatic n: where n is an integer greater than 1 off: turn off multi-threading (Default:auto) -o [ --output ] arg Specify the name of output binary. Works with --shared, --shared_systemc, --exe options only. Default for shared library is <current_directory>/xsim.dir/work/xsc/dpi.so --work arg Specify the work directory where the outputs (object files) shall be placed . Default is <current_directory>/xsim.dir/work/xsc --lib arg Specify the logical library directories that will be read. Default is <current_directory>/xsim.dir/wo rk/xsc --cppversion arg Set the CPP version; currently CPP 11 and 14 supported. Default is 11 -v [ --verbose ] arg Specify verbosity level for printing messages. Allowed values are: 0, 1, 2 (Default:0) --gcc_version arg (=auto) gcc version to be picked up from tps directory in installation. Must match gcc install directory name i.e. gcc-6.2.0. Default value "auto" --sv_stub_dir arg Specify the Directory for SystemC stub Files created from SystemVerilog Modules SystemC-to-SystemVerilog Stub Generation Options: --sc_stub_gen Automate SC-to-SV stub and stub library generation for SystemC files. --output_stub_file arg Specify the output stub path and filename. Examples:
その後に、指定できるオプションは、下記のものです。各オプションについてみています。
--gcc_compile_options arg --gcc_link_options arg -c [ --compile ] -f [ --file ] arg -h [ --help ] -i [ --input_file ] arg --shared --shared_systemc --static --exe --version --print_gcc_version --debug --gcc_path --mt arg (=auto) -o [ --output ] arg --work arg --lib arg --cppversion arg -v [ --verbose ] arg --gcc_version arg (=auto) --sv_stub_dir arg --sc_stub_gen --output_stub_file arg
--gcc_compile_options arg
--gcc_link_options arg
GCCのリンク・オプションを指定します。
-c [ --compile ]
コンパイルのみを行う。リンクは実行しない。
-f [ --file ] arg
オプションを指定したファイルを指定する
-h [ --help ]
ヘルプ
-i [ --input_file ] arg
コンパイルするファイルを列挙したファイルを指定する。
--shared
共有ライブラリを生成する。
--shared_systemc
SystemC用の共有ライブラリを生成する。
--static
静的ライブラリを生成する。
--exe
スタンドアロンのSystemCの実行プログラムを生成する。
--version
xscコマンドのバージョンを表示します。
--print_gcc_version
GCCのバージョンを表示します。
--debug
SystemCのデバッグを有効にする。
--gcc_path
GCCのパスを指定する。
--mt arg (=auto)
コンパイルをマルチスレッドで実行する。off を指定すると、シングルスレッドで実行する。
-o [ --output ] arg
生成されるファイル名を指定する。
--work arg
WORKライブラリを指定する
--lib arg
xscコマンドが生成するライブラリパスを指定します。デフォルトでは、
<current_directory>/xsim.dir/work/xsc
--cppversion arg
C++のバージョンを指定する。指定できるのは、11 or 14
-v [ --verbose ] arg
メッセージのレベル(0, 1, 2)を指定する。デフォルトは、2。 --gcc_version arg (=auto)
--sv_stub_dir arg
SystemVerilogから生成されるSystemCのStubファイルを生成するディレクトリを指定する。
--sc_stub_gen
SystemCから生成されるSystemVerilog のStubファイルを生成するディレクトリを指定する。
--output_stub_file arg
スタブファイルのパスを指定する。
おわりに
今日は、xscコマンドについて、見てみました。
xscコマンドは、C/C++だけでなく、SystemCもサポートしていることがわかりました。