I need to use a common memory for 2 sequences. I have a memory defined as uvm_component and all the logic needed to build a memory and its parameterizable. This memory is placed in the sequencer so that the sequences can read/write to it and then drive request from the driver. This all works very well if I wanted to use memory per agent/sequence.
I want to now merge 2 sequences driving 2 different interfaces to use the same memory. I have tried the following ways
1) create the memory in TB, so sequences can write/read into. This is not possible as hierarchy is built in test, but when sequences are compiled it cannot find this hierarchy.
2) Cannot do uvm_config_db , as I cannot replace 2 memories from individual sequences to a common place in TB.
3) tried virtual sequence, but had to have 2 sequencers there to pass handles to these 2 lower sequencers. This would still mean 2 memories.
4) Made the sequences run on a single virtual sequencer, but that would not run as the driver widths are different so I would get error either on $cast as below.
Please let me know how to use single memory model across various sequences.
.
When I tried to run the lower sequences on same sequencer (just for using same memory). Here is the error I get. One sequencer data width is 128 and the other is 64. I have used $cast to cast one type of sequencer to the other and then run the sequence on the sequencer.
slave_memory_seq.start(kpEnv.sysSequencer.axi4_slave_sequencer, null); //128 bit sequence
//slave_memory_sram_seq.start(kpEnv.axi4_slave_agent_sram.m_sequencer, null);
slave_memory_sram_seq.start($cast (kpEnv.sysSequencer.axi4_slave_sram_sequencer, kpEnv.sysSequencer.axi4_slave_sequencer), null); //64 bit sequence.
Trying to use 1 sequencer (kpEnv.sysSequencer.axi4_slave_sequencer) which has the same memory so both sequences can share.
I get the following error
slave_memory_sram_seq.start($cast (kpEnv.sysSequencer.axi4_slave_sram_sequencer, kpEnv.sysSequencer.axi4_slave_sequencer), null);
|
ncelab: *E,TYCMPAT (./tb/tests/kp_base_test.sv,484|33): formal and actual do not have assignment compatible data types (expecting datatype compatible with 'class uvm_pkg::uvm_sequencer_base' but found 'integer' instead).
Is there any other way I could run 2 sequences on same sequencer (only purpose being to use the memory).
Thanks in advance!