Can an upper level of an ovm_layering_agent connect to two lower level ovm_layering_agents?

I am verifying an FPGA that is a pixel formater for a graphics processor. Due to hardware limitations, in order to achieve 60 fps throughput the hardware splits the lines of a video frame into two halves and sends each half to a separate “video port” on the FPGA “simultaneously”. What I want to do is create a hierachy of ovm_layering_agents. The top level sequence would generate active video frames. The top ovm_layering_agent’s translator would split the frame into a left_half and right_half; and send each half to its own ovm_layering_agent. So the environment would look something like this:

class lcd_env extends ovm_env;
`ovm_component_utils( lcd_env )

ovm_layering_agent #(video_frame_seq_item) m_video_frame;
ovm_layering_agent #(split_frame_seq_item) m_split_frame0;
ovm_layering_agent #(split_frame_seq_item) m_split_frame1;

endclass: lcd_env

Can I map the m_video_frame agent to both the m_split_frame0 and m_split_frame1 agents? If so, how would the mapping look in the build method?

–Bryan

I am not sure what your exact requirement is, but the syntax is not correct. The ovm_agent is not associated with any seq_item, as you have shown. Seems like you may have to have extended layering agent for “split” from the base_layering agent.

If you have some more code, which you are of doubt, I can help.

In reply to mpattaje:

The ovm_layering_agent requires a parameter of type ovm_sequence_item for it’s layering_sequencer. In my application, what I would be doing in the build method is to instantiate the layering agents by:

m_video_frame = ovm_layering_agent #(video_frame_seq_item)::type_id::create(“m_video_frame”, this);

m_split_frame0 = ovm_layering_agent #(split_frame_seq_item)::type_id::create(“m_split_frame0”, this);

m_split_frame1 = ovm_layering_agent #(split_frame_seq_item)::type_id::create(“m_split_frame1”, this);

The next thing in the build method is to map the layering agent to it’s sequencer class, translator class, default sequence class, lower agent instance, and the lower agent’s sequencer instance. What I want to know is if I can map m_video_frame to both m_split_frame0 and m_split_frame1. The translator class would take a video frame transaction and split the pixels into 2 split frame transactions sending one of them to the sequencer in m_split_frame0 and the other to the sequencer in m_split_frame1.

Is this possible? If not is there a way that I can generate a sequence of whole frames and split it (vertically) into half frames and send the half frame transactions to different instances of the same type of sequencer (virtual sequencer maybe)?

In reply to bbushart:

the maping code would look like:

m_split_frame0.create_mapping(“m_split_frame0”,
split_frame_sequencer::get_type(),
“m_lower_agent0”,
split_lower_translator::get_type(),
default_sequnce::get_type(),
string path to m_lower_agent0 sequencer
);
m_split_frame1.create_mapping(“m_split_frame0”,
split_frame_sequencer::get_type(),
“m_lower_agent1”,
split_lower_translator::get_type(),
default_seqence::get_type(),
string path to m_lower_agent1 sequencer
);

This will map m_video_frame to m_split_frame0:

m_video_frame.create_mapping(“m_video_frame”,
video_frame_sequencer::get_type(),
“m_split_frame0”,
frame_split_frame_translator::get_type(),
default_frame_seq::get_type(),
“layering_sequencer”
);

Can the above code be modified or duplicated to also map m_video_frame to m_split_frame1 so that the translator class sends one half frame to m_split_frame0 and the other half frame to m_split_frame1?

In reply to bbushart:

Hi,

As per the uvm_cookbook, your code looks solidly correct, though I didn’t try simulating an example. It has example of your requirement - translating from one higher level sequence to more number of lower level sequences.

I hope you would have referred this already, sorry I couldn’t help you more.