Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

Should UVM Analysis Interface write const objects

$
0
0

The current write method sends a handle to a non-const object. This allows any subscriber to a uvm_analysis_port to modify the object in the monitor. This is BAD.

 

To prevent this it would be ideal to make the write method take a const object. However, in SV the const keyword only affects the handle, not the object pointed to by the handle. In C++ you can make what the pointer is pointing to const. I don't see a way to do that in SV. Making the handle const is not useful in this case.

 

With this language shortcoming, the monitor could copy its transaction before doing the write, thus ensuring that its copy can't be modiified. This would work, but a performance penalty would be paid for every write to an analysis port whether it was needed or not. If the object was declared const then it would force the subscriber to make a non-const copy only when needed.

 

Am I understanding the limitation of SV correctly? If so, is there a request to fix it? If that happened, shouldn't the TLM interfaces be modified to pass const objects?

 


Viewing all articles
Browse latest Browse all 756

Trending Articles