Jump to content

Recommended Posts

Posted (edited)

Is it possible to implement analysis port in user call back class? or is it possible to implement only in component derived from uvm_component?

Edited by ManMe
Posted

uvm_analysis_imp requires that the implementation be a component, but uvm_analysis_port can be instantiated outside of a component:

uvm_analysis_port #( my_obj ) myport = new( "myport", null );

It might make debugging more difficult, but the port functionality doesn't require it.

Posted

While it is possible to instantiate an analysis_port outside of a component, as jadec shows, it's not recommended. Perhaps if you could describe what you're ultimately trying to achieve, we might be able to suggest a better alternative.

  • 9 years later...
Posted

Apologies for the necropost, but I'm trying to do the same the OP is doing.

I have a VIP that exposes a callback to access its internal states and I want to pack that state into a transaction and transfer it to a subscriber for some further processing.

I've described the usecase here: https://verificationacademy.com/forums/uvm/analysis-port-wrapped-callback

but unfortunately not many answers so far...

 

Anyone from this forum open to chime in?

Posted
On 7/7/2022 at 2:48 PM, David Black said:

you simply are describing a UVM subscriber.

Hi David, I'm not entirely sure to understand what you mean. A UVM subscriber is essentially a uvm_component with an associated analysis_export at my disposal.

My VIP exposes a callback (not an analysis_port) so how can I 'attach' the analysis_export of my subscriber to my callback?

My preferred way would be to instantiate an analysis_port in my callback and have it connected to my subscriber analysis_export. Alternatively I could get the handle of subscriber in my callback and simply pass the transaction to the subscriber write function, without going through proper port connection, but I find this strategy less than ideal.

 

On 7/7/2022 at 2:48 PM, David Black said:

You could alternatively use the general purpose UVM callback mechanism.

I'm not sure what you mean by that, although I do understand what's the general purpose callback mechanism in UVM. My VIP already has a callback that's executed right before the packet is to be transmitted onto the interface and therefore it gives us the possibility to check/modify several attributes of the packet.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...