Config_db VS TLM

Hi ,

In layered protocol such as USB I have seen config_db being used by phy layer to pass information to the protocol layer for further processing .
A certain thread in protocol Monitor uses wait_modified so that as soon phy deserializes data it can send it to protocol layer .

My question is couldn’t TLM be used in this scenario ?
I understand that TLM can be unidirectional as well as bidirectional whereas config_db is unidirectional . But TLM unidirectional put could be replaced with config_db ( Assuming the consumer component is never overridden via factory ) right ? TLM get is where I feel config_db can’t be replaced with config_db .

Any performance wise preference between the 2 ?

Thanks .

In reply to MICRO_91:

There is no direction associated with uvm_config_db. They are essentially global variables accessed with string names. Every call to the uvm_config_db involves a lot of string processing. It was designed for initialization and occasional communication.

TLM establishes a strict protocol or contract on who initiates transfer of data and the direction of that transfer. It make take a little extra effort to setup, but communication is more efficient.

The UVM provides a few other mechanisms that might be more efficient than either, like the pool classes. You really need to experiment and read the code to get a feel for what is best for your situation.