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

File IO Operations: Multiple arguments to fdisplay

Verilog Examples

Runnable example from the Verilog File IO Operations tutorial (Multiple arguments to fdisplay)

Open in IDE
testbench.v
module tb;
  reg [3:0] a, b, c, d;
  integer fd;

  initial begin
    a = 4'ha;
    b = 4'hb;
    c = 4'hc;
    d = 4'hd;

    fd = $fopen("my_file.txt", "w");
    $fdisplay(fd, a, b, c, d);
    $fclose(fd);
  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.