Tuesday, 14 June 2016

Handshake Mechanism : Driver or Sequence?


In this article, I am sharing my thoughts on whether the Response handling mechanism should be in Driver or sequence?
The most common form of sequence - driver use models is the scenario where the sequencer sends sequence item to the driver, which process the item to the pin level  protocol format and also the driver needs to respond to the pin-level information or send back the response to the sequence.

For example as shown in below figure the Protocol requires an ACK/NACK handshake from DUT after every 8 bits of data. Depending upon the Response the next set of action is taken place.
  

                                                                                                    Figure 1: Serial Protocol 


          For the above protocol format the state Machine logic is implemented in Driver. It is easy to have such a logic in driver than sequence. Let us discuss in detail.

Figure 2: State Machine Logic Implemented in Driver


 After analyzing, it was decided that for this protocol format the Response handling mechanism should be  in Driver than in sequence because of the following Reasons.

1) If we have Response logic in sequence, the user who uses the VIP has to have in-depth protocol Knowledge in writing sequences/test cases and sequence looks more complex and takes time in coding/debugging them.
                                    
                                
Figure 3:  Handshake Mechanism: Response Control in Sequence

2)   If we have Response logic in Driver, coding the sequence will become simpler but the driver logic is complex and sometimes we may require more flags to control the logic which will be bit confusing.

                                    Figure 4:  Handshake Mechanism: Response Control in Driver

A good VIP implementation shall consider such scenarios and arrive at a trade-off based on the protocol requirements.

No comments:

Post a Comment