英文:
Why uvm_driver class is not abstract class while other like class uvm_sequence also parameterized class but it is abstract one?
问题
这里有不同的UVM类签名:
virtual class uvm_env extends uvm_component;
virtual class uvm_scoreboard extends uvm_component;
virtual class uvm_monitor extends uvm_component;
class uvm_sequencer #(type REQ=uvm_sequence_item, RSP=REQ)
extends uvm_sequencer_param_base #(REQ, RSP);
class uvm_driver #(type REQ=uvm_sequence_item,
type RSP=REQ) extends uvm_component;
virtual class uvm_sequence #(type REQ = uvm_sequence_item,
type RSP = REQ) extends uvm_sequence_base;
在上面,我们可以看到 uvm_sequencer
、uvm_driver
和 uvm_sequence
都是带有参数的类。为什么 uvm_sequence
类仍然是抽象类,而其他两个不是呢?
英文:
Here here different UVM class signatures:
virtual class uvm_env extends uvm_component;
virtual class uvm_scoreboard extends uvm_component;
virtual class uvm_monitor extends uvm_component;
class uvm_sequencer #(type REQ=uvm_sequence_item, RSP=REQ)
extends uvm_sequencer_param_base #(REQ, RSP);
class uvm_driver #(type REQ=uvm_sequence_item,
type RSP=REQ) extends uvm_component;
virtual class uvm_sequence #(type REQ = uvm_sequence_item,
type RSP = REQ) extends uvm_sequence_base;
In above we can see uvm_sequencer
, uvm_driver
and uvm_sequence
are parametrized classes. Why uvm_sequence
class is still abstract one, while other two are not?
答案1
得分: 2
以下是链接中的引用部分的中文翻译:
"uvm_driver 应该声明为虚拟类。除非您扩展它以执行实际的驱动操作,否则它没有任何有用的目的。虚拟关键字防止您构建它。"
英文:
Here is link to answer to same question. quoting from answer
"uvm_driver should have been declared as a virtual class. It serves no useful purpose unless you extend it with code that does the actual driving. The virtual keyword prevents you from ever constructing it."
https://verificationacademy.com/forums/uvm/why-uvm-driver-and-sequencer-are-non-virtual
答案2
得分: 2
The uvm_sequencer
class is not defined as virtual because it is already useful as it is without being extended.
The uvm_driver
class is not defined as virtual probably because of legacy from OVM. There were a couple of rare cases it could be used without extension.
英文:
The uvm_sequencer
class is not defined as virtual because it is already useful as it is without being extended.
The uvm_dirver
class is not defined as virtual probably because of legacy from OVM. There were a couple of rare cases it could be used without extension.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论