Vengineerの戯言

人生は短いけど、長いです。人生を楽しみましょう!

Xilinx xsimを調べる(その1)

はじめに

Xilinx の xsim (HDLシミュレータ)が面白いのでいろいろと調べ始めました。

そして、あたしの「競争戦略」は、下記のような感じです。。。

xsim の前に実行するコマンド

xsim コマンドでシミュレーションする前に、各ファイルを

が必要です。

今日は、xvlog コマンドについて、見ていきます。明日は、xsc コマンドについて、見ていきます。xvhdl コマンドは 使わないので、このブログには残しません。必要な人は、自分で調べてみてください。

xvlog コマンド

xvlog コマンドを引数無しに実行すると、下記のようなメッセージが表示されます。

エラーメッセージとしては、HDLファイルを指定していないよ。ということです。

ERROR: [XSIM 43-3273] No HDL file(s) specified.
ERROR: [XSIM 43-3273] No HDL file(s) specified.
Usage: xvlog [options] file...
(Switches with double dash '--' can also be used with a single dash '-')

Vivado Simulator xvlog options:
  -f [ --file ] arg          Read additional options from the specified file
  -h [ --help ]              Print this help message
  --version                  Print the compiler version
  --initfile arg             Use user defined simulator init file to add to or
                             override the settings provided by the default
                             xsim.ini file
  -L [ --lib ] arg           Specify search libraries for the instantiated
                             design units in a Verilog or Mixed language
                             design. Use -L|--lib for each search library. The
                             format of the argument is <name>[=<dir>] where
                             <name> is the logical name of the library and
                             <dir> is an optional physical directory of the
                             library
  --nolog                    Suppress log file generation
  --log arg                  Specify the log file name. Default is <application
                             name>.log
  --prj arg                  Specify Vivado Simulator  project file containing
                             one or more entries of 'vhdl|verilog <work lib>
                             <HDL file name>'
  --relax                    Relax strict HDL language checking rules
  -v [ --verbose ] arg       Specify verbosity level for printing messages.
                             Allowed values are: 0, 1, 2 (Default:0)
  --incr                     Enable incremental parsing and compilation check
                             point
  --nosignalhandlers         Run with no XSim specific signal handlers.
                             Necessary when 3rd party software such as
                             antivirus, firewall is generating signals as part
                             of its normal usage, causing XSim Compiler and
                             Kernel executables to trap these signals and
                             report a crash.
  -i [ --include ] arg       Specify directories to be searched for files
                             included using Verilog `include. Use -i|--include
                             for each specified search directory
  -d [ --define ] arg        Define Verilog macros. Use -d|--define for each
                             Verilog macro. The format of the macro is
                             <name>[=<val>] where <name> is name of the macro
                             and <value> is an optional value of the macro
  --sourcelibdir arg         Directory for Verilog source files of uncompiled
                             modules. Use -sourcelibdir|--sourcelibdir
                             <dirname> for each source directory.
  --sourcelibext arg         File extension for Verilog source files of
                             uncompiled modules. Use -sourcelibext|--sourcelibe
                             xt <file extension> for source file extension.
  --sourcelibfile arg        Filename of a Verilog source file which has
                             uncompiled modules. Use -sourcelibfile|--sourcelib
                             file <filename>.
  --noname_unnamed_generate  Generate name for an unnamed generate block
  --uvm_version arg          Specify the uvm version(default: 1.2)
  --work arg                 Specify the work library. The format of the
                             argument is <name>[=<dir>] where <name> is the
                             logical name of the library and <dir> is an
                             optional physical directory of the library
  --encryptdumps             Encrypt parse dump of design units
  --sv                       Compile input files in System Verilog mode

Examples:
  xvlog file1.v file2.v
  xvlog -work worklib file1.v file2.v
  xvlog -prj files.prj

その後に、指定できるオプションは、下記のものです。各オプションについてみています。

  -f [ --file ] arg  
  -h [ --help ]  
  --version     
  --initfile arg  
  -L [ --lib ] arg  
  --nolog
  --log arg 
  --prj arg
  --relax
  -v [ --verbose ] arg 
  --incr 
  --nosignalhandlers 
  -i [ --include ] arg 
  -d [ --define ] arg 
  --sourcelibdir arg 
  --sourcelibext arg 
  --sourcelibfile arg
  --noname_unnamed_generate
  --uvm_version arg
  --work arg
  --encryptdumps 
  --sv

-f [ --file ] arg

arg に指定したファイル名の中に、Verilog HDL/SystemVerilog ファイル名を列挙します。

-h [ --help ]

ヘルプファイル。上記のメッセージを表示します。

--version

下記のようなバージョンを表示します。

Vivado Simulator v2021.2

--initfile arg

Use user defined simulator init file to add to or override the settings provided by the default xsim.ini file

xsim.init ファイル内でデフォルト値を変更する場合に使います。xsim.ini は自分で用意する必要があるようですが。

-L [ --lib ] arg

コンパイルしたものをストアするライブラリ名を指定します。

--nolog

ログを表示しない

--log arg

ログファイル名を指定します

--prj arg

Specify Vivado Simulator project file containing one or more entries of 'vhdl|verilog '

プロジェクトファイルを指定します。プロジェクトファイルは、次のようなフォーマットになっています。

sv work src/top.sv

最初がファイルのフォーマット(sv: systemverilog, verilog, vhdl)、2番目がライブラリ名、最後がファイルのパス名になっています。

--relax

Relax strict HDL language checking rules

これでどのくらいチェックが緩くなるのだろうか?

-v [ --verbose ] arg

メッセージのレベル(0, 1, 2) を指定します。デフォルトは、2 です。

--incr

インクリメンタル・コンパイル

--nosignalhandlers

Xsim が持っているシグナルハンドラを置き換えるときに使います

-i [ --include ] arg

`include ディレクトリで指定したファイルがあるディレクトリ(パス)名を指定します。

-d [ --define ] arg

`define ディレクトリでマクロを定義する感じで、コマンドラインからマクロを定義します。

--sourcelibdir arg

ソースコードディレクトリ(パス)名を指定します。

--sourcelibext arg

ソースコードの拡張子を指定します。

--sourcelibfile arg

ソースコードのファイル名を指定します。

--noname_unnamed_generate

名前が付いていない generate 文の名前を指定します。

--uvm_version arg

UVM のバージョンの指定します。デフォルトは、1.2 です。1.2 しか入っていません。

--work arg

WORKライブラリを指定します。

--encryptdumps

ダンプファイルの暗号化?

--sv

ファイルをSystemVerilogとしてパースします。指定しないと、Verilog HDLとしてパースします。

おわりに

今日は、xvlog コマンドについて、みてみました。明日は、xsc コマンドについて、みてみます。