uvm_env——UVM大环境(UVM Environment )

1 What is uvm_env?

  uvm_env is used to create and connect the uvm_components like driver, monitors , sequeners etc. A environment class can also be used as sub-environment in another environment.User-defined environment is derived from uvm_env, uvm_env is inherited from uvm_component.
Environment is the container class, It contains one or more agents, as well as other components such as scoreboard, top level monitor, and checker.

文件:
src/comps/uvm_env.svh
类:
uvm_env
//------------------------------------------------------------------------------
//
// CLASS: uvm_env
//
// The base class for hierarchical containers of other components that
// together comprise a complete environment. The environment may
// initially consist of the entire testbench. Later, it can be reused as
// a sub-environment in even larger system-level environments.
//------------------------------------------------------------------------------

virtual class uvm_env extends uvm_component;

  // Function: new
  //
  // Creates and initializes an instance of this class using the normal
  // constructor arguments for <uvm_component>: ~name~ is the name of the
  // instance, and ~parent~ is the handle to the hierarchical parent, if any.

  function new (string name="env", uvm_component parent=null);
    super.new(name,parent);
  endfunction

  const static string type_name = "uvm_env";

  virtual function string get_type_name ();
    return type_name;
  endfunction

endclass

如上所示,uvm_env扩展uvm_component,是两大容器之一(另一个是uvm_agent).本质上来讲,UVM是将验证平台和激励(uvm_test 和seqence)分开的,umv_env是验证平台的顶层,所有关于平台相关的代码都应该在top_env extends uvm_env中配置完成。

参考文献:

1 UVM Env. http://www.verificationguide.com/p/uvm-env.html.

2 Uvm_env. http://testbench.in/UT_02_UVM_TESTBENCH.html

原文地址:https://www.cnblogs.com/dpc525/p/7867687.html