Why uvm_driver class is not abstract class while other like class uvm_sequence also parameterized class but it is abstract one?

huangapple go评论67阅读模式
英文:

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_sequenceruvm_driveruvm_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.

huangapple
  • 本文由 发表于 2023年8月5日 00:28:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76837713.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定