UVM basics -------- uvm_root

Source: Internet
Author: User
Uvm_root is the top-level instance of UVM that plays the role of a top-level and Phase Controller for component. This class does not need to be instantiated by the user. It is an automatically instantiated class that the user calls directly through uvm_top. Any component, as long as its parent is not specified, will act as a child of the top. Top manages all component phase; 1. the UVM automatically creates a single instance of uvm_root that users can access via the Global (uvm_pkg-scope) variable, uvm_top.2. key roles of uvm_top instances: 1. implicit top-level (implicit top level) The uvm_top serves as an implicit top-level component. any component whose parent is specified as null becomes a child of uvm_top. thus, all UVM components in simulation are descendants of uvm_top . If all created parents are specified as null, they will become the child of uvm_top, and uvm_top is the top layer of the UVM build tree.
2. phase Control uvm_top manages the phasing for all components. 3. search use uvm_top to search for components based on their hierarchical name. see find and find_all. (use the uvm_top hierarchical name-based search component) 4. report configuration use uvm_top to globally configure report verbosity, log files, and actions. for example, uvm_top.set_report_verbosity_level_hier (uvm_full) wocould set full verbosity for all components in simulation. 5. global Reporter because uvm_top is globally accessible (in uvm_pkg scope), UVM's reporting mechanism is accessible from anywhere outside uvm_component, such as in modules and sequences. see uvm_report_error, uvm_report_warning, and other global methods.
1. Attribute uvm_component top_levels [$]; // each top is registered in I. e test, it includes des Uvm_test_topComponent that is created by run_test as well as any other top level components that have been instantiated anywhere in the hierarchy. bit enable_print_topology = 0; // If set, print the topological structure bit finish_on_completion = 1 at the end of end_of_elaboration phase; // If set, then run_test will call $ finish after all phases are executed. time phase_timeout = 'uvm _ default_timeout; static local uvm_root m_inst; bit m_phase_all_done; // all stages are completed
2. main API methods: 1. virtual task run_test (string test_name = ""): // parses the command line "+ uvm_testname =", extracts uvm_test_top from the factory, constructs an instance, and calls the corresponding instance.
1. phases all components through all registered Phases 2. if the optional test_name argument is provided, or if a command-line plusarg, + uvm_testname = test_name, is found, then the specified component is created just prior to phasing. 2. find/find_all: 1. function void uvm_root: find_all (string comp_match, ref uvm_component comps [$], input uvm_component comp = NULL); // query the entire uvm_top and call m_find_all_recurse to implement 2. function uvm_component uvm_root: Find (string comp_match); // call uvm_root: find_all to implement 3. uvm_root private function:

1. function uvm_root: New (); // set reporter, command_processor, and call report_header 1. call super. new ("_ top _", null) sets uvm_root to the top layer of the tree 2. set reporter, get command_processor, and call report_header 3. call m_check_verbosity to obtain and set verbosity 2 through the command line. function uvm_root: Get (); 1. form a single-State class of uvm_root 2. uvm_domain: get_common_domain (); m_inst.m_domain = uvm_domain: get_uvm_domain () is called to generate two domains, one common and one uvm_domain 3. task uvm_root: run_phase (uvm_phase phase); // This function mainly checks whether $ time is 0. If not 0, an error is reported because run must start from 0. function void uvm_root: m_do_dump_args (); // If the command line has + uvm_dump_linline_args, output all the parameters of the command line 5. function void uvm_root: build_phase (uvm_phase phase); // call some built-in functions to complete the UVM simulation environment configuration: Super. build_phase (phase); m_set_cl_msg_args (); m_do_verbosity_settings (); // parse command line Input + uvm_set_verbosity =, mainly for some syntax checks. If any problem is found, an error is reported, do not process the settings m_do_timeout_settings (); // parse the "+ uvm_timeout =" command line, and apply the settings to uvm_top m_do_factory_settings (); // parse the + (parser | parser) = of the command line, call m_process_inst_override or call m_process_type_override m_do_config_settings (); obtain from the command line + (uvm_set_config_int | uvm_set_config_int) = settings, parse the settings and call m_process_config to record these settings in the resource database m_do_max_quit_settings (); + uvm_max_quit_count = this option for parsing the command line, set this option to the global report_server m_do_dump_args (); // If the command line has + uvm_dump_linline_args, all parameters of the command line are output.



From Weizhi note (wiz)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.