Can v create Classobject inside a interface? if Yes, how to do it?

Hello All,

I have declared all Parameters inside a Class.Now i want to use this parameters inside the interface,how can i do it…???

Class A;
parameter x=8;
parameter y=16l
endclass

interface intf()
logic [x-1:0] addr; // x is parameter inside the class ,
logic [y-1:0] data; // now i want to use it in this interface .
// How can i do it???
endinterface

In Modules ,Before using class properties or methods , we will create an object of class using function new and access the class members using its handle.

Then what can be done in the above case???

Please guide me,
Regards ,
Murali.A

You don’t need to construct a class object to reference a parameter of a class. You can use A::x.

And we strongly recommend you put your classes, and everything else outside of a module or interface, inside a package.

Dave