aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bind/basic.sv
blob: ce0d04c488b1cc2752af735992609cf6c4fcb0cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// A basic example of the bind construct

module foo (input logic a, input logic b, output logic c);
  // Magic happens here...
endmodule

module bar (input a, input b, output c);
  assign c = a ^ b;
endmodule

module top ();
  logic u, v, w;
  foo foo_i (.a (u), .b (v), .c (w));

  bind foo bar bound_i (.*);

  always_comb begin
    assert(w == u ^ v);
  end
endmodule