Ready-to-run snippets

Code Examples

Ready-to-run Verilog, SystemVerilog, and UVM examples. Click any to open it live in the IDE.

← All examples

Command Line Arguments: $test$plusargs: Checking Whether an Argument Was Passed

SystemVerilog Testbench Components

Runnable example from the SystemVerilog Command Line Arguments tutorial ($test$plusargs: Checking Whether an Argument Was Passed)

Open in IDE
testbench.sv
module tb;
  initial begin
    if ($test$plusargs ("STANDBY"))
      $display ("STANDBY argument is found ...");
  
    if ($test$plusargs ("Standby"))
      $display ("Standby argument is also found ...");
  
    if ($test$plusargs ("STAND"))
      $display ("STAND substring is found ...");
  
    if ($test$plusargs ("S"))
      $display ("Some string starting with S found ...");
  
    if ($test$plusargs ("T"))
      $display ("Some string containing T found ...");
  
    if ($test$plusargs ("STAND_AT_EASE"))
      $display ("Can't stand any longer ...");
  
    if ($test$plusargs ("SUNSHADE"))
      $display ("It's too hot today ...");
  
    if ($test$plusargs ("WINTER"))
      $display ("No match.. ");
  end
endmodule
Admin mode — edit and delete controls are visible on each row. Use the IDE to add new snippets via File → Save as Snippet.