Analysis Export and Fifo in an uvm_object?

Is it possible to add an analysis export and an analysis fifo in a class derived from an uvm_object?
Note: This class is not derived from uvm_component

In reply to shamanth:

I don;t know if there is anything that forbids it, buut it would certainly be unconventional. Plus you lose the ability to debug TLM port connections (that might ultimately prevent it from compiling). You should try it and explain why think you need to do this.

In reply to dave_59:

Hi Dave,

Thanks for reply.

1] Actually when we create an analysis port
analysis_port = new(“analysis_port”,this),
we pass “this” as the second argument. “this” needs the current instance to be a component. It throws error when the current instance is object.

2] If we don’t pass “this” argument, then uvm error pop ups saying 2nd argument is missing (Where in it needs the current instance).

Regards
SHAMANTH HK

Did you try to put null instead of this?

In reply to shamanth:

If you are looking to the source code you see the constructor ha 2 arguments:

function new (string name, uvm_component parent);

Because of this you cannot neglect the 2nd argument. But you could try ‘null’.

Again it is not a good idea to implement an analysis port in an uvm_object.
Could you please explain what kind of object you are using?

In reply to shimonc:

Hi Shimonc,

Yeah i even tried that, but as it expects a valid component as argument compiler threw error saying it can’t be null.

Regards
SHAMANTH HK

In reply to shamanth:

When you want to implement a port/export in an uvm_object you need another object you want to connect these ports/exports to. But there is nothing.
If you want to send data from an object like a sequence to a component you can use uvm_events to do this.