Jump to content

Recommended Posts

Posted

Hi,

Does someone have existing code-piece for a collector that iterates aftter build from uvm_root, and collects all instances of a certain uvm type - lets say tlm fifo?

Thanks.

Naveen

Posted

Just realize that tlm fifo is a templated specialization of uvm_component. I wanted to collect all such tlm fifoes, in an environment developed my scores of people, and thereby have handy access to tlm fifo allowing me to control/be aware of the "size" - unbounded and unconnected tlm fifoes have been a source of bother.

I can however collect tlm fifoes in a "uvm_component" type array :- is there a distinguishing property that can be accessed in a uvm_component indicating it is a "tlm fifo type"?

Posted

Since tlm_fifo is not registered with factory, you can use uvm_root::find_all() to get a list of all components, and then iterate over the list using $cast() to select the types you are interested in.

Posted (edited)

Since tlm_fifo is not registered with factory, you can use uvm_root::find_all() to get a list of all components, and then iterate over the list using $cast() to select the types you are interested in.

Dave, The issue is that the uvm_tlm_fifo_base#(T) class is parameterized, and extends directly off the uvm_component. Therefore, to get all possible specializations of the tlm fifo, thru' $cast from a uvm_component list, would require I have access to ALL transaction types - this is not much different from the problem that I started off with.

Can you explain pls - i likely didnt follow,

Edited by naveeng
Posted

that is an SV limitation around parameterized types. what might work as a workaround is to look at get_type_name() or $typename() and trying to extract the typename from it.

/uwe

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...