SystemVerilog bind cover: assertions added without touching RTL, with what each bind did in one VCS run

SystemVerilog bind: Add Assertions Without Touching RTL, Tested on VCS

In short: The SystemVerilog bind statement places a checker inside a design module or interface from the outside, so you add assertions without editing the RTL. bind tav_req_ack tav_req_ack_sva u_sva (...) puts the checker into every instance of tav_req_ack. bind tav_req_ack : tav_tb.u_a ... puts it into one. The checker can connect to internal signals and parameters. In my run, one bind caught a late-ack bug in one of two instances.

Designers own the RTL. Verification engineers want assertions inside it. Those two facts collide on every project.

bind is how SystemVerilog settles it: the checker lives in your files, and the compiler places it inside the design for you. I built a small bench with a planted bug and ran every form of bind on VCS. Every result below is a line from that log.

A simple way to picture it

Think of a clip-on sensor for a machine. You fit it from the outside, it reads what’s happening inside, and nobody has to open the case or change the factory drawing.

The RTL is the factory drawing. A bound checker is the clip-on sensor: it sits inside the design’s hierarchy and sees its internal signals, but the RTL file never changes.

SystemVerilog bind measured on VCS: one bind puts a checker in every instance, one bind targets one instance, one binds into an interface; only the buggy instance failed, and UVM_ERROR counted 5 of 10 failures
Three bind lines, and where VCS placed each checker in one run

bind at a glance

You writeWhat you getShown in
bind tav_req_ack tav_req_ack_sva u_sva (...)the checker in every instance of the moduleparts 1, 2
.busy(busy_q) in the port lista checker port wired to an internal signalpart 1
#(.MAX_LAT(LAT + 1))a checker parameter set from the design’s own parameterpart 1
bind tav_req_ack : tav_tb.u_a ...the checker in that one instance onlypart 3
bind tav_req_if tav_if_sva ...a checker inside an interface (it must be an interface too)part 4
tav_tb.u_a.u_sva.n_failthe bound checker reached by its pathpart 5

The setup

tav_req_ack takes a request and answers with a one-cycle ack. Inside it has a busy_q flag and a counter, and neither is a port. The RTL has no assertions at all.

The testbench has two instances. u_a is normal. u_b has BUG_LATE = 1, which delays its ack by two extra cycles. The rule the checker enforces: after a request is taken, ack must come within MAX_LAT cycles.

property p_ack_in_time;
  @(posedge clk) disable iff (!rst_n)
    (req && !busy) |-> ##[1:MAX_LAT] ack;
endproperty

1. One bind, every instance

bind tav_req_ack tav_req_ack_sva #(.MAX_LAT(LAT + 1)) u_sva (
  .clk(clk), .rst_n(rst_n), .req(req), .ack(ack), .busy(busy_q));
[TAV_1] protocol checker bound at tav_tb.u_a.u_sva, MAX_LAT = 2
[TAV_1] protocol checker bound at tav_tb.u_b.u_sva, MAX_LAT = 2

One line of bind, two checkers. VCS placed u_sva inside both u_a and u_b, as if it had been typed into the RTL.

Two details matter here. The port list is read inside the design, so .busy(busy_q) reaches an internal signal that no port exposes. And LAT + 1 used the design’s own parameter: LAT is 1, so MAX_LAT came out as 2. If someone changes LAT, the checker follows.

2. The checker catches the bug

The test sent the same 5 requests to both instances.

"testbench.sv", 38: tav_tb.u_b.u_sva.a_ack_in_time: started at 45ns failed at 65ns
	Offending 'ack'
UVM_ERROR testbench.sv(41) @ 65: reporter [TAV_SVA] tav_tb.u_b.u_sva.a_ack_in_time: no ack within 2 cycles of the request

That pair of lines came 5 times, once per request, all from u_b. With a 10 ns clock, the request was taken at 45 ns and the window closed at 65 ns with no ack. u_a stayed silent.

The full path in each message, tav_tb.u_b.u_sva, tells you which instance broke. That’s one more reason to bind per module instead of writing a checker by hand for each instance.

3. One instance only

bind tav_req_ack : tav_tb.u_a tav_lat_probe u_probe (.*);
[TAV_3] latency probe bound at tav_tb.u_a.u_probe

The colon form names the module and then the instance path. The probe went into u_a and nowhere else. It’s handy for a checker that only makes sense for one instance, or for trying a new checker on one copy before rolling it out.

.* worked here because every probe port, clk, req and ack, has a signal with the same name inside tav_req_ack.

4. Binding into an interface

bind tav_req_if tav_if_sva u_if_sva (.clk(clk), .rst_n(rst_n), .req(req));
[TAV_4] interface checker bound at tav_tb.if_a.u_if_sva
[TAV_4] interface checker bound at tav_tb.if_b.u_if_sva

You can bind into an interface too, and the checker sits inside every instance of it. The catch: tav_if_sva has to be an interface itself. A module can’t be placed inside an interface, and VCS says so:

Error-[IIM] Illegal instantiation of module
testbench.sv, 22
"tav_if_mod_sva u_if_mod( .clk (clk),  .req (req));"
  Instantiation of module 'tav_if_mod_sva' is illegal.
  Interface "tav_req_if" has a module instantiation which is not allowed.

That error came from the second file, tav_bind_errors.sv, which binds a module into the interface on purpose.

5. Reaching a bound checker by its path

A bound instance gets a normal hierarchical name, so the testbench can read it like any other signal:

[TAV_5] u_a.u_sva: n_taken = 5, n_fail = 0
[TAV_5] u_b.u_sva: n_taken = 0, n_fail = 5

n_taken counts the cover property hits, and n_fail counts the assertion failures. u_a completed all 5 requests in time, and u_b failed all 5.

A trap in the log: which failures UVM counts

The checker has the same rule twice. a_ack_in_time reports through uvm_error in its else block. a_ack_in_time_dflt has no action block, so it uses the default action, which is $error.

"testbench.sv", 45: tav_tb.u_b.u_sva.a_ack_in_time_dflt: started at 45ns failed at 65ns
	Offending 'ack'

Both failed 5 times, and VCS printed a failure line for each one. The UVM summary still said UVM_ERROR : 5, not 10. The 5 default-action failures never reached it.

So if your regression decides pass or fail from the UVM summary, a bound assertion with no action block can fail without failing the test. Report through uvm_error, as a_ack_in_time does, or make sure the script also checks the simulator’s own assertion messages.

The second mistake: .* with a different name

The checker’s port is busy, but inside tav_req_ack the signal is busy_q. With .*, VCS looks for a signal named exactly busy in the design, and there isn’t one:

Error-[IIPCNDI] Identifier not declared
testbench.sv, 9
  In instance 'u_busy' of 'tav_busy_sva', identifier 'busy' bound by .*
  wildcard specification to an input port is not defined or imported in the
  scope.

VCS didn’t report this one in the file that also had the interface mistake. It only showed up once it was the only error, so after fixing one bind error, compile again before you trust the list. The fix is to connect it by name: .busy(busy_q), as part 1 does.

Which form should you use?

  • A rule that holds for every copy of a block: bind to the module name.
  • A checker for one copy, or a trial run: bind with module : instance_path.
  • Rules about the signals on a bus: bind into the interface, with an interface as the checker.
  • A checker that needs internal state: connect its ports to the internal signals by name in the bind port list.
  • Ports and internal names match exactly: .* saves typing. Otherwise list each connection.

The bench: two files, one run

Everything above comes from tav_bind_design.sv (the RTL, with no assertions) and tav_bind_tb.sv (the checkers, the bind statements and one UVM test). The mistakes come from tav_bind_errors.sv and tav_bind_error_a.sv.

On EDA Playground, put the design file in design.sv and the testbench in testbench.sv, pick UVM 1.2 and press Run (download all four as a zip).

tav_bind_design.sv (design.sv)

// tav_bind_design.sv  (paste into design.sv)
// The Art of Verification: SystemVerilog bind, the design side.
// A small request/acknowledge block. The RTL has no assertions in it.
// BUG_LATE = 1 makes the ack two cycles late, so a bound checker can catch it.

module tav_req_ack #(
  parameter int LAT      = 1,   // cycles of work after the request is taken
  parameter bit BUG_LATE = 0
) (
  input  logic clk,
  input  logic rst_n,
  input  logic req,
  output logic ack
);
  logic [2:0] cnt_q;            // internal: not a port
  logic       busy_q;           // internal: not a port

  always_ff @(posedge clk or negedge rst_n) begin
    if (!rst_n) begin
      busy_q <= 1'b0;
      cnt_q  <= '0;
      ack    <= 1'b0;
    end else begin
      ack <= 1'b0;
      if (!busy_q && req) begin
        busy_q <= 1'b1;
        cnt_q  <= '0;
      end else if (busy_q) begin
        if (cnt_q == (BUG_LATE ? LAT + 1 : LAT - 1)) begin
          ack    <= 1'b1;
          busy_q <= 1'b0;
        end else begin
          cnt_q <= cnt_q + 1'b1;
        end
      end
    end
  end
endmodule

tav_bind_tb.sv (testbench.sv)

// tav_bind_tb.sv  (paste into testbench.sv)
// The Art of Verification: SystemVerilog bind, checkers added without touching RTL.
// One UVM test, 5 parts. Every TAV result is printed with `uvm_info.
// EDA Playground: design.sv = tav_bind_design.sv, testbench.sv = this file,
// pick UVM 1.2 and press Run.

`include "uvm_macros.svh"
import uvm_pkg::*;

// ---------------------------------------------------------------
// The interface the testbench drives
// ---------------------------------------------------------------
interface tav_req_if (input logic clk);
  logic rst_n;
  logic req;
  logic ack;
endinterface

// ---------------------------------------------------------------
// Checker 1: the protocol rules, bound into every tav_req_ack
// ---------------------------------------------------------------
module tav_req_ack_sva #(parameter int MAX_LAT = 2) (
  input logic clk,
  input logic rst_n,
  input logic req,
  input logic ack,
  input logic busy              // will be wired to the DUT's internal busy_q
);
  int n_taken;                  // requests the cover saw complete in time
  int n_fail;                   // failures of a_ack_in_time

  property p_ack_in_time;
    @(posedge clk) disable iff (!rst_n)
      (req && !busy) |-> ##[1:MAX_LAT] ack;
  endproperty

  // Failure reported through UVM, so it lands in the UVM summary
  a_ack_in_time: assert property (p_ack_in_time)
    else begin
      n_fail++;
      `uvm_error("TAV_SVA", $sformatf("%m: no ack within %0d cycles of the request", MAX_LAT))
    end

  // The same rule with no action block: the default action is $error
  a_ack_in_time_dflt: assert property (p_ack_in_time);

  // Never an ack unless the block was busy on the cycle before
  a_no_spurious_ack: assert property (@(posedge clk) disable iff (!rst_n) ack |-> $past(busy))
    else `uvm_error("TAV_SVA", $sformatf("%m: ack without a request"))

  c_in_time: cover property (@(posedge clk) disable iff (!rst_n)
                             (req && !busy) ##[1:MAX_LAT] ack) n_taken++;

  initial `uvm_info("TAV_1", $sformatf("protocol checker bound at %m, MAX_LAT = %0d", MAX_LAT), UVM_LOW)
endmodule

// ---------------------------------------------------------------
// Checker 2: a latency note, bound into ONE instance only
// ---------------------------------------------------------------
module tav_lat_probe (input logic clk, input logic req, input logic ack);
  initial `uvm_info("TAV_3", $sformatf("latency probe bound at %m"), UVM_LOW)
endmodule

// ---------------------------------------------------------------
// Checker 3: bound into the interface, not the design.
// A module can't live inside an interface, so this checker is an interface too.
// ---------------------------------------------------------------
interface tav_if_sva (input logic clk, input logic rst_n, input logic req);
  a_req_known: assert property (@(posedge clk) disable iff (!rst_n) !$isunknown(req))
    else `uvm_error("TAV_SVA", $sformatf("%m: req is X or Z"))
  initial `uvm_info("TAV_4", $sformatf("interface checker bound at %m"), UVM_LOW)
endinterface

// ---------------------------------------------------------------
// The bind statements: the only place checker and design meet
// ---------------------------------------------------------------
// Part 1 and 2: every instance of tav_req_ack gets the protocol checker.
// busy is wired to the DUT's internal busy_q, and MAX_LAT uses the DUT's own LAT.
bind tav_req_ack tav_req_ack_sva #(.MAX_LAT(LAT + 1)) u_sva (
  .clk(clk), .rst_n(rst_n), .req(req), .ack(ack), .busy(busy_q));

// Part 3: only instance u_a gets the latency probe
bind tav_req_ack : tav_tb.u_a tav_lat_probe u_probe (.*);

// Part 4: bind into an interface
bind tav_req_if tav_if_sva u_if_sva (.clk(clk), .rst_n(rst_n), .req(req));

// ---------------------------------------------------------------
// The UVM test
// ---------------------------------------------------------------
class tav_bind_test extends uvm_test;
  `uvm_component_utils(tav_bind_test)
  virtual tav_req_if vif_a, vif_b;

  function new(string name, uvm_component parent);
    super.new(name, parent);
  endfunction

  function void build_phase(uvm_phase phase);
    if (!uvm_config_db#(virtual tav_req_if)::get(this, "", "vif_a", vif_a)) `uvm_fatal("TAV", "no vif_a")
    if (!uvm_config_db#(virtual tav_req_if)::get(this, "", "vif_b", vif_b)) `uvm_fatal("TAV", "no vif_b")
  endfunction

  // Send n single-cycle requests, each after the previous ack
  task drive(virtual tav_req_if vif, int n);
    repeat (n) begin
      @(posedge vif.clk) vif.req <= 1'b1;
      @(posedge vif.clk) vif.req <= 1'b0;
      wait (vif.ack == 1'b1);
      repeat (2) @(posedge vif.clk);
    end
  endtask

  virtual task run_phase(uvm_phase phase);
    phase.raise_objection(this);
    vif_a.req <= 1'b0; vif_b.req <= 1'b0;
    vif_a.rst_n <= 1'b0; vif_b.rst_n <= 1'b0;
    repeat (3) @(posedge vif_a.clk);
    vif_a.rst_n <= 1'b1; vif_b.rst_n <= 1'b1;

    // Part 2: the same traffic into the good and the buggy instance
    fork
      drive(vif_a, 5);
      drive(vif_b, 5);
    join
    repeat (5) @(posedge vif_a.clk);

    // Part 5: ask the testbench top to read the bound checkers' counters
    uvm_event_pool::get_global("tav_report").trigger();
    #1;
    phase.drop_objection(this);
  endtask
endclass

// ---------------------------------------------------------------
// Testbench top
// ---------------------------------------------------------------
module tav_tb;
  logic clk = 0;
  always #5 clk = ~clk;

  tav_req_if if_a (clk);
  tav_req_if if_b (clk);

  tav_req_ack #(.LAT(1))                u_a (.clk(clk), .rst_n(if_a.rst_n), .req(if_a.req), .ack(if_a.ack));
  tav_req_ack #(.LAT(1), .BUG_LATE(1))  u_b (.clk(clk), .rst_n(if_b.rst_n), .req(if_b.req), .ack(if_b.ack));

  // Part 5: the bound instances have normal hierarchical names
  initial begin
    uvm_event_pool::get_global("tav_report").wait_trigger();
    `uvm_info("TAV_5", $sformatf("u_a.u_sva: n_taken = %0d, n_fail = %0d", u_a.u_sva.n_taken, u_a.u_sva.n_fail), UVM_LOW)
    `uvm_info("TAV_5", $sformatf("u_b.u_sva: n_taken = %0d, n_fail = %0d", u_b.u_sva.n_taken, u_b.u_sva.n_fail), UVM_LOW)
  end

  initial begin
    uvm_config_db#(virtual tav_req_if)::set(null, "uvm_test_top", "vif_a", if_a);
    uvm_config_db#(virtual tav_req_if)::set(null, "uvm_test_top", "vif_b", if_b);
    run_test("tav_bind_test");
  end
endmodule

What VCS printed

VCS X-2025.06-SP1 with UVM 1.2. The run ended at 426 ns with UVM_ERROR : 5, all 5 from u_b, which is the planted bug doing its job. VCS also printed its own 10 assertion failure lines. Every TAV line is shown in its part above, with the UVM_INFO testbench.sv(NN) @ 0: reporter prefix trimmed.

Common mistakes (and the fix for each)

1. Binding a module into an interface. VCS stopped with IIM. Fix: write the checker as an interface.

2. Using .* when the names differ. The checker’s busy has no match, so VCS stopped with IIPCNDI. The design calls it busy_q. Fix: connect it by name, .busy(busy_q).

3. Leaving the action block empty. In my run, 5 failures never reached the UVM summary. Fix: report through uvm_error, or have the regression read the simulator’s assertion messages.

4. Hard-coding a limit the design already has. Fix: pass the design’s parameter into the checker, as #(.MAX_LAT(LAT + 1)) does.

5. Editing the RTL to add assertions. Fix: keep checkers and bind statements in verification files, so the RTL owner never has to merge your changes.

Where AI helps, and where it doesn’t

An AI assistant is quick at writing the bind line and the port list once you paste the module header. It’s also good at turning a spec sentence into a first draft of a property.

Where I’d check it is the details this run turned up: whether the checker must be an interface, which internal names exist, and which failures your UVM summary counts. Those depend on your design and your tool, so the log has the final word.

Practice challenge

Add a second checker that only u_b gets: ack must be a one-cycle pulse, ack |=> !ack. Bind it with the instance form, run it, and confirm from the bound-at message that it landed in tav_tb.u_b only.

FAQ

What is bind in SystemVerilog? A statement that places a module, interface or checker inside a design module or interface from the outside. It’s mostly used to add assertions without editing the RTL.

How do I bind to one instance only? Use the colon form: bind tav_req_ack : tav_tb.u_a tav_lat_probe u_probe (.*);. In my run the probe appeared only at tav_tb.u_a.u_probe.

Can a bound checker see internal signals? Yes. The port list is read inside the target, so .busy(busy_q) connected the checker to a signal that isn’t a port.

Can I bind into an interface? Yes, but the bound checker must be an interface. VCS rejected a module with Error-[IIM].

Can I pass the design’s parameters to a bound checker? Yes. #(.MAX_LAT(LAT + 1)) used the design’s LAT, and the checker printed MAX_LAT = 2.

Why didn’t my assertion failure fail the UVM test? An assertion with no action block uses $error, which the UVM summary doesn’t count. In my run, 10 failures printed and UVM_ERROR showed 5.

References

  • IEEE 1800-2023, SystemVerilog standard: clause 23.11 (binding auxiliary code to scopes or instances) and clause 16 (assertions, including action blocks and default actions).
  • Accellera, Universal Verification Methodology (UVM) 1.2 class reference: reporting macros.

Keep learning

If assertions are new to you, start with assertions and their advantages, then immediate vs concurrent assertions. For more properties to bind, see assertions with examples and SVA examples part 2.

Part 4’s interface ties in with why we need a virtual interface, and the reporting trap with UVM reporting. Bound assertions also feed formal tools: read where to use formal verification.