How to use p_sequencer in EUVM

Hello puneet,

I try to using p_sequencer in EUVM, but I met “No context available” error when assign sequencer as p_sequencer(wcmd_seq.seqr = p_sequencer.m_write_cmd_sequencer;) as following code.

Could you please check how to use p_sequencer and check following code.

Thanks in advance.

class sv_virtual_sequencer : uvm_sequencer!uvm_sequence_item
{
mixin uvm_component_utils;
@UVM_BUILD {
axi_master_write_cmd_sequencer m_write_cmd_sequencer;
axi_master_data_sequencer m_write_data_sequencer;
axi_master_write_resp_ready_sequencer m_write_resp_ready_sequencer;
}
this (string name, uvm_component parent=null) {
super(name, parent);
}
}

class sv_base_seq : uvm_sequence!uvm_sequence_item
{
mixin uvm_declare_p_sequencer!(sv_virtual_sequencer);
mixin uvm_object_utils;
this (string name = “sv_base_seq”) {
super(name);
}
void cpu_axi_wr (uint addr, uint data) {
master_write_cmd_burst_seq wcmd_seq;
master_write_data_burst_seq wdata_seq;
master_write_resp_ready_seq wresp_ready_seq;
fork (
{
wcmd_seq = master_write_cmd_burst_seq.type_id.create(“wcmd_seq”);
wcmd_seq.write_cmd_id = 0;
wcmd_seq.write_cmd_start_addr = addr + i;
wcmd_seq.write_cmd_len = 0;
wcmd_seq.write_cmd_size = 2;
wcmd_seq.write_cmd_burst_type = 1;
wcmd_seq.write_cmd_lock = 0;
wcmd_seq.write_cmd_cache = 2; // need to randomize : must be fixed
wcmd_seq.write_cmd_prot = 0;
wcmd_seq.delay = 1;
wcmd_seq.rand_awvalid = 1;
wcmd_seq.wait_write_cmd_resp = 1;
wcmd_seq.print ();
wcmd_seq.seqr = p_sequencer.m_write_cmd_sequencer;
//wcmd_seq.start(p_sequencer.m_write_cmd_sequencer);
},
{
wdata_seq = master_write_data_burst_seq.type_id.create(“wdata_seq”);
wdata_seq.pkt_data = data + i;
wdata_seq.print ();
//wdata_seq.seqr = p_sequencer.m_write_data_sequencer;
//wdata_seq.start(p_sequencer.m_write_data_sequencer);
}
},
{
wresp_ready_seq = master_write_resp_ready_seq.type_id.create(“wresp_ready_seq”);
wresp_ready_seq.write_resp_ready = 1;
wresp_ready_seq.write_resp_ready_delay = 0;
wresp_ready_seq.print ();
//wresp_ready_seq.seqr = p_sequencer.m_write_resp_ready_sequencer;
//wresp_ready_seq.start(p_sequencer.m_write_resp_ready_sequencer);
}
},
).join();
uvm_info(“sv_base_seq”, “end of join cpu_axi_wr”, UVM_MEDIUM);
return;
}
}

class axi_master_agent: uvm_agent
{
mixin uvm_component_utils;

@UVM_BUILD {
axi_master_write_cmd_driver!(“axiwcmd”) wcmd_driver;
axi_master_write_cmd_sequencer wcmd_sequencer;
axi_master_data_driver!(“axiwdata”) wdata_driver;
axi_master_data_sequencer wdata_sequencer;
axi_master_write_resp_ready_driver!(“axiwresp”) wresp_ready_driver;
axi_master_write_resp_ready_sequencer wresp_ready_sequencer;
}

this(string name, uvm_component parent) {
super(name, parent);
}
override void build_phase (uvm_phase phase) {
uvm_info(“axi_master_agent”, format(“build_phase”), UVM_MEDIUM);
wcmd_sequencer = axi_master_write_cmd_sequencer.type_id.create(“wcmd_sequencer”, this);
wcmd_driver = axi_master_write_cmd_driver!(“axiwcmd”).type_id.create(“wcmd_driver”, this);
wdata_sequencer = axi_master_data_sequencer.type_id.create(“wdata_sequencer”, this);
wdata_driver = axi_master_data_driver!(“axiwdata”).type_id.create(“wdata_driver”, this);
wresp_ready_sequencer = axi_master_write_resp_ready_sequencer.type_id.create(“wresp_ready_sequencer”, this);
wresp_ready_driver = axi_master_write_resp_ready_driver!(“axiwresp”).type_id.create(“wresp_ready_driver”, this);
}
override void connect_phase(uvm_phase phase) {
super.connect_phase(phase);
if (get_is_active() == UVM_ACTIVE) {
wcmd_driver.seq_item_port.connect(wcmd_sequencer.seq_item_export);
wdata_driver.seq_item_port.connect(wdata_sequencer.seq_item_export);
wresp_ready_driver.seq_item_port.connect(wresp_ready_sequencer.seq_item_export);
}
}
}

class axi_env : uvm_env
{
mixin uvm_component_utils;
@UVM_BUILD {
axi_master_agent agent;
}

this(string name , uvm_component parent) {
super(name, parent);
}
override void build_phase (uvm_phase phase) {
super.build_phase(phase);
uvm_info(“axi_env”, format(“build_phase”), UVM_MEDIUM);
agent = axi_master_agent.type_id.create(“agent”, this);
}
override void connect_phase(uvm_phase phase) {
super.connect_phase(phase);
}
}

class sv_base_test: uvm_test
{
mixin uvm_component_utils;

this(string name, uvm_component parent) {
super(name, parent);
}

@UVM_BUILD {
axi_env env;
sv_virtual_sequencer virtual_seqr;
}
override void build_phase(uvm_phase phase) {
uvm_info(“sv_base_test”, format(“build_phase”), UVM_MEDIUM);
env = axi_env.type_id.create(“env”,this);
virtual_seqr = sv_virtual_sequencer.type_id.create(“virtual_seqr”, this);
}
override void connect_phase(uvm_phase phase) {
super.connect_phase(phase);
virtual_seqr.m_write_cmd_sequencer = env.agent.wcmd_sequencer;
virtual_seqr.m_write_data_sequencer = env.agent.wdata_sequencer;
virtual_seqr.m_write_resp_ready_sequencer = env.agent.wresp_ready_sequencer;
}

}

class axi_test: sv_base_test
{
mixin uvm_component_utils;
this(string name, uvm_component parent) {
super(name, parent);
}

override void run_phase(uvm_phase phase) {
phase.raise_objection(this, “axi_test”);
phase.get_objection.set_drain_time(this, 1.usec);
sv_base_seq axi_test_seq;
axi_test_seq = sv_base_seq.type_id.create(“axi_test_seq”);
uvm_info (“AXI_TEST”, format (“created axi_test_seq”), UVM_MEDIUM);
axi_test_seq.cpu_axi_wr(0x20000000, 0x5555AAAA);
phase.drop_objection(this, “axi_test”);
}

}

Error log:
— Stack trace follows:

Dumping VCS Annotated Stack:
#0 0x00002aaab1b21965 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00002aaab7c226c0 in core.sync.condition.Condition.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#2 0x00002aaab7c22360 in core.sync.barrier.Barrier.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#3 0x00002aaab55a665f in esdl.base.core.PoolThread.execTaskProcesses() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#4 0x00002aaab7c24e3c in thread_entryPoint () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#5 0x00002aaab1b1ddd5 in start_thread () from /lib64/libpthread.so.0
#6 0x00002aaab24bfead in clone () from /lib64/libc.so.6
#0 0x00002aaab1b21965 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00002aaab7c226c0 in core.sync.condition.Condition.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#2 0x00002aaab7c22360 in core.sync.barrier.Barrier.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#3 0x00002aaab55a665f in esdl.base.core.PoolThread.execTaskProcesses() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#4 0x00002aaab7c24e3c in thread_entryPoint () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#5 0x00002aaab1b1ddd5 in start_thread () from /lib64/libpthread.so.0
#6 0x00002aaab24bfead in clone () from /lib64/libc.so.6
#0 0x00002aaab1b21965 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00002aaab7c226c0 in core.sync.condition.Condition.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#2 0x00002aaab7c22360 in core.sync.barrier.Barrier.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#3 0x00002aaab55a665f in esdl.base.core.PoolThread.execTaskProcesses() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#4 0x00002aaab7c24e3c in thread_entryPoint () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#5 0x00002aaab1b1ddd5 in start_thread () from /lib64/libpthread.so.0
#6 0x00002aaab24bfead in clone () from /lib64/libc.so.6
#0 0x00002aaab2486a89 in waitpid () from /lib64/libc.so.6
#1 0x00002aaab2404de2 in do_system () from /lib64/libc.so.6
#2 0x00002aaab2405191 in system () from /lib64/libc.so.6
#3 0x00002aaaab1472bb in SNPSle_10ee25eff68cd8461c9146fa1d0b35e87067f3c8015b313e639d2928478c79b3f673f99203bcf8be64600612100082236bffb2007f1e0ef9 () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/liberrorinf.so
#4 0x00002aaaab148d46 in SNPSle_10ee25eff68cd8461c9146fa1d0b35e87067f3c8015b313efba706aab251478fa49e66610e453774633a6c152e7ef778f2202cda681f3d4e () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/liberrorinf.so
#5 0x00002aaaab141ac5 in SNPSle_d35ca1ff70d465c2b9b1a72eee90a506fdd009d3de3db1de () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/liberrorinf.so
#6 0x00002aaaad5e20e8 in SNPSle_64133461705005bb725549e2e6fa1b3f () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/libvcsnew.so
#7 0x00002aaaad43f99e in SNPSle_82244d58c54c18c70d63edc9becab634 () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/libvcsnew.so
#9 0x00002aaab434ab7d in sv_test_lib.sv_base_seq.cpu_axi_wr(uint, uint).__lambda3() () from ./sv_test_lib.so
#10 0x00002aaab55a0a63 in esdl.base.core.Process.dg_wrap(void() delegate) () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#11 0x00002aaab7c24260 in fiber_entryPoint () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#12 0x0000000000000000 in ?? ()
#0 0x00002aaab1b21965 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00002aaab7c226c0 in core.sync.condition.Condition.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#2 0x00002aaab7c22360 in core.sync.barrier.Barrier.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#3 0x00002aaab55a7122 in esdl.base.core.EsdlExecutor.executeProcs() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#4 0x00002aaab55b0294 in _D4esdl4base4core13EsdlSimulator13runSimulationMFSQBwQBuQBs7SimTimeZv () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#5 0x00002aaab55b01d6 in esdl.base.core.EsdlSimulator.stepSim() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#6 0x00002aaab43fbe24 in _D4esdl4base4core13EsdlSimulator__T14elabRootThreadTC3uvmQBy10uvm_entity6uvm_tbZQBtMFQBhZ9__lambda2MFZv () from ./sv_test_lib.so
#7 0x00002aaab7c24e3c in thread_entryPoint () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#8 0x00002aaab1b1ddd5 in start_thread () from /lib64/libpthread.so.0
#9 0x00002aaab24bfead in clone () from /lib64/libc.so.6
#0 0x00002aaab1b23adb in do_futex_wait.constprop () from /lib64/libpthread.so.0
#1 0x00002aaab1b23b6f in __new_sem_wait_slow.constprop.0 () from /lib64/libpthread.so.0
#2 0x00002aaab1b23c0b in sem_wait@@GLIBC_2.2.5 () from /lib64/libpthread.so.0
#3 0x00002aaab7c23e68 in core.sync.semaphore.Semaphore.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libdruntime-ldc-shared.so.91
#4 0x00002aaab559a0f9 in esdl.base.core.AsyncLock.wait() () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#5 0x00002aaab5598574 in _D4esdl4base4core15AsyncTimedEvent8scheduleMFSQBsQBqQBo7SimTimebZb () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#6 0x00002aaab5596492 in _D4esdl4base4core8EventObj8scheduleMFSQBk4data4time4TimebZv () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/euvm/euvm-1.0-beta9/lib/libesdl-ldc-shared.so
#7 0x00002aaab4419231 in _D3uvm4meta7mailbox__T13MailVpiOutboxTC11sv_test_lib23axi_master_cmd_seq_itemZQCe11asyncNotifyMFS4esdl4data4time4TimeZv () from ./sv_test_lib.so
#8 0x00002aaab441950e in _D3uvm4meta7mailbox__T13MailVpiOutboxTC11sv_test_lib23axi_master_cmd_seq_itemZQCe8try_peekMFKQCdZb () from ./sv_test_lib.so
#9 0x00002aaab4394b26 in _D3uvm5comps14uvm_vpi_driver__TQtTC11sv_test_lib23axi_master_cmd_seq_itemVAyaa7_61786977636d64ZQDf24vpi_try_next_item_calltfFPaZi () from ./sv_test_lib.so
#10 0x00002aaaae84194a in SNPSle_8558840eca7f4a4e () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/libvcsnew.so
#11 0x00002aaaaace5513 in R_VCSgd_g7hgQ_6e () from /user/ssd_zcomp6/DV/chan.im/PRJ/MDV/simple_accel/dv_work/tc/axi/axi_idx001_basic_seq/simv.daidir/_67550_archive_1.so
#12 0x00002aaaad5938e0 in SNPSle_63c7abb936d47b07d29d61775f9dbe8c () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/libvcsnew.so
#13 0x00002aaaad5f48af in SNPSle_490598bfebcc8e81efcf3d1815066cc9 () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/libvcsnew.so
#14 0x00002aaaad606677 in SNPSle_490598bfebcc8e81 () from /raid/tools/synopsys/VCSMX/2017.12/linux64/lib/libvcsnew.so
#15 0x000000000040993f in main ()

Process VmPeak: 907776 kb, VmSize: 907772 kb
System Free Memory: 68920836 kb, System Free Swap: 134185724 kb
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 103079540 8659576 89160768 9% /
/dev/sdb1 1966562248 1090221860 776421796 59% /user/ssd_zcomp6

No context available
Aborting from core/sync/mutex.d(149) Error: pthread_mutex_destroy failed.Command line: ./simv +vpi -sv_lib sv_test_lib +warn=noFCDCI +vmm_log_nowarn_at_200 +vmm_log_nofatal_at_1000 +vcs+lic+wait +ntb_solver_array_size_warn=20000 +UVM_VERBOSITY=UVM_DEBUG +UVM_TESTNAME=sv_test_lib.axi_test -l simv.log