aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bind/hier.sv
blob: fd3bc62b865e5189c590794f97b9b10a6a88d3c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// An example of the bind construct using a hierarchical reference starting with $root

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));

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

bind $root.top.foo_i bar bound_i (.*);