lundi 10 octobre 2016

Is there a name for the UVM pattern of calling multiple phases against each object?

In UVM, most objects need to implement or inherit methods for the most common phases, such as build_phase(), connect_phase(), and run_phase(). Less often, an object will need to define one of the more targeted methods such as end_of_elaboration_phase() or start_of_simulation_phase().

But in fact, all phases must be called against all objects. All objects see the call to the first phase before the next phase begins. In Pythonesque pseudocode, what the UVM infrastructure is doing is:

for phase in allPhases:
    for obj in allObjects:
        obj.phase()

That means that the base class for every object must contain a null method for the case when that particular customization point is unused.

This structure feels like a design pattern to me. Is there a name for it?

I think that the key features are:

  • many objects implementing the same interface
  • a defined set of methods are called against every object instance
  • there is a sequential order to the method calls
  • some objects customize the methods and some inhereit null methods, so not every object takes action on every method call

Aucun commentaire:

Enregistrer un commentaire