# Accessing a generate block hierarchy

**URL:** <https://verificationacademy.com/forums/t/accessing-a-generate-block-hierarchy/28727>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [July 25, 2013, 5:43am UTC](https://verificationacademy.com/forums/t/accessing-a-generate-block-hierarchy/28727 "2013-07-25T05:43:25Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![suhas.ns](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/f1d935/32.png) [@suhas.ns](https://verificationacademy.com/forums/u/suhas.ns)\
**Post date:** [August 29, 2016, 7:56am UTC](https://verificationacademy.com/forums/t/accessing-a-generate-block-hierarchy/28727/6 "2016-08-29T07:56:39Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/accessing-a-generate-block-hierarchy/28727/5):_

Hi Dave,  
I’m trying to something similar but for binding my assertions.  
Below is my bind statement in my bind assert module:

_`define NUM_BLKS 4; genvar asrt_inst; generate for (asrt_inst = 0;asrt_inst < `NUM\_BLKS;asrt\_inst = asrt\_inst+1)  
begin  
bind top.u\_dut.u\_blk\_gen[asrt\_inst] my\_assert u\_my\_assert (  
._  
);  
end  
endgenerate\*

Here, the RTL is under gen block of u\_blk\_gen[gen\_var], and I’m trying to bind my assertion to each instance of the generated instance.  
The path instances of the RTL, generated using the generate block are :

1. top.u\_dut.u\_blk\_gen[0]
2. top.u\_dut.u\_blk\_gen[1]
3. top.u\_dut.u\_blk\_gen[2]
4. top.u\_dut.u\_blk\_gen[3]

And with the bind statement, I get the below compile error:  
\*  
bind top.u\_dut.u\_blk\_gen[gpt\_asrt\_inst] my\_assert u\_my\_assert (  
|  
ncvlog: _E,ILLGVR (/home/user/assertion\_bind.v,165|72): This genvar cannot be used in this context [12.1.3(IEEE 2001)]._

Is there a work around for such scenario?

---

_[View the full topic](https://verificationacademy.com/forums/t/accessing-a-generate-block-hierarchy/28727)._
