In reply to Ramyas:
When you embed a covegroup declaration inside a class declaration, the covergroup name txn_cg becomes the name of the instance. (See 19.4 Using covergroup in classes in SV LRM)
You need write your constructor like this:
txn_cg = new;
This means you can only have one instance of an embedded covergroup per class object. If you need more, you have to define the covergroup outside the class.
Also in your constructor above, you were declaring t_cg inside the constructor. You would not be able to sample it outside the constructor.