# What is the best/recommended practice to implement a bi-direction bus in uvm framework

**URL:** <https://verificationacademy.com/forums/t/what-is-the-best-recommended-practice-to-implement-a-bi-direction-bus-in-uvm-framework/40775>\
**Category:** UVM\
**Tags:** UVM, UVM-Framework\
**Created:** [August 22, 2022, 3:45am UTC](https://verificationacademy.com/forums/t/what-is-the-best-recommended-practice-to-implement-a-bi-direction-bus-in-uvm-framework/40775 "2022-08-22T03:45:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxwbobo](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/z/d26b3c/32.png) [@zxwbobo](https://verificationacademy.com/forums/u/zxwbobo)\
**Post date:** [August 22, 2022, 3:45am UTC](https://verificationacademy.com/forums/t/what-is-the-best-recommended-practice-to-implement-a-bi-direction-bus-in-uvm-framework/40775/1 "2022-08-22T03:45:21Z")

</div>

hi sir,  
i’m trying to adopt uvm framework to next project, and will use sim/emu test bench (yes, my company has veloce server ^-^, and that’s why uvm framework attracts me)  
but there is an implementation choice surfacing:  
the protocol that dut uses is a bi-directional, req/response protocol, similar like pcie tlp (memory read/write, and write also needs response) but far simpler since it is an on chip bus and no switch connection)

![](https://sm.ms/image/S7F1Cl9Tvi5kUuy)

> **[bi-dir-bus.png - SM.MS - Simple Free Image Hosting](https://sm.ms/image/S7F1Cl9Tvi5kUuy)**
>
> Simple Free Image Hosting

the figure below is tx cmd examples. anyway, dut/agent could receive commands at any time as long as rx bus is idle, and relies status after cmd finished.  
so here is my question:  
where to implement this protocol, bus\_driver or bus\_driver\_bfm? (NOTICE: i wish i could get benefit from veloce either)  
in uvm framework, it defines an agent/driver either INITIATOR or RESPONDER but both, so i’m not sure what is best/recommend way to handle this protocol.  
I could process all the commands in driver or driver\_bfm. the implementation of this protocol is up to me. anyway, since i decided to adopt uvm framework, it’s better to obeying experts’ advices, and i believe this will gain especial veloce speed-up performance

thanks!

---

<div class="post-metadata">

**Author:** ![zxwbobo](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/z/d26b3c/32.png) [@zxwbobo](https://verificationacademy.com/forums/u/zxwbobo)\
**Post date:** [August 22, 2022, 3:51am UTC](https://verificationacademy.com/forums/t/what-is-the-best-recommended-practice-to-implement-a-bi-direction-bus-in-uvm-framework/40775/2 "2022-08-22T03:51:17Z")

</div>

_In reply to [zxwbobo](https://verificationacademy.com/forums/t/what-is-the-best-recommended-practice-to-implement-a-bi-direction-bus-in-uvm-framework/40775):_

there is a typo in the figure.  
rx\_rsp should be rx\_data, and cmd/rsp will be distinguished by data (with rx\_start rising edge) itself  
e.g., at rx\_starting rising, msb of data set to 1’b1 indicates command, and 0 means response

thanks
