# Binding Parameterized Interface to a Parameterized Module

**URL:** <https://verificationacademy.com/forums/t/binding-parameterized-interface-to-a-parameterized-module/41465>\
**Category:** SystemVerilog\
**Tags:** Binding-Parameterized-Interface-to-a-Parameterized-Module, SystemVerilog\
**Created:** [April 4, 2023, 7:25pm UTC](https://verificationacademy.com/forums/t/binding-parameterized-interface-to-a-parameterized-module/41465 "2023-04-04T19:25:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ABD\_91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/c77e96/32.png) [@ABD\_91](https://verificationacademy.com/forums/u/ABD_91)\
**Post date:** [April 4, 2023, 7:25pm UTC](https://verificationacademy.com/forums/t/binding-parameterized-interface-to-a-parameterized-module/41465/1 "2023-04-04T19:25:25Z")

</div>

Hi ,  
My parameterized interface is defined as :

```verilog

interface intf #( parameter LENGTH = 10 , HEIGHT = 20 );

 logic [LENGTH-1 : 0] a ;
 logic [HEIGHT-1 : 0] b ;

 initial $display(" Within %m : LENGTH = %0d , HEIGHT = %0d " , LENGTH , HEIGHT );

endinterface

```

The interface needs to be instantiated within following module :

```verilog

module CSR #( parameter LENGTH = 10 , HEIGHT = 20 );

 ...........................
 // We Need to Instantiate interface with the Actual Parameters for module CSR  

endmodule

```

The module CSR is instantiated as :

```verilog

module CSR_top ;
  ...............

  CSR #( 100 , 200 ) csr() ;

endmodule

```

Now the requirement is to to bind the interface ’ intf ’ to specific instance ’ csr ’ via the top\_tb :

```verilog

module top_tb ;
  
  // The overridden parameters to the interface must be the same parameters provided to instance name ' csr ' i.e 100 and 200 .
  bind top_tb.u_chip_top.csr_top.csr intf#( LENGTH , HEIGHT ) intf_inst() ;

endmodule 

```

This does work , however I am confused how is it that there is No error when I write : intf#( LENGTH , HEIGHT )

How does it take the same parameters i.e 100 and 200 as the overridden one in instance : top\_tb.u\_chip\_top.csr\_top.csr

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [April 4, 2023, 7:44pm UTC](https://verificationacademy.com/forums/t/binding-parameterized-interface-to-a-parameterized-module/41465/2 "2023-04-04T19:44:10Z")

</div>

_In reply to [ABD\_91](https://verificationacademy.com/forums/t/binding-parameterized-interface-to-a-parameterized-module/41465):_

Bind is just a shortcut for having written

```verilog
module CSR #( parameter LENGTH = 10 , HEIGHT = 20 );
   
 ...........................
 // We Need to Instantiate interface with the Actual Parameters for module CSR  
   intf#( LENGTH , HEIGHT ) intf_inst() ;
endmodule

```

So the overwritten LENGTH and HEIGHT parameters get passed down into intf\_inst.
