Languages

CommunityCategory: XMODELAdding simulator-specific options to the ‘xmodel’ command
SA Support Team Staff asked 4 years ago

Sometimes, I need to add some options to the 'xmodel' command that are specific to our SystemVerilog simulator. The '-allowredefinition' option for the NC-Verilog command 'ncverilog' or 'irun' can be such an example. I know the 'xmodel' command supports standard options such as '-f' for providing a command file input and '-D' for defining a macro. But sometimes I need to pass some special options to the SystemVerilog host simulator that are not supported by the 'xmodel' command. Is there a way?

1 Answers
Best Answer
SA Support Team Staff answered 4 years ago

Yes, you can pass the simulator-specific options to the 'xmodel' command using the '--elab-option' or '--sim-option' options. The 'xmodel' command runs each simulation job in two steps, elaboration and simulation. And with the '--elab-option' and '--sim-option' options, you can pass additional options to each simulator command performing the respective step. For information on the simulator commands issued by the 'xmodel' command, please refer to this Q&A posting.

For example, let's say you want to pass an '-allowredefinition' option to 'ncverilog' during its elaboration step. For your information, this option allows redefinition of the same-named module. You can add this option by enclosing it within the '--elab-option' and '--' tokens, as shown below:

xmodel tb.sv --top tb --simtime 10ns --sim ncverilog --elab-option -allowredefinition --

As another example, let's say you want to pass a '-gdb' option to 'ncverilog' during its simulation step. This option runs the simulation under the 'gdb' debugger. This time, you can add this option by enclosing it within the '--sim-option' and '--' tokens:

xmodel tb.sv --top tb --simtime 10ns --sim ncverilog --sim-option -gdb --

Please note that you can also pass vendor-specific options made of multiple tokens by listing them between the '--elab-option' and '--' tokens or between the '--sim-option' and '--' tokens. Here is an example of passing '-allow redefinition' and '+ncerror+CUVMPW' options to the elaboration command and passing '-gdb' option to the simulation command:

xmodel tb.sv --top tb --simtime 10ns --sim ncverilog --elab-option -allowredefinition +ncerror+CUVMPW -- --sim-option -gdb --

You can check whether the options are being supplied as intended with the '--command' option, which displays the commands and options issued by the 'xmodel' command:

xmodel tb.sv --top tb --simtime 10ns --sim ncverilog --elab-option -allowredefinition +ncerror+CUVMPW -- --sim-option -gdb -- --command
SA Support Team Staff asked 4 years ago

'xmodel' 명령을 사용할때 특정 SystemVerilog 시뮬레이터에서 지원하는 옵션을 추가하고 싶을때가 있습니다. 예를 들면, NC-Verilog의 'ncverilog' 또는 'irun' 명령의 '-allowredefinition' 같은 옵션을 들 수 있겠습니다. 'xmodel' 명령이 커맨드 파일 입력을 지정하는 '-f' 옵션이나 매크로를 정의하는 '-D' 옵션 등의 표준 옵션들은 자체 지원하는 것을 알고 있지만, 가끔은 특정 SystemVerilog 시뮬레이션에서 지원하는 옵션들을 사용해야 하는 경우가 있습니다. 이들을 추가하는 방법이 있나요?

1 Answers
Best Answer
SA Support Team Staff answered 4 years ago

Yes, you can pass the simulator-specific options to the 'xmodel' command using the '--elab-option' or '--sim-option' options. The 'xmodel' command runs each simulation job in two steps, elaboration and simulation. And with the '--elab-option' and '--sim-option' options, you can pass additional options to each simulator command performing the respective step. For information on the simulator commands issued by the 'xmodel' command, please refer to this Q&A posting.

For example, let's say you want to pass an '-allowredefinition' option to 'ncverilog' during its elaboration step. For your information, this option allows redefinition of the same-named module. You can add this option by enclosing it within the '--elab-option' and '--' tokens, as shown below:

xmodel tb.sv --top tb --simtime 10ns --sim ncverilog --elab-option -allowredefinition --

As another example, let's say you want to pass a '-gdb' option to 'ncverilog' during its simulation step. This option runs the simulation under the 'gdb' debugger. This time, you can add this option by enclosing it within the '--sim-option' and '--' tokens:

xmodel tb.sv --top tb --simtime 10ns --sim ncverilog --sim-option -gdb --

Please note that you can also pass vendor-specific options made of multiple tokens by listing them between the '--elab-option' and '--' tokens or between the '--sim-option' and '--' tokens. Here is an example of passing '-allow redefinition' and '+ncerror+CUVMPW' options to the elaboration command and passing '-gdb' option to the simulation command:

xmodel tb.sv --top tb --simtime 10ns --sim ncverilog --elab-option -allowredefinition +ncerror+CUVMPW -- --sim-option -gdb --

You can check whether the options are being supplied as intended with the '--command' option, which displays the commands and options issued by the 'xmodel' command:

xmodel tb.sv --top tb --simtime 10ns --sim ncverilog --elab-option -allowredefinition +ncerror+CUVMPW -- --sim-option -gdb -- --command