Uvm_layering-1.0 problem with uvm 1.1d

I want to try uvm_layering-1.0 with uvm 1.1d, but when I run the example design, it will report error like:

lp_sequencer_port [ILLCRT] It is illegal to create a component (‘lp_sequencer_port’ under ‘simple_e1.sequencer’) after the build phase has ended.

I found out that in uvm_layering_agent.svh , they tried to build the sequencer after build phase and before connect phase. but it’s not allowed to build anything in connect phase in uvm1.1d. and simply putting the post_build after the build phase does not work since the handler does not exist.

Is there any new version of uvm_layering-1.0, or is there efficient way to solve the problem? is the callback working for this?

the code of the uvm_layering_agent.svh is here.

//////////////

function void uvm_layering_agent::build();
layering_ap = new( $psprintf(“%s_ap” , m_layering_name ) , this );

m_factory = uvm_factory::get();

if (m_layering_sequencer_wrapper == null) begin
`uvm_fatal(s_nolayering_id, “No layering specified. Use create_mapping() to create one.”)
end

assert( $cast( layering_sequencer ,
m_factory.create_component_by_type( m_layering_sequencer_wrapper ,
get_full_name() ,
“layering_sequencer”,
this ) ) );

if( m_monitor_wrapper != null ) begin
assert( $cast( layering_monitor ,
m_factory.create_component_by_type( m_monitor_wrapper ,
get_full_name() ,
“layering_monitor” ,
this ) ) );
end

if( m_checker_wrapper != null ) begin
assert( $cast( layering_checker ,
m_factory.create_component_by_type( m_checker_wrapper ,
get_full_name() ,
“layering_checker” ,
this ) ) );
end

endfunction

function void uvm_layering_agent::post_build();
//
// this method needs to be called after the top down build methods have all been done ( otherwise the bus agent
// may not exist yet )
//
set_bus_agent_and_sequencer();

// create the two ports in the bus sequencer
m_sequencer_port = new( $psprintf(“%s_sequencer_port” , m_layering_name ) , m_bus_sequencer );
m_response_port = new( $psprintf(“%s_response_port” , m_layering_name ) , m_bus_sequencer );
endfunction

function void uvm_layering_agent::connect();
post_build(); // not worth the trouble of doing a whole new pre_build phase just for this …
// set_bus_agent_and_sequencer();

m_sequencer_port.connect( layering_sequencer.seq_item_export );
m_response_port.connect( layering_sequencer.rsp_export );

if( layering_monitor != null ) begin
layering_ap.connect( layering_monitor.layering_ap );
layering_monitor.connect_to_agent_ports( m_bus_agent );
end

if( layering_checker != null ) begin
layering_monitor.layering_ap.connect( layering_checker.analysis_export );
end
endfunction

function void uvm_layering_agent::set_bus_agent_and_sequencer;
uvm_component parent = get_parent();
uvm_component c;

m_bus_agent = parent.lookup( m_bus_agent_name );

assert( m_bus_agent != null ) else begin
parent.uvm_report_error( s_lookup_error_id , $psprintf(“cannot find agent called %s” , m_bus_agent_name ) );
end

c = m_bus_agent.lookup( m_bus_sequencer_name );

assert( c != null ) else begin
uvm_report_error( s_lookup_error_id , $psprintf(“cannot find sequencer called %s” , m_bus_sequencer_name ) );
end

assert( $cast( m_bus_sequencer , c ) ) else begin
c.uvm_report_error( s_sequencer_type_error_id , “is not a sequencer” );
end

`uvm_info(s_layering_info,
$psprintf(“Found lower sequencer ‘%s’”, m_bus_sequencer.get_full_name()),
UVM_HIGH)

endfunction

Please do not use the uvm_layering_pkg.
Instead, sequence layering is explained in the UVM Cookbook and the Advanced UVM video course.
Good luck,
-Tom

In reply to tfitz:

thanks for your advice

In reply to jie:

but is there any other examples of sequence layering?

In reply to jie: