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

Net Types: wire, wor and wand Resolution

Verilog Net Types

Two drivers on a wire, wor and wand net show how each net type resolves conflicts

Open in IDE
testbench.v
module tb;
  reg  d1, d2;
  wire w;
  wor  wo;
  wand wa;

  assign w  = d1;   assign w  = d2;
  assign wo = d1;   assign wo = d2;
  assign wa = d1;   assign wa = d2;

  initial begin
    d1 = 1;  d2 = 0;
    #1 $display("wire=%b wor=%b wand=%b", w, wo, wa);
  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.