Sometimes the RTL being verified contains multiple instances of the same interface, where the prediction process only slightly differs. This snippet will present you with a solution for scalable scoreboard in such cases.
Let’s assume our environment consists of an array of agents of size AGENTS_NUM, each containing a monitor with an export. UVM does not provide a solution to implement a TLM write_() function which would allow a scoreboard to listen to all agents with a single call to it and also make it aware of each agent’s index, so here’s how one can create such a thing.
This custom uvm_port requires an index in the constructor to pass it later to write(). If provided, as shown below, then the write() function will be called for any seq_item coming from any monitor with index provided to indicate the sender.
And connection in env is clean and smooth, as it’s just a for-loop.