Virtual sequencer or sub-environment?

Hello everyone,

New guy here, I just wanna ask a which one do you think is better to use, virtual sequencer or sub-environment? my team was asked to design a uvm testbench environment for a certain DUT, but since the top block of that DUT is not yet ready, the RTL designers asked us to create a TB Arch for the two sub-blocks inside that DUT first so we can start testing. We agreed on having 2 separate agents for the 2 sub-blocks as long as the 2 agents can synchronize with each other. 2 suggestions came up on how we’re going to do this:
a.) we use a virtual sequencer
b.) we create 2 separate environment for each sub-block (though I’m not yet sure how we’re going to synchronize the 2 sub-blocks using this)

so which one do you think is better? comments, suggestions and adding advantage and disadvantage in your comment will be highly appreciated as well.

thanks everyone!

regards,
edward

The big question is: what kind of synchronization do you need?
In general, to maximize reuse, you want to create an environment that can verify your two sub-blocks together and can also be reused when you get the top block in place. So, beginning with the end in mind, what agents are you going to need to verify the top block? With those in place, what additional components are you going to need to add to make up for the missing top block?
Are you going to build block-level environments for each of the sub-blocks? If so, you should make them configurable enough so that you can reuse them when you put the blocks together.
A good rule of thumb is to use envs to group sets of components together, and then you can create a top-level env that uses the (configurable) sub-envs as components. Think of this as “structural reuse.”
The use of a virtual sequence is to coordinate stimulus across multiple sequencers. So, when you have your sub-blocks, you can use the virtual sequence to start sequences on each agent. When you get your top block in place, you can reuse the same virtual sequence to coordinate the same stimuli.
By the way, you don’t need a “virtual sequencer.” Just keep sequencer pointers in your virtual sequence and you’re good to go. See the UVM Cookbook for more details.
So, I guess the answer to your question is “use both.”
Good luck,
-Tom

Keep in mind the following recommendations:

  • An agent should be protocol interface specific (i.e. AHB, AXI, PCI, etc.)
  • An environment should be DUT specific and integrate one or more agents coordinated by a virtual sequence.

You can accomplish what you want to do by creating individual UVM environments for each sub-block. These would be your unit level test environments and should be able to completely verify each individual block independent of each other.

When your development team has integrated the two IP blocks into a higher-level DUT, you can then incorporate both unit level environments into a new environment. This allows you to re-use all the previously developed code to now test your DUT.