# What are the key points when implementing Driver?

**URL:** <https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300>\
**Category:** UVM\
**Tags:** UVM, driver\
**Created:** [July 16, 2019, 7:29am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300 "2019-07-16T07:29:06Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 16, 2019, 7:29am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/1 "2019-07-16T07:29:06Z")

</div>

I am writing a driver for my tb, now I feel puzzled when it comes to the timing, I am ok with other key points like virtual interface and get\_next\_item() methods, but how to code the main driving part where the timing is concerned?

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [July 16, 2019, 8:44pm UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/2 "2019-07-16T20:44:25Z")

</div>

_In reply to [Marina.Miao](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300):_

In your driver’s run\_phase you have to implement the timing required by the spec of your functional interface. This includes the correct generaition of all control signals and the timing with respect to clock cycles. In other words the driver has to implement the interface protocol.

---

<div class="post-metadata">

**Author:** ![MSB](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MSB](https://verificationacademy.com/forums/u/MSB)\
**Post date:** [July 16, 2019, 10:49pm UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/3 "2019-07-16T22:49:34Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/2):_

> _In reply to [Marina.Miao](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/2):_  
> In your driver’s run\_phase you have to implement the timing required by the spec of your functional interface. This includes the correct generaition of all control signals and the timing with respect to clock cycles. In other words the driver has to implement the interface protocol.

Need to take care of input and output skews. This can be achieved using clocking block by mentioning the skews in it.

---

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 17, 2019, 1:36am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/4 "2019-07-17T01:36:20Z")

</div>

_In reply to [mbhat](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/3):_

Yes, I have implemented interface using clocking block and modport, and skew is included, the main problem for me I think is the correct generation of all control signals and timing with respect to clock cycles. I am doing it for the first time so I am still struggling here.  
There are just five signals here: valid, start, length that indicates the packet length, and ready, It must be easy, but for me it is not. QAQ(crying)

Thanks anyway.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [July 17, 2019, 6:24am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/5 "2019-07-17T06:24:06Z")

</div>

_In reply to [Marina.Miao](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/4):_

You should have in your interface spec waveform visualizing the behavior of all your signals. Follow these descriptions.

---

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 17, 2019, 7:32am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/6 "2019-07-17T07:32:55Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/5):_

there is only word description in the spec right now, no waveform for me.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [July 17, 2019, 7:53am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/7 "2019-07-17T07:53:52Z")

</div>

_In reply to [Marina.Miao](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/6):_

Then the timing should be described in words like this: The start bit becomes high, then the data are transmitted (data length is 8 bit) afterwards the stop bit is asserted…

---

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 17, 2019, 12:02pm UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/8 "2019-07-17T12:02:00Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/7):_

No, QAQ, it not like that, just description for each signals, no timing descriptions .

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [July 17, 2019, 12:14pm UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/9 "2019-07-17T12:14:05Z")

</div>

_In reply to [Marina.Miao](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/8):_

Could you please post the desription for one signal? What kind of DUT do you have?

---

<div class="post-metadata">

**Author:** ![bro\_fed\_learning](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bro\_fed\_learning](https://verificationacademy.com/forums/u/bro_fed_learning)\
**Post date:** [July 17, 2019, 10:52pm UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/10 "2019-07-17T22:52:07Z")

</div>

If you are not provided with timing details, maybe the input signals are from standard protocol I/F? I2C? APB? AHB? etc. You need to check the standard documentation for the timing.

---

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 18, 2019, 1:21am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/11 "2019-07-18T01:21:08Z")

</div>

_In reply to [bro\_fed\_learning](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/10):_

No, it is defined by our designer, not standard protocol IF.

---

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 18, 2019, 1:26am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/12 "2019-07-18T01:26:54Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/11):_

RxReady output This signal is used by Transport to backpressure data from Adapter Layer. It is high when Transport ingress can accept data from Adapter Layer. When interfacing logic layer, this signal should be always high.

Just like this.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [July 18, 2019, 5:44am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/13 "2019-07-18T05:44:22Z")

</div>

_In reply to [Marina.Miao](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/12):_

If you have only this kind of information you have to ask your designer for some waveforms describing how the interface is working, because this is an absolute need.

---

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 19, 2019, 1:27am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/14 "2019-07-19T01:27:39Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/13):_

Thank you very much for all your replies, more experienced verification colleague said it’s simple enough so waveform is not necessary.

---

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 21, 2019, 8:40am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/15 "2019-07-21T08:40:05Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/14):_

if I want to randomize the ‘ready’ signal on the bus, how can I implement in my driver?

I currently do it in this way:  
define a rand variable ready in the class driver\_cfg, create a substance of driver\_cfg in the build\_phase of driver class, then use driver\_cfg.randmize() with {constraint of ready}, but I don’t know how to implement in the constraint.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [July 21, 2019, 11:35am UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/16 "2019-07-21T11:35:16Z")

</div>

_In reply to [Marina.Miao](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/15):_

I’d recommend you should whatch this course:  
[https://verificationacademy.com/courses/basic-uvm](https://verificationacademy.com/courses/basic-uvm)  
BTW, is ready an input or an output signal?

---

<div class="post-metadata">

**Author:** ![MarinaZhang](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MarinaZhang](https://verificationacademy.com/forums/u/MarinaZhang)\
**Post date:** [July 21, 2019, 12:45pm UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/17 "2019-07-21T12:45:38Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/16):_

ready is DUT’s input signal, so my tb drive this signal, at the same time the driver sample data according to valid and ready, and then encapsulate into items.

BTW, I have learned all the basic\_uvm course last year or so.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [July 21, 2019, 2:36pm UTC](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/18 "2019-07-21T14:36:01Z")

</div>

_In reply to [Marina.Miao](https://verificationacademy.com/forums/t/what-are-the-key-points-when-implementing-driver/36300/17):_

Looks like you should have another look tto the basics.  
What you have to do is to define:  
(1) a seq\_item which contains all your data members you need  
(2) a sequence which generates seq\_items  
(3) a sequencer/driver pair  
(4) construct them  
(5) then you can execute your sequence on the sequencer.

The details are described on the basics video.
