VAPL Facade Pattern
VAPL Facade Pattern
VAPL Facade Pattern
Structure:
Using the GPIO env as an example, we see that the virtual_sequencer class has
references to the sequencer (sqr) of Bus Agent and GPIO Agent. The UART
environment level sequences (virtual sequences) can now be run using the
virtual sequencer in the UART env. Similarly, when you integrate multiple
environments together, we could have a top level virtual sequencer which has
references to lower level sequences thereby providing the top level sequence a
simpler interface to the environments below.
Example:
`uvm_component_utils(virtual_sequencer)
// Note that the handles are in terms that the test writer understands
bus_master_sequencer bus;
gpio_sequencer gpio;
endclass: virtual_sequencer
endclass:env
`uvm_object_utils(virtual_sequence_base)
gpio = v_sqr.gpio;
endtask: body
endclass: virtual_sequence_base
// Virtual sequence class:
//
class example_virtual_seq extends virtual_sequence_base;
random_bus_seq bus_seq;
random_gpio_chunk_seq gpio_seq;
`uvm_object_utils(example_virtual_seq)
task body();
super.body; // Sets up the sub-sequencer pointers
gpio_seq = random_gpio_chunk_seq::type_id::create("gpio_seq");
bus_seq = random_bus_seq::type_id::create("bus_seq");
repeat(20) begin
bus_seq.start(bus);
gpio_seq.start(gpio);
end
endtask: body
endclass: example_virtual_seq
//...
test_seq.start(m_env.m_v_sqr);
//...
endtask: run