Array of Mailbox and array of semaphores

Hi,

Can we have a array of Mailbox and array of semaphores?
Can we have user defined phase anywhere? Is there any restriction where to create/after which phase to create?

In reply to Kishankk:

You can have an array of any data type including the built-in mailbox and semaphore.

You question about phases is unclear and I don’t understand how that relates to your first question. If you are referring to user-defined UVM phases, we recommend not using them, especially if you have to ask how they work.

Hi Dave Thanks for the reply,

First 2nd question is not depending on 1st question.

In general, if we want to create ay user-defined phase ,Can we have user defined phase anywhere? Is there any restriction where to create/after which phase to create?Ex only after build and create phase …like that

In reply to Kishankk:

I strongly advise against defining your own phases. It makes integration of other people’s code more difficult.

While the UVM LRM does not explicitly state any restrictions on user-defined phase, it’s important to infer any implicit limitations from the rest of the UVM. You must construct a component before executing any of its phases. Typically this happens in the the build_phase of its parent, but it could happen earlier. Also, the build_phase must happen at time 0, so you cannot add any task based phases before that.

Thank you Dave