简体   繁体   中英

Why has uvm_top disappeared?

I compiled my first IEEE 1800.2-2017 UVM code this week and was surprised to discover that uvm_top no longer exists. A quick search of IEEE 1800.2-2017 reveals no occurrence of "uvm_top" and a quick look at the source code reveals that it really has disappeared. Here are two workarounds:

Instead of, eg:

comp = uvm_top.find("*.m_agent.m_seqr"); // uvm 1.2

you could do:

comp = uvm_root::get().find("*.m_agent.m_seqr"); // IEEE 1800.2-2017

or, if you prefer:

uvm_root uvm_top = uvm_root::get();
comp = uvm_top.find("*.m_agent.m_seqr"); 

I have two questions:

i) Why did the creators of IEEE 1800.2-2017 get rid of uvm_top ? ii) What do they intend us to do instead? (one of those things above or something else?)

Speculations:

  1. Dogmatism that global variables are evil and should be avoided (even if in this case the variable is const ).

  2. It's easier for them to generate the class reference, because the tool can handle classes and functions, but not variables inside packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM