Two different logic in single driver

Hello all,
I have two sequences, “config_seq” and “data_seq”. “config_seq” is used to configure the DUT, and “data_seq” is used for data transfer. data_seq requires a handshaking mechanism between DUT and TB but config_seq doesn’t require. For both sequences, I have to use the same driver.
How to implement this in a single driver logic?

In reply to Malai_21:

What do you mean with ‘handshake mechanism’? Dou have to put back to the sequence a response or what is it?

In reply to chr_sue:

In reply to Malai_21:
What do you mean with ‘handshake mechanism’? Dou have to put back to the sequence a response or what is it?

No need to response back to the sequence. while Driving data to DUT, a request is issued from DUT and TB has to give “ack”, transfer the data. This is happening in the driver only.
while configuring DUT I don’t have to perform handshaking. Both configuration and data transfer happens in a single APB interface.

 I have a single drive to perform both configuration and data transfer.

In reply to Malai_21:

Where is the problem? I guess during configuration no data are coming from the DUT. It is straight forward. If you get the request you are reacting with the acknowledge. This is simple behavior.

In reply to chr_sue:

During configuration, no request will come from DUT. But during data transfer request has to come from DUT.

If I use the same drive for configuration, it was waiting for the request from DUT.

My requirement is if I start the configuration sequence, the driver should not wait for the request, if I start the data transfer sequence, it should wait for the request.

 Both should be implemented in a single driver. Is there a way to identify a sequence? or I can use sub-phase in the run phase?

In reply to Malai_21:

Could you please show a piece of your driver code?
Of course you can pass an identifier to your seq_item which indicates the configuration function or the reactive function.

After reading this question, I understand that you running two sequences config_seq and data_seq on driver. config_seq doesnt need rsp and data_seq requires rsp from dut.

So if using same driver how does the config_seq handles the rsp, since it does not have mechanism to handle rsp

Example code

//driver run task

seq_item_port.get_next_item(req);
drive_dut(req);
seq_item_port.item_done(rsp);


//config_seq
start_item(req);
req.randomize();
finish_item(); //how does rsp is handled here? rsp fifo might overflow since use the rsp here.

//data_seq
start_item(req);
req.randomize();
finish_item();
get_response(rsp); //rsp handled here

In reply to UVM_SV_101:

As I said you can add a datamember to your seq_item which is indicating wwhat type of sequence you are running. Then you can deal with the response and without response depending on this identifier.

In reply to chr_sue:

got it thanks!