Design has SPI interface , where there is continuous toggling MOSI lines. In the Driver each set of bits is decoded to perform respective tasks .
class driver_spi extends uvm_driver#(spi_pkt);
--
task get_addr_data();
for (i=15;i>=0;i=i-1)
begin
@(posedge spi_if.spi_clk);
addr[i] = spi_if.spi_mosi;
end
for (i=31;i>=0;i=i-1)
begin
@(posedge spi_if.spi_clk);
data[i] = spi_if.spi_mosi;
end
endtask
task drive();
forever
begin
seq_item_port.get_next_item(req);
fork
$display ( "In Addr decoding phase");
get_addr_data();
$display ( "In Data decoding phase");
get_addr_data();
join
seq_item_port.item_done();
end
endtask
---
endclass:driver_spi
Need to know spi_mosi[23] bit during the data_phase, which needs to be send back to sequence , based on the validity of bit in sequence, need to stop the testcase .
considering seq_item_port.item_done(rsp); that would provide rsp after all transactions.
Please suggest how this can be achieved.