Uvm Ieee 18002-2020
Uvm Ieee 18002-2020
Uvm Ieee 18002-2020
STANDARDS
Verification Methodology Language
Reference Manual
Developed by the
Design Automation Standards Committee
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2™-2020
(Revision of
IEEE Std 1800.2-2017)
Developed by the
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
Grateful acknowledgment is made for permission to use the following source material:
Abstract: The Universal Verification Methodology (UVM) that can improve interoperability, reduce
the cost of using intellectual property (IP) for new projects or electronic design automation (EDA)
tools, and make it easier to reuse verification components is provided. Overall, using this standard
will lower verification costs and improve design quality throughout the industry. The primary
audiences for this standard are the implementors of the UVM base class library, the implementors of
tools supporting the UVM base class library, and the users of the UVM base class library.
Keywords: agent, blocking, callback, class, component, consumer, driver, event, export, factory,
function, generator, IEEE 1800.2™, member, method, monitor, non-blocking, phase, port, register,
resource, sequence, sequencer, transaction-level modeling, verification methodology
IEEE is a registered trademark in the U.S. Patent & Trademark Office, owned by The Institute of Electrical and Electronics
Engineers, Incorporated.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
Important Notices and Disclaimers Concerning IEEE Standards Documents
IEEE documents are made available for use subject to important notices and legal disclaimers. These notices
and disclaimers, or a reference to this page, appear in all standards and may be found under the heading
“Important Notices and Disclaimers Concerning IEEE Standards Documents.” They can also be obtained on
request from IEEE or viewed at http://standards.ieee.org/IPR/disclaimers.html.
IEEE Standards do not guarantee or ensure safety, security, health, or environmental protection, or ensure
against interference with or from other devices or networks. Implementers and users of IEEE Standards
documents are responsible for determining and complying with all appropriate safety, security, environmental,
health, and interference protection practices and all applicable laws and regulations.
IEEE does not warrant or represent the accuracy or content of the material contained in its standards, and
expressly disclaims all warranties (express, implied and statutory) not included in this or any other document
relating to the standard, including, but not limited to, the warranties of: merchantability; fitness for a particular
purpose; non-infringement; and quality, accuracy, effectiveness, currency, or completeness of material. In
addition, IEEE disclaims any and all conditions relating to: results; and workmanlike effort. IEEE standards
documents are supplied “AS IS” and “WITH ALL FAULTS.”
Use of an IEEE standard is wholly voluntary. The existence of an IEEE standard does not imply that there are
no other ways to produce, test, measure, purchase, market, or provide other goods and services related to the
scope of the IEEE standard. Furthermore, the viewpoint expressed at the time a standard is approved and issued
is subject to change brought about through developments in the state of the art and comments received from
users of the standard.
In publishing and making its standards available, IEEE is not suggesting or rendering professional or other
services for, or on behalf of, any person or entity nor is IEEE undertaking to perform any duty owed by any
other person or entity to another. Any person utilizing any IEEE Standards document, should rely upon his or
her own independent judgment in the exercise of reasonable care in any given circumstances or, as appropriate,
seek the advice of a competent professional in determining the appropriateness of a given IEEE standard.
IN NO EVENT SHALL IEEE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO:
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE PUBLICATION, USE OF, OR RELIANCE UPON
ANY STANDARD, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE AND
REGARDLESS OF WHETHER SUCH DAMAGE WAS FORESEEABLE.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
Translations
The IEEE consensus development process involves the review of documents in English only. In the event that
an IEEE standard is translated, only the English version published by IEEE should be considered the approved
IEEE standard.
Official statements
A statement, written or oral, that is not processed in accordance with the IEEE SA Standards Board Operations
Manual shall not be considered or inferred to be the official position of IEEE or any of its committees and shall
not be considered to be, or be relied upon as, a formal position of IEEE. At lectures, symposia, seminars, or
educational courses, an individual presenting information on IEEE standards shall make it clear that his or her
views should be considered the personal views of that individual rather than the formal position of IEEE.
Comments on standards
Comments for revision of IEEE Standards documents are welcome from any interested party, regardless of
membership affiliation with IEEE. However, IEEE does not provide consulting information or advice
pertaining to IEEE Standards documents. Suggestions for changes in documents should be in the form of a
proposed change of text, together with appropriate supporting comments. Since IEEE standards represent a
consensus of concerned interests, it is important that any responses to comments and questions also receive the
concurrence of a balance of interests. For this reason, IEEE and the members of its societies and Standards
Coordinating Committees are not able to provide an instant response to comments or questions except in those
cases where the matter has previously been addressed. For the same reason, IEEE does not respond to
interpretation requests. Any person who would like to participate in revisions to an IEEE standard is welcome
to join the relevant IEEE working group.
Users of IEEE Standards documents should consult all applicable laws and regulations. Compliance with the
provisions of any IEEE Standards document does not imply compliance to any applicable regulatory
requirements. Implementers of the standard are responsible for observing or referring to the applicable
regulatory requirements. IEEE does not, by the publication of its standards, intend to urge action that is not in
compliance with applicable laws, and these documents may not be construed as doing so.
Copyrights
IEEE draft and approved standards are copyrighted by IEEE under US and international copyright laws. They
are made available by IEEE and are adopted for a wide variety of both public and private uses. These include
both use, by reference, in laws and regulations, and use in private self-regulation, standardization, and the
promotion of engineering practices and methods. By making these documents available for use and adoption by
public authorities and private users, IEEE does not waive any rights in copyright to the documents.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
Photocopies
Subject to payment of the appropriate fee, IEEE will grant users a limited, non-exclusive license to photocopy
portions of any individual standard for company or organizational internal use or individual, non-commercial
use only. To arrange for payment of licensing fees, please contact Copyright Clearance Center, Customer
Service, 222 Rosewood Drive, Danvers, MA 01923 USA; +1 978 750 8400. Permission to photocopy portions
of any individual standard for educational classroom use can also be obtained through the Copyright Clearance
Center.
Users of IEEE Standards documents should be aware that these documents may be superseded at any time by
the issuance of new editions or may be amended from time to time through the issuance of amendments,
corrigenda, or errata. An official IEEE document at any point in time consists of the current edition of the
document together with any amendments, corrigenda, or errata then in effect.
Every IEEE standard is subjected to review at least every 10 years. When a document is more than 10 years old
and has not undergone a revision process, it is reasonable to conclude that its contents, although still of some
value, do not wholly reflect the present state of the art. Users are cautioned to check to determine that they have
the latest edition of any IEEE standard.
In order to determine whether a given document is the current edition and whether it has been amended through
the issuance of amendments, corrigenda, or errata, visit IEEE Xplore at http://ieeexplore.ieee.org/ or contact
IEEE at the address listed previously. For more information about the IEEE SA or IEEE’s standards
development process, visit the IEEE SA Website at http://standards.ieee.org.
Errata
Errata, if any, for IEEE standards can be accessed via https://standards.ieee.org/standard/index.html. Search for
standard number and year of approval to access the web page of the published standard. Errata links are located
under the Additional Resources Details section. Errata are also available in IEEE Xplore:
https://ieeexplore.ieee.org/browse/standards/collection/ieee/. Users are encouraged to periodically check for
errata.
Patents
Attention is called to the possibility that implementation of this standard may require use of subject matter
covered by patent rights. By publication of this standard, no position is taken by the IEEE with respect to the
existence or validity of any patent rights in connection therewith. If a patent holder or patent applicant has filed
a statement of assurance via an Accepted Letter of Assurance, then the statement is listed on the IEEE SA
Website at https://standards.ieee.org/about/sasb/patcom/patents.html. Letters of Assurance may indicate
whether the Submitter is willing or unwilling to grant licenses under patent rights without compensation or
under reasonable rates, with reasonable terms and conditions that are demonstrably free of any unfair
discrimination to applicants desiring to obtain such licenses.
Essential Patent Claims may exist for which a Letter of Assurance has not been received. The IEEE is not
responsible for identifying Essential Patent Claims for which a license may be required, for conducting
inquiries into the legal validity or scope of Patents Claims, or determining whether any licensing terms or
conditions provided in connection with submission of a Letter of Assurance, if any, or in any licensing
agreements are reasonable or non-discriminatory. Users of this standard are expressly advised that
determination of the validity of any patent rights, and the risk of infringement of such rights, is entirely their
own responsibility. Further information may be obtained from the IEEE Standards Association.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
Participants
At the time this IEEE standard was completed, the Universal Verification Methodology (UVM) Working
Group had the following membership:
The following members of the entity balloting committee voted on this standard. Balloters may have voted for
approval, disapproval, or abstention.
When the IEEE SA Standards Board approved this standard on 4 June 2020, it had the following membership:
6
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
Introduction
This introduction is not part of IEEE Std 1800.2™-2020, IEEE Standard for Universal Verification Methodology Language
Reference Manual.
Verification has evolved into a complex project that often spans internal and external teams, but the
discontinuity associated with multiple, incompatible methodologies among those teams can limit productivity.
The Universal Verification Methodology (UVM) Language Reference Manual (LRM) addresses verification
complexity and interoperability within companies and throughout the electronics industry for both novice and
advanced teams while also providing consistency. While UVM is revolutionary, being the first verification
methodology to be standardized, it is also evolutionary, as it is built on the Open Verification Methodology
(OVM), which combined the Advanced Verification Methodology (AVM) with the Universal Reuse
Methodology (URM) and concepts from the e Reuse Methodology (eRM). Furthermore, UVM also infuses
concepts and code from the Verification Methodology Manual (VMM), plus the collective experience and
knowledge of the over 300 members of the Accellera UVM Working Group to help standardize verification
methodology. Finally, the transaction-level modeling (TLM) facilities in UVM are based on what was
developed by Open SystemC Initiative (OSCI) for SystemC, though they are not an exact replication or re-
implementation of the SystemC TLM library.
7
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
Contents
1. Overview ...................................................................................................................................................12
1.1 Scope ..................................................................................................................................................12
1.2 Purpose ...............................................................................................................................................12
1.3 Word usage .........................................................................................................................................12
1.4 Conventions used ................................................................................................................................13
2. Normative references.................................................................................................................................15
9. Phasing ......................................................................................................................................................81
9.1 Overview ............................................................................................................................................81
9.2 Implementation ...................................................................................................................................81
9.3 Phasing definition classes ...................................................................................................................82
9.4 uvm_domain .......................................................................................................................................91
9.5 uvm_bottomup_phase .........................................................................................................................92
9.6 uvm_task_phase..................................................................................................................................92
9.7 uvm_topdown_phase ..........................................................................................................................93
9.8 Predefined phases ...............................................................................................................................94
8
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
10.2 uvm_event_callback .......................................................................................................................101
10.3 uvm_barrier ....................................................................................................................................102
10.4 Pool classes .....................................................................................................................................104
10.5 Objection mechanism .....................................................................................................................105
10.6 uvm_heartbeat ................................................................................................................................110
10.7 Callbacks classes ............................................................................................................................112
9
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
18.2 uvm_reg_map .................................................................................................................................263
18.3 uvm_reg_file ...................................................................................................................................271
18.4 uvm_reg ..........................................................................................................................................273
18.5 uvm_reg_field .................................................................................................................................290
18.6 uvm_mem .......................................................................................................................................301
18.7 uvm_reg_indirect_data ...................................................................................................................315
18.8 uvm_reg_fifo ..................................................................................................................................315
18.9 uvm_vreg ........................................................................................................................................319
18.10 uvm_vreg_field .............................................................................................................................328
18.11 uvm_reg_cbs .................................................................................................................................334
18.12 uvm_mem_mam ...........................................................................................................................339
10
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
F.3 Methods and types ............................................................................................................................434
F.4 Core service ......................................................................................................................................438
F.5 Traversal ...........................................................................................................................................442
F.6 uvm_run_test_callback .....................................................................................................................445
F.7 uvm_root ..........................................................................................................................................446
11
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Standard for Universal
Verification Methodology Language
Reference Manual
1. Overview
1.1 Scope
This standard establishes the Universal Verification Methodology (UVM), a set of application programming
interfaces (APIs) that defines a base class library (BCL) definition used to develop modular, scalable, and
reusable components for functional verification environments. The APIs and BCL are based on the IEEE
standard for SystemVerilog, IEEE Std 1800™. 1
1.2 Purpose
Verification components and environments are currently created in different forms, making interoperability
among verification tools and/or geographically dispersed design environments both time consuming to develop
and error prone. The results of the UVM standardization effort will improve interoperability and reduce the cost
of repurchasing and rewriting intellectual property (IP) for each new project or electronic design automation
(EDA) tool, as well as make it easier to reuse verification components. Overall, the UVM standardization effort
will lower verification costs and improve design quality throughout the industry.
The word shall indicates mandatory requirements strictly to be followed in order to conform to the standard and
from which no deviation is permitted (shall equals is required to). 2, 3
The word should indicates that among several possibilities one is recommended as particularly suitable, without
mentioning or excluding others; or that a certain course of action is preferred but not necessarily required
(should equals is recommended that).
The word may is used to indicate a course of action permissible within the limits of the standard (may equals is
permitted to).
The word can is used for statements of possibility and capability, whether material, physical, or causal (can
equals is able to).
1
Information on references can be found in Clause 2.
2
The use of the word must is deprecated and cannot be used when stating mandatory requirements, must is used only to describe
unavoidable situations.
3
The use of will is deprecated and cannot be used when stating mandatory requirements, will is only used in statements of fact.
12
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
UVM is case-sensitive.
Any syntax examples shown in this standard are informative. They are intended to illustrate the usage
of UVM constructs in a simple context and do not define the full syntax.
Courier shows SystemVerilog examples, external command names, directories and files, etc., e.g., an
implementation needs to call super.do_copy.
The asterisk (*) symbol, when combined with a prefix and/or postfix denoting a part of the construct, represents
a series of construct names with exactly this prefix and/or postfix, e.g., class uvm_*_port.
a) Equivalent terms:
1) “TRUE,” “True,” and “true” are equivalent to each other and used interchangeably throughout
this document.
2) “FALSE,” “False,” and “false” are equivalent to each other and used interchangeably throughout
this document.
b) A bit value of 1 is treated as TRUE and 0 is treated as FALSE.
c) Conversely, TRUE refers to 1 and FALSE refers to 0 for return values.
d) Datatypes returned:
1) For a bit or integer, 1 (or 1'b1) or 0 (1'b0) is acceptable.
2) For an enumerated type, TRUE or FALSE is acceptable.
e) For functions that return TRUE/FALSE, if only one returned value is defined (e.g., for TRUE), then the
opposite return value shall be inferred (for all other possibilities).
1.4.3 Inheritance
Class declarations shown in this document may be of the form class A extends B. These declarations do not
imply class A and class B are adjacent in the inheritance tree; implementations are free to have other classes
between A and B in the inheritance tree, e.g.,
class X extends B;
// body of class X
endclass
class A extends X;
// body of class A
endclass
would comply.
13
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The API and the semantics of the API from a base class shall be present in any derived classes, unless that API
is overridden by an explicitly documented API within the derived class.
The functionality described in this document typically operates on a set of data objects. An implementation
and/or the underlying run-time engine may choose any operation order or sorting order for “equivalent data”
objects within the specified semantics.
As a result of this policy, results returned and/or sequential behavior and/or produced output may differ
between implementations and/or different underlying engines.
1.4.5 uvm_pkg
All properties of UVM, including classes, global methods, and variables, are exported via the uvm_pkg
package. They may be accessed via import or via the Scope Resolution Operator (::).
UVM does not require any specific time unit precision for uvm_pkg.
All UVM methods that operate on values of type time, such as uvm_printer::print_time (see 16.2.3.11), are
subject to the time scaling defined in IEEE Std 1800™.
Any APIs that result in user code being executed are not guaranteed to be random stable. All other APIs are
guaranteed to be random stable, unless otherwise specified.
14
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
2. Normative references
The following referenced documents are indispensable for the application of this document (i.e., they must be
understood and used, so each referenced document is cited in text and its relationship to this document is
explained). For dated references, only the edition cited applies. For undated references, the latest edition of the
referenced document (including any amendments or corrigenda) applies.
IEEE Std 1800™, IEEE Standard for SystemVerilog—Unified Hardware Design, Specification, and
Verification Language. 4, 5
3.1 Definitions
agent: An abstract container used to emulate and verify device under test (DUT) devices; agents encapsulate a
driver, sequencer, and monitor.
blocking: An interface where tasks block execution until they complete. See also: non-blocking.
component: A piece of verification intellectual property (VIP) that provides functionality and interfaces.
consumer: A verification component that receives transactions from another component.
driver: A component responsible for executing or otherwise processing transactions, usually interacting with
the device under test (DUT) to do so.
environment: The container object that defines the testbench topology.
export: A transaction-level modeling (TLM) interface that provides an implementation of methods used for
communication. Used in Universal Verification Methodology (UVM) to connect to a port.
factory method: A classic software design pattern used to create generic code by deferring, until run time, the
exact specification of the object to be created.
hook: A method that enables users to customize certain behaviors of a component.
generator: A verification component that provides transactions to another component. Also referred to as a
producer.
monitor: A passive entity that samples device under test (DUT) signals, but does not drive them.
non-blocking: A call that returns immediately. See also: blocking.
policy: A collection of settings used to apply an operation to a class.
port: A transaction-level modeling (TLM) interface that defines the set of methods used for communication.
Used in Universal Verification Methodology (UVM) to connect to an export.
proxy: A class functioning as an interface to another component or class.
request: A transaction that provides information to initiate the processing of a particular operation.
response: A transaction that provides information about the completion or status of a particular operation.
4
IEEE publications are available from the Institute of Electrical and Electronics Engineers (http://standards.ieee.org/).
5
The IEEE standards or products referred to in Clause 2 are trademarks owned by the Institute of Electrical and Electronics Engineers,
Incorporated.
6
IEEE Standards Dictionary Online is available at: http://ieeexplore.ieee.org/.
15
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
scoreboard: The mechanism used to dynamically predict the response of the design and check the observed
response against the predicted response. Usually, refers to the entire dynamic response-checking structure.
sequence: A Universal Verification Methodology (UVM) object that procedurally defines a set of transactions
to be executed and/or controls the execution of other sequences.
sequencer: An advanced stimulus generator that executes sequences that define the transactions provided to
the driver for execution.
singleton: A design pattern where the creation of the class only has one instance of that class.
test: Specific customization of an environment to exercise required functionality of the device under test
(DUT).
testbench: The structural definition of a set of verification components used to verify a device under test
(DUT). Also referred to as a verification environment.
transaction: A class instance that encapsulates information used to communicate between two or more
components.
user: Someone that uses the Universal Verification Methodology (UVM) base class library (BCL).
NOTE—In this standard, user uses the classes, functions, methods, or macros defined herein. 7
7
Notes in text, tables, and figures are given for information only and do not contain requirements needed to implement the standard.
16
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The UVM classes and utilities are divided into the following categories pertaining to their role or function. The
subsequent clauses of this standard give a more detailed overview of each category—and the classes that
comprise them.
Base—The basic building blocks for all environments are components, which do the actual work, transactions,
which convey information between components, and ports, which provide the interfaces used to convey
transactions. The UVM’s core base classes provide these building blocks. See Clause 5.
Reporting—The reporting classes provide a facility for issuing reports (messages) with consistent formatting
and configurable side effects, such as logging to a file or exiting simulation. Reports can also filter out
messages based on their verbosity, unique ID, or severity. See Clause 6.
Recording—The recording classes provide a facility to record transactions into a database using a consistent
API. Users can configure what gets sent to the back-end database without knowing exactly how the connection
to that database is established. See Clause 7.
Factory—As the name implies, the UVM factory is used to manufacture (create) UVM objects and
components. A factory can be configured to produce an object of a given type on a global or instance basis.
Factories allow dynamically configurable component hierarchies and object substitutions without having to
modify their code or break encapsulation. See Clause 8.
Phasing—This category defines the phasing capability provided by UVM. See Clause 9.
Synchronization—These event and barrier synchronization classes can be used for process synchronization. See
Clause 10.
Containers—These classes are type parameterized data structures that provide queue and pool services. The
class-based queue and pool types allow for efficient sharing of the data structures compared with their
SystemVerilog built-in counterparts. See Clause 11.
UVM TLM—The UVM transaction-level modeling (TLM) library defines several abstract, transaction-level
interfaces, and the ports and exports that facilitate their use. Each UVM TLM interface consists of one or more
methods used to transport data, typically whole transactions (objects) at a time. Component designs that use
UVM TLM ports and exports to communicate are inherently more reusable, interoperable, and modular. See
Clause 12.
Components—Components form the foundation of UVM. They encapsulate the behavior of drivers,
scoreboards, and other objects in a testbench. The UVM base class library provides a set of predefined
component types, all derived directly or indirectly from uvm_component. See Clause 13.
Sequencers—The sequencer serves as an arbiter for controlling transaction flow from multiple stimulus
generators. More specifically, the sequencer controls the flow of uvm_sequence_item–based transactions (see
14.1) generated by one or more uvm_sequence #(REQ,RSP)–based sequences (see 14.3). See Clause 15.
17
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Policies—Each of UVM’s policy classes performs a specific task for uvm_object–based objects: printing,
comparing, recording, packing, and unpacking (see 5.3). They are implemented separately from uvm_object to
allow for different ways to print, compare, etc., without modifying the object class being utilized; e.g., a user
can simply apply a different printer or compare policy to change how an object is printed or compared. See
Clause 16.
Register layer—The register abstraction classes, when properly extended, abstract the read/write operations to
registers and memories in a design under test (DUT) . See Clause 17.
Macros—UVM provides several macros to help increase user productivity. See Annex B.
Configuration and resources—These classes provide a configuration database, which is used to store and
retrieve both configuration time and run-time properties. See Annex C.
Package scope—This category defines a small list of types, variables, functions, and tasks defined in the
uvm_pkg scope. These items are accessible from any scope that imports the uvm_pkg. See Annex F.
Command line processor—This a general interface to the command line arguments that were provided for the
given simulation. See Annex G.
5. Base classes
5.1 Overview
The UVM base class library defines a set of base classes and utilities that facilitate the design of modular,
scalable, and reusable verification environments. The basic building blocks for all environments are
components and the transactions they use to communicate.
a) uvm_object—All components and transactions derive from uvm_object (see 5.3), which defines an
interface of core class-based operations: create, copy, compare, print, sprint, record, etc. It also defines
interfaces for instance identification (name, type name, unique id, etc.) and random seeding. All
derivatives of uvm_object are factory enabled, unless otherwise specified.
b) uvm_component—The uvm_component class (see 13.1) is the base class for all UVM components.
Components are quasi-static objects that exist throughout simulation. This allows them to establish
structural hierarchy much like modules and program blocks. Components participate in a phased test
flow during the course of simulation. Each phase—build, connect, run, etc.—is defined by a callback
that is executed in precise order. Finally, the uvm_component also defines any configuration,
reporting, transaction recording, and factory interfaces.
c) uvm_transaction—The uvm_transaction (see 5.4) is the root base class for UVM transactions,
which, unlike uvm_components (see 13.1), are transient in nature. It extends uvm_object (see 5.3) to
include a timing and recording interface. Simple transactions can derive directly from
uvm_transaction, while sequence-enabled transactions derive from uvm_sequence_item (see 14.1).
5.2 uvm_void
The uvm_void class is the abstract base class for all UVM classes. It is an abstract class with no data members
or functions. It allows for creation of generic containers of objects, similar to a void pointer in the C
programming language. User classes derived directly from uvm_void inherit none of the UVM functionality,
but such classes may be placed in uvm_void-typed containers along with other UVM objects.
18
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Class declaration
virtual class uvm_void
5.3 uvm_object
The uvm_object class is the abstract base class for all UVM data and hierarchical classes. Its primary role is to
define a set of methods for such common operations as create (see 5.3.5.1), copy (see 5.3.8.1), compare (see
5.3.9.1), print (see 5.3.6.1), and record (see 5.3.7.1). Classes deriving from uvm_object need to implement the
pure virtual methods, such as create (see 5.3.5.1) and get_type_name (see 5.3.4.7).
new
function new ( string name = "" )
Creates a new uvm_object with the given instance name. If name is not supplied, the object is unnamed.
5.3.3 Seeding
5.3.3.1 get_uvm_seeding
Helper method for retrieving the UVM seeding enable value via uvm_coreservice_t::get_uvm_seeding (see
F.4.1.4.25).
5.3.3.2 set_uvm_seeding
Helper method for setting the UVM seeding enable value via uvm_coreservice_t::set_uvm_seeding (see
F.4.1.4.26).
5.3.3.3 reseed
This method sets the seed of the object ensuring all objects have unique seeding values.
If the get_uvm_seeding method (see 5.3.3.1) returns 0, then reseed does not perform any function.
5.3.4 Identification
5.3.4.1 set_name
Specifies the instance name of this object, overwriting any previously given name from new (see 5.3.2) or
set_name.
19
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.3.4.2 get_name
Returns the name of the object, as provided by the name argument in the new constructor (see 5.3.2) or
set_name method (see 5.3.4.1).
5.3.4.3 get_full_name
Returns the full hierarchical name of this object. The return value is the same as get_name (see 5.3.4.2), as
uvm_objects do not inherently possess hierarchy.
Objects possessing hierarchy, such as uvm_components (see 13.1), override the default implementation. Other
objects might be associated with component hierarchy, but are not themselves components. For example,
uvm_sequence #(REQ,RSP) (see 14.3) classes are typically associated with a uvm_sequencer.
#(REQ,RSP) (see 15.5). In this case, it is useful to override get_full_name to return the sequencer’s full name
concatenated with the sequence’s name. This provides the sequence a full context, which is useful when
debugging.
5.3.4.4 get_inst_id
Returns a distinct integer for each distinct UVM object. At the time an object is created, an object identifier is
assigned to it, implicitly or explicitly, depending on which API creates the object. The ID of an object is
guaranteed to be unique to that object for the object’s lifetime. An implementation may reuse the ID of a
previously garbage collected object.
5.3.4.5 get_type
Returns the type-proxy (wrapper) for this object. The uvm_factory’s type-based override and creation methods
(see 8.3.1) take arguments of uvm_object_wrapper (see 8.3.2).
This method provides a common API for extensions of uvm_object to use when providing factory support. If
an extension of uvm_object supports factory creation, that extension should implement a static get_type
method that returns the appropriate uvm_object_wrapper (see 8.3.2).
5.3.4.6 get_object_type
Returns the type-proxy (wrapper) for this object. The uvm_factory’s type-based override and creation methods
(see 8.3.1) take arguments of uvm_object_wrapper (see 8.3.2). This method, if implemented, can be used as
convenient means of supplying those arguments. This method is the same as the static get_type method (see
5.3.4.5), but it uses an already allocated object to determine the type-proxy to access (instead of using the static
object).
20
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The default implementation of this method does a factory lookup of the proxy using the return value from
get_type_name (see 5.3.4.7). If the type returned by get_type_name is not registered with the factory, then a
null handle is returned.
5.3.4.7 get_type_name
This function returns the type name of the object, which is typically the type identifier enclosed in quotes. It is
used for various debugging functions in the UVM base class library and it is used by the factory for creating
objects.
5.3.5 Creation
5.3.5.1 create
The create method allocates a new object of the same type as this object and returns it via a base uvm_object
handle. Every class deriving from uvm_object, directly or indirectly, shall implement the create method.
The default implementation of the create method returns null. Every class deriving from uvm_object shall
implement the create method to return the newly allocated object of the same type as the derived class.
5.3.5.2 clone
The clone method creates and returns an exact copy of this object.
5.3.6 Printing
The printing methods, print (see 5.3.6.1) and sprint (see 5.3.6.2), initiate a new print operation on this object.
To promote correct printing operation and a consistent output format, the user shall use a uvm_printer policy
class (see 16.2). That is, instead of using $display or string concatenations directly, the do_execute_op (see
5.3.13) and do_print (see 5.3.6.3) implementations shall use the policy’s APIs to print fields. See 16.2 for more
information on printer output formatting.
5.3.6.1 print
The printer argument provides the policy class to be used for this operation. If no printer is provided (or the
value provided is null), the method shall use the default printer policy, as returned by get_default_printer (see
F.4.1.4.13).
a) If the policy’s active object depth (see 16.1.3.4) is 0, then flush (see 16.2.4.2) is called on the printer
policy.
21
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
b) print_object (see 16.2.3.1) is called on the printer policy, the name sent to print_object is determined
using get_root_enabled (see 16.2.5.8).
c) The value returned by the printer policy’s emit method (see 16.2.4.1) shall be directed to the
printer’s current File (see 16.2.5.1).
5.3.6.2 sprint
The sprint method works just like the print method (see 5.3.6.1), except the output of the printer policy’s emit
method (see 16.2.4.1) is returned in a string rather than displayed.
5.3.6.3 do_print
The do_print method is a user-definable hook that allows users customization over what is printed beyond the
information provided by the field macros (see B.2.2) or do_execute_op method (see 5.3.13).
5.3.6.4 convert2string
This virtual function has a default implementation that returns an empty string (""), but may be extended in
derived classes to provide object information in the form of a string. The format of the string is user-defined.
5.3.7 Recording
To promote correct recording operation, the user shall use a uvm_recorder policy class (see 16.4). That is,
instead of using implementation-specific API directly, the do_execute_op (see 5.3.13) and do_record (see
5.3.7.2) implementations shall use the policy’s APIs to record fields. See Clause 7 for more information on the
recording classes.
5.3.7.1 record
The recorder argument provides the policy class to be used for this operation. If no recorder is provided (or the
value provided is null), the call is silently ignored. Otherwise, the object shall pass itself to the record_object
method (see 16.4.6.4) of the recorder.
5.3.7.2 do_record
The do_record method is a user-definable hook that allows users customization over what is recorded beyond
the information provided by the field macros (see B.2.2) or do_execute_op method (see 5.3.13).
22
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.3.8 Copying
5.3.8.1 copy
The copy method copies the field values from rhs into this object.
The copier argument provides the policy class to be used for this operation. If no copier is provided (or the
value provided is null), the method shall use the default copier policy, as returned by get_default_copier (see
F.4.1.4.19).
a) If the policy’s active object depth (see 16.1.3.4) is 0, then flush (see 16.2.4.2) is called on the copier
policy.
b) copy_object (see 16.6.4.1) is called on the copier policy, with this object as lhs and rhs as rhs.
5.3.8.2 do_copy
The do_copy method is the user-definable hook called by the copy method (see 5.3.8.1). A derived class can
override this method to include its fields in a copy operation.
An implementation in a derived class should call super.do_copy and $cast the rhs argument to the derived
type before copying.
5.3.9 Comparing
To promote correct comparing operation, the user shall use a uvm_comparer policy class (see 16.3). That is,
instead of using implementation-specific API directly, the do_execute_op (see 5.3.13) and do_compare (see
5.3.9.2) implementations shall use the policy’s APIs to compare fields.
5.3.9.1 compare
The comparer argument provides the policy class to be used for this operation. If no comparer is provided (or
the value provided is null), the method shall use the default comparer policy, as returned by
get_default_comparer (see F.4.1.4.16).
a) If the policy’s active object depth (see 16.1.3.4) is 0, then flush (see 16.2.4.2) is called on the
comparer policy.
23
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
b) compare_object (see 16.3.3.4) is called on the comparer policy, with lhs set to this object and name set
to the return value of this object’s get_name method (see 5.3.4.2).
c) The value returned by compare_object (see 16.3.3.4) shall be returned by compare.
5.3.9.2 do_compare
The do_compare method is a user-definable hook that allows users customization over what is recorded
beyond the information provided by the field macros (see B.2.2) or do_execute_op method (see 5.3.13). A
derived class can override this method to include its fields in a compare operation. It shall return 1 if the
comparison succeeds, 0 otherwise.
NOTE—The rhs argument is provided as a generic uvm_object. Thus, the derived class implementation may
need to $cast rhs to the type of this object before comparing.
5.3.10 Packing
The pack_* methods bitwise-concatenate this object’s properties into an array of bits, bytes, ints, or longints.
The methods are not virtual and shall not be overloaded. To include additional fields in a pack operation,
derived classes can override the do_pack method (see 5.3.10.2).
The optional packer argument specifies the packing policy. If this is not provided, the default as returned by
get_default_packer (see F.4.1.4.15) is used. See 16.5 for more information.
If the policy’s active object depth (see 16.1.3.4) is 0, then flush (see 16.5.2.2) is called on the packer policy
prior to packing any fields. After processing the object’s fields, the packer’s state is copied to the stream array
using the state retrieval method (see 16.5.3.2) of the same stream type.
24
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The return value is the number of bits packed into the packer, as determined via
uvm_packer::get_packed_size (see 16.5.3.3).
NOTE—As stream may contain metadata and/or compressed data, the return value may not be the same as the size of
stream.
5.3.10.2 do_pack
The do_pack method is the user-definable hook called by the pack methods (see 5.3.10.1). A derived class can
override this method to include its fields in a pack operation.
The packer argument is the policy object for packing, which is responsible for generating the final array of
packed data from the fields provided. It shall be an error to pass a value of null to the packer argument of
do_pack, an implementation of uvm_object::do_pack shall generate an error message if a null value is
detected.
While the unpacking order needs to match the packing order, the packing order does not need to match
declaration order itself.
5.3.11 Unpacking
The unpack_* methods extract this object’s property values from an array of bits, bytes, ints, or longints. The
object shall unpack fields in the same order in which they were originally packed.
The unpack_* methods are fixed (non-virtual) entry points that are directly callable by the user. To include
additional fields in the unpack operation, derived classes can override the do_unpack method (see 5.3.11.2).
The optional packer argument specifies the unpacking policy. If this is not provided, the default as returned by
get_default_packer (see F.4.1.4.15) is used. See 16.5 for more information.
25
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Prior to unpacking any fields, the object shall set the internal state of the packer using the state assignment
method (see 16.5.3.1) of the same stream type.
The return value is the actual number of bits unpacked from the given array.
5.3.11.2 do_unpack
The do_unpack method is the user-definable hook called by the unpack method (see 5.3.11.1). A derived class
can override this method to include its fields in an unpack operation.
The packer argument is the policy object for unpacking, which is responsible for generating field values from
an array of packed data. See 16.5 for more information.
It shall be an error to pass a value of null to the packer argument of do_unpack, an implementation of
uvm_object::do_unpack shall generate an error message if a null value is detected.
NOTE—As the underlying storage format of the uvm_packer (see 16.5) is unspecified, it is unsafe for users to unpack
fields using different types than the fields with which they were packed or to unpack fields in a different order than the
fields in which they were packed.
5.3.12 Configuration
set_local
virtual function void set_local ( uvm_resource_base rsrc )
This method provides write access to member properties by using a UVM resource (see C.2). The return value
of get_name (see 5.3.4.2) for rsrc is used to determine the name of the property being accessed. The object
designer can choose which, if any, properties are accessible and override this method.
In addition to explicit printing (see 5.3.6), recording (see 5.3.7), copying (see 5.3.8), comparing (see 5.3.9),
packing (see 5.3.10), unpacking (see 5.3.11), and configuration (see 5.3.12) support, uvm_object provides a field
operation mechanism that allows for a centralized definition of all operations that are supported for an object’s
fields.
do_execute_op
The do_execute_op method is the user-definable hook called by the policy class. A derived class may override
this method to include its fields in the execution of the operation. The field macros (see B.2.2) provide a default
implementation of the do_execute_op method that is available to the user.
The active policy methods are used to track which policy object (see 16.1) is presently operating on an object.
5.3.14.1 push_active_policy
26
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Pushes policy on to the internal policy stack for this object, making it the current active policy, as retrieved by
get_active_policy (see 5.3.14.3). An implementation shall generate an error message if policy is null, and the
request will be ignored.
5.3.14.2 pop_active_policy
Pops the current active policy off of the internal policy stack for this object. If the internal policy stack for this
object is empty when pop_active_policy is called, then null is returned.
5.3.14.3 get_active_policy
Returns the head of the internal policy stack for this object. If the internal policy stack for this object is empty,
null is returned.
5.4 uvm_transaction
The uvm_transaction class is the root base class for UVM transactions. Inheriting all the methods of
uvm_object (see 5.3), uvm_transaction adds a timing and recording interface.
5.4.2 Methods
5.4.2.1 new
function new (
string name = ""
uvm_component initiator = null
)
Initializes a new transaction object. The name is the instance name of the transaction. If not supplied, then the
object is unnamed. The initiator is described in set_initiator (see 5.4.2.14).
5.4.2.2 accept_tr
Calling accept_tr indicates the transaction item has been received by a consumer component.
“Accept” refers to the consumer receiving an item, whereas “begin” (see 5.4.2.4) refers to the consumer acting
on an item. Those may or may not be coincident.
a) The transaction’s internal accept time is set to the current simulation time, or to accept_time if provided
and non-zero. The accept_time may be any time, past or future. The default value of accept_time shall
be 0.
27
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.4.2.3 do_accept_tr
This user-definable callback is called by accept_tr (see 5.4.2.2) just before the accept event is triggered.
5.4.2.4 begin_tr
This function indicates the transaction has been started. Generally, a consumer component begins execution of
a transactions it receives.
See 5.4.2.2 for more information on how the begin-time may differ from when the transaction item was
received.
a) The transaction’s begin time (see 5.4.2.16) is set to the current simulation time, or to begin_time non-
zero. A non-zero begin_time may be any time, past or future, but shall not be less than the accept time
(see 5.4.2.2). The default value of begin_time shall be 0.
b) If recording is enabled (see 5.4.2.11), a new database transaction is started with the same begin_time via
a call to uvm_tr_stream::open_recorder (see 7.2.5.1). The record method inherited from uvm_object
(see 5.3) is then called, which records the current property values to this new transaction. If
parent_handle is non-zero, the newly started transaction is linked to the parent transaction given by
parent_handle using a uvm_parent_child_link (see 7.3.2). The default value of parent_handle shall
be 0.
c) The do_begin_tr method (see 5.4.2.5) is called to allow for any post-begin action in derived classes.
d) The event at key begin in the transaction’s event pool (see 5.4.2.13) is triggered. Any processes
waiting on this event resume in the next delta cycle.
This function returns 0 if recording is not enabled or returns the uvm_recorder::get_handle (see 16.4.5.1) of
the recorder opened in step b).
5.4.2.5 do_begin_tr
This user-definable callback is called by begin_tr (see 5.4.2.4) just before the event at key begin in the
transaction’s event pool (see 5.4.2.13) is triggered.
28
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.4.2.6 end_tr
This function indicates the transaction execution has ended. Generally, a consumer component ends execution
of the transactions it receives.
begin_tr (see 5.4.2.4) shall have been previously called for this call to be successful.
a) The transaction’s internal end time is set to the current simulation time, or to end_time if provided and
non-zero. The end_time may be any non-negative time. The default value of end_time shall be 0.
b) If recording is enabled and a database transaction is currently active, the record method inherited from
uvm_object (see 5.3) is called, which records the final property values. The uvm_recorder associated
with this transaction is closed via a call to uvm_recorder::close (see 16.4.4.2). If free_handle = 1,
the recorder is released and can no longer be linked (if supported by an implementation). The default
value of free_handle shall be 1.
c) The do_end_tr method is called to allow for any post-end action in derived classes.
d) The event at key end in the transaction’s event pool (see 5.4.2.13) is triggered. Any processes waiting
on this event resume in the next delta cycle.
5.4.2.7 do_end_tr
This user-definable callback is called by end_tr (see 5.4.2.6) just before the event at key end in the
transaction’s event pool (see 5.4.2.13) is triggered.
5.4.2.8 get_tr_handle
Returns the handle associated with the transaction, as specified by a previous call to begin_tr (see 5.4.2.4) with
transaction recording enabled. If begin_tr has not been called, or if is_active (see 5.4.2.12) returns 0, then
get_tr_handle returns 0.
5.4.2.9 enable_recording
Turns on recording to the stream specified. Only one stream is tracked within the transaction, so further calls to
enable_recording overwrite the internally stored value.
If transaction recording is on (the default), then a call to record (see 5.3.7.1) is made when the transaction is
ended.
An error shall be generated if enable_recording is called after accept_tr (see 5.4.2.2) or after begin_tr (see
5.4.2.4) but before end_tr (see 5.4.2.6).
29
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.4.2.10 disable_recording
Turns off recording that has been enabled by a call to enable_recording (see 5.4.2.9). This is effectively
identical to passing null to enable_recording.
An error shall be generated if disable_recording is called after accept_tr (see 5.4.2.2) or after begin_tr (see
5.4.2.4) but before end_tr (see 5.4.2.6).
5.4.2.11 is_recording_enabled
5.4.2.12 is_active
Returns 1 if the transaction has been started, but has not been ended. Returns 0 if the transaction has not been
started or has ended.
5.4.2.13 get_event_pool
Returns the event pool associated with the transaction (see 10.4.1).
5.4.2.14 set_initiator
Specifies initiator as the initiator of the transaction. The meaning of initiator is up to the user, e.g., the initiator
can be the component that produces the transaction. An implementation shall include the initiator when printing
(see 5.3.6) or recording (see 5.3.7).
5.4.2.15 get_initiator
Returns the component that produced or started the transaction, as specified by a previous call to set_initiator
(see 5.4.2.14).
Returns the time at which this transaction was accepted, begun, or ended, as by a previous call to accept_tr (see
5.4.2.2), begin_tr (see 5.4.2.4), or end_tr (see 5.4.2.6).
30
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.4.2.17 set_transaction_id
Specifies this transaction’s numeric identifier to id. If not specified via this method, the transaction ID defaults
to -1.
5.4.2.18 get_transaction_id
Returns this transaction’s numeric identifier, which is -1 if not specified explicitly by set_transaction_id (see
5.4.2.17). -1 is not allowed as an id.
Transaction-level communication between components is handled via its ports, exports, imps, and sockets, all
of which derive from this class.
The uvm_port_base extends IF, which is the type of the interface implemented by derived port, export,
implementation, or socket. IF is also a type parameter to uvm_port_base.
uvm_port_base possesses the properties of components in that they have a hierarchical instance path and
parent.
5.5.2 Methods
5.5.2.1 new
function new (
string name,
uvm_component parent,
uvm_port_type_e port_type,
int min_size = 0,
int max_size = 1
)
name and parent are the uvm_component (see 13.1) constructor arguments.
min_size and max_size specify the minimum and maximum number of implementation (imp) ports to be
connected to this port base by the end of elaboration. Setting max_size to -1 specifies no maximum, i.e., an
unlimited number of connections are allowed. The default value of min_size shall be 0. The default value of
max_size shall be 1.
31
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.5.2.2 get_name
5.5.2.3 get_full_name
5.5.2.4 get_parent
5.5.2.5 get_type_name
Returns the type name to this port. Derived port classes can implement this method to return the concrete type.
Otherwise, only a generic "uvm_port", "uvm_export", or "uvm_implementation" is returned.
5.5.2.6 min_size
Returns the minimum number of implementation ports to be connected to this port prior to resolve_bindings
being called (see 5.5.2.15).
5.5.2.7 max_size
Returns the maximum number of implementation ports to be connected to this port prior to resolve_bindings
being called (see 5.5.2.15).
5.5.2.8 is_unbounded
Returns 1 if this port has no maximum on the number of implementation ports this port can connect. A port is
unbounded when the max_size argument (see 5.5.2.1) in the constructor is specified as -1.
5.5.2.9 get_connected_to
For a port or export type, this function intends to fill a list with all of the ports, exports and implementations
that this port is connected to.
32
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.5.2.10 get_provided_to
For an implementation or export type, this function intends to fill a list with all of the ports, exports, and
implementations to which this port has provided its implementation.
Returns 1 if this port is of the type given by the method name, 0 otherwise.
5.5.2.12 size
Returns the number of implementation ports connected to this port. The value is not valid before the
end_of_elaboration phase, as port connections have not yet been resolved.
5.5.2.13 set_default_index
Specifies the default implementation port to use when calling an interface method. This method should only be
called on UVM_EXPORT types. The value shall not be specified before the end_of_elaboration phase. Use
size (see 5.5.2.12) to retrieve the valid range for index. If set_default_index is not called, the default shall be 0.
5.5.2.14 connect
Connects this port to the given provider port. The ports shall be compatible in the following ways:
This functionality can be disabled using the configuration and resources classes (see Annex C). The port
shall check for a field named check_connection_relationships of the resource type
33
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_resource#(uvm_bitstream_t) with a scope matching the port’s full name (see 5.5.2.3). A value of 0
disables the check, any other value enables the check.
If this port is an UVM_PORT type (see F.2.3), the provider shall be a parent port, or a sibling export or
implementation port.
If this port is an UVM_EXPORT type (see F.2.3), the provider shall be a child export or
implementation port.
If any relationship check is violated, a warning shall be issued.
This method is automatically called just before entering the end_of_elaboration phase. It recurses through
each port’s fanout to determine all the imp destinations. It then checks against the required minimum and
maximum connections. After resolution, size (see 5.5.2.12) returns a valid value and get_if (see 5.5.2.16) can
be used to access a particular imp.
5.5.2.16 get_if
Returns an implementation (imp) port at the given index from the array of imps to which this port is connected.
Use size (see 5.5.2.12) to retrieve the valid range for index. This method should only be called at the
end_of_elaboration phase or after, as port connections are not resolved before then. The default value of
index shall be 0.
5.6 uvm_time
This time type is used to represent time values in a canonical form that can bridge different time scales and time
precisions.
class uvm_time
5.6.2.1 new
function new(
string name = "uvm_time",
real res = 0
)
The canonical time value of the object is initialized to 0. If a resolution is not specified, the default resolution,
as specified by set_time_resolution (see 5.6.2.2), is used.
34
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
5.6.2.2 set_default_time_resolution
res specifies the default canonical time resolution; this shall be a power of 10.
5.6.2.3 get_name
5.6.2.4 reset
5.6.2.5 get_realtime
Returns the current canonical time value, scaled for the caller’s time scale.
scaled shall be a time literal value that corresponds to the number of seconds specified in secs (1ns by
default); it has to be a time literal value that is greater or equal to the current time scale.
5.6.2.6 incr
Increments the current canonical time value by the specified number of scaled time units.
t is a time value expressed in the scale and precision of the caller. scaled shall be a time literal value that
corresponds to the number of seconds specified in secs (1ns by default); it has to be a time literal value that is
greater or equal to the current time scale.
5.6.2.7 decr
Decrements the current canonical time value by the specified number of scaled time units.
35
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
t is a time value expressed in the scale and precision of the caller. scaled shall be a time literal value that
corresponds to the number of seconds specified in secs (1ns by default); it has to be a time literal value that is
greater or equal to the current time scale.
5.6.2.8 get_abstime
Returns the current canonical time value, in the number of specified time units, regardless of the current time
scale of the caller.
secs is the number of seconds in the desired time unit, e.g., 1e-9 for nanoseconds.
5.6.2.9 set_abstime
Specifies the current canonical time value, in the number of specified time units, regardless of the current time
scale of the caller.
secs is the number of seconds in the desired time unit, e.g., 1e-9 for nanoseconds.
5.7 uvm_field_op
uvm_field_op is the UVM class for describing all operations supported by the do_execute_op function (see
5.3.13).
5.7.2 Methods
5.7.2.1 new
Creates a new object of type uvm_field_op with the given instance name. If name is not supplied, the object is
unnamed.
5.7.2.2 set
36
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
a) op_type—The operation type, as described using uvm_field_flag_t (see F.2.1.2). A uvm_field_op can
only represent a single operation at a time; it shall be an error if the reserved bits (see F.2.1.1) of the
op_type argument match more than one operation type.
b) policy—The policy class to be used for this operation. Operations that do not require a policy object
may set the policy to null. The default value is null.
c) rhs—The right-hand side value to be used for this operation. Operations that do not require a right-
hand side object may set the rhs to null. The default value is null.
An error shall be generated if set is called twice without a flush call (see 5.7.2.9) between.
5.7.2.3 get_op_name
Based on the operation type defined by set (see 5.7.2.2), returns the associated name as showin in Table 1. The
return value for types that are not listed in Table 1 is undefined.
get_op_name shall generate an error message if set (see 5.7.2.2) has never been called on this uvm_field_op or
if flush (see 5.7.2.9) has been called more recently than set on this uvm_field_op.
UVM_PRINT print
UVM_RECORD record
UVM_PACK pack
UVM_UNPACK unpack
UVM_COPY copy
UVM_COMPARE compare
UVM_SET set
5.7.2.4 get_op_type
get_op_type shall generate an error message if set (see 5.7.2.2) has never been called on this uvm_field_op or
if flush (see 5.7.2.9) has been called more recently than set on this uvm_field_op.
5.7.2.5 get_policy
37
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
get_policy shall generate an error message if set (see 5.7.2.2) has never been called on this uvm_field_op or if
flush (see 5.7.2.9) has been called more recently than set on this uvm_field_op.
5.7.2.6 get_rhs
Returns the right-hand side object to be used when executing the operation.
get_rhs shall generate an error message if set (see 5.7.2.2) has never been called on this uvm_field_op or if
flush (see 5.7.2.9) has been called more recently than set on this uvm_field_op.
5.7.2.7 user_hook_enabled
Returns the current value of the user hook enabled bit. The value defaults to 1 and can only be set to 0 via a call
to disable_user_hook (see 5.7.2.8).
The user hook enabled bit indicates whether the policy class should call the do_* method associated with its
operation after calling the do_execute_op method (see 5.3.13). For example, a uvm_printer (see 16.2) will not
call do_print (see 5.3.6.3) if user_hook_enabled returns 0 after the printer has called do_execute_op.
5.7.2.8 disable_user_hook
Disables the call to the user hook by setting the return value of user_hook_enabled (see 5.7.2.7) to 0.
5.7.2.9 flush
Resets the uvm_field_op, allowing it to be reused. Future calls to uvm_field_op::get_* (see 5.7.2.3 to 5.7.2.6)
shall generate errors unless set (see 5.7.2.2) is called again.
6. Reporting classes
6.1 Overview
The reporting classes provide a facility for issuing reports with consistent formatting. Users can configure what
actions to take and what files to send output to based on report severity, ID, or both severity and ID. Users can
also filter messages based on their verbosity settings.
The primary interface to the UVM reporting facility is the uvm_report_object (see 6.3) from which all
uvm_components extend (see 13.1.1). The uvm_report_object delegates most tasks to its internal
uvm_report_handler (see 6.4). If the report handler determines the report is not filtered based on the
configured verbosity setting, it sends the report to the central uvm_report_server (see 6.5.1) for formatting and
processing.
38
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
6.2 uvm_report_message
The uvm_report_message is the basic UVM object message class. It provides the fields that are common to all
messages. The report message object can be initialized with the common fields (see 6.2.2) and passes through
the whole reporting system (i.e., report object, report handler, report server, report catcher) as an object. The
additional elements can be added/deleted to/from the message object anywhere in the reporting system, and can
be printed or recorded along with the common fields.
6.2.2.1 new
6.2.2.2 new_report_message
Creates a new uvm_report_message object. This function is the same as new (see 6.2.2.1), however this
method will preserve the random stability of the calling thread. While it is legal to call this method from a non-
thread context, the random stability of the non-thread context is not guaranteed.
6.2.2.3 do_print
Returns or specifies the uvm_report_object (see 6.3) that originated the message.
39
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns or specifies the uvm_report_handler (see 6.4) that is responsible for checking whether the message is
enabled, may be upgraded/downgraded, etc.
Returns or specifies the uvm_report_server (see 6.5.1) that is responsible for servicing the message’s actions.
Returns or specifies the severity (UVM_INFO, UVM_WARNING, UVM_ERROR, or UVM_FATAL) of the message.
Returns or specifies the id of the message. The value of this field is completely under user discretion. See 6.4.
Returns or specifies the message verbosity threshold value. This value is compared against settings in the
uvm_report_handler (see 6.4) to determine whether this message is executed.
40
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns or specifies the line in the file from which the message originates.
Returns or specifies the optional user-supplied string that is meant to convey the context of the message.
Returns or specifies the action(s) the uvm_report_server (see 6.5.1) performs for this message.
Returns or specifies the file to which the message is written when the message’s action is UVM_LOG.
6.2.4.10 set_report_message
Specifies all the common fields of the report message in one function call.
6.3 uvm_report_object
The uvm_report_object provides an interface to the UVM reporting facility. Through this interface, various
messages can be issued that occur during simulation. Users can configure what actions are taken and what file(s)
are output for individual messages from a particular report object or for all messages from all report objects in
the environment. Defaults are applied where there is no explicit configuration.
41
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Most methods in uvm_report_object are delegated to an internal instance of a uvm_report_handler (see 6.4),
which stores the reporting configuration and determines whether an issued message should be displayed based
on that configuration. Then, to display a message, the report handler delegates the actual formatting and
production of messages to a central uvm_report_server (see 6.5.1).
A report consists of the message fields described in 6.2.4. It may optionally include the filename and line
number from which the message came. If a report has a verbosity level greater than the configured maximum
verbosity level (see 6.3.4.1) of its report object, it is ignored. If a report passes the verbosity filter, in effect, the
report’s action is determined. If the action includes output to a file, the configured file descriptor(s) are
determined.
a) Actions—These can be set for severity, id, and the (severity, id) pair. See 6.3.5.2.
b) Default actions—The following list highlights the default actions assigned to each severity. These can
be overridden by any of the set_*_action methods.
1) UVM_INFO—UVM_DISPLAY
2) UVM_WARNING—UVM_DISPLAY
3) UVM_ERROR—UVM_DISPLAY | UVM_COUNT
4) UVM_FATAL—UVM_DISPLAY | UVM_EXIT
c) File descriptors—These can be specified as (in increasing priority) default, severity level, id, or
(severity-id) pair. File descriptors are of UVM_FILE type (see F.2.8). It is the user’s responsibility to
open and close them.
d) Default file handle—The default file handle is 0, which means reports are not sent to a file even if an
UVM_LOG attribute is specified in the action associated with the report. This can be overridden by any
of the set_*_file methods.
new
function new( string name = "" )
6.3.3 Reporting
6.3.3.1 uvm_get_report_object
6.3.3.2 uvm_report_enabled
42
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
string id = ""
)
Returns 1 if the configured verbosity for this severity/id is greater than or equal to verbosity, else returns 0.
The default value of severity shall be UVM_INFO.
43
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These are the primary reporting methods in UVM. Using these instead of $display and other ad hoc
approaches promotes consistent output and central control over where output is directed and any actions that
result. All reporting methods have the following arguments, although each has a different default verbosity:
a) id—A string containing the id for the report or report group that can be used for identification and
therefore targeted filtering. An individual report’s actions and output file(s) can be configured using
this id string.
b) message—The message body as a single string.
c) verbosity—The verbosity of the message indicating its relative importance. If this number is less than
or equal to the maximum verbosity level (see 6.3.4.3), then the report is issued, subject to the configured
action and file descriptor specifications. Verbosity is ignored for warnings, errors, and fatals. However,
if a warning, error, or fatal is demoted to an info message, then the verbosity is taken into account.
d) filename/line (optional)—A string containing filename and an integer for line number defining the
location from which the report was issued. If specified, the location is displayed in the output. The
default value of filename shall be an empty string ("") and the default value of line shall be 0.
e) context_name (optional)—The string context from where the message is originating. This can be the %m
of a module, a specific method, etc. The default value of context_name shall be an empty string ("").
f) report_enabled_checked (optional)—This bit indicates if the currently provided message has been
checked as to whether the message should be processed. If it has not been checked, it will be checked
as part of the uvm_report function. The default value shall be 0.
6.3.3.4 uvm_process_report_message
This method takes a preformed uvm_report_message (see 6.2), populates it with the report object, and passes
it to the report handler for processing; see 6.4.7.
6.3.4.1 get_report_verbosity_level
Returns the verbosity level in effect for this object. This function calls the underlying report handler
get_verbosity_level (see 6.4.3.1).
6.3.4.2 get_report_max_verbosity_level
44
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns the maximum verbosity level in effect for this report object.
6.3.4.3 set_report_verbosity_level
Specifies the maximum verbosity level for reports for this component. This function calls the underlying report
handler set_verbosity_level (see 6.4.3.2).
These methods associate the specified verbosity threshold with reports of the given id or severity-id pair. These
functions call the underlying report handler set_id_verbosity or set_severity_id_verbosity, respectively (see
6.4.3.3).
6.3.5.1 get_report_action
Returns the action associated with reports having the given severity and id. This function calls the underlying
report handler get_action (see 6.4.4.1).
45
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These methods associate the specified action or actions with reports of the given severity, id, or severity-id pair.
These functions call the underlying report handler set_severity_action, set_id_action, or
set_severity_id_action, respectively (see 6.4.4.2).
6.3.6.1 get_report_file_handle
Returns the file descriptor associated with reports having the given severity and id. This function calls the
underlying report handler get_file_handle (see 6.4.5.1).
These methods configure the report handler to direct some or all of its output to the given file descriptor (see
F.2.8). These functions call the underlying report handler set_default_file, set_id_file, set_severity_file, or
set_severity_id_file, respectively (see 6.4.5.2).
These methods provide the ability to upgrade or downgrade a message in terms of severity given the severity and
id. These functions call the underlying report handler set_severity_override or set_severity_id_override,
respectively (see 6.4.6).
46
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
6.3.8.1 get_report_handler
Returns the underlying report handler to which most reporting tasks are delegated.
6.3.8.2 set_report_handler
Specifies the report handler, overwriting the previous value. This allows more than one component to share the
same report handler.
6.3.8.3 reset_report_handler
Resets the underlying report handler to its default settings (see 6.4.2.1). This clears any changes made with the
override configuration methods (see 6.3.7).
6.4 uvm_report_handler
The uvm_report_handler is the class to which most methods in uvm_report_object (see 6.3) delegate.
uvm_report_handler stores the maximum verbosity, actions, and files that affect the way reports are handled.
6.4.2.1 new
6.4.2.2 do_print
6.4.3.1 get_verbosity_level
47
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns the verbosity level stored in this handler for the given id or severity-id pair. A verbosity associated with
a particular severity-id pair takes precedence over a verbosity associated with id, which takes precedence over
the maximum verbosity. The default value of severity shall be UVM_INFO.
6.4.3.2 set_verbosity_level
Specifies the maximum verbosity level for this handler. Any report whose verbosity exceeds this maximum is
ignored.
These methods associate the specified verbosity level with the given id or severity-id pair. A verbosity
associated with a particular severity-id pair takes precedence over a verbosity associated with id, which takes
precedence over the maximum verbosity.
verbosity can be any integer, but is most commonly a predefined uvm_verbosity value (see F.2.2.4).
6.4.4.1 get_action
Returns the action (uvm_action, see F.2.2.3) stored in this handler for the given severity, id, or severity-id pair.
An action associated with a particular severity-id pair takes precedence over an action associated with id, which
takes precedence over an action associated with severity.
48
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_action action
)
These methods associate the specified action with the given severity, id, or severity-id pair. An action
associated with a particular severity-id pair takes precedence over an action associated with id, which takes
precedence over an action associated with severity. action can take the value UVM_NO_ACTION or it can be a
bitwise OR of any combination of the other uvm_action_types enum values, see F.2.2.2.
6.4.5.1 get_file_handle
Returns the file descriptor (UVM_FILE, see F.2.8) stored in the handler associated with the given severity, id, or
severity-id pair. A file associated with a particular severity-id pair takes precedence over a file associated with
id, which takes precedence over a file associated with a severity, which takes precedence over the default file
descriptor.
These methods configure this handler to direct some or all of its output to the given file descriptor, where file is
a multi-channel descriptor (mcd) or a file id compatible with $fdisplay.
A file descriptor can be associated with reports of the given severity, id, or severity-id pair. A file associated
with a particular severity-id pair takes precedence over a file associated with id, which takes precedence over a
file associated with a severity, which takes precedence over the default file descriptor.
When a report is issued and its associated action has the UVM_LOG bit specified, the report is then sent to its
associated file descriptor. The user is responsible for opening and closing these files.
49
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_severity new_severity
)
function void set_severity_id_override (
uvm_severity cur_severity,
string id,
uvm_severity new_severity
)
These methods provide the ability to upgrade or downgrade a message in terms of severity (new_severity) given
the cur_severity and id. An upgrade or downgrade for a specific id takes precedence over an upgrade or
downgrade associated with cur_severity.
process_report_message
virtual function void process_report_message(
uvm_report_message report_message
)
This is the common handler method used by the core reporting methods (e.g., uvm_report_error) in
uvm_report_object (see 6.3.3.3).
This subclause covers the classes that define the UVM report server facility.
6.5.1 uvm_report_server
The uvm_report_server is an abstract class that declares many of its methods as pure virtual. UVM uses
the uvm_default_report_server class (see 6.5.2) as its default report server implementation.
6.5.1.2.1 new
Initializes a new report server. The name argument is optional, but should generally be provided to aid in
debugging.
6.5.1.2.2 get_max_quit_count
50
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
6.5.1.2.3 set_max_quit_count
count is the maximum number of UVM_QUIT actions the uvm_report_server can tolerate before invoking die
on the uvm_root (see F.7) instance returned by uvm_coreservice_t::get_root (see F.4.1.4.1). When
overridable = 0 is passed, the count cannot be changed again. The default value of overridable shall be 1.
6.5.1.2.4 get_quit_count
Intended to return the current number of UVM_QUIT actions already passed through this server.
6.5.1.2.5 set_quit_count
Intended to specify the current number of UVM_QUIT actions already passed through this uvm_report_server.
6.5.1.2.6 get_severity_count
Intended to return the count of already passed messages with severity severity.
6.5.1.2.7 set_severity_count
Intended to specify the count of already passed messages with severity severity to count.
6.5.1.2.8 get_id_count
6.5.1.2.9 get_id_set
Intended to return the set of ids already used by this uvm_report_server. q shall be a queue.
51
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
6.5.1.2.10 get_severity_set
Intended to return the set of severities already used by this uvm_report_server. q shall be a queue.
6.5.1.2.11 get_message_database
Intended to return the uvm_tr_database (see 7.1) used for recording messages.
6.5.1.2.12 set_message_database
Intended to specify the uvm_tr_database (see 7.1) used for recording messages.
6.5.1.2.13 do_copy
Copies all message statistic severity, id counts to the destination uvm_report_server. The copy is cumulative:
items from the source are transferred, existing entries are not deleted, and existing entries/counts are overridden
when they exist in the source set. rhs shall be a uvm_report_server or derived from one.
6.5.1.2.14 process_report_message
This method is the main entry point for the uvm_report_server, processing the provided
uvm_report_message (see 6.2). The report server shall take the following steps, in order:
a) All report catchers (see 6 . 6 ) that are currently registered and active are processed. If any call to
catch (see 6.6.5) returns CAUGHT, process_report_message ends immediately.
b) After processing all report catchers, if the message contains an action of UVM_NO_ACTION,
process_report_message ends immediately.
c) If the message actions include one or both of UVM_LOG or UVM_DISPLAY, compose_report_message
(see 6.5.1.2.15) is called.
d) Finally, execute_report_message (see 6.5.1.2.16) is called.
6.5.1.2.15 compose_report_message
Intended to construct the actual string sent to the file or command line from the severity, component name,
report id, and the message itself. report_object_name can be specified to override the use of the
report_handler full name in the message. Users can overload this method to customize report formatting.
52
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
6.5.1.2.16 execute_report_message
Processes the provided report_message per the actions contained within. composed_message gets logged or
displayed if the report_message calls for that action. Users can overload this method to customize action
processing.
6.5.1.2.17 report_summarize
Intended to output statistical information on the reports issued by this central report server. This information is
sent to the file descriptor file. The default value of file shall be UVM_STDOUT.
6.5.1.2.18 get_server
This method is provided as a wrapper function to conveniently retrieve the report server via the
uvm_coreservice_t::get_report_server method (see F.4.1.4.4).
6.5.1.2.19 set_server
This method is provided as a wrapper function to conveniently specify the report server via the
uvm_coreservice_t::set_report_server method (see F.4.1.4.4). In addition to specifying the server, this also
copies the severity/id counts from the current report server to the new one.
6.5.2 uvm_default_report_server
Class declaration
6.6 uvm_report_catcher
The uvm_report_catcher is used to catch messages issued by the UVM report server. Catchers are
uvm_callbacks, so all facilities in the uvm_callback (see 10.7.1) and uvm_callbacks#(T,CB) (see 10.7.2)
classes are available for registering catchers and controlling catcher state. The
53
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Multiple report catchers can be registered with a report object. The catchers can be registered as default
catchers, which catch all reports on all uvm_report_object reporters (see 6.3), or catchers can be attached to
specific report objects (e.g., components).
User extensions of uvm_report_catcher shall implement the catch method (see 6.6.5.), in which the action to
be taken on catching the report is specified. The catch method can return CAUGHT, in which case further
processing of the report is immediately stopped, or return THROW, in which case the (possibly modified) report
is passed on to other registered catchers.
On catching a report, the catch method can modify the severity, id, action, verbosity, or the report string itself
before the report is finally issued by the report server. The report can be immediately issued from within the
catcher class by calling the issue method (see 6.6.6.6).
The catcher maintains a count of all reports with UVM_FATAL, UVM_ERROR, or UVM_WARNING (see F.2.2.1)
severity and a count of all reports with UVM_FATAL, UVM_ERROR, or UVM_WARNING severity whose severity
was lowered. These statistics are reported in the summary of uvm_report_server (see 6.5.1).
new
function new( string name = "uvm_report_catcher" )
Initializes a new report catcher. The name argument is optional, but should generally be provided to aid in
debugging.
6.6.3.1 get_client
Returns the uvm_report_object (see 6.3) that has generated the message currently being processed.
6.6.3.2 get_severity
Returns the uvm_severity (see F.2.2.1) of the message that is currently being processed. If the severity was
modified by a previously executed catcher object (which re-threw the message), the returned severity is the
modified value.
6.6.3.3 get_context
54
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns the context name of the message that is currently being processed. This is typically the full hierarchical
name of the component that issued the message. However, if user-defined context is specified in
uvm_report_message (see 6.2), the user-defined context is returned.
6.6.3.4 get_verbosity
Returns the verbosity of the message that is currently being processed. If the verbosity was modified by a
previously executed catcher (which re-threw the message), the returned verbosity is the modified value.
6.6.3.5 get_id
Returns the string id of the message that is currently being processed. If the id was modified by a previously
executed catcher (which re-threw the message), the returned id is the modified value.
6.6.3.6 get_message
Returns the string message of the message that is currently being processed. If the message was modified by a
previously executed catcher (which re-threw the message), the returned message is the modified value.
6.6.3.7 get_action
Returns the uvm_action (see F.2.2.3) of the message that is currently being processed. If the action was
modified by a previously executed catcher (which re-threw the message), the returned action is the modified
value.
6.6.3.8 get_fname
6.6.3.9 get_line
6.6.3.10 get_report_message
Returns the report message object (see 6.2) for this report.
55
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
6.6.4.1 set_severity
Changes the severity of the message to severity. Any other report catchers will see the modified value.
6.6.4.2 set_verbosity
Changes the verbosity of the message to verbosity. Any other report catchers will see the modified value.
6.6.4.3 set_id
Changes the id of the message to id. Any other report catchers will see the modified value.
6.6.4.4 set_message
Changes the text of the message to message. Any other report catchers will see the modified value.
6.6.4.5 set_action
Changes the action of the message to action. Any other report catchers will see the modified value.
6.6.4.6 set_context
Changes the context of the message to context_str. Any other report catchers will see the modified value.
catch
typedef enum {UNKNOWN_ACTION, THROW, CAUGHT} action_e
pure virtual function action_e catch()
This is the method that is intended to be called for each registered report catcher. There are no arguments to this
function. The interface methods in 6.6.3 can be used to access information about the current message being
processed.
56
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
6.6.6 Reporting
6.6.6.1 uvm_report_fatal
Generates a fatal message using the current message’s report object. This message bypasses any message
catching callbacks. The default values of line and report_enabled_checked shall be 0. The default values of
fname and context_name shall be an empty string ("").
6.6.6.2 uvm_report_error
Generates an error message using the current message’s report object. This message bypasses any message
catching callbacks. The default values of line and report_enabled_checked shall be 0. The default values of
fname and context_name shall be an empty string ("").
6.6.6.3 uvm_report_warning
Issues a warning message using the current message’s report object. This message bypasses any message
catching callbacks. The default values of line and report_enabled_checked shall be 0. The default values of
fname and context_name shall be an empty string ("").
6.6.6.4 uvm_report_info
57
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
string message,
int verbosity,
string fname = "",
int line = 0,
string context_name = "",
bit report_enabled_checked = 0
)
Issues an info message using the current message’s report object. This message bypasses any message catching
callbacks. The default values of line and report_enabled_checked shall be 0. The default values of fname and
context_name shall be an empty string ("").
6.6.6.5 uvm_report
Issues a message using the current message’s report object. This message bypasses any message catching
callbacks. The default values of line and report_enabled_checked shall be 0. The default values of fname and
context_name shall be an empty string ("").
6.6.6.6 issue
Immediately issues the message that is currently being processed. This is useful if the message is being
CAUGHT, but should still be emitted.
Issuing a message updates the report_server stats, possibly multiple times if the message is not CAUGHT.
7. Recording classes
The recording classes provide a facility to record transactions into a database using a consistent API. Users can
configure what gets sent to the back-end database, without knowing exactly how the connection to that database
is established.
The primary interface to the recording facility is the uvm_tr_database (see 7.1), which represents the
application-specific mechanism that is recording the transactions. Transactions within the database are grouped
logically within streams, which are represented by the uvm_tr_stream class (see 7.2). Finally, each transaction
in the database is represented by a uvm_recorder (see 16.4.1), which additionally serves as the policy that is
provided to the uvm_object::record method (see 5.3.7.1).
58
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
7.1 uvm_tr_database
The uvm_tr_database class is pure virtual and needs to be extended with an implementation.
NOTE—The uvm_tr_database class is intended to abstract the underlying database implementation from the user, as the
details of the database are often specific to the database implementation.
new
function new( string name = "unnamed-uvm_tr_database" )
name—Instance name.
7.1.3.1 open_db
Opens the back-end connection to the database. If the database is already open, this method returns '1'.
Otherwise, it calls do_open_db (see 7.1.6.1) and returns the result. A return value of '0' indicates the database
could not be opened.
7.1.3.2 close_db
Closes the back-end connection to the database. Closing a database closes and frees all uvm_tr_streams within
the database. If the database is already closed, i.e., is_open (see 7.1.3.3) returns '0', this method returns '1'.
Otherwise, it calls do_close_db (see 7.1.6.2) and returns the result.
7.1.3.3 is_open
Returns the open/closed status of the database. This method returns '1' if the database has been successfully
opened, but not yet closed. A return value of '0' indicates the database is not currently open.
7.1.4.1 open_stream
59
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Provides a reference to a stream within the database; it has the following parameters:
name—A string name for the stream. This is the name associated with the stream in the database.
scope—An optional scope for the stream.
type_name—An optional name describing the type of records to be created in this stream.
This method returns a reference to a uvm_tr_stream object (see 7.2) if successful, null otherwise.
This method also calls do_open_stream (see 7.1.6.3); if a non-null stream is returned, then
uvm_tr_stream::do_open (see 7.2.7.1) is called.
Streams can only be opened if the database is open (per is_open [see 7.1.3.3]); otherwise, the request is ignored
and null is returned.
7.1.4.2 get_streams
Provides a queue of all streams within the database; it has the following parameters:
The get_streams method returns the size of the queue, such that the user can conditionally process the
elements.
establish_link
function void establish_link( uvm_link_base link )
7.1.6.1 do_open_db
Intended to be the back-end implementation of open_db (see 7.1.3.1). A return value of '1' indicates the
database was successfully opened. A return value of '0' indicates the database could not be opened.
7.1.6.2 do_close_db
Intended to be the back-end implementation of close_db (see 7.1.3.2). A return value of '1' indicates the
database was successfully closed; whereas, a return value of '0' indicates the database could not be closed.
60
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
7.1.6.3 do_open_stream
7.1.6.4 do_establish_link
7.2 uvm_tr_stream
The uvm_tr_stream base class is a representation of a stream of records within a uvm_tr_database (see 7.1).
NOTE—The record stream is intended to abstract the underlying database implementation from the user, as the details of
the database are often specific to the database implementation.
new
function new( string name = "unnamed-uvm_tr_stream" )
7.2.3.1 get_db
A warning shall be issued if get_db is called prior to the stream being initialized via do_open (see 7.2.7.1).
7.2.3.2 get_scope
61
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
A warning shall be issued if get_scope is called prior to the stream being initialized via do_open (see 7.2.7.1).
7.2.3.3 get_stream_type_name
A warning shall be issued if get_stream_type_name is called prior to the stream being initialized via do_open
(see 7.2.7.1).
Once a stream has been opened via uvm_tr_database::open_stream (see 7.1.4.1), the user can close the
stream.
The act of freeing a stream is a signal from the user to the database developer that it may release any internal
references to the stream, as the user will not be accessing it again.
A link can be established within the database any time between open and free, however it shall be an error to
establish a link after freeing the stream.
7.2.4.1 close
Closing a stream closes all open recorders in the stream. This method triggers a do_close call (see 7.2.7.2),
followed by uvm_recorder::close (see 16.4.4.2) on all open recorders within the stream.
7.2.4.2 free
Freeing a stream indicates that the database can free any references to the stream (including references to
records within the stream). This method triggers a do_free call (see 7.2.7.3), followed by uvm_recorder::free
(see 16.4.4.3) on all recorders within the stream.
7.2.4.3 is_open
Returns true if this uvm_tr_stream was opened on the database, but has not yet been closed; otherwise
returns false.
7.2.4.4 is_closed
Returns true if this uvm_tr_stream was closed on the database, but has not yet been freed; otherwise returns
false.
62
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
New recorders can be opened prior to the stream being closed. Once a stream has been closed, requests to open
a new recorder are ignored (open_recorder [see 7.2.5.1] returns null).
7.2.5.1 open_recorder
Marks the opening of a new transaction recorder on the stream; it has the following parameters:
If open_time is omitted (or specified as '0'), the stream uses the current time.
This method triggers a do_open_recorder call (see 7.2.7.4). If do_open_recorder returns a non-null value, the
uvm_recorder::do_open method (see 16.4.7.1) is called in the recorder.
Transaction recorders can only be opened if the stream is open on the database (per is_open [see 7.2.4.3]).
Otherwise, the request is ignored and null is returned.
7.2.5.2 get_recorders
Provides a queue of all transactions within the stream; it has the following parameter:
The get_recorders method returns the size of the queue, such that the user can conditionally process the
elements.
7.2.6 Handles
7.2.6.1 get_handle
A value of 0 indicates the recorder has been freed and no longer has a valid ID.
7.2.6.2 get_stream_from_handle
63
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If no stream exists with the given id or the stream with that id has been freed, then null is returned.
7.2.7.1 do_open
Callback triggered via uvm_tr_database::open_stream (see 7.1.4.1); it has the following parameters:
7.2.7.2 do_close
The do_close callback can be used to specify an internal state within the stream, as well as providing a location
to record any closing information.
7.2.7.3 do_free
The do_free callback can be used to release the internal state within the stream, as well as providing a location
to record any “freeing” information.
7.2.7.4 do_open_recorder
Marks the beginning of a new record in the stream. This is a back-end implementation of open_recorder (see
7.2.5.1).
64
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
A null return value implies that the recorder could not be opened (for whatever reason). Users should do a null
check on the return value of open_recorder (see 7.2.5.1).
The uvm_link_base class (see 7.3.1), and its extensions, are provided as a mechanism to improve compile-time
safety when trying to establish links between records within uvm_tr_databases (see 7.1).
7.3.1 uvm_link_base
The uvm_link_base class presents a simple API for defining a link between any two objects.
Using extensions of this class, a uvm_tr_database (see 7.1) can determine the type of links being passed,
without relying on any arbitrary string names.
new
function new( string name = "unnamed-uvm_link_base" )
7.3.1.3 Accessors
7.3.1.3.1 get_lhs
7.3.1.3.2 set_lhs
7.3.1.3.3 get_rhs
65
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
7.3.1.3.4 set_rhs
7.3.1.3.5 set
Triggers both the do_set_rhs (see 7.3.1.4.4) and do_set_lhs (see 7.3.1.4.2) callbacks.
7.3.1.4.1 do_get_lhs
7.3.1.4.2 do_set_lhs
7.3.1.4.3 do_get_rhs
7.3.1.4.4 do_set_rhs
7.3.2 uvm_parent_child_link
The uvm_parent_child_link class is used to represent a parent/child relationship between two objects.
66
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
7.3.2.2.1 new
7.3.2.2.2 get_link
lhs—Left-hand-side reference.
rhs—Right-hand-side reference.
name—Optional name for the link object. The default value of name shall be "pc_link".
my_db.establish_link(uvm_parent_child_link::get_link(record1, record2))
7.3.3 uvm_cause_effect_link
7.3.3.2.1 new
67
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
7.3.3.2.2 get_link
lhs—Left-hand-side reference.
rhs—Right-hand-side reference.
name—Optional name for the link object. The default value of name shall be "ce_link".
my_db.establish_link(uvm_cause_effect_link::get_link(record1, record2))
7.3.4 uvm_related_link
The uvm_related_link is used to represent a generic “is related” link between two objects.
7.3.4.2.1 new
7.3.4.2.2 get_link
lhs—Left-hand-side reference.
rhs—Right-hand-side reference.
68
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
name—Optional name for the link object. The default value of name shall be "ce_link".
my_db.establish_link(uvm_cause_effect_link::get_link(record1, record2))
8. Factory classes
8.1 Overview
As the name implies, the uvm_factory (see 8.3.1) is used to manufacture (create) UVM objects and
components. Only one instance of the factory is present in a given simulation.
User-defined object and component types are registered with the factory via typedef or macro invocation,
see 8.3.1.8. The factory generates and stores lightweight proxies to the user-defined objects and components.
When the user requests a new object or component from the factory (e.g., using
uvm_factory::create_object_by_type), the factory determines what type of object to create based on its
configuration, then asks that type’s proxy to create an instance of the type, which is returned to the user.
8.2.1 Introduction
This subclause defines the proxy component and object classes used by the factory. To avoid the overhead of
creating an instance of every component and object that are registered, the factory holds lightweight wrappers,
or proxies. When a request for a new object is made, the factory calls upon the proxy to create the object it
represents.
8.2.2 type_id
All classes derived from uvm_object (see 5.3) within the UVM package (see 1.3.5) shall have a proxy declared
as type_id, unless explicitly stated otherwise.
69
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The uvm_component_registry serves as a lightweight proxy for a component of type T and type name Tname,
a string. The proxy enables efficient registration with the uvm_factory (see 8.3.1). Without it, registration
would require an instance of the component itself.
class uvm_component_registry #(
type T = uvm_component,
string Tname = "<unknown>"
) extends uvm_object_wrapper
8.2.3.2 Methods
8.2.3.2.1 create_component
Creates a component of type T using the provided name and parent. This is an override of the method in
uvm_object_wrapper (see 8.3.2). It is called by the factory after determining the type of object to create and
the user can then implement it.
NOTE—Users should not call this method directly, they should use create instead (see 8.2.3.2.4).
8.2.3.2.2 get_type_name
8.2.3.2.3 get
The singleton instance is registered for initialization via uvm_init (see F.3.1.3) during static initialization. If
uvm_init has been called prior to this registration occurring, the instance’s initialize method (see 8.2.3.2.7) is
called automatically during static initialization.
70
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
8.2.3.2.4 create
Returns an instance of the component type T, represented by this proxy, subject to any factory overrides based
on the context provided by contxt if it is not an empty string ("") or otherwise provided by the parent’s full
name. The new instance uses the given leaf name and parent.
8.2.3.2.5 set_type_override
This is a pass-through; it configures the factory to create an object of the type represented by override_type
whenever a request is made to create an object of the type T, represented by this proxy, provided no instance
override applies. The original type T shall be a super class of the override_type. replace is a pass-through to the
set_type_override_by_type (see 8.3.1.4.2). The default value of replace shall be 1.
8.2.3.2.6 set_inst_override
Configures the factory to create a component of the type represented by override_type whenever a request is
made to create an object of the type T, represented by this proxy, with matching instance paths. The original
type T shall be a super class of the override_type.
If parent is not specified, inst_path is interpreted as an absolute instance path, which enables instance overrides
to be specified outside the component classes. If parent is specified, inst_path is interpreted as being relative to
the parent’s hierarchical instance path, i.e., {parent.get_full_name(),".", inst_path} is the instance
path that is registered with the override. inst_path may contain wildcards for matching against multiple
contexts.
8.2.3.2.7 initialize
Registers this proxy object with the current factory (see F.4.1.4.2) via uvm_factory::register (see 8.3.1.3).
The uvm_object_registry serves as a lightweight proxy for an uvm_object (see 5.3) of type T and type name
Tname, a string. The proxy enables efficient registration with the uvm_factory (see 8.3.1). Without it,
registration would require an instance of the object itself.
71
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
class uvm_object_registry #(
type T = uvm_object,
string Tname = "<unknown>"
) extends uvm_object_wrapper
8.2.4.2 Methods
8.2.4.2.1 create_object
Creates a component of type T and returns it as a handle to uvm_object (see 5.3). This is called by the factory
after determining the type of object to create and the user can then implement it.
NOTE—Users should not call this method directly, they should use create instead (see 8.2.4.2.4).
8.2.4.2.2 get_type_name
Returns the value given by the string parameter Tname by default. This method overrides the method in
uvm_object_wrapper (see 8.3.2).
8.2.4.2.3 get
The singleton instance is registered for initialization via uvm_init (see F.3.1.3) during static initialization. If
uvm_init has been called prior to this registration occurring, the instance’s initialize method (see 8.2.3.2.7) is
called automatically during static initialization.
8.2.4.2.4 create
Returns an instance of the object type T, represented by this proxy, subject to any factory overrides based on the
context provided by the parent’s full name. The contxt argument, if supplied, supersedes the parent’s context.
The new instance uses the given leaf name and parent.
8.2.4.2.5 set_type_override
72
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
bit replace = 1
)
Configures the factory to create an object of the type represented by override_type whenever a request is made
to create an object of the type represented by this proxy, provided no instance override applies. The original
type T is typically a super class of the override_type. The default value of replace shall be 1.
8.2.4.2.6 set_inst_override
Configures the factory to create an object of the type represented by override_type whenever a request is made
to create an object of the type represented by this proxy, with matching instance paths. The original type T is
typically a super class of the override_type.
If parent is not specified, inst_path is interpreted as an absolute instance path, which enables instance overrides
to be specified outside the component classes. If parent is specified, inst_path is interpreted as being relative to
the parent’s hierarchical instance path, i.e., {parent.get_full_name(),".", inst_path} is the instance
path that is registered with the override. inst_path may contain wildcards for matching against multiple
contexts.
8.2.4.2.7 initialize
Registers this proxy object with the current factory (see F.4.1.4.2) via uvm_factory::register (see 8.3.1.3).
UVM additionally supports registration of abstract objects and components with the factory. Since registered
classes are abstract, they cannot be constructed directly via a call to new. As such, the user needs to provide a
factory override for any abstract classes that are registered with the factory. It shall be an error to attempt to
construct an abstract class for which no overrides have been declared.
The abstract registries should only be used with objects and components that have been declared as virtual
types, e.g.,
For standard components and objects (i.e., those not declared using the keyword virtual), the standard
registries should be used (see 8.2.3 and 8.2.4).
8.2.5.1 uvm_abstract_component_registry
This serves as a lightweight proxy for an abstract component of type T and type name Tname, a string. The
proxy enables efficient registration with uvm_factory (see 8.3.1). Without it, registration would require an
instance of the component itself.
73
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
8.2.5.1.2 create_component
As abstract classes cannot be constructed, this method shall generate an error and return null.
8.2.5.1.3 get_type_name
8.2.5.1.4 get
8.2.5.1.5 create
8.2.5.1.6 set_type_override
8.2.5.1.7 set_inst_override
8.2.5.1.8 initialize
8.2.5.2 uvm_abstract_object_registry
This serves as a lightweight proxy for an abstract object of type T and type name Tname, a string. The proxy
enables efficient registration with uvm_factory (see 8.3.1). Without it, registration would require an instance of
the object itself.
74
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
8.2.5.2.2 create_object
As abstract classes cannot be constructed, this method shall generate an error and return null.
8.2.5.2.3 get_type_name
8.2.5.2.4 get
8.2.5.2.5 create
8.2.5.2.6 set_type_override
8.2.5.2.7 set_inst_override
8.2.5.2.8 initialize
This subclause covers the classes that define the UVM factory facility.
8.3.1 uvm_factory
As the name implies, uvm_factory is used to manufacture (create) UVM objects and components. Object and
component types are registered with the factory using lightweight proxies to the actual objects and components
being created. The uvm_object_registry #(T,Tname) (see 8.2.4) and uvm_component_registry #(T,Tname)
(see 8.2.3) classes are used to proxy uvm_objects (see 5.3) and uvm_components (see 13.1), respectively.
type-based—These interfaces are far less prone to typographical errors in usage. When errors do occur,
they are caught at compile-time.
75
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
name-based—These interfaces are dominated by string arguments that can be misspelled and provided
in the wrong order. Errors in name-based requests might only be caught at the time of the call, if at all.
That being said, a name-based factory is required when crossing language boundaries, such as direct
programming interface (DPI) or the command line.
A uvm_factory is an abstract class that declares many of its methods as pure virtual.
8.3.1.2.1 get
The static accessor is provided as a convenience wrapper around retrieving the factory via the
uvm_coreservice_t::get_factory method (see F.4.1.4.2).
8.3.1.2.2 set
Sets the factory instance to be f. This is a convenience wrapper around setting the factory via the
uvm_coreservice_t::set_factory method (see F.4.1.4.3).
register
pure virtual function void register ( uvm_object_wrapper obj )
Intended to register the given proxy object, obj, with the factory. The proxy object is a lightweight substitute for
the component or object it represents. When the factory needs to create an object of a given type, it calls the
proxy’s create_object (see 8.3.2.2.1) or create_component (see 8.3.2.2.1) method to do so.
When doing name-based operations, the factory calls the proxy’s get_type_name method (see 8.3.2.2.2) to
match against the requested_type_name argument in subsequent calls to create_component_by_name and
create_object_by_name (see 8.3.1.5). If the proxy object’s get_type_name method returns "<unknown>" or
the empty string (""), name-based lookup is effectively disabled.
76
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These methods are intended to configure the factory to create an object of the override’s type whenever a
request is made to create an object of the original type using a context that matches full_inst_path.
When overriding by type, original_type and override_type are handles to the types’ proxy objects.
Preregistration is not required.
When overriding by name, the original_type_name typically refers to a preregistered type in the factory. It may,
however, be any arbitrary string. Future calls to any of the create_* methods with the same string and matching
instance path produce the type represented by override_type_name, which needs to be preregistered with the
factory.
The full_inst_path is matched against the concatenation of {parent_inst_path, ".", name} provided in
future create requests. full_inst_path may include wildcards (* and ?) such that a single instance override can
be applied in multiple contexts. A full_inst_path of "*" is effectively a type override (see 8.3.1.4.2), as it
matches all contexts.
When the factory processes instance overrides, the instance queue is processed in order of override registrations
and the first override match prevails. Thus, more specific overrides should be registered first, followed by more
general overrides.
These methods are intended to configure the factory to create an object of the override’s type whenever a
request is made to create an object of the original type, provided no instance override applies. The original type
shall be a super class of the override_type.
When overriding by type, original_type and override_type are handles to the types’ proxy objects.
Preregistration is not required.
When overriding by name, the original_type_name typically refers to a preregistered type in the factory. It may,
however, be any arbitrary string. Future calls to any of the create_* methods with the same string and matching
instance path produce the type represented by override_type_name, which needs to be preregistered with the
factory.
77
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
8.3.1.5 Creation
These methods are intended to create and return a component or object of the requested type, which may be
specified by type or by name. A requested component shall be derived from the uvm_component base class
(see 13.1), and a requested object shall be derived from the uvm_object base class (see 5.3).
When requesting by type, requested_type is a handle to the type’s proxy object. Preregistration is not required.
When requesting by name, request_type_name is a string representing the requested type, which shall have
been registered with the factory with that name prior to the request. If the factory does not recognize the
requested_type_name, an error shall be generated and a null handle returned.
If no instance override is found, the factory then searches for a type override.
Once the final override is found, an instance of that component or object is returned in place of the requested
type. New components use the given name and parent. New objects use the given name, if provided.
Override searches are recursively applied, with instance overrides taking precedence over type overrides. If foo
overrides bar, and xyz overrides foo, then a request for bar produces xyz. Recursive loops result in an error,
in which case the type returned is the one that formed the loop. Using the previous example, if bar overrides
xyz, then bar is returned after the error is generated.
78
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
8.3.1.6.1 set_type_alias
Intended to allow overrides by type to use the alias_type_name as an additional name to refer to original_type.
8.3.1.6.2 set_inst_alias
Intended to allow overrides by name to use the alias_type_name as an additional name to refer to original_type
in the context referred to by full_inst_path.
8.3.1.7 Introspection
These methods are intended to return the proxy to the object that would be created given the arguments.
full_inst_path is typically derived from the parent’s instance path and the leaf name of the object to be created,
i.e.,
8.3.1.7.2 find_wrapper_by_name
Intended to return the uvm_object_wrapper (see 8.3.2) associated with a given type_name.
8.3.1.7.3 is_type_name_registered
This method checks if the given type_name was registered in the factory as the name for a type and returns 1 in
this case.
79
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
8.3.1.7.4 is_type_registered
This method checks if the given uvm_object_wrapper (see 8.3.2) obj was registered in the factory for a type
and returns 1 in this case.
8.3.1.7.5 print
Intended to print the state of the uvm_factory, including registered types, instance overrides, and type
overrides.
When all_types is 0, only type and instance overrides are displayed. When all_types is 1 (the default),
all registered user-defined types are printed as well, provided they have names associated with them. When
all_types is 2, any UVM types (prefixed with uvm_) are included in the list of registered types.
8.3.1.8 Usage
More reference information can be found in B.2.1, 8.2.3, 8.2.4, and 13.1.
8.3.2 uvm_object_wrapper
The uvm_object_wrapper provides an abstract interface for creating object and component proxies. Instances
of these lightweight proxies, representing every uvm_object–based (see 5.3) and uvm_component–based
object (see 13.1) available in the test environment, are registered with the uvm_factory (see 8.3.1). When the
factory is called upon to create an object or component, it finds and delegates the request to the appropriate
proxy.
8.3.2.2 Methods
8.3.2.2.1 create_object
Creates a new object with the optional name. An object proxy (see 8.2.4) implements this method to create an
object of a specific type T.
8.3.2.2.2 create_component
80
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_component parent
)
Creates new component, passing to its constructor the given name and parent. A component proxy (see 8.2.3)
implements this method to create an object of a specific type T.
8.3.2.2.3 get_type_name
Derived classes implement this method to return the type name of the object created by create_component (see
8.3.2.2.2) or create_object (see 8.3.2.2.1).
8.3.3 uvm_default_factory
Class declaration
9. Phasing
9.1 Overview
UVM implements an automated mechanism for phasing the execution of the various components in a testbench.
9.2 Implementation
The API described here provides a general purpose testbench phasing solution, consisting of a phaser machine
that traverses a master schedule graph. This machine is built by the integrator from one or more instances of
template schedules provided by UVM or by third-party verification intellectual property (VIP), and it supports
implicit or explicit synchronization, run-time control of threads, and jumps.
Each schedule node refers to a single phase compatible with that VIP’s components and that executes the
required behavior via an IMP (see F.2.5.1).
A single class represents the definition, state, and context of a phase. It is instantiated once as a singleton IMP
(see F.2.5.1) and one or more times as nodes in a graph that represent serial and parallel phase relationships and
store the current state as the phaser progresses, and also as the phase implementation that specifies required
component behavior (by extension into the component context if non-default behavior required).
a) uvm_phase—The base class for defining a phase’s behavior, state, and context. See 9.3.1.
81
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
b) uvm_domain—A phasing schedule node representing an independent branch of the schedule. See 9.4.
c) uvm_bottomup_phase—A phase implementation for bottom-up function phases. See 9.5.
d) uvm_topdown_phase—A phase implementation for top-down function phases. See 9.7.
e) uvm_task_phase—A phase implementation for task phases. See 9.6.
The common phases to all uvm_components (see 13.1) are described in 9.8.
The run-time phases are described in 9.8.2.
The following classes are used to specify a phase and its implied functionality.
9.3.1 uvm_phase
This base class defines everything about a phase: its behavior, state, and context.
To define behavior, UVM or the user extends it to create singleton objects that capture the definition of what
the phase does and how it does it. These are then cloned to produce multiple nodes that are hooked up in a
graph structure to provide context—which phases follow which—and to hold the state of the phase throughout
its lifetime.
UVM provides default extensions of this class for the standard run-time phases.
NOTE—Users may likewise extend this class to define the phase proxy for a particular component context as required.
To create custom phases, use one of the three predefined extended classes that encapsulate behavior for
different phase types: uvm_task_phase (see 9.6), uvm_bottomup_phase (see 9.5), and uvm_topdown_phase
(see 9.7).
82
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
A schedule is a coherent group of one or mode phase/state nodes linked together by a graph structure, allowing
arbitrary linear/parallel relationships to be specified, and executed by stepping through them in the graph order.
Each schedule node points to a phase, holds the execution state of that phase, and has optional links to other
nodes for synchronization.
The main operations are: construct, add phases, and instantiate hierarchically within another schedule.
Each graph structure is a directed acyclic graph (DAG). Each instance is a node connected to others to form the
graph. Each node in the graph has zero or more successors, and zero or more predecessors. No nodes are
completely isolated from others. Exactly one node has zero predecessors. This is the root node.
Also, since the graph is acyclic, following the forward arrows never lead back to the starting point for any
nodes in the graph; but, eventually this leads to a node with no successors.
A given phase may appear multiple times in the complete phase graph, due to the multiple independent domain
feature and the ability for different VIP to customize their own phase schedules (perhaps reusing existing
phases). Each node instance in the graph maintains its own state of execution.
Phase state is represented by a value of uvm_phase_state (see F.2.5.2). A phase object that is not a schedule or a
node within a schedule has the phase state value UVM_PHASE_UNINITIALIZED. Other phase objects may
progress through the states in the order shown for uvm_phase_state, with the exception of responding to a
jump (see F.2.5.2).
9.3.1.3 Methods
9.3.1.3.1 new
function new(
string name = "uvm_phase",
uvm_phase_type phase_type = UVM_PHASE_SCHEDULE,
uvm_phase parent = null
)
Creates a new phase node, with a name and phase_type (one of UVM_PHASE_IMP, UVM_PHASE_NODE,
UVM_PHASE_SCHEDULE, or UVM_PHASE_DOMAIN). The default value of phase_type shall be
UVM_PHASE_SCHEDULE.
9.3.1.3.2 get_phase_type
83
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.3.1.3.3 set_max_ready_to_end_iterations
Sets the maximum number of iterations of ready_to_end. A raise and drop of objection while this phase is in
phase_ready_to_end causes a new iteration of phase_ready_to_end if the new iteration count is less than this
value (see 13.1.4.3.2). The default value is the value returned from get_max_ready_to_end_iterations (see
9.3.1.3.6).
9.3.1.3.4 get_max_ready_to_end_iterations
9.3.1.3.5 set_default_max_ready_to_end_iterations
Sets the global default maximum number of iterations of phase_ready_to_end (see 9.3.1.3.3). The default
value is 20.
9.3.1.3.6 get_default_max_ready_to_end_iterations
9.3.1.4 State
9.3.1.4.1 get_state
9.3.1.4.2 get_run_count
This is an accessor to return the integer number of times this phase has executed.
9.3.1.4.3 find_by_name
Locates a phase node with the specified name and returns its handle. When stay_in_scope is set to 1, this only
searches within this phase’s schedule and domain. The default value of stay_in_scope shall be 1.
84
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.3.1.4.4 find
Locates the phase node with the specified phase IMP and returns its handle. When stay_in_scope is set to 1, this
only searches within this phase’s schedule and domain. The default value of stay_in_scope shall be 1.
9.3.1.4.5 is
Returns 1 if the containing uvm_phase refers to the same phase as the phase argument, 0 otherwise.
9.3.1.4.6 is_before
Returns 1 if the containing uvm_phase refers to a phase that is earlier than the phase argument, 0 otherwise.
9.3.1.4.7 is_after
Returns 1 if the containing uvm_phase refers to a phase that is later than the phase argument, 0 otherwise.
9.3.1.5 Callbacks
9.3.1.5.1 exec_func
Implements the proxy functionality for a function phase type comp—the component to execute the functionality
upon phase—the phase schedule that originated this phase call.
9.3.1.5.2 exec_task
Implements the proxy functionality for a task phase type comp—the component to execute the functionality
upon phase—the phase schedule that originated this phase call.
85
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.3.1.6 Schedule
9.3.1.6.1 add
Adds phase to the schedule or domain. add shall be called only from a phase with the type
UVM_PHASE_SCHEDULE or UVM_PHASE_DOMAIN. Optionally, one or more phases may be specified to specify
how the new phase aligns with existing phases. The optional phases shall already exist in the schedule or
domain. If no optional phases are specified, phase is appended to the schedule or domain.
If with_phase is not null, phase is added in parallel with with_phase. If after_phase is not null, phase is added
as a successor to after_phase. If before_phase is not null, phase is added as a predecessor to before_phase. If
start_with_phase is not null, phase is added as a successor to the predecessor(s) of start_with_phase. If
end_with_phase is not null, phase is added as a predecessor to the successor(s) of end_with_phase. with_phase,
after_phase, and start_with_phase specify the predecessor of phase; only one of these shall be non-null.
with_phase, before_phase, and end_with_phase specify the successor of phase; only one of these shall be non-
null.
9.3.1.6.2 get_parent
Returns the parent schedule node, if any, for the hierarchical graph traversal.
9.3.1.6.3 get_full_name
Returns the full path from the enclosing domain down to this node. The singleton IMP phases have no
hierarchy.
9.3.1.6.4 get_schedule
Returns the topmost parent schedule node, if any, for the hierarchical graph traversal. The default value of hier
shall be 0.
9.3.1.6.5 get_schedule_name
Returns the schedule name associated with this phase node. An implementation calls get_schedule (hier) (see
9.3.1.6.4) and then constructs a hierarchical name including any schedule names above the returned schedule.
The default value of hier shall be 0.
86
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.3.1.6.6 get_domain
9.3.1.6.7 get_imp
Returns the phase implementation for this node. Returns null if this phase type is not a UVM_PHASE_IMP.
9.3.1.6.8 get_domain_name
Returns the domain name associated with this phase node or "unknown" if no domain found.
9.3.1.6.9 get_adjacent_predecessor_nodes
Provides an array of nodes that are predecessors to this phase node. A predecessor node is defined as any phase
node that lies prior to this node in the phase graph; an adjacent predecessor node has no nodes between this
node and the predecessor node.
9.3.1.6.10 get_adjacent_successor_nodes
Provides an array of nodes that are successors to this phase node. A successor node is defined as any phase
node that lies after this node in the phase graph, with no nodes between this node and the successor node.
Task-based phase nodes within the phasing graph provide a uvm_objection-based interface (see 10.5.1) for
prolonging the execution of the phase. All other phase types do not contain an objection and shall report an
error if the user attempts to use raise_objection (see 9.3.1.7.2), drop_objection (see 9.3.1.7.3), or
get_objection_count (see 9.3.1.7.4).
9.3.1.7.1 get_objection
Returns the uvm_objection (see 10.5.1) that gates the termination of the phase.
9.3.1.7.2 raise_objection
87
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Raises an objection to ending this phase, which provides components with greater control over the phase flow
for processes that are not implicit objectors to the phase. The default value of count shall be 1. For more details,
refer to the uvm_objection version of this function (see 10.5.1.3.3).
9.3.1.7.3 drop_objection
Drops an objection to ending this phase. The default value of count shall be 1. For more details, refer to the
uvm_objection version of this function (see 10.5.1.3.4).
9.3.1.7.4 get_objection_count
This is a pass through to the get_objection_count on the objection returned by get_objection. See 10.5.1.5.3.
9.3.1.8 Synchronization
The functions sync (see 9.3.1.8.1) and unsync (see 9.3.1.8.2) add relationships between nodes, such that the
node’s start and end are synchronized.
9.3.1.8.1 sync
9.3.1.8.2 unsync
88
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.3.1.8.3 wait_for_state
task wait_for_state(
uvm_phase_state state,
uvm_wait_op op = UVM_EQ
)
Waits until this phase compares with the given state and op operands.
wait_for_state(UVM_PHASE_STARTED, UVM_GTE)
9.3.1.9 Jumping
Phase jumping refers to a change in the normal process of a phase ending and the successor phase(s) starting. A
phase can be made to end prematurely and/or which phase is started next can be changed. To jump all active
phases within a domain that are predecessors or successors, directly or indirectly, of the jump target, use
uvm_domain::jump (see 9.4.2.4). Phase jumping can also be specified for an individual phase instance by
using the following functions.
9.3.1.9.1 jump
Jumps to the specified phase. The phase shall be in the set of predecessors or successors of the current phase.
All active phases that share phase as a common successor or predecessor shall also be affected.
9.3.1.9.2 set_jump_phase
Specifies which phase to transition to when this phase completes. Note that this function is part of what jump
does (see 9.3.1.9.1); unlike jump, this does not set the flag to terminate the phase prematurely.
9.3.1.9.3 end_prematurely
Specifies a flag to cause the phase to end prematurely. Note that this function is part of what jump does (see
9.3.1.9.1); unlike jump, this does not set a jump_phase to go to after the phase ends.
9.3.1.9.4 get_jump_target
Returns a handle to the target phase of the current jump or null, if no jump is in progress. It is valid from the
time jump (see 9.3.1.9.1) or set_jump_phase (see 9.3.1.9.2) is called until the jump occurs. There is also a
callback for UVM_PHASE_JUMPING that contains a valid return from this function.
89
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.3.2 uvm_phase_state_change
This is a phase state transition descriptor, which is used to describe the phase transition that caused a
uvm_phase_cb::state_changed callback to be invoked.
9.3.2.2 Methods
9.3.2.2.1 get_state
Returns the state to which the phase just transitioned. This is functionally equivalent to uvm_phase::get_state
(see 9.3.1.4.1).
9.3.2.2.2 get_prev_state
9.3.2.2.3 jump_to
If the current state is UVM_PHASE_ENDED or UVM_PHASE_JUMPING because of a phase jump, this returns the
phase that is the target of jump. Otherwise, it returns null.
9.3.3 uvm_phase_cb
This class defines a callback method that is invoked by the phaser during the execution of a specific node in the
phase graph or for all phase nodes. User-defined callback extensions can be used to integrate data types that are
not natively phase-aware with the UVM phasing.
9.3.3.2 Methods
9.3.3.2.1 new
9.3.3.2.2 phase_state_change
90
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_phase_state_change change
)
Called whenever a phase changes state. The change descriptor describes the transition that was just completed.
The callback method is invoked immediately after the phase state has changed, but before the phase
implementation is executed.
An extension may interact with the phase, such as raising the phase objection to prolong the phase, in a manner
that is consistent with the current phase state.
By default, this callback method does nothing. Unless otherwise specified, modifying the phase transition
descriptor has no effect on the phasing schedule or execution.
9.4 uvm_domain
This is a phasing schedule node representing an independent branch of the schedule. It is a handle used to
assign domains to components or hierarchies in the testbench.
9.4.2 Methods
9.4.2.1 new
Creates a new instance (type = UVM_PHASE_DOMAIN) of a phase domain. The new instance is added to the list
of all domains indexed by name. It shall be an error to call new with a name that is already in the list of all
domains.
9.4.2.2 get_domains
Provides a list of all domains for the domains argument. The list of all domains always contains a
domains["common"] entry that contains the UVM common phases (see 9.8) and a domains["uvm"] entry
that contains the UVM run-time phases (see 9.8.2).
9.4.2.3 add_uvm_phases
9.4.2.4 jump
Jumps all active phases of this domain to phase if there is a path between the active phases of this domain and
phase.
91
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.5 uvm_bottomup_phase
This is a virtual base class for function phases that operate bottom-up. The virtual function execute (see 9.5.2.3)
is called for each component. A bottom-up phase invokes the delegate function first on components without any
children; once finished, the delegate function is invoked on each of the first sets’ parents, etc. A bottom-up
function phase completes when the execute method has been called and returned on all applicable components
in the hierarchy.
9.5.2 Methods
9.5.2.1 new
9.5.2.2 traverse
Traverses the component tree in bottom-up order and, depending on the state, calls
comp.phase_started(phase), execute(comp,phase), or comp.phase_ended(phase).
9.5.2.3 execute
Calls uvm_phase::exec_func(comp,phase).
9.6 uvm_task_phase
This is the base class for all task phases. It forks a call to uvm_phase::exec_task (see 9.3.1.5.2) for each
component in the hierarchy.
The completion of these tasks does not imply, nor is it required for, the end of phase. Once the phase completes,
any remaining forked uvm_phase::exec_task threads are forcibly and immediately killed.
By default, the way for a task phase to extend over time is if there is at least one component that raises an
objection, e.g.,
92
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
...
phase.drop_objection(this, "Applied enough stimulus")
endtask
endclass
There is however one scenario wherein time advances within a task-based phase without any objections to the
phase being raised. If two (or more) phases are synched, or they share a common successor, such as the
uvm_run_phase (see 9.8.1.5) and the uvm_post_shutdown_phase (see 9.8.2.12) sharing the
uvm_extract_phase (see 9.8.1.6) as a successor, then phase advancement is delayed until all predecessors of
the common successor are ready to proceed. Because of this, it is possible for time to advance between the
uvm_component::phase_started (see 13.1.4.3.1) and uvm_component::phase_ended (see 13.1.4.3.1) of a
task phase without any participants in the phase raising an objection.
A task phase shall not share a successor with a topdown_phase or bottomup_phase, as that setup could try
to make the topdown_phase or bottomup_phase consume time.
9.6.2 Methods
9.6.2.1 new
9.6.2.2 traverse
Traverses the component tree and, depending on the state, calls comp.phase_started(phase),
execute(comp,phase), comp.phase_ready_to_end (phase), or comp.phase_ended (phase).
9.6.2.3 execute
Forks uvm_phase::exec_task(comp,phase).
9.7 uvm_topdown_phase
This is a virtual base class for function phases that operate top-down. The virtual function execute (see 9.7.2.3)
is called for each component.
93
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
A top-down function phase completes when the execute method has been called and returned on all applicable
components in the hierarchy.
9.7.2 Methods
9.7.2.1 new
9.7.2.2 traverse
Traverses the component tree in top-down order and, depending on the state, calls
comp.phase_started(phase), execute(comp,phase), or comp.phase_ended(phase).
9.7.2.3 execute
Calls uvm_phase::exec_func(comp,phase).
UVM defines some phases. The user is free to create more phases.
The names of the UVM predefined phases (which are returned by get_name for a phase instance) match the
class names specified in this subclause with the "uvm_" and "_phase" terms removed. Each UVM predefined
phase implements the following method.
get
which returns the singleton phase handle for each phase. The return value of get is of the same type as the phase
itself, such that uvm_build_phase::get has a return type of uvm_build_phase, uvm_run_phase has a
return type of uvm_run_phase, and so on.
The UVM predefined phases are classified as common phases and run-time phases. The common phases are the
set of function and task phases that all uvm_components (see 13.1) execute together. All uvm_components
are always synchronized with respect to the common phases. The run-time phases execute in a predefined
94
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
phase schedule that runs concurrently to the common phase uvm_run_phase (see 9.8.1.5). By default, all
uvm_components (see 13.1) using the run-time schedule are synchronized with respect to the predefined
phases in the schedule. It is possible for components to belong to different domains in which case their
schedules can be unsynchronized with a call to unsync (see 9.3.1.8.2).
The common phases are described in the order of their execution. All of the phases before uvm_run_phase
(see 9.8.1.5) shall execute at simulation time 0.
9.8.1.1 uvm_build_phase
This is a uvm_topdown_phase (see 9.7) whose exec_func calls the uvm_component::build_phase method
(see 13.1.4.1.1).
9.8.1.2 uvm_connect_phase
9.8.1.3 uvm_end_of_elaboration_phase
9.8.1.4 uvm_start_of_simulation_phase
9.8.1.5 uvm_run_phase
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::run_phase virtual method
(see 13.1.4.1.5). This phase runs in parallel to the run-time phases, uvm_pre_reset_phase through
uvm_post_shutdown_phase (see 9.8.2). The uvm_run_phase shall always be running when time is
advancing, so when this phase starts, simulation time is still 0, and the time when this phase ends shall be the
same time that the uvm_final_phase ends (see 9.8.1.9).
The run phase starts a global timeout counter thread. The expiration time of the counter shall be
implementation-specific, unless set via uvm_root::set_timeout (see F.7.2.3) prior to uvm_run_phase starting.
If the counter expires before uvm_run_phase ends, it shall generate a fatal error.
95
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.8.1.6 uvm_extract_phase
9.8.1.7 uvm_check_phase
9.8.1.8 uvm_report_phase
9.8.1.9 uvm_final_phase
This is a uvm_topdown_phase (see 9.7) whose exec_func calls the uvm_component::final_phase method
(see 13.1.4.1.9).
The run-time phases shall include the following task phases, shown in their default order of execution. Users and
implementations may add run-time phases before or after any of these specified phases. The run-time phases
shall not start before the end of uvm_start_of_simulation_phase (see 9.8.1.4). uvm_extract_phase (see
9.8.1.6) shall not start before the run-time phases have ended. These specified phases shall not overlap within
an instance of uvm_domain.
9.8.2.1 uvm_pre_reset_phase
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::pre_reset_phase method
(see 13.1.4.2.1).
9.8.2.2 uvm_reset_phase
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::reset_phase method (see
13.1.4.2.2).
9.8.2.3 uvm_post_reset_phase
96
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::post_reset_phase method
(see 13.1.4.2.3).
9.8.2.4 uvm_pre_configure_phase
9.8.2.5 uvm_configure_phase
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::configure_phase method
(see 13.1.4.2.5).
9.8.2.6 uvm_post_configure_phase
9.8.2.7 uvm_pre_main_phase
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::pre_main_phase method
(see 13.1.4.2.7).
9.8.2.8 uvm_main_phase
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::main_phase method (see
13.1.4.2.8).
9.8.2.9 uvm_post_main_phase
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::post_main_phase method
(see 13.1.4.2.9).
9.8.2.10 uvm_pre_shutdown_phase
97
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
9.8.2.11 uvm_shutdown_phase
This is a uvm_task_phase (see 9.6) whose exec_task calls the uvm_component::shutdown_phase method
(see 13.1.4.2.11).
9.8.2.12 uvm_post_shutdown_phase
a) uvm_event#(T)—UVM’s event class (see 10.1.2) augments the SystemVerilog event data type with
such services as setting callbacks and data delivery.
b) uvm_barrier—A barrier is used to prevent a pre-configured number of processes from continuing
until all have reached a certain point in simulation (see 10.3).
c) uvm_event_pool and uvm_barrier_pool—The event and barrier pool classes are specializations of
uvm_pool #(string, T) (see 11.2) used to store collections of uvm_events (see 10.1) and
uvm_barriers (see 10.3), respectively, indexed by string name. Each pool class contains a static,
“global” pool instance for sharing across all processes (see 10.4).
d) uvm_event_callback—The event callback is used to create callback objects that may be attached to
uvm_events (see 10.2).
This subclause defines the uvm_event_base class (see 10.1.1) and its derivative uvm_event#(T) (see 10.1.2).
10.1.1 uvm_event_base
The uvm_event_base class is an abstract wrapper class around the SystemVerilog event construct. It
provides some additional services, such as setting callbacks and maintaining the number of waiters.
10.1.1.2 Methods
10.1.1.2.1 new
98
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.1.1.2.2 wait_on
If the event has already been triggered, this task returns immediately. If a delta value is specified, the caller is
forced to wait a single delta #0 before returning. This prevents the caller from returning before previously
waiting processes have had a chance to resume. The default value of delta shall be 0.
Once an event has been triggered, it will be remain “on” until the event is reset (see 10.1.1.2.8).
10.1.1.2.3 wait_off
If the event has already triggered and is “on,” this task waits for the event to be turned “off” via a call to reset
(see 10.1.1.2.8).
If the event has not already been triggered, this task returns immediately. If delta value is specified, the caller
is forced to wait a single delta #0 before returning. This prevents the caller from returning before previously
waiting processes have had a chance to resume. The default value of delta shall be 0.
10.1.1.2.4 wait_trigger
If one process calls wait_trigger in the same delta as another process calls uvm_event#(T)::trigger (see
10.1.2.2.4), a race condition occurs. If the call to wait occurs before the trigger, this method returns in this delta.
If the wait occurs after the trigger, this method does not return until the next trigger, which may never occur
and, thus, cause a deadlock. This race can be avoided by using wait_ptrigger (see 10.1.1.2.5).
10.1.1.2.5 wait_ptrigger
Waits for a persistent trigger of the event. Unlike wait_trigger (see 10.1.1.2.4), this views the trigger as
persistent within a given time-slice and, thus, avoids certain race conditions. If this method is called after the
trigger, but within the same time-slice, the caller returns immediately.
10.1.1.2.6 get_trigger_time
Returns the time that this event was last triggered. If the event has not been triggered or the event has been
reset, the trigger time is 0.
10.1.1.2.7 is_on
Indicates whether the event has been triggered since it was last reset.
99
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.1.1.2.8 reset
Resets the event to its off state. If wakeup is set, all processes currently blocked waiting on wait_trigger (see
10.1.1.2.4) or wait_ptrigger (see 10.1.1.2.5) for the event are activated before the reset. The default value of
wakeup shall be 0.
10.1.1.2.9 cancel
This is used if a process that is waiting on an event is disabled or activated by some other means.
10.1.1.2.10 get_num_waiters
10.1.2 uvm_event#(t)
The uvm_event class is an extension of the abstract uvm_event_base class (see 10.1.1).
The optional parameter T allows the user to define a data type that can be passed during an event trigger.
10.1.2.2 Methods
10.1.2.2.1 new
10.1.2.2.2 wait_trigger_data
10.1.2.2.3 wait_ptrigger_data
100
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.1.2.2.4 trigger
An optional data argument can be supplied with the enable to provide trigger-specific information. If no data is
provided, then get_trigger_data (see 10.1.2.2.5) shall return the default data (see 10.1.2.2.6).
10.1.2.2.5 get_trigger_data
Returns the data, if any, provided by the last call to trigger (see 10.1.2.2.4).
Default trigger data to be used when trigger (see 10.1.2.2.4) is called without passing in data.
get_default_data shall return the most recent data assigned via set_default_data. The value returned
by get_default_data prior to calling set_default_data is the uninitialized value of type T.
10.2 uvm_event_callback
The uvm_event_callback class is an abstract class that is used to create callback objects that may be attached
to uvm_event#(T)s (see 10.1.2). To do so, simply derive a new class and override pre_trigger (see 10.2.2.2)
and/or post_trigger (see 10.2.2.3).
Callbacks are an alternative to using processes that wait on events. When a callback is attached to an event, that
callback object’s callback function is called each time the event is triggered.
10.2.2 Methods
10.2.2.1 new
10.2.2.2 pre_trigger
101
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
T data
)
This callback is called just before triggering the associated event. In a derived class, override this method to
implement any pre-trigger functionality.
If the callback returns 1, the event does not trigger and the post-trigger callback is not called. This provides a
way for a callback to prevent the event from triggering.
In this function, e is the uvm_event#(T) (see 10.1.2) that is being triggered and data is the optional data
associated with the event trigger.
10.2.2.3 post_trigger
This callback is called after triggering the associated event. In a derived class, override this method to
implement any post-trigger functionality.
In this function, e is the uvm_event#(T) (see 10.1.2) that is being triggered and data is the optional data
associated with the event trigger.
10.3 uvm_barrier
The uvm_barrier class provides a multi-process synchronization mechanism. It enables a set of processes to
block until the desired number of processes reach the synchronization point, at which time all of the processes
are released.
10.3.2 Methods
10.3.2.1 new
function new (
string name = "",
int threshold = 0
)
10.3.2.2 wait_for
Blocks until the number of blocked wait_for calls matches the current threshold.
The number of processes to wait for can be specified by using the set_threshold method (see 10.3.2.6).
102
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.3.2.3 reset
Resets the barrier. This sets the waiter count back to zero (0).
The threshold is unchanged. After reset, the barrier forces any processes to wait for the threshold again.
If the wakeup bit is set to 1, any currently waiting processes shall be activated. The default value of wakeup
shall be 1.
10.3.2.4 set_auto_reset
Determines if the barrier should reset itself after the threshold is reached.
The default is on, so when a barrier hits its threshold it resets and new processes block until the threshold is
reached again.
If auto reset is off, then once the threshold is achieved, new processes pass through without being blocked until
the barrier is reset. The default value of value shall be 1.
10.3.2.5 get_threshold
10.3.2.6 set_threshold
This determines how many processes are waiting on the barrier before the processes may proceed. Once the
threshold is reached, all waiting processes are activated.
If threshold is set to a value less than the number of currently waiting processes, the barrier is reset and all
waiting processes are activated.
10.3.2.7 get_num_waiters
10.3.2.8 cancel
Decrements the waiter count by one. This is used when a process that is waiting on the barrier is killed or
activated by some other means.
103
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.4.1 uvm_event_pool
By default, the event pool contains the events: begin, accept, and end. Events can also be added by derivative
objects. An event pool is a specialization of an uvm_pool #(KEY,T) (see 11.2), e.g., a uvm_pool
#(uvm_event).
10.4.1.2.1 new
10.4.1.2.2 get_global_pool
10.4.1.2.3 get_global
Returns the item instance specified by key from the global item pool.
10.4.1.2.4 get
If no item exists by that key, a new item is created with that key and returned.
10.4.2 uvm_barrier_pool
104
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.4.2.2.1 new
10.4.2.2.2 get_global_pool
10.4.2.2.3 get_global
Returns the item instance specified by key from the global item pool.
10.4.2.2.4 get
If no item exists by that key, a new item is created with that key and returned.
10.5.1 uvm_objection
Objections provide a facility for coordinating status information between two or more participating
components, objects, or even module-based IP.
new
function new ( string name = "" )
10.5.1.3.1 get_propagate_mode
105
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns the propagation mode for this objection, as specified by set_propagate_mode (see 10.5.1.3.2). If
set_propagate_mode has not been called since this objection was created, then get_propagate_mode shall
return 1.
10.5.1.3.2 set_propagate_mode
Specifies the propagation mode for this objection. By default, objections support hierarchical propagation for
components.
When propagation mode is set to ‘0’, all intermediate callbacks between the source and top shall be skipped.
Since the propagation mode changes the behavior of the objection, it can only be changed if there are no
objections raised or draining. Any attempts to change the mode while objections are raised or draining shall
result in an error.
10.5.1.3.3 raise_objection
Raises the number of objections for the source object by count, which defaults to 1. The object is usually the this
handle of the caller. If object is not specified or null, the implicit top-level component, uvm_root (see F.7), is
chosen.
The source and total objection counts for object are increased by count. description is a string that
marks a specific objection and is used in tracing/debug.
The objection’s raised virtual method (see 10.5.1.4.1) is called, which calls the
uvm_component::raised method (see 13.1.6.1) for all of the components up the hierarchy.
10.5.1.3.4 drop_objection
Drops the number of objections for the source object by count, which defaults to 1. The object is usually the this
handle of the caller. If object is not specified or null, the implicit top-level component, uvm_root (see F.7), is
chosen.
a) The source and total objection counts for object are decreased by count. description is a string that
marks a specific objection and is used in tracing/debug. It is error to drop the objection count for object
below zero (0).
106
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
b) The objection’s dropped virtual method (see 10.5.1.4.2) is called, which calls the
uvm_component::dropped method (see 13.1.6.2) for all of the components up the hierarchy.
c) If the total objection count has not reached zero (0) for object, the drop shall be propagated up the
object hierarchy as with raise_objection (see 10.5.1.3.3). Then, each object in the hierarchy shall
update their source counts, objections that they originated, and total counts, the total number of
objections by them and all their descendants.
If the total objection count reaches zero (0), propagation up the hierarchy is deferred until a configurable drain
time (see 10.5.1.3.7) has passed and the uvm_component::all_dropped callback (see 13.1.6.3) for the current
hierarchy level has returned. The following process occurs for each instance up the hierarchy from the source
caller:
A process is forked in a non-blocking fashion, allowing the drop call to return. The forked process then
does the following.
1) If a drain time was specified for the given object, the process waits for that amount of time.
2) The objection’s all_dropped virtual method (see 10.5.1.4.3) is called, which calls the
uvm_component::all_dropped method (see 13.1.6.3) (if object is a component).
3) The process then waits for the all_dropped callback to complete.
4) After the drain time has elapsed and the all_dropped callback has completed, propagation of
the dropped objection to the parent proceeds as described in raise_objection (see 10.5.1.3.3),
except as described in the next item.
If a new objection for this object or any of its descendants is raised during the drain time or during
execution of the all_dropped callback (see 10.5.1.4.3) at any point, the hierarchical chain previously
described is terminated and the dropped callback does not go up the hierarchy. The raised (see
10.5.1.4.1) objection propagates up the hierarchy, but the number of raised propagated up is reduced by
the number of drops that were pending, waiting for the all_dropped/drain time completion. Thus, if
exactly one objection caused the count to go to zero (0), and during the drain exactly one new objection
comes in, no raises or drops are propagated up the hierarchy.
As an optimization, if the object has no set drain time and no registered callbacks, the forked process shall be
skipped and propagation proceeds immediately to the parent as described.
10.5.1.3.5 clear
Immediately clears the objection state. All counts are cleared and any processes waiting on a call to wait_for
(with objt_event UVM_ALL_DROPPED and obj the implicit top-level component [see F.7]) are released (see
10.5.1.5.2).
The obj is available for an implementation to use for debug purposes only; its value shall have no functional
effect on outcome of this method. The clear action does not result in objections being dropped, and therefore,
does not result in the standard ::dropped callback (see 10.5.1.4.2) being executed.
10.5.1.3.6 get_drain_time
Returns the current drain time of the given object (default: 0 ns).
107
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.5.1.3.7 set_drain_time
Sets the drain time, which is the amount of time between the last remaining objection being dropped and the
all_dropped callback (see 10.5.1.4.3) being called. If an objection is raised before this drain time expires,
all_dropped is not called for this iteration.
10.5.1.4.1 raised
Objection callback that is called when a raise_objection (see 10.5.1.3.3) has reached obj. The default
implementation attempts to cast obj to a component, and, if successful, calls the uvm_component::raised hook
(see 13.1.6.1).
10.5.1.4.2 dropped
Objection callback that is called when a drop_objection (see 10.5.1.3.4) has reached obj. The default
implementation attempts to cast obj to a component, and, if successful, calls the uvm_component::dropped
hook (see 13.1.6.2).
10.5.1.4.3 all_dropped
Objection callback that is called when a drop_objection (see 10.5.1.3.4) has reached obj, and the total count for
obj goes to zero (0). This callback is executed after the drain time associated with obj. The default
implementation attempts to cast obj to a component, and, if successful, calls the
uvm_component::all_dropped hook (see 13.1.6.3).
108
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.5.1.5.1 get_objectors
Returns the current list of objecting objects (that raised an objection, but have not dropped it). list shall be a
queue.
10.5.1.5.2 wait_for
task wait_for(
uvm_objection_event objt_event,
uvm_object obj = null
)
Waits for the raised (see 10.5.1.4.1), dropped (see 10.5.1.4.2), or all_dropped (see 10.5.1.4.3) event to occur
in the given obj. If obj is null, the implicit top-level component (see F.7) is used. The task returns after all
corresponding callbacks for that event have been executed.
10.5.1.5.3 get_objection_count
10.5.1.5.4 get_objection_total
Returns the current number of objections raised by the given object and all descendants.
10.5.2 uvm_objection_callback
This is the callback type that defines the callback hooks for an objection callback.
NOTE—Users may use uvm_objection_cbs_t (see D.4.2) to add callbacks to specific objections.
10.5.2.2 Methods
10.5.2.2.1 raised
109
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.5.2.2.2 dropped
10.5.2.2.3 all_dropped
10.6 uvm_heartbeat
Heartbeats provide a way for environments to easily verify their descendants are alive. A uvm_heartbeat is
associated with a specific objection object. A component that is being tracked by the heartbeat object shall raise
(or drop) the synchronizing objection during the heartbeat window.
The uvm_heartbeat object has a list of participating components. The heartbeat can be configured so that all
components (UVM_ALL_ACTIVE), exactly one (UVM_ONE_ACTIVE), or any component (UVM_ANY_ACTIVE)
trigger the objection in order to satisfy the heartbeat condition.
10.6.2 Methods
10.6.2.1 new
function new(
string name,
uvm_component cntxt,
uvm_objection objection = null
)
Creates a new heartbeat instance associated with cntxt. The context is the hierarchical location where the
heartbeat objections flow through and are monitored. The objection associated with the heartbeat is optional, if it
is left null, but it needs to be specified before the heartbeat monitor will activate.
110
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.6.2.2 set_mode
Specifies or retrieves the heartbeat mode. The current value for the heartbeat mode is returned. If an argument
is specified to change the mode, then the mode is changed to the new value. The default value of mode shall be
UVM_NO_HB_MODE.
10.6.2.3 set_heartbeat
Establishes the heartbeat event and assigns a list of components to watch. The monitoring is started as soon as
this method is called. Once the monitoring has been started with a specific event, providing a new monitor event
results in an error. To change trigger events, first stop (see 10.6.2.7) the monitor and then start (see 10.6.2.6) it
with a new event trigger.
If the trigger event e is null and there was no previously set trigger event, the monitoring is not started.
Monitoring can be started by explicitly calling start (see 10.6.2.6). comps shall be a queue.
10.6.2.4 add
Adds a single component to the set of components to be monitored. This does not cause monitoring to be
started. If monitoring is currently active, this component is immediately added to the list of components and is
expected to participate in the currently active event window.
10.6.2.5 remove
Removes a single component to the set of components being monitored. Monitoring is not stopped, even if the
last component has been removed (an explicit stop (see 10.6.2.7) is required).
10.6.2.6 start
Starts the heartbeat monitor. If e is null, then whatever event was previously set is used. If no event was
previously set, a warning shall be issued. It is an error if the monitor is currently running and e is specifying a
different trigger event than the current event.
10.6.2.7 stop
Stops the heartbeat monitor. The current state information is reset so that if start (see 10.6.2.6) is called again
the process waits for the first event trigger to start the monitoring.
111
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This subclause defines the classes used for callback registration, management, and user-defined callbacks.
10.7.1 uvm_callback
The uvm_callback class is the base class for user-defined callback classes. Typically, the component developer
defines an application-specific callback class that extends from this class. In it, one or more virtual methods are
defined (callback interfaces) that represent the hooks available for user override.
10.7.1.2 Methods
10.7.1.2.1 new
10.7.1.2.2 callback_mode
Enables/disables callbacks: on==0 disables, on==1 enables. Any value for on other than 0 or 1 has no effect
on the enable state of the callback. The default value of on shall be 1.
This returns the value of 1 if the callback was enabled before any change or 0 if the callback was disabled.
10.7.1.2.3 is_enabled
The uvm_callbacks class provides a base class for implementing callbacks, which are typically used to modify
or augment component behavior without changing the component class. To work effectively, the developer of
the component class defines a set of “hook” methods that enable users to customize certain behaviors of the
component in a manner that is controlled by the component developer. The integrity of the component’s overall
behavior is intact, while still allowing certain customizable actions by the user.
To improve compile-time type-safety, the class is parameterized on both the user-defined callback interface
implementation as well as the object type associated with the callback. The object type-callback type pair is
associated using the `uvm_register_cb macro (see B.4.1) to define a valid pairing; valid pairings are checked
when a user attempts to add a callback to an object.
112
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
class uvm_callbacks #(
type T = uvm_object,
type CB = uvm_callback
) extends uvm_object
10.7.2.2.1 T
This type parameter specifies the base object type with which the CB callback objects (see 10.7.2.2.2) are to be
registered. This type shall be a derivative of uvm_object (see 5.3).
10.7.2.2.2 CB
This type parameter specifies the base callback type to be managed by this callback class. The callback type is
typically a interface class, which defines one or more virtual method prototypes that users can override in
subtypes. This type shall be a derivative of uvm_callback (see 10.7.1). When accessing the add/delete interface
(see 10.7.2.3), the CB parameter is optional.
10.7.2.3.1 add
Registers the given callback object, cb, with the given obj handle. Callbacks without a specified context are
“type-wide,” meaning they are called for all objects, as opposed to called for specific instances. If ordering is
UVM_APPEND (the default), the callback is executed after previously added callbacks; otherwise, the callback is
executed ahead of previously added callbacks. The cb is the callback handle; it shall be non-null and if the
callback has already been added to the object instance then a warning shall be issued.
10.7.2.3.2 add_by_name
Registers the given callback object, cb, with one or more uvm_components (see 13.1). The components need
to already exist and be type T or a derivative. root specifies the location in the component hierarchy to start the
search for name. The default value of ordering shall be UVM_APPEND. See F.7.4.1 for more details on searching
by name.
113
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.7.2.3.3 delete
Deletes the given callback object, cb, from the queue associated with the given obj handle. The obj handle can
be null, which allows de-registration of callbacks without an object context. The cb is the callback handle; it
shall be non-null and if the callback has already been removed from the object instance then a warning shall be
issued.
10.7.2.3.4 delete_by_name
Removes the given callback object, cb, associated with one or more uvm_component (see 13.1) callback
queues. root specifies the location in the component hierarchy to start the search for name. See F.7.4.1 for more
details on searching by name.
This set of functions provide an iterator interface for callback queues. A facade class, uvm_callback_iter (see
D.1) is also available; it is the generally preferred way to iterate over callback queues.
10.7.2.4.1 get_first
Returns the first enabled callback of type CB that resides in the queue for obj. If obj is null, the type wide queue
for T is searched. itr is the iterator; it shall be updated with a value that can be supplied to get_next (see
10.7.2.4.3) to retrieve the next callback object.
10.7.2.4.2 get_last
Returns the last enabled callback of type CB that resides in the queue for obj. If obj is null, the type wide queue
for T is searched. itr is the iterator; it shall be updated with a value that can be supplied to get_prev (see
10.7.2.4.4) to retrieve the previous callback object.
114
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
10.7.2.4.3 get_next
Returns the next enabled callback of type CB that resides in the queue for obj, using itr as the starting point. If
obj is null, the type wide queue for T is searched. itr is the iterator; it shall be updated with a value that can be
supplied to get_next (see 10.7.2.4.3) to retrieve the next callback object.
If no more callbacks exist in the queue, null is returned. get_next shall continue to return null in this case until
get_first (see 10.7.2.4.1) has been used to reset the iterator.
10.7.2.4.4 get_prev
Returns the previous enabled callback of type CB that resides in the queue for ob, using itr as the starting point.
If obj is null, the type wide queue for T is searched. itr is the iterator; it shall be updated with a value that can be
supplied to get_prev (see 10.7.2.4.4) to retrieve the previous callback object.
If no more callbacks exist in the queue, null is returned. get_prev shall continue to return null in this case until
get_last (see 10.7.2.4.2) has been used to reset the iterator.
10.7.2.5 get_all
This function populates the end of the all_callbacks queue with the list of all registered callbacks of type CB
(whether they are enabled or disabled). If obj is null, then all_callbacks shall be populated with all registered
typewide callbacks. If obj is not null, then all_callbacks shall be populated with both the typewide and instance
callbacks (if any) registered for obj.
11.1 Overview
The container classes are type parameterized data structures. The uvm_queue #(T) class (see 11.3) implements
a queue data structure similar to the SystemVerilog queue construct. And the uvm_pool #(KEY,T) class (see
11.2) implements a pool data structure similar to the SystemVerilog associative array. The class-based data
structures allow the objects to be shared by reference; e.g., passing a uvm_pool as an input to a function copies
only the class handle into the function, not the entire associative array.
115
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Implements a class-based dynamic associative array. Allows sparse arrays to be allocated on demand, and
passed and stored by reference.
class uvm_pool #(
type KEY = int,
T = uvm_void
) extends uvm_object
11.2.2 Methods
11.2.2.1 new
11.2.2.2 get_global_pool
This allows items to be shared among components throughout the verification environment.
11.2.2.3 get_global
Returns the specified item instance from the global item pool.
11.2.2.4 get
If no item exists by that key, a new item is allocated with that key, with a value as defined by Table 7-1 of IEEE
Std 1800-2012. 8
11.2.2.5 add
Adds the given (key, item) pair to the pool. If an item already exists at the given key it is overwritten with the
new item.
8
Information on references can be found in Clause 2.
116
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
11.2.2.6 num
11.2.2.7 delete
Removes the item with the given key from the pool.
11.2.2.8 exists
Returns 1 if an item with the given key exists in the pool, 0 otherwise.
11.2.2.9 first
If the pool is not empty, then key is the key of the first item and 1 is returned.
11.2.2.10 last
If the pool is not empty, then key is set to the last key in the pool and 1 is returned.
11.2.2.11 next
If the input key is the last key in the pool, then key is left unchanged and 0 is returned.
If a next key is found, then key is updated with that key and 1 is returned.
11.2.2.12 prev
117
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If the input key is the first key in the pool, then key is left unchanged and 0 is returned.
If a previous key is found, then key is updated with that key and 1 is returned.
Implements a class-based dynamic queue. Allows queues to be allocated on demand, and passed and stored by
reference.
11.3.2 Methods
11.3.2.1 new
11.3.2.2 get_global_queue
This allows items to be shared among components throughout the verification environment.
11.3.2.3 get_global
Returns the specified item instance from the global item queue.
11.3.2.4 get
If index is equal to or greater than the size of the queue (see 11.3.2.5), an implementation shall issue a warning
message and return the value for a non-existent array entries of type T, as defined by Table 7-1 of IEEE Std
1800-2012.
11.3.2.5 size
118
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
11.3.2.6 insert
Inserts the item at the given index in the queue. If index is equal to or greater than the current size of the queue
(see 11.3.2.5), the method call shall have no effect on the queue and an implementation shall issue a warning
message.
11.3.2.7 delete
Removes the item at the given index from the queue; if index is not provided, the entire contents of the queue are
deleted. The default value of index shall be -1.
11.3.2.8 pop_front
Returns the first element in the queue ( index = 0 ). If the queue is empty, an implementation shall issue a
warning message and return the value for a non-existent array entries of type T, as defined by Table 7-1 of
IEEE Std 1800-2012.
11.3.2.9 pop_back
Returns the last element in the queue (index=size()-1). If the queue is empty, an implementation shall issue
a warning message and return the value for a non-existent array entries of type T, as defined by Table 7-1 of
IEEE Std 1800-2012.
11.3.2.10 push_front
11.3.2.11 push_back
11.3.2.12 wait_until_not_empty
If this queue is empty, blocks until not empty. If the queue is not empty, returns immediately.
119
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.1 Overview
UVM provides a collection of classes and interfaces for transaction-level modeling (TLM). These objects
enable transaction-level communication between entities, meaning requests are sent and responses received by
transmitting transaction objects through various interfaces. The UVM TLM facility consists of two parts. UVM
TLM 1 (see 12.2) is concerned with passing messages of arbitrary types through ports and exports. UVM
TLM 2 (see 12.3) is concerned with modeling protocols and is based on sockets and a standardized transaction
object called a generic payload. Sockets are constructed from ports and are connected in a similar manner (see
12.3.5). Sockets provide both blocking and non-blocking style of communication as well as forward and
backward paths.
12.2.1 General
Each UVM TLM 1 interface is either blocking, non-blocking, or a combination of the two, as follows:
a) blocking—A blocking interface conveys transactions in blocking fashion; its methods do not return
until the transaction has been successfully sent or retrieved. Because delivery may consume time to
complete, the methods in such an interface are declared as tasks.
b) non-blocking—A non-blocking interface conveys transactions in a non-blocking fashion; the methods
return immediately regardless of success. Its methods are declared as functions. Because delivery may
fail (e.g., the target component is busy and cannot accept the request), the methods may return with
failed status.
c) combination—A combination interface contains both the blocking and non-blocking variants.
UVM TLM 1’s port and export implementations allow connections between ports whose interfaces are not an
exact match. For example, an uvm_blocking_get_port can be connected to any port, export, or imp port
that provides, at a minimum, an implementation of the blocking_get interface, which includes the
uvm_get_* ports, exports, and imps; the uvm_blocking_get_peek_* ports, exports, and imps; and the
uvm_get_peek_* ports, exports, and imps.
UVM provides unidirectional (see 12.2.2) and bidirectional (see 12.2.3) ports, exports, and implementation
ports for connecting components via the UVM TLM 1 interfaces.
1) ports—Instantiated in components that require, or use, the associate interface to initiate transaction
requests.
2) exports—Instantiated by components that forward an implementation of the methods defined in the
associated interface. An implementation is typically provided by an imp port in a child component.
3) imps—Instantiated by components that provide an implementation of or directly implement the
methods defined in the associated interface.
Finally, the analysis interface is used to perform non-blocking broadcasts of transactions to connected
components. It is typically used by components, such as monitors, to publish transactions observed on a bus to
its subscribers, which are typically scoreboards and response/coverage collectors. See 12.2.10.
120
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The unidirectional UVM TLM 1 interfaces consist of blocking, non-blocking, and combined blocking and non-
blocking variants of the put (see 12.2.2.1), get, and peek (see 12.2.2.2) interfaces, plus a non-blocking analysis
interface (see 12.2.10).
12.2.2.1 put
The put interfaces are used to send, or put, transactions to other components. Successful completion of a put
guarantees its delivery, not its execution.
The get interfaces are used to retrieve transactions from other components. The peek interfaces are used for the
same purpose, except the retrieved transaction is not consumed; successive calls to peek shall return the same
object. Combined get_peek interfaces also can be used.
blocking_put
nonblocking_put
put
blocking_get
nonblocking_get
get
blocking_peek
nonblocking_peek
peek
blocking_get_peek
nonblocking_get_peek
get_peek
analysis
The bidirectional interfaces consist of blocking, non-blocking, and combined blocking and non-blocking
variants of the transport (see 12.2.3.1) and master and slave interfaces (see 12.2.3.2).
121
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.2.3.1 transport
The transport interface sends a request transaction and returns a response transaction in a single task call,
thereby enforcing an in-order execution semantic. The request and response transactions can be different types.
The primitive, unidirectional put, get, and peek interfaces (see 12.2.2) are combined to form bidirectional
master and slave interfaces. The master puts requests and gets or peeks responses. The slave gets or peeks
requests and puts responses. Because the put and the get come from different function interface methods, the
requests and responses are not coupled as they are with the transport interface (see 12.2.3.1).
transport
blocking_transport
nonblocking_transport
blocking_master
nonblocking_master
master
blocking_slave
nonblocking_slave
slave
This class declares all of the methods of the UVM TLM API. Various subsets of these methods are combined to
form primitive UVM TLM interfaces, which are then paired in various ways to form more abstract
“combination” UVM TLM interfaces. Components requiring a particular interface use ports to convey that
requirement. Components providing a particular interface use exports to convey its availability.
Communication between components is established by connecting ports to compatible exports, much like
connecting module signal-level output ports to compatible input ports. The difference is UVM TLM ports and
exports bind interfaces (groups of methods), not signals and wires. The methods of the interfaces so bound pass
data as whole transactions (e.g., objects). The set of primitive and combination UVM TLM interfaces afford
many choices for designing components that communicate at the transaction level.
122
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
type T2 = int
)
12.2.4.2 Methods
12.2.4.2.1 put
Components implementing the put method shall block the calling thread if they cannot immediately accept
delivery of the transaction.
12.2.4.2.2 get
The calling thread is blocked if the requested transaction cannot be provided immediately. The new transaction
is returned in the provided output argument. An implementation of get needs to regard the transaction as
consumed. Subsequent calls to get shall return a different transaction instance.
12.2.4.2.3 peek
If a transaction is available, it is written to the provided output argument. If a transaction is not available, the
calling thread is blocked until one is available. The returned transaction is not consumed. A subsequent peek or
get (see 12.2.4.2.2) shall return the same transaction.
12.2.4.2.4 try_put
If the component is ready to accept the transaction argument, it does so and returns 1; otherwise, it returns 0.
12.2.4.2.5 can_put
12.2.4.2.6 try_get
123
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If a transaction is immediately available, it is written to the output argument and 1 is returned. Otherwise, the
output argument is not modified and 0 is returned.
12.2.4.2.7 can_get
Returns 1 if a new transaction can be provided immediately upon request; otherwise, it returns 0.
12.2.4.2.8 try_peek
If available, a transaction is written to the output argument and 1 is returned. A subsequent peek (see
12.2.4.2.3) or get (see 12.2.4.2.2) shall return the same transaction. If a transaction is not available, the output
argument is unmodified and 0 is returned.
12.2.4.2.9 can_peek
12.2.4.2.10 transport
Executes the given request and returns the response in the given output argument.
12.2.4.2.11 nb_transport
Executes the given request and returns the response in the given output argument.
Completion of this operation needs to occur without blocking. If the operation cannot be executed immediately,
a 0 shall be returned; otherwise, it returns 1.
12.2.4.2.12 write
124
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These unidirectional ports are instantiated by components that require, or use, the associated interface to
convey transactions. A port can be connected to any compatible port, export, or imp port. Unless its min_size
is 0, a port shall be connected to at least one implementation of its associated interface.
blocking_put
nonblocking_put
put
blocking_get
nonblocking_get
get
blocking_peek
nonblocking_peek
peek
blocking_get_peek
nonblocking_get_peek
get_peek
Type parameter
T—The type of transaction to be communicated by the export. The type T is not restricted to class
handles and may be a value type such as int, enum, struct, or something similar.
Ports are connected to interface implementations directly via uvm_*_imp #(T,IMP) ports (see 12.2.7.1) or
indirectly via hierarchical connections to uvm_*_port #(T) and uvm_*_export #(T) ports (see 12.2.6.1).
new
function new (
string name,
uvm_component parent,
int min_size=1,
int max_size=1
)
name and parent are the standard uvm_component constructor arguments (see 13.1). min_size and max_size
specify the minimum and maximum number of interfaces that shall have been connected to this port by the end
of elaboration. The default value of both min_size and max_size shall be 1.
125
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These bidirectional ports are instantiated by components that require, or use, the associated interface to convey
transactions. A port can be connected to any compatible port, export, or imp port. Unless its min_size is 0, a
port shall be connected to at least one implementation of its associated interface.
blocking_transport
nonblocking_transport
transport
blocking_master
nonblocking_master
master
blocking_slave
nonblocking_slave
slave
Type parameters
new
function new (
string name,
uvm_component parent,
int min_size=1,
int max_size=1
)
name and parent are the standard uvm_component (see 13.1) constructor arguments. min_size and max_size
specify the minimum and maximum number of interfaces that shall have been connected to this port by the end
of elaboration. The default value of both min_size and max_size shall be 1.
This is a unidirectional port that forwards or promotes an interface implementation from a child component to
its parent. An export can be connected to any compatible child export or imp port, and shall ultimately be
connected to at least one implementation of its associated interface.
126
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The interface type represented by the asterisk (*) is any of the following:
blocking_put
nonblocking_put
put
blocking_get
nonblocking_get
get
blocking_peek
nonblocking_peek
peek
blocking_get_peek
nonblocking_get_peek
get_peek
Type parameter
Exports are connected to interface implementations directly via uvm_*_imp #(T,IMP) ports (see 12.2.7.1) or
indirectly via hierarchical other uvm_*_export #(T) exports.
new
function new (
string name,
uvm_component parent,
int min_size=1,
int max_size=1
)
name and parent are the standard uvm_component (see 13.1) constructor arguments. min_size and max_size
specify the minimum and maximum number of interfaces that shall have been supplied to this port by the end
of elaboration. The default value of both min_size and max_size shall be 1.
This is a bidirectional port that forwards or promotes an interface implementation from a child component to its
parent. An export can be connected to any compatible child export or imp port, and shall ultimately be
connected to at least one implementation of its associated interface.
The interface type represented by the asterisk (*) is any of the following:
blocking_transport
nonblocking_transport
transport
blocking_master
nonblocking_master
127
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
master
blocking_slave
nonblocking_slave
slave
Type parameters:
new
function new (
string name,
uvm_component parent,
int min_size=1,
int max_size=1
)
name and parent are the standard uvm_component (see 13.1) constructor arguments. min_size and max_size
specify the minimum and maximum number of interfaces that shall have been supplied to this port by the end
of elaboration. The default value of both min_size and max_size shall be 1.
The following classes define the UVM TLM 1 implementation (imp) classes.
This is a unidirectional imp port that provides access to an implementation of the associated interface to all
connected ports and exports. Each imp port instance shall be connected to the component instance that
implements the associated interface, typically the imp port’s parent. All other connections are prohibited, e.g.,
to other ports and exports.
blocking_put
nonblocking_put
put
blocking_get
nonblocking_get
get
blocking_peek
nonblocking_peek
128
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
peek
blocking_get_peek
nonblocking_get_peek
get_peek
Type parameters:
IMP—The type of the component implementing the interface, i.e., the class to which this imp delegates.
The interface methods are implemented in a component of type IMP, a handle to which is passed in a
constructor argument. The imp port delegates all interface calls to this component.
new
function new (
string name,
IMP parent
)
Creates a new unidirectional imp port with the given name and parent. The parent shall implement the interface
associated with this port. Its type shall be the type specified in the imp’s type-parameter IMP.
This is a bidirectional imp port that provides access to an implementation of the associated interface to all
connected ports and exports. Each imp port instance shall be connected to the component instance that
implements the associated interface, typically the imp port’s parent. All other connections are prohibited, e.g.,
to other ports and exports.
blocking_transport
nonblocking_transport
transport
blocking_master
nonblocking_master
master
blocking_slave
nonblocking_slave
slave
Type parameters:
129
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
REQ_IMP—Component type that implements the request side of the interface. Defaults to IMP. For
master and slave imps only.
RSP_IMP—Component type that implements the response side of the interface. Defaults to IMP. For
master and slave imps only.
The interface methods are implemented in a component of type IMP, a handle to which is passed in a
constructor argument. The imp port delegates all interface calls to this component.
A single component of type IMP implements the entire interface for both requests and responses.
Two sibling components of type REQ_IMP and RSP_IMP implement the request and response
interfaces, respectively. In this case, the IMP parent instantiates this imp port and both the REQ_IMP and
RSP_IMP components.
This second mode is needed when a component instantiates more than one imp port, as for the
uvm_tlm_req_rsp_channel #(REQ,RSP) channel (see 12.2.9.1).
uvm_*_imp #(REQ, RSP, IMP, REQ_IMP, RSP_IMP) has the following methods:
new
Creates a new unidirectional imp port with the given name and parent. The parent, whose type is specified by
IMP type parameter, shall implement the interface associated with this port.
function new (
string name,
IMP imp
)
The optional req_imp and rsp_imp arguments, which are available to master and slave imp ports, allow the
requests and responses to be handled by different subcomponents. If they are specified, they shall point to the
underlying component that implements the request and response methods, respectively.
function new (
string name,
IMP imp,
REQ_IMP req_imp=imp,
RSP_IMP rsp_imp=imp
)
The following classes define the UVM TLM 1-based FIFO (first-in, first-out) classes.
12.2.8.1 uvm_tlm_fifo_base#(T)
This class is the base for uvm_tlm_fifo#(T) (see 12.2.8.2). It defines the UVM TLM 1 exports through which
all transaction-based FIFO operations occur. It also defines default implementations for each interface method
provided by these exports.
130
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The interface methods provided by put_export (see 12.2.8.1.3) and get_peek_export (see 12.2.8.1.4) are
detailed in 12.2.2. See also Clause 12 for a general discussion of UVM TLM 1 interface definition and usage.
Type parameter
12.2.8.1.2 Ports
12.2.8.1.3 put_export
This provides both the blocking and non-blocking put interface methods to any attached port:
Any put port variant can connect and send transactions to the FIFO via this export, provided the transaction
types match. See 12.2.2 for more information on each of the above interface methods.
12.2.8.1.4 get_peek_export
This provides all the blocking and non-blocking get and peek interface methods:
Any get or peek port variant can connect to and retrieve transactions from the FIFO via this export, provided
the transaction types match. See 12.2.4 for more information on each of the above interface methods.
12.2.8.1.5 put_ap
Transactions passed via put or try_put (via any port connected to the put_export [see 12.2.8.1.3]) are sent
out this port via its write method.
All connected analysis exports and imps shall receive put transactions. See 12.2.2 for more information on the
write method.
12.2.8.1.6 get_ap
Transactions passed via get, try_get, peek, or try_peek (via any port connected to the get_peek_export
[see 12.2.8.1.4]) are sent out this port via its write method.
131
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
All connected analysis exports and imps shall receive get transactions. See 12.2.2 for more information on the
write method.
12.2.8.1.7 Methods
new
function new(
string name,
uvm_component parent = null
)
name and parent are the standard uvm_component (see 13.1) constructor arguments. The parent should be null
if the uvm_tlm_fifo (see 12.2.8.2) is going to be used in a statically elaborated construct (e.g., a module).
12.2.8.2 uvm_tlm_fifo#(T)
This class provides storage of transactions between two independently running processes. Transactions are put
into the FIFO via put_export (see 12.2.8.1.3). Transactions are fetched from the FIFO in the order they arrived
via get_peek_export (see 12.2.8.1.4). The put_export and get_peek_export are inherited from the
uvm_tlm_fifo_base #(T) super class (see 12.2.8.1.5), and the interface methods provided by these exports are
noted in 12.2.2.
12.2.8.2.1 new
function new(
string name,
uvm_component parent = null,
int size = 1
)
name and parent are the standard uvm_component (see 13.1) constructor arguments. The parent should be null
if the uvm_tlm_fifo#(T) is going to be used in a statically elaborated construct (e.g., a module). The size
indicates the maximum size of the FIFO; a value of zero (0) indicates no upper bound. The default value of size
shall be 1.
12.2.8.2.2 size
Returns the capacity of the FIFO, i.e., the number of entries the FIFO is capable of holding. A return value of 0
indicates the FIFO capacity has no limit.
12.2.8.2.3 used
132
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.2.8.2.4 is_empty
12.2.8.2.5 is_full
Returns 1 when the number of entries in the FIFO is equal to its size (see 12.2.8.2.2), 0 otherwise.
12.2.8.2.6 flush
Removes all entries from the FIFO, after which used (see 12.2.8.2.3) returns 0 and is_empty (see 12.2.8.2.4)
returns 1.
12.2.8.3 uvm_tlm_analysis_fifo#(T)
This class is a uvm_tlm_fifo#(T) (see 12.2.8.2) with an unbounded size and a write interface. It can be used any
place a uvm_analysis_imp (see 12.2.10.2) is used, e.g., as a buffer between a uvm_analysis_port (see
12.2.10.1) in an initiator component and a UVM TLM 1 target component.
12.2.8.3.1 Ports
analysis_export #(T)
This provides the write method to all connected analysis ports and parent exports:
Typically, access via ports bound to this export is used for writing to an analysis FIFO. See the write method
noted in 12.2.2 for more information.
12.2.8.3.2 Methods
new
function new(
string name,
uvm_component parent = null
)
name and parent are the standard uvm_component (see 13.1) constructor arguments. name is the local name of
this component. The parent should be left unspecified when this component is instantiated in statically
elaborated constructs and needs to be specified when this component is a child of another UVM component.
The following classes define the built-in UVM TLM 1 channel classes.
133
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This contains a request FIFO of type REQ and a response of type RSP. These FIFOs can be of any size. This
channel is particularly useful for dealing with pipelined protocols where the request and response are not tightly
coupled.
Type parameters:
class uvm_tlm_req_rsp_channel #(
type REQ = int,
type RSP = REQ
) extends uvm_component
12.2.9.1.2 Ports
12.2.9.1.3 put_request_port
This provides both the blocking and non-blocking put interface methods to the request FIFO:
Any put port variant can connect and send transactions to the request FIFO via this export, provided the
transaction types match.
12.2.9.1.4 get_peek_response_export
This provides all the blocking and non-blocking get and peek interface methods to the response FIFO:
Any get or peek port variant can connect to and retrieve transactions from the response FIFO via this export,
provided the transaction types match.
12.2.9.1.5 get_peek_request_export
This provides all the blocking and non-blocking get and peek interface methods to the request FIFO:
134
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Any get or peek port variant can connect to and retrieve transactions from the request FIFO via this export,
provided the transaction types match.
12.2.9.1.6 put_response_export
This provides both the blocking and non-blocking put interface methods to the response FIFO:
Any put port variant can connect and send transactions to the response FIFO via this export, provided the
transaction types match.
12.2.9.1.7 request_ap
Transactions passed via put or try_put (via any port connected to the put_request_export [see 12.2.9.1.3])
are sent out this port via its write method.
All connected analysis exports and imps shall receive these transactions.
12.2.9.1.8 response_ap
Transactions passed via put or try_put (via any port connected to the put_response_export [see
12.2.9.1.6]) are sent out this port via its write method.
All connected analysis exports and imps shall receive these transactions.
12.2.9.1.9 master_export
Exports a single interface that allows a master to put requests and get or peek responses. It is a combination
of put_request_export (see 12.2.9.1.3) and get_peek_response_export (see 12.2.9.1.4).
12.2.9.1.10 slave_export
Exports a single interface that allows a slave to get or peek requests and to put responses. It is a
combination of put_response_export (see 12.2.9.1.6) and get_peek_request_export (see 12.2.9.1.5).
12.2.9.1.11 Methods
new
function new (
string name,
uvm_component parent = null,
int request_fifo_size = 1,
135
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
int response_fifo_size = 1
)
name and parent are the standard uvm_component (see 13.1) constructor arguments. The parent shall be null
if this component is defined within a static component such as a module, program block, or interface. The last
two arguments specify the request and response FIFO sizes, which have default values of 1.
class uvm_tlm_transport_channel #(
type REQ = int,
type RSP = REQ
) extends uvm_tlm_req_rsp_channel #(REQ, RSP)
12.2.9.2.2 Ports
transport_export
This provides both the blocking and non-blocking transport interface methods to the response FIFO:
Any transport port variant can connect to and send requests and retrieve responses via this export, provided
the transaction types match. Upon return, the response argument carries the response to the request.
12.2.9.2.3 Methods
new
function new (
string name,
uvm_component parent = null,
)
name and parent are the standard uvm_component (see 13.1) constructor arguments. The parent shall be null
if this component is defined within a statically elaborated construct such as a module, program block, or
interface.
This subclause defines the port, export, and imp classes used for transaction analysis.
12.2.10.1 uvm_analysis_port
136
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.2.10.1.2 Methods
12.2.10.1.3 new
function new (
string name,
uvm_component parent
)
Initializes the port with the given leaf instance name and handle to its parent.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_PORT (see F.2.3), 0, and −1 (unbounded), respectively.
12.2.10.1.4 write
12.2.10.2 uvm_analysis_imp
Receives all transactions broadcasted by a uvm_analysis_port (see 12.2.10.1). This serves as the termination
point of an analysis port/export/imp connection. The component attached to the imp class—called a
subscriber—implements the analysis interface.
This invokes the write(T) method in the parent component. An implementation of the write(T) method
shall not modify the value passed to it.
12.2.10.2.2 Methods
new
function new (
string name,
IMP imp
)
Initializes the imp with the given leaf instance name and handle to its parent implementation imp.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_IMPLEMENTATION (see F.2.3), 1, and 1, respectively.
137
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.2.10.3 uvm_analysis_export
12.2.10.3.2 Methods
new
function new (
string name,
uvm_component parent = null
)
Instantiates the export with the given leaf instance name and handle to its parent.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_EXPORT (see F.2.3), 1, and −1 (unbounded), respectively.
12.3.1 General
UVM TLM 2 defines a generic payload (see 12.3.4), which is the base type for transport interfaces that may be
blocking or non-blocking. The interface is categorized as a port (see 12.3.6), export (see 12.3.7), or
implementation (see 12.3.8). The interface may also be implemented in sockets (see 12.3.5), which provide
both a forward and a backward path.
UVM TLM 2 provides the following two transport interfaces (see 12.3.2.2):
A call to nb_transport (see 12.2.4.2.11) always represents a phase transition. However, the return from
nb_transport might or might not do so; the choice being indicated by the value returned from the function
(UVM_TLM_ACCEPTED versus UVM_TLM_UPDATED [see 12.3.3.2]).
Generally, the completion of a transaction over a particular hop is shown by using the value of the phase
argument. As a shortcut, a target might indicate the completion of the transaction by returning a special value of
UVM_TLM_COMPLETED (see 12.3.3.2). However, this is optional.
138
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The transaction object itself does not contain any timing information by design or even events and the status
from the API. Delays can be passed as arguments to b_transport/nb_transport (see 12.3.2.2); this pushes the
actual realization of any delay in the simulator kernel downstream and defers it (for simulation speed).
uvm_tlm_if is the base class type to define the transport methods (see 12.3.2.2).
class uvm_tlm_if #(
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e
)
Each of the interface methods (see 12.3.2.2.1 to 12.3.2.2.3) take a handle to the transaction to be transported and
a reference argument for the delay. In addition, the non-blocking interfaces take a reference argument for the
phase.
12.3.2.2.1 nb_transport_fw
This is a forward path call. The first call to this method for a transaction marks the initial timing point. Every call
to this method may mark a timing point in the execution of the transaction. The timing annotation argument
allows the timing points to be offset from the simulation times at which the forward path is used. The final
timing point of a transaction may be marked by a call to nb_transport_bw (see 12.3.4) or a return from this call
or a subsequent call to nb_transport_fw.
See 12.3.2 for more details on the semantics and rules of the non-blocking transport interface.
12.3.2.2.2 nb_transport_bw
This is an implementation of a backward path. This function shall be implemented in the INITIATOR
component class.
Every call to this method may mark a timing point, including the final timing point, in the execution of the
transaction. The timing annotation argument allows the timing point to be offset from the simulation times at
which the backward path is used. The final timing point of a transaction may be marked by a call to
nb_transport_fw (see 12.3.2.2.1) or a return from this call or a subsequent call to nb_transport_bw.
See 12.3.2 for more details on the semantics and rules of the non-blocking transport interface.
139
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.2.2.3 b_transport
This executes a blocking transaction. Once this method returns, the transaction is presumed to have been
executed. Whether that execution is successful or not shall be indicated by the transaction itself.
The callee may modify or update the transaction object, subject to any constraints imposed by the transaction
class. The initiator may reuse a transaction object from one call to the next and across calls to b_transport.
The call to b_transport shall mark the first timing point of the transaction. The return from b_transport shall
mark the final timing point of the transaction. The timing annotation argument allows the timing points to be
offset from the simulation times at which the task call and return are executed.
12.3.3 Enumerations
12.3.3.1 uvm_tlm_phase_e
Designates non-blocking transport synchronization state values between an initiator and a target.
12.3.3.2 uvm_tlm_sync_e
These are the predefined phase state values for the non-blocking transport base protocol between an initiator
and a target.
The generic payload transaction represents a generic bus read/write access. It is used as the default transaction
in UVM TLM 2 blocking and non-blocking transport interfaces.
12.3.4.1 Globals
12.3.4.1.1 uvm_tlm_command_e
140
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.4.1.2 uvm_tlm_response_status_e
12.3.4.2 uvm_tlm_generic_payload
This class provides a transaction definition commonly used in memory-mapped bus-based systems. It is
intended to be a general purpose transaction class that lends itself to many applications. The class is derived
from uvm_sequence_item (see 14.1), which enables it to be generated in sequences and transported to drivers
through sequencers.
12.3.4.2.3 new
Creates a new instance of the generic payload. This also initializes all the members to their default values.
12.3.4.2.4 do_pack
141
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Only get_data_length bytes of the get_data array, and get_byte_enable_length bytes of the get_byte_enable
array, shall be packed. A fatal message shall be generated if the size of the array is less than the associated
length value.
12.3.4.2.5 do_unpack
NOTE—These member variables are provided for use during randomization. When not randomizing, the Accessors (see
12.3.4.2.15) should be used to provide compatibility with derivations of uvm_tlm_generic_payload.
12.3.4.2.7 m_address
This is the address for the bus operation. It should be specified or read using the set_address (see 12.3.4.2.22)
and get_address (see 12.3.4.2.22) methods. This variable should be used only when constraining.
For a read or write command, the target shall interpret the current value of the address attribute as the start
address in the system memory map of the contiguous block of data being read or written. The address
142
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
associated with any given byte in the data array depends on the address attribute, the array index, the streaming
width attribute, the endianness, and the width of the physical bus.
If the target is unable to execute the transaction with the given address attribute (because the address is out-of-
range, for example) it shall generate a standard error response. The recommended response status is
UVM_TLM_ADDRESS_ERROR_RESPONSE.
12.3.4.2.8 m_command
This is the bus operation type. It should be specified using the set_command (see 12.3.4.2.17), set_read (see
12.3.4.2.19), or set_write (see 12.3.4.2.21) methods and read using the get_command (see 12.3.4.2.16),
is_read (see 12.3.4.2.18), or is_write (see 12.3.4.2.20) methods. This variable should be used only when
constraining.
If the target is unable to execute a read or write command, it shall generate a standard error response. The
recommended response status is UVM_TLM_COMMAND_ERROR_RESPONSE.
On the receipt of a generic payload transaction where the command attribute is equal to
UVM_TLM_IGNORE_COMMAND, the target shall not execute a write command or a read command that does not
modify any data. The target may, however, use the value of any attribute in the generic payload, including any
extensions.
The command attribute shall be specified by the initiator and shall not be overwritten by any interconnect.
12.3.4.2.9 m_data
This is data read or to be written. It should be specified and read using the set_data (see 12.3.4.2.25) or
get_data (see 12.3.4.2.24) methods. The variable should be used only when constraining.
For a read command or a write command, the target shall copy data to or from the data array, respectively,
honoring the semantics of the remaining attributes of the generic payload.
For a write command or UVM_TLM_IGNORE_COMMAND, the contents of the data array shall be specified by the
initiator, and shall not be overwritten by any interconnect component or target. For a read command, the
contents of the data array shall only be overwritten by the target (honoring the semantics of the byte enable).
Arbitrary data types may be converted to and from a byte array using the streaming operator and uvm_object
objects (see 5.3) may be further converted using the uvm_object::pack_bytes and
uvm_object::unpack_bytes methods (see 5.3.10.1). Simply use a consistent mechanism to both fill the
payload data array and later extract data from it.
12.3.4.2.10 m_length
This is the number of bytes to be copied to or from the m_data array (see 12.3.4.2.9), inclusive of any bytes
disabled by the m_byte_enable attribute (see 12.3.4.2.12).
The data length attribute shall be specified by the initiator and shall not be overwritten by any interconnect
component or target.
143
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The data length attribute shall not be set to 0. In order to transfer zero bytes, the m_command attribute (see
12.3.4.2.8) should be specified as UVM_TLM_IGNORE_COMMAND.
12.3.4.2.11 m_response_status
This is the status of the bus operation. It should be specified using the set_response_status method (see
12.3.4.2.37) and read using the get_response_status (see 12.3.4.2.36), get_response_string (see 12.3.4.2.40),
is_response_ok (see 12.3.4.2.38), or is_response_error (see 12.3.4.2.39) methods. This variable should be
used only when constraining.
The response status attribute shall be specified to UVM_TLM_INCOMPLETE_RESPONSE by the initiator and may
be overwritten by the target. The response status attribute should not be overwritten by any interconnect
component, because the default value UVM_TLM_INCOMPLETE_RESPONSE indicates the transaction was not
delivered to the target.
The target may specify the response status attribute as UVM_TLM_OK_RESPONSE to indicate it was able to
execute the command successfully or specify one of the five error responses to indicate an error. The target
should choose the appropriate error response depending on the cause of the error. If a target detects an error, but
is unable to select a specific error response, it may specify the response status as
UVM_TLM_GENERIC_ERROR_RESPONSE.
The target shall be responsible for specifying the response status attribute at the appropriate point in the lifetime
of the transaction. In the case of the blocking transport interface, this means before returning control from
b_transport (see 12.3.2.2.3). In the case of the non-blocking transport interface and the base protocol, this
means before sending the BEGIN_RESP phase or returning a value of UVM_TLM_COMPLETED.
It is recommended that the initiator always checks the response status attribute on receiving a transition to the
BEGIN_RESP phase or after the completion of the transaction. An initiator may choose to ignore the response
status if it is known in advance the value will be UVM_TLM_OK_RESPONSE—say it is known this initiator is only
connected to targets that always return UVM_TLM_OK_RESPONSE—but, in general, this will not be the case. In
other words, the initiator can only ignore the response status at its own risk.
12.3.4.2.12 m_byte_enable
Indicates valid m_data (see 12.3.4.2.9) array elements. Should be specified and read using the set_byte_enable
(see 12.3.4.2.31) or get_byte_enable (see 12.3.4.2.30) methods. The variable should be used only when
constraining.
The elements in the byte enable array shall be interpreted as follows. A value of 8’h00 indicates the
corresponding byte is disabled and a value of 8’hFF indicates the corresponding byte is enabled.
Byte enables may be used to create burst transfers where the address increment between each beat is greater
than the number of significant bytes transferred on each beat, or to place words in selected byte lanes of a bus.
At a more abstract level, byte enables may be used to create “lacy bursts” where the data array of the generic
payload has an arbitrary pattern of holes punched in it.
The byte enable mask may be defined by a small pattern applied repeatedly or by a large pattern covering the
whole data array. The byte enable array may be empty, in which case byte enables shall not be used for the
current transaction.
144
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The byte enable array shall be specified by the initiator and shall not be overwritten by any interconnect
component or target.
If the byte enable pointer is not empty, the target shall implement the semantics of the byte enable defined as
follows or generate a standard error response. The recommended response status is
UVM_TLM_BYTE_ENABLE_ERROR_RESPONSE.
In the case of a write command, any interconnect component or target should ignore the values of any disabled
bytes in the m_data array (see 12.3.4.2.9). In the case of a read command, any interconnect component or
target should not modify the values of disabled bytes in the m_data array.
12.3.4.2.13 m_byte_enable_length
It shall be specified by the initiator, and shall not be overwritten by any interconnect component or target.
12.3.4.2.14 m_streaming_width
This is the number of bytes transferred on each beat. Should be specified and read using the
set_streaming_width (see 12.3.4.2.29) or get_streaming_width (see 12.3.4.2.28) methods. This variable
should be used only when constraining.
Streaming affects the way a component should interpret the data array. A stream consists of a sequence of data
transfers occurring on successive notional beats, each beat having the same start address as given by the generic
payload address attribute. The streaming width attribute shall determine the width of the stream, i.e., the number
of bytes transferred on each beat. In other words, streaming affects the local address associated with each byte
in the data array. In all other respects, the organization of the data array is unaffected by streaming.
The bytes within the data array have a corresponding sequence of local addresses within the component
accessing the generic payload transaction. The lowest address is given by the value of the address attribute. The
highest address is given by the formula address_attribute + streaming_width - 1. The address to, or from
which, each byte is being copied in the target shall be specified as the value of the address attribute at the start
of each beat.
With respect to the interpretation of the data array, a single transaction with a streaming width shall be
functionally equivalent to a sequence of transactions each having the same address as the original transaction,
each having a data length attribute equal to the streaming width of the original, and each with a data array that is
a different subset of the original data array on each beat. This subset effectively steps down the original data
array maintaining the sequence of bytes.
A streaming width of 0 indicates a streaming transfer is not required. This is equivalent to a streaming width
value greater than or equal to the size of the m_data array (see 12.3.4.2.9).
Streaming may be used in conjunction with byte enables, where the streaming width would typically be equal to
the byte enable length. It would also make sense to have the streaming width be a multiple of the byte enable
length. Having the byte enable length be a multiple of the streaming width implies different bytes were enabled
on each beat.
If the target is unable to execute the transaction with the given streaming width, it shall generate a standard
error response. The recommended response status is TLM_BURST_ERROR_RESPONSE.
145
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.4.2.15 Accessors
The accessor functions (see 12.3.4.2.16 to 12.3.4.2.40) can specify and retrieve each of the members of the
generic payload. All of the accessor methods are virtual.
12.3.4.2.16 get_command
12.3.4.2.17 set_command
12.3.4.2.18 is_read
Returns true if the current value of the m_command variable (see 12.3.4.2.8) is UVM_TLM_READ_COMMAND.
12.3.4.2.19 set_read
Specifies the current value of the m_command variable (see 12.3.4.2.8) to UVM_TLM_READ_COMMAND.
12.3.4.2.20 is_write
Returns true if the current value of the m_command variable (see 12.3.4.2.8) UVM_TLM_WRITE_COMMAND.
12.3.4.2.21 set_write
Specifies the current value of the m_command variable (see 12.3.4.2.8) to UVM_TLM_WRITE_COMMAND.
12.3.4.2.22 get_address
12.3.4.2.23 set_address
146
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.4.2.24 get_data
12.3.4.2.25 set_data
12.3.4.2.26 get_data_length
12.3.4.2.27 set_data_length
12.3.4.2.28 get_streaming_width
12.3.4.2.29 set_streaming_width
12.3.4.2.30 get_byte_enable
12.3.4.2.31 set_byte_enable
12.3.4.2.32 get_byte_enable_length
147
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.4.2.33 set_byte_enable_length
Specifies the size m_byte_enable_length (see 12.3.4.2.13) of the m_byte_enable array (see 12.3.4.2.12), i.e.,
m_byte_enable.size.
12.3.4.2.34 set_dmi_allowed
12.3.4.2.35 is_dmi_allowed
12.3.4.2.36 get_response_status
12.3.4.2.37 set_response_status
12.3.4.2.38 is_response_ok
Returns true if the current value of the m_response_status variable (see 12.3.4.2.11) is
UVM_TLM_OK_RESPONSE.
12.3.4.2.39 is_response_error
Returns true if the current value of the m_response_status variable (see 12.3.4.2.11) is not
UVM_TLM_OK_RESPONSE.
12.3.4.2.40 get_response_string
Returns the current value of the m_response_status variable (see 12.3.4.2.11) as a string.
148
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.4.2.42 get_num_extensions
12.3.4.2.43 get_extension
Returns the instance specific extension bound under the specified key. If no extension is bound under that key,
null is returned.
12.3.4.2.44 set_extension
Adds an instance-specific extension. Only one instance of any given extension type is allowed. If there is an
existing extension instance of the type of ext, ext replaces it and its handle is returned. Otherwise, null is
returned.
12.3.4.2.45 clear_extension
12.3.4.2.46 clear_extensions
12.3.4.3 uvm_tlm_gp
This typedef provides a short, more convenient name for the uvm_tlm_generic_payload type (see 12.3.4.2).
Class declaration
12.3.4.4 uvm_tlm_extension_base
This is the non-parameterized base class for all generic payload extensions. The pure virtual function
get_type_handle (see 12.3.4.4.4) returns a unique handle that represents the derived type, which is
implemented in derived classes.
This class shall never be extended by user classes; such user classes shall extend from uvm_tlm_extension (see
12.3.4.5).
149
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.4.4.2 Methods
12.3.4.4.3 new
The new constructor is only given as a pass-through mechanism to call uvm_object::new. This class is abstract
and cannot be constructed itself.
12.3.4.4.4 get_type_handle
Intended to be an interface to polymorphically retrieve a handle that uniquely identifies the type of the subclass.
12.3.4.4.5 get_type_handle_name
Intended to be an interface to polymorphically retrieve the name that uniquely identifies the type of the
subclass.
12.3.4.5 uvm_tlm_extension
This is a UVM TLM 2 extension class. This class is parameterized with an arbitrary type that represents the
type of the extension. An instance of the generic payload can contain one extension object of each type; it
cannot contain two instances of the same extension type.
The extension type can be identified using the ID method (see 12.3.4.5.4).
To implement a generic payload extension, simply derive a new class from this class and specify the name of
the derived class as the extension parameter.
12.3.4.5.2 Methods
12.3.4.5.3 new
150
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.4.5.4 ID
Returns the unique ID of this UVM TLM 2 extension type. This method is used to identify the type of the
extension to retrieve from a uvm_tlm_generic_payload instance (see 12.3.4.2), using the
uvm_tlm_generic_payload::get_extension method (see 12.3.4.2.43).
12.3.5 Sockets
Sockets group together all the necessary core interfaces for transportation and binding. A socket is like a port or
export; in fact it is derived from the same base class as port and export, namely uvm_port_base #(IF) (see 5.5).
However, unlike a port or export, a socket provides both a forward and backward path. Thus asynchronous
(pipelined) bidirectional communication can be enabled by connecting sockets together. A socket contains both
a port and an export.
Sockets have three orthogonal attributes: Each socket is either an initiator or a target, is either a pass-through or a
terminator, and implements either the blocking interfaces or the non-blocking interfaces. Components that
initiate transactions are called initiators and components that receive transactions sent by an initiator are called
targets. Initiators have initiator sockets and targets have target sockets. Terminator sockets are used on
initiators and targets as well as interconnect components. Pass-through sockets are used to enable connections
to cross hierarchical boundaries. Initiator sockets can connect to target sockets. Initiator terminator sockets
cannot be connected to other initiator terminator sockets, and target terminator sockets cannot be connected to
other target terminator sockets.
There are eight socket types: the cross of blocking or non-blocking, pass-through or termination, and target or
initiator.
Sockets are specified based on what they are (IS-A) and what they contain (HAS-A). IS-A and HAS-A are types
of object relationships. IS-A refers to the inheritance relationship and HAS-A refers to the ownership
relationship. For example, the statement D IS-A B means D is derived from base B. Given that, the phrase
object A HAS-A B then means B is a member of A.
12.3.5.1 uvm_tlm_b_target_socket
IS-A forward imp; has no backward path except via the payload contents.
The class implementing this socket shall implement a b_transport method (see 12.3.2.2.3) with the following
signature:
class uvm_tlm_b_target_socket #(
type IMP = int,
type T = uvm_tlm_generic_payload
) extends uvm_port_base #(uvm_tlm_if #(T))
12.3.5.1.2 Methods
151
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.5.1.3 new
function new (
string name,
uvm_component parent,
IMP imp = null
)
Constructs a new instance of this socket. The imp argument is a reference to the class implementing the
b_transport method (see 12.3.2.2.3). If not specified, it is presumed to be the same as parent.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_IMPLEMENTATION (see F.2.3), 1, and 1, respectively.
12.3.5.1.4 connect
It is illegal to call connect on a target termination socket. Calling this method shall result in an error.
12.3.5.2 uvm_tlm_b_initiator_socket
IS-A forward port; has no backward path except via the payload contents.
12.3.5.2.2 Methods
12.3.5.2.3 new
function new (
string name,
uvm_component parent,
)
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_PORT (see F.2.3), 1, and 1, respectively.
12.3.5.2.4 connect
Connects this socket to the specified provider, which shall be of one of the following types:
a) uvm_tlm_b_target_socket (see 12.3.5.1)
b) uvm_tlm_b_passthrough_initiator_socket (see 12.3.5.7)
c) uvm_tlm_b_passthrough_target_socket (see 12.3.5.8).
152
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
12.3.5.3 uvm_tlm_nb_target_socket
The class implementing this socket shall implement a nb_transport_fw method (see 12.3.2.2.1) with the
following signature:
class uvm_tlm_nb_target_socket #(
type IMP = int,
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e
) extends uvm_port_base #(uvm_tlm_if #(T,P))
12.3.5.3.2 Methods
12.3.5.3.3 new
function new (
string name,
uvm_component parent,
IMP imp = null
)
Constructs a new instance of this socket. The imp argument is a reference to the class implementing the
nb_transport_fw method (see 12.3.2.2.1). If not specified, it is presumed to be the same as parent.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_IMPLEMENTATION (see F.2.3), 1, and 1, respectively.
12.3.5.3.4 connect
It is illegal to call connect on a target termination socket. Calling this method shall result in an error.
12.3.5.4 uvm_tlm_nb_initiator_socket
class uvm_tlm_nb_initiator_socket #(
type IMP = int,
type T = uvm_tlm_generic_payload,
153
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
type P = uvm_tlm_phase_e
) extends uvm_port_base #(uvm_tlm_if #(T,P))
12.3.5.4.2 Methods
12.3.5.4.3 new
function new (
string name,
uvm_component parent,
IMP imp = null
)
Constructs a new instance of this socket. The imp argument is a reference to the class implementing the
nb_transport_bw method (see 12.3.4). If not specified, it is presumed to be the same as parent.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_PORT (see F.2.3), 1, and 1, respectively.
12.3.5.4.4 connect
Connects this socket to the provider, which shall be of one of the following types:
12.3.5.5 uvm_tlm_nb_passthrough_initiator_socket
class uvm_tlm_nb_passthrough_initiator_socket #(
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e
) extends uvm_port_base#(uvm_tlm_if#(T,P))
12.3.5.5.2 Methods
12.3.5.5.3 new
Initializes the socket with the given leaf instance name and handle to its parent.
154
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_PORT (see F.2.3), 1, and 1 respectively.
12.3.5.5.4 connect
Connects this socket to the provider, which shall be of one of the following types:
12.3.5.6 uvm_tlm_nb_passthrough_target_socket
class uvm_tlm_nb_passthrough_target_socket #(
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e
) extends uvm_port_base#(uvm_tlm_if(T,P))
12.3.5.6.2 Methods
12.3.5.6.3 new
function new (
string name,
uvm_component parent
)
Initializes the socket with the given leaf instance name and handle to its parent.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_EXPORT (see F.2.3), 1, and 1 respectively.
12.3.5.6.4 connect
Connects this socket to the provider, which shall be of one of the following types:
12.3.5.7 uvm_tlm_b_passthrough_initiator_socket
155
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
class uvm_tlm_b_passthrough_initiator_socket #(
type T = uvm_tlm_generic_payload
) extends uvm_port_base #(uvm_tlm_if #(T))
12.3.5.7.2 Methods
12.3.5.7.3 new
function new (
string name,
uvm_component parent
)
Initializes the socket with the given leaf instance name and handle to its parent.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_PORT (see F.2.3), 1, and 1 respectively.
12.3.5.7.4 connect
Connects this socket to the provider, which shall be of one of the following types:
12.3.5.8 uvm_tlm_b_passthrough_target_socket
class uvm_tlm_b_passthrough_target_socket #(
type T = uvm_tlm_generic_payload
) extends uvm_port_base#(uvm_tlm_if#(T))
12.3.5.8.2 Methods
12.3.5.8.3 new
function new (
string name,
uvm_component parent
)
156
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Initializes the socket with the given leaf instance name and handle to its parent.
The port_type, min_size, and max_size of the underlying uvm_port_base (see 5.5.2.1) shall be set to
UVM_EXPORT (see F.2.3), 1, and 1 respectively.
12.3.5.8.4 connect
Connects this socket to the provider, which shall be of one of the following types:
12.3.6.1 uvm_tlm_b_transport_port
This class provides a blocking transport port, which can be bound to one export. There is no backward path for
the blocking transport.
Class declaration
class uvm_tlm_b_transport_port #(
type T = uvm_tlm_generic_payload
) extends uvm_port_base #(uvm_tlm_if #(T))
12.3.6.2 uvm_tlm_nb_transport_fw_port
This class provides a non-blocking backward transport port. Transactions received from the producer, on the
forward path, are sent back to the producer on the backward path using this non-blocking transport port, which
can be bound to one export.
Class declaration
class uvm_tlm_nb_transport_fw_port #(
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e
) extends uvm_port_base #(uvm_tlm_if #(T,P))
12.3.6.3 uvm_tlm_nb_transport_bw_port
This class provides a non-blocking backward transport port. Transactions received from the producer, on the
forward path, are sent back to the producer on the backward path using this non-blocking transport port, which
can be bound to one export.
Class declaration
class uvm_tlm_nb_transport_bw_port #(
type T = uvm_tlm_generic_payload,
157
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
type P = uvm_tlm_phase_e
) extends uvm_port_base #(uvm_tlm_if #(T,P))
This subclause defines the export classes for connecting UVM TLM 2 interfaces.
12.3.7.1 uvm_tlm_b_transport_export
Class declaration
12.3.7.2 uvm_tlm_nb_transport_fw_export
Class declaration
class uvm_tlm_nb_transport_fw_export #(
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e
) extends uvm_port_base #(uvm_tlm_if #(T,P))
12.3.7.3 uvm_tlm_nb_transport_bw_export
Class declaration
class uvm_tlm_nb_transport_bw_export #(
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e
) extends uvm_port_base #(uvm_tlm_if #(T,P))
This subclause defines the implementation classes for connecting UVM TLM 2 interfaces.
UVM TLM 2 imps bind a UVM TLM 2 interface with the object that contains the interface implementation. In
addition to the transaction type and the phase type, the imps are parameterized with the type of the object that
provides the implementation. Typically, this is the type of the component where the imp resides. The
constructor of the imp takes as an argument an object of type IMP and installs it as the implementation object.
The imp constructor argument is usually "this".
12.3.8.1 uvm_tlm_b_transport_imp
Used like exports, except an additional class parameter specifies the type of the implementation object. When
the imp is instantiated, the implementation object is bound.
158
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Class declaration
class uvm_tlm_b_transport_imp #(
type T = uvm_tlm_generic_payload,
type IMP = int
) extends uvm_port_base #(uvm_tlm_if #(T))
12.3.8.2 uvm_tlm_nb_transport_fw_imp
Used like exports, except an additional class parameter specifies the type of the implementation object. When
the imp is instantiated, the implementation object is bound.
Class declaration
class uvm_tlm_nb_transport_fw_imp #(
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e,
type IMP = int
) extends uvm_port_base #(uvm_tlm_if #(T,P))
12.3.8.3 uvm_tlm_nb_transport_bw_imp
Used like exports, except an additional class parameter specifies the type of the implementation object. When
the imp is instantiated, the implementation object is bound.
Class declaration
class uvm_tlm_nb_transport_bw_imp #(
type T = uvm_tlm_generic_payload,
type P = uvm_tlm_phase_e,
type IMP = int
) extends uvm_port_base #(uvm_tlm_if #(T,P))
12.3.9 uvm_tlm_time
The uvm_tlm_time type is the argument type used to represent delays in UVM TLM 2, such as in the
b_transport (see 12.3.2.2.3), nb_transport_fw (see 12.3.2.2.1), and nb_transport_bw (see 12.3.2.2.2)
methods.
13.1 uvm_component
The uvm_component class is the common base class for UVM components. In addition to the features
inherited from uvm_object (see 5.3) and uvm_report_object (see 6.3), uvm_component provides the
following interfaces:
a) Hierarchy—Provides methods for searching and traversing the component hierarchy.
159
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
b) Phasing—Defines a phased test flow that all components follow, with a group of standard phase
methods and an API for custom phases and multiple independent phasing domains to mirror DUT
behavior, e.g., power.
c) Hierarchical reporting—Provides a convenience interface to the uvm_report_handler (see 6.4). All
messages, warnings, and errors are processed through this interface.
d) Transaction recording—Provides methods for recording the transactions produced or consumed by the
component to a transaction database (application specific).
e) Factory—Provides a convenience interface (see D.2.1) to the uvm_factory (see 8.3.1). The factory is
used to create new components and other objects based on type-wide and instance-specific
configuration.
13.1.2.1 new
function new (
string name,
uvm_component parent
)
Initializes a new component with the given leaf instance name and handle to its parent.
The name shall be provided such that the full hierarchical name is unique and the leaf name is composed only
from the characters A through Z, a through z, 0 through 9, or the special characters: _ - [ ] ( ) { }.
The component is inserted as a child of the parent object, if any. If parent already has a child by the given
name, an error shall be generated.
If parent is null, the component shall become a child of the implicit top-level component (see F.7).
13.1.2.2 print_enabled
bit print_enabled = 1
This bit determines if this component should automatically be printed as a child of its parent component.
By default, print_enabled shall be 1 and all children are printed. However, this bit allows a parent component
to disable the printing of specific children.
13.1.2.3 do_execute_op
The do_execute_op method is the user-definable hook called by the policy class (see 5.3.13).
When processing an op with an operation type of UVM_PRINT (see 5.7.2.4), the component shall automatically
print all children components whose print_enabled bit (see 13.1.2.2) is set to 1.
160
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These methods provide user access to information about the component hierarchy, i.e., topology.
13.1.3.1 get_parent
13.1.3.2 get_full_name
Returns the full hierarchical name of this object, which is formed by concatenating the full hierarchical name of
the parent, if any, with the leaf name of this object (as given by uvm_object::get_name [see 5.3.4.2]),
separated by a period (.).
13.1.3.3 get_children
This function populates the end of the children array with the list of this component’s children. Children shall
be a queue.
These methods are used to iterate through this component’s children, if any:
a) get_child—Returns a reference to the child which has name. If no child exists with the given name,
then null is returned.
b) get_first_child—Iteration method for the internal array of children components. If the array is non-
empty, get_first_child sets name to the name of the first child in the array and returns 1. If the array is
empty, name is left unchanged and the method returns 0.
c) get_next_child—Iteration method for the internal array of children components. If the array is non-
empty, get_next_child sets name to the name of the next child in the array and returns 1. If there are no
more children in the array, name is left unchanged and the method returns 0.
13.1.3.5 get_num_children
13.1.3.6 has_child
Returns 1 if this component has a child with the given name, 0 otherwise.
161
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
13.1.3.7 lookup
Looks for a component with the given hierarchical name relative to this component. If the given name is
preceded with a . (dot), the search begins relative to the top level (absolute lookup). The handle of the
matching component is returned, if none, null is returned. The name shall not contain wild cards.
13.1.3.8 get_depth
Returns the component’s depth from the root level. The implicit top-level component (see F.7) has a depth of 0.
The test and any other top-level components have a depth of 1, and so on.
These methods implement an interface that allows all components to step through a standard schedule of phases
(see Clause 9) or a customized schedule, and also an API to allow independent phase domains that can jump
like state machines to reflect behavior, e.g., power domains on the DUT in different portions of the testbench.
The phase tasks and functions are the phase name plus the _phase suffix, e.g., the build phase function is
build_phase.
All phase tasks have the property that forked tasks are killed when the phase ends and they do not influence the
overall phase with the presence or absence of returning.
13.1.4.1.1 build_phase
The uvm_build_phase phase implementation method (see 9.8.1.1). This phase gives components a defined
time to create and configure the testbench.
If automatic configuration is enabled (see 13.1.5.2), the component shall call apply_config_settings (see
13.1.5.1) when super.build_phase(phase) is called.
13.1.4.1.2 connect_phase
The uvm_connect_phase phase implementation method (see 9.8.1.2). This phase gives components a defined
time to establish cross-component connections.
13.1.4.1.3 end_of_elaboration_phase
The list of connected imps within each port and export is populated and the port’s minimum and maximum
connection limits are enforced.
162
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
13.1.4.1.4 start_of_simulation_phase
13.1.4.1.5 run_phase
Whether this task returns or not does not indicate the end or persistence of this phase. Thus, the phase
automatically ends once all objections are dropped using phase.drop_objection.
13.1.4.1.6 extract_phase
13.1.4.1.7 check_phase
13.1.4.1.8 report_phase
13.1.4.1.9 final_phase
Whether each of these tasks returns or not does not indicate the end or persistence of the particular phase. It is
necessary to raise an objection using phase.raise_objection to cause a phase to persist. Once all
components have dropped their respective objection, via phase.drop_objection, or if no component raises
an objection, the phase is ended.
All processes associated with a task-based phase are killed when the phase ends, see 9.6.
13.1.4.2.1 pre_reset_phase
163
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
13.1.4.2.2 reset_phase
13.1.4.2.3 post_reset_phase
13.1.4.2.4 pre_configure_phase
13.1.4.2.5 configure_phase
13.1.4.2.6 post_configure_phase
13.1.4.2.7 pre_main_phase
13.1.4.2.8 main_phase
13.1.4.2.9 post_main_phase
13.1.4.2.10 pre_shutdown_phase
164
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
13.1.4.2.11 shutdown_phase
13.1.4.2.12 post_shutdown_phase
Any threads spawned in these callbacks are not affected when the phase ends.
13.1.4.3.1 phase_started
Invoked at the start of each phase. The phase argument specifies the phase being started.
13.1.4.3.2 phase_ready_to_end
Invoked when all objections to ending the given phase and all sibling phases have been dropped, thus indicating
that phase is ready to begin a clean exit. Sibling phases are phases who share any adjacent successor nodes (see
9.3.1.6.10).
Components needing to consume delta cycles or advance time to perform a clean exit from the phase may raise
the phase’s objection, e.g., phase.raise_objection(this,"Reason"). It is the responsibility of this
component to drop the objection once it is ready for this phase to end (and processes killed). If no objection to
the given phase or sibling phases are raised, the phase state (see 9.3.1.1.3) shall proceed to UVM_PHASE_ENDED.
If any objection is raised, when all objections to ending the given phase and siblings are dropped, another
iteration of phase_ready_to_end is called. To prevent endless iterations due to coding error, phase_ended (see
13.1.4.3.3) is called after any iterations returned by phase.get_max_ready_to_end_iterations (see 9.3.1.3.4)
regardless of whether a previous iteration lead to any objections being raised.
13.1.4.3.3 phase_ended
Invoked at the end of each phase. The phase argument specifies the phase ending.
13.1.4.4.1 set_domain
165
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Applies a phase domain to this component and, if hier is non-zero, recursively to all its children. The default
domain (before set_domain is called) is the uvm domain (see 13.1.4.4.2). The default value of hier shall be 1.
Calls the virtual define_domain method (see 13.1.4.4.3), which derived components can override to augment
or replace the domain definition of its base class.
13.1.4.4.2 get_domain
13.1.4.4.3 define_domain
Builds phase schedules into the provided domain handle. The default implementation adds a copy of the uvm
phasing schedule to the given domain, if one does not already exist, and only if the domain is currently empty.
This method is called by set_domain (see 13.1.4.4.1), which integrators may use to specify this component
belongs in a domain apart from the default "uvm" domain.
Custom component base classes requiring a custom phasing schedule can augment or replace the domain
definition they inherit by overriding their define_domain.
Alternatively, the integrator can attempt to define the schedule by setting up a new domain and setting it onto
the component, and the component can override that schedule by overriding this method.
13.1.4.5.1 suspend
This method needs to be implemented by the user to suspend the component according to the protocol and
functionality it implements. A suspended component can be subsequently resumed using resume (see
13.1.4.5.2).
13.1.4.5.2 resume
This method needs to be implemented by the user to resume a component that was previously suspended using
suspend (see 13.1.4.5.1).
13.1.4.6 pre_abort
166
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This callback is executed when the message system is executing a UVM_EXIT action (see F.2.2.2). The exit
action causes an immediate termination of the simulation, but the pre_abort callback hook gives components
an opportunity to provide additional information to the user before the termination happens.
Components can be designed to be user-configurable in terms of their topology (the type and number of
children it has), mode of operation, and run-time parameters (knobs). The configuration interface
accommodates this common need, allowing a component’s composition and state to be modified without
having to derive new classes or new class hierarchies for every configuration scenario.
13.1.5.1 apply_config_settings
Searches for all configuration settings matching this component’s instance path.
For each resource with a scope matching the return of get_full_name (see 13.1.3.2) as follows:
a) do_execute_op (see 5.3.13) is passed a uvm_field_op (see 5.7) with op_type UVM_SET and rhs set to
the resource.
b) If user_hook_enabled (see 5.7.2.7) returns 1, the resource shall be passed to set_local (see 5.3.12).
When the verbose bit is set to 1, all settings are printed as they are applied. apply_config_settings can also be
overloaded to customize automated configuration. The default value of verbose shall be 0 or not set.
13.1.5.2 use_automatic_config
Returns 1 if the component should call apply_config_settings in the build_phase (see 13.1.4.1.1);
otherwise, returns 0.
By default, use_automatic_config returns 1. If the user wishes to disable the automatic call to
apply_config_settings (see 13.1.5.1), this method needs to be overloaded to return a 0.
When an extended component extends use_automatic_config and returns a 0, wherein the base class returned
1, the extended component is assuming responsibility for any configuration that would have occurred within the
apply_config_settings call in the base class.
These methods provide component level hooks into the uvm_objection mechanism (see 10.5.1).
13.1.6.1 raised
167
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_object source_obj,
string description,
int count
)
13.1.6.2 dropped
13.1.6.3 all_dropped
These methods comprise the component-based transaction recording interface (see also Clause 7). They can be
used to record the transactions that this component “sees,” i.e., produces or consumes.
13.1.7.1 accept_tr
This function marks the acceptance of a transaction, tr, by this component. Specifically, it performs the
following actions:
168
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
13.1.7.2 do_accept_tr
The accept_tr method (see 13.1.7.1) calls this function to accommodate any user-defined post-accept action.
13.1.7.3 begin_tr
This function marks the start of a transaction, tr, by this component. Specifically, it performs the following
actions:
13.1.7.4 do_begin_tr
The begin_tr (see 13.1.7.3) method calls this function to accommodate any user-defined post-begin action.
13.1.7.5 end_tr
169
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
bit free_handle = 1
)
This function marks the end of a transaction, tr, by this component. Specifically, it performs the following
actions:
13.1.7.6 do_end_tr
The end_tr (see 13.1.7.5) method calls this function to accommodate any user-defined post-end action.
13.1.7.7 record_error_tr
This function marks an error transaction by a component. Properties of the given uvm_object, info, are
recorded to the transaction database, as implemented in its uvm_object::do_record (see 5.3.7.2) and
uvm_object::do_execute_op (see 5.3.13) methods.
An error_time of 0 indicates to use the current simulation time. The keep_active bit determines if the handle
should remain active; if 0, then a zero-length error transaction is recorded. The default value of error_time shall
be 0. The default value of keep_active shall be 0.
170
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
A handle to the transaction is returned. The interpretation of this handle, as well as the strings stream_name,
label, and desc, are application specific. The default value of stream_name shall be "main". The default value
of label shall be "error_tr".
13.1.7.8 record_event_tr
An event_time of 0 indicates to use the current simulation time. The keep_active bit determines if the handle
may be used for other application-specific purposes (0 means no; 1 means yes). The default value of
event_time shall be 0. The default value of keep_active shall be 0.
A handle to the transaction is returned. The interpretation of this handle, as well as the strings stream_name,
label, and desc, are application specific. The default value of stream_name shall be "main". The default value
of label shall be "event_tr".
13.1.7.9 get_tr_stream
If get_tr_stream has not been called on this component with the given name and stream_type_name pair, or if
the stream returned by the prior call with the given name and stream_type_name has been freed (see 13.1.7.10),
then get_tr_stream shall return the value of open_stream (see 7.1.4.1) with a name of name, a scope of
get_full_name (see 13.1.3.2), and a type name of stream_type_name. Otherwise, the call shall return the same
value as the prior call to get_tr_stream on this component with the given name and stream_type_name pair.
13.1.7.10 free_tr_stream
Frees any internal references caused by a call to this API. This method is an indication by the user that the
implementation should remove any references it has to stream.
The next call to get_tr_stream (see 13.1.7.9) results in a newly created uvm_tr_stream (see 7.2).
13.1.7.11 set_tr_database
171
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Specifies the uvm_tr_database object (see 7.1) to use for begin_tr (see 13.1.7.3) and other methods in this
subclause (see 13.2). The default object is uvm_coreservice_t::get_default_tr_database (see F.4.1.4.6).
13.1.7.12 get_tr_database
Returns the uvm_tr_database object set by set_tr_database or the default (see 13.1.7.11).
13.1.7.13 set_recording_enabled
Specifies whether recording is enabled. A value of 1 indicates this component is enabled for recording.
13.1.7.14 get_recording_enabled
Returns 1 if recording is enabled for this component, otherwise returns 0. If set_recording_enabled (see
13.1.7.13) has never been called for this component, the default is 0.
13.2 uvm_test
This class is the virtual base class for any user-defined tests; using it provides the ability to select which test to
execute via the UVM_TESTNAME command line (see G.2.1) or as an argument to the uvm_root::run_test task
(see F.7.3.1).
Deriving from uvm_test allows distinguishing tests from other component types that inherit from
uvm_component (see 13.1) directly. Such tests also automatically inherit features that may be added to
uvm_test in the future.
13.2.2 Methods
new
function new (
string name,
uvm_component parent
)
172
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Initializes an instance of this class using the following constructor arguments for uvm_component: name is the
name of the instance, and parent is the handle to the hierarchical parent, if any (see 13.1).
13.3 uvm_env
This is 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.
13.3.2 Methods
new
function new (
string name = "env",
uvm_component parent = null
)
Initializes an instance of this class using the following constructor arguments for uvm_component: name is the
name of the instance, and parent is the handle to the hierarchical parent, if any (see 13.1).
13.4 uvm_agent
The uvm_agent virtual class should be used as the base class for the user-defined agents. Deriving from
uvm_agent enables distinguishing agents from other component types also using its inheritance.
13.4.2 Methods
13.4.2.1 new
function new (
string name,
uvm_component parent
)
Initializes an instance of this class using the following constructor arguments for uvm_component: name is the
name of the instance, and parent is the handle to the hierarchical parent, if any (see 13.1).
13.4.2.2 get_is_active
173
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The configuration parameter is_active is used to identify whether this agent should be acting in active or
passive mode. The parameter should be set as a uvm_active_passive_enum, however it additionally
supports uvm_config_string (see C.4.2.3.2) to allow for command line overrides.
Example
+uvm_set_config_string=<path.to.agent>,is_active,UVM_ACTIVE
uvm_config_db#(uvm_active_passive_enum)::(this,
"<relative.path.to.agent>", "is_active", UVM_ACTIVE)
The default implementation shall return UVM_ACTIVE, unless overridden via the configuration database. An
agent developer may override this behavior if a more complex algorithm is needed to determine the
active/passive nature of the agent.
13.5 uvm_monitor
This class should be used as the base class for user-defined monitors.
Deriving from uvm_monitor allows distinguishing monitors from other component types inheriting from
uvm_component (see 13.1). Such monitors automatically inherit features that may be added to uvm_monitor
in the future.
13.5.2 Methods
new
function new (
string name,
uvm_component parent
)
Initializes an instance of this class using the following constructor arguments for uvm_component: name is the
name of the instance, and parent is the handle to the hierarchical parent, if any (see 13.1).
13.6 uvm_scoreboard
This class should be used as the base class for user-defined scoreboards.
Deriving from uvm_scoreboard allows distinguishing scoreboards from other component types inheriting from
uvm_component (see 13.1). Such scoreboards automatically inherit features that may be added to
uvm_scoreboard in the future.
13.6.2 Methods
174
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This is the base class for drivers that initiate requests for new transactions via a uvm_seq_item_pull_port (see
15.2.2.1). The ports are typically connected to the exports of an appropriate sequencer component.
This driver operates in a pull mode. Its ports are typically connected to the corresponding exports in a pull
sequencer as follows:
driver.seq_item_port.connect(sequencer.seq_item_export)
driver.rsp_port.connect(sequencer.rsp_export)
The rsp_port (see 13.7.2.2) only needs connecting if the driver uses it to write responses to the analysis export
in the sequencer.
class uvm_driver #(
type REQ = uvm_sequence_item,
type RSP = REQ
) extends uvm_component
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
13.7.2 Ports
13.7.2.1 seq_item_port
uvm_seq_item_pull_port#(REQ,RSP) seq_item_port
Derived driver classes should use this port to request items from the sequencer. They may also use it to send
responses back.
13.7.2.2 rsp_port
uvm_analysis_port#(RSP) rsp_port
This port provides an alternate way of sending responses back to the originating sequencer. Which port to use
depends on which export the sequencer provides for connection.
13.7.3 Methods
This is the base class for a driver that passively receives transactions, i.e., it does not initiate requests for
transactions. This is also known as push mode. Its ports are typically connected to the corresponding ports in a
push sequencer as follows:
push_sequencer.req_port.connect(push_driver.req_export)
push_driver.rsp_port.connect(push_sequencer.rsp_export)
The rsp_port (see 13.8.2.2) only needs connecting if the driver uses it to write responses to the analysis export
in the sequencer.
175
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
class uvm_push_driver #(
type REQ = uvm_sequence_item,
type RSP = REQ
) extends uvm_component
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
13.8.2 Ports
13.8.2.1 req_export
uvm_blocking_put_imp#(REQ,
uvm_push_driver#(REQ,RSP))
req_export
This export provides the blocking put interface whose default implementation produces an error. Derived
drivers shall override put with an appropriate implementation (and not call super.put). Ports connected to
this export shall supply the driver with transactions.
13.8.2.2 rsp_port
uvm_analysis_port#(RSP) rsp_port
This analysis port is used to send response transactions back to the originating sequencer.
13.8.3 Methods
13.9 uvm_subscriber
This class provides an analysis export for receiving transactions from a connected analysis export. Making such
a connection “subscribes” this component to any transactions emitted by the connected analysis port.
Subtypes of this class shall define the write method to process the incoming transactions.
13.9.2 Ports
analysis_export
uvm_analysis_imp #(T, uvm_subscriber#(T)) analysis_export
This export provides access to the write method, which derived subscribers shall implement.
176
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
13.9.3 Methods
13.9.3.1 new
13.9.3.2 write
This is a pure virtual method that shall be defined in each subclass. Access to this method by outside
components should be done via the analysis_export (see 13.9.2).
With uvm_sequence objects (see 14.3), users can encapsulate DUT initialization code, bus-based stress tests,
network protocol stacks—anything procedural—then have them all execute in specific or random order to more
quickly reach corner cases and coverage goals.
14.1 uvm_sequence_item
The base class for user-defined sequence items and also the base class for the uvm_sequence class (see 14.3).
The uvm_sequence_item class provides the basic functionality for objects, both sequence items and sequences,
to operate in the sequence mechanism.
14.1.2.1 new
14.1.2.2 set_item_context
Specifies the sequence and sequencer execution context for a sequence item.
177
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These methods are used to specify and return the status of the use_sequence_info bit. When
use_sequence_info is set to 1, the sequence information is printed, copied, and recorded. When
use_sequence_info has the default value of 0, the sequence information is not used.
14.1.2.4 set_id_info
Copies the internal sequence id, as well as the transaction id (see 5.4.2.18), from the referenced item into the
calling item. This routine should always be used by drivers to initialize responses for future compatibility.
14.1.2.5 get_sequencer
14.1.2.6 set_sequencer
Specifies the sequencer for this item to sequencer. This takes effect immediately, so it shall not be called while
the sequence is actively communicating with the sequencer.
14.1.2.7 get_parent_sequence
Returns a reference to the parent sequence of any sequence_item on which this method was called.
14.1.2.8 set_parent_sequence
Specifies the parent sequence of this item. This is used to identify the source sequence of an item.
14.1.2.9 get_depth
Returns the value set by the most recent set_depth call (see 14.1.2.10) or if set_depth has never been called, 1 +
the number of recursive calls to get_parent_sequence (see 14.1.2.7) that can be done without returning null. A
root sequence has a depth of 1, its child has a depth of 2, and its grandchild has a depth of 3.
14.1.2.10 set_depth
178
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The depth of any sequence is calculated automatically. However, this method may be used to specify the depth
of a particular sequence. This method overrides the automatically calculated depth, even if it is incorrect.
14.1.2.11 is_item
This function may be called on any sequence_item or sequence. It returns 1 for items and 0 for sequences
(which derive from this class).
14.1.2.12 get_root_sequence_name
Provides the name of the root sequence (the top-most parent sequence).
14.1.2.13 get_root_sequence
14.1.2.14 get_sequence_path
Provides a string of names of each sequence in the full hierarchical path. A dot (.) is used as the separator
between each sequence.
Sequence items and sequences use the sequencer that they are associated with for reporting messages. If no
sequencer has been specified for the item/sequence using set_sequencer (see 14.1.2.6) (or indirectly via
uvm_sequence_base::start_item [see 14.2.6.2] or uvm_sequence_base::start [see 14.2.3.1]), then the global
reporter is used.
14.1.3.1 uvm_get_report_object
Returns the sequencer (see 14.1.2.5) if non-null; otherwise, returns the implicit top-level component (see
F.4.1.4.1).
14.1.3.2 uvm_report_enabled
Returns 1 if the configured verbosity for this severity/id is greater than or equal to verbosity, else returns 0.
179
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The default implementation shall forward this call to uvm_report_enabled (see 6.3.3.2) on the report object
returned by uvm_get_report_object (see 14.1.3.1) and return the result of that call.
180
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
bit report_enabled_checked = 0
)
These are the primary reporting methods in UVM, implemented in this class. If uvm_report_enabled (see
14.1.3.2) returns a 0, these return with no action. Otherwise, they create a new report message populated
according the argument values and pass that message to uvm_process_report_message (see 14.1.3.4).
14.1.3.4 uvm_process_report_message
This method takes a preformed uvm_report_message (see 6.2), populates it with the report object from
get_report_object (see 6.2.3.1), if the uvm_report_message context is an empty string ("") then sets it to the
return from get_sequence_path (see 14.1.2.14), and finally passes it to the designated report handler for the
report object for processing; see 6.4.7.
14.2 uvm_sequence_base
The uvm_sequence_base class provides the interfaces needed to create streams of sequence items and/or other
sequences.
A sequence is executed by calling its start method (see 14.2.3.1), either directly or via invocation of any of the
`uvm_do_* macros (see B.3).
14.2.2.1 new
14.2.2.2 get_randomize_enabled
Returns the current value of the randomize enabled bit, as set by set_randomize_enabled (see 14.2.2.3). If
set_randomize_enabled has not been called, then returns 1.
14.2.2.3 set_randomize_enabled
Sets the value of the randomize enabled bit. When set to 1, the sequence shall be randomized automatically
before being executed by the `uvm_do* and `uvm_rand_send* macros (see B.3), or as a default sequence.
When set to 0, the sequence shall not be automatically randomized.
181
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.2.2.4 get_sequence_state
14.2.2.5 wait_for_sequence_state
Waits until the sequence reaches one of the given states. state_mask can be a bitwise OR'ing of any of the
sequence states. If the sequence is already in one of the states, this method returns immediately.
14.2.3.1 start
The sequencer argument specifies the sequencer on which to run this sequence.
If parent_sequence is null, and no parent sequence has been assigned via set_parent_sequence (see 14.1.2.8),
then this sequence is a root sequence; otherwise, it is a child of parent_sequence. When parent_sequence is not
null, the parent_sequence’s pre_do (see 14.2.3.4), mid_do (see 14.2.3.5), and post_do (see 14.2.3.7) methods
are called during the execution of this sequence.
By default, the priority of a sequence is the priority of its parent sequence. If it is a root sequence, i.e.,
get_parent_sequence (see 14.1.2.7) returns null, its default priority is 100. To change this, use a non-negative
value of this_priority. Higher numbers indicate a higher priority.
If call_pre_post is set to 1 (the default), the pre_body (see 14.2.3.3) and post_body (see 14.2.3.8) tasks are
called before and after the sequence body (see 14.2.3.6) is called.
14.2.3.2 pre_start
This task is a user-definable hook that is called before the optional execution of pre_body (see 14.2.3.3).
14.2.3.3 pre_body
This task is a user-definable hook. The value of call_pre_post as passed into start (see 14.2.3.1) is in control.
182
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.2.3.4 pre_do
Although pre_do is a task, consuming simulation cycles may result in unexpected behavior on the driver.
14.2.3.5 mid_do
This function is a user-definable hook function that is called after the sequence item has been randomized and
just before the item is sent to the driver.
14.2.3.6 body
This is the user-defined task where the main sequence code resides.
14.2.3.7 post_do
This function is a user-definable callback function that is called after the driver has indicated that it has
completed the item, using either the item_done (see 15.2.1.2.3) or put (see 15.2.1.2.8) methods.
14.2.3.8 post_body
This task is a user-definable hook. The value of call_pre_post as passed into start (see 14.2.3.1) is in control.
14.2.3.9 post_start
This task is a user-definable hook that is called after the optional execution of post_body (see 14.2.3.8).
14.2.4.1 get_starting_phase
Returns the starting phase. If non-null, the starting phase specifies the phase in which this sequence was started.
The starting phase is set automatically when this sequence is started as the default sequence on a sequencer.
14.2.4.2 set_starting_phase
183
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.2.4.3 get_automatic_phase_objection
Returns (and locks) the value of the “automatically object to starting phase” bit.
If 1, the sequence automatically raises an objection to the starting phase (if the starting phase is not null)
immediately prior to pre_start (see 14.2.3.2) being called. The objection is dropped after post_start (see
14.2.3.9) has executed or kill (see 14.2.5.11) has been called.
14.2.4.4 set_automatic_phase_objection
The most common interaction with the starting phase within a sequence is to simply raise the phase’s objection
prior to executing the sequence and drop the objection after ending the sequence (either naturally or via a call to
kill [see 14.2.5.11]). To simplify this interaction for the user, UVM provides the ability to perform this
functionality automatically.
NOTE—Do not set the automatic phase objection bit to 1 if a sequence runs with a forever loop inside of the body, as
the objection will never get dropped.
14.2.5.1 get_priority
14.2.5.2 set_priority
The priority of a sequence may be changed at any point in time. value shall be >= 1. When the priority of a
sequence is changed, the new priority is used by the sequencer the next time that it arbitrates between
sequences.
The default priority value is the value of the sequence’s parent’s priority. The default priority for root sequences
is 100. Higher values result in higher priorities.
14.2.5.3 is_relevant
The default is_relevant implementation returns 1, indicating that the sequence is always relevant.
Users may choose to override this with their own virtual function to indicate to the sequencer that the sequence
is not currently relevant after a request has been made.
When the sequencer arbitrates, it will call is_relevant on each requesting, unblocked sequence to see if it is
relevant. If a 0 is returned, then the sequence is not used.
184
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If all requesting sequences are not relevant, the sequencer will call wait_for_relevant (see 14.2.5.4) on all
sequences and re-arbitrate upon its return.
Any sequence that implements is_relevant shall also implement wait_for_relevant so the sequencer has a way
to wait for a sequence to become relevant.
14.2.5.4 wait_for_relevant
This method is called by the sequencer when all available sequences are not relevant. When wait_for_relevant
returns, the sequencer attempts to re-arbitrate.
An implementation in a derived sequence should not return unless is_relevant is 1 (see 14.2.5.3). If a sequence
defines is_relevant, then the sequence shall also supply a wait_for_relevant method.
14.2.5.5 lock
Requests a lock on the specified sequencer. When sequencer is null, the lock is requested on the current default
sequencer (see 14.1.2.5). If sequencer is null and get_sequencer returns null, an implementation shall generate
a fatal message.
A lock request is arbitrated the same as any other request. A lock is granted after all previously arbitrated
requests are completed and no other locks or grabs are blocking this sequence.
The lock call returns once the lock has been granted.
14.2.5.6 grab
Requests a lock on the specified sequencer. If no argument is supplied, the lock is requested on the current
default sequencer (see 14.1.2.5). If sequencer is null and get_sequencer returns null, an implementation shall
generate a fatal message.
A grab request is put in front of the arbitration queue and is arbitrated before any other requests. A grab is
granted when no other grabs or locks are blocking this sequence.
The grab call returns once the grab has been granted.
14.2.5.7 unlock
Removes any locks obtained by this sequence on the specified sequencer. When sequencer is null, the unlock is
done on the current default sequencer (see 14.1.2.5). If sequencer is null and get_sequencer returns null, an
implementation shall generate a fatal message.
NOTE—The unlock method removes any locks acquired from both lock (see 14.2.5.5) and grab (see 14.2.5.6).
14.2.5.8 ungrab
185
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.2.5.9 is_blocked
Returns a bit indicating whether this sequence is currently prevented from running due to another lock or grab.
A 1 is returned if the sequence is currently blocked. A 0 is returned if no lock or grab prevents this sequence
from executing.
14.2.5.10 has_lock
Note that even if this sequence does not have a lock, a child sequence may have a lock, in which case the
sequence is still blocked from issuing operations on the sequencer.
14.2.5.11 kill
This function kills the sequence and causes all current locks, grabs, or requests in the sequence’s default
sequencer to be removed. The sequence state changes to UVM_STOPPED, and the post_body (see 14.2.3.8) and
post_start (see 14.2.3.9) callback methods are executed.
14.2.5.12 do_kill
This function is a user hook that is called whenever a sequence is terminated by using sequence.kill or
sequencer.stop_sequences (which effectively calls sequence.kill).
14.2.6.1 create_item
This creates and initializes a sequence_item or sequence using the factory. The item or sequence’s sequencer is
set to l_sequencer via uvm_sequence_item::set_sequencer (see 14.1.2.6).
14.2.6.2 start_item
186
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This is a convenience method for initiating the execution of a sequence item request on a sequencer with a
specified priority.
a) If item is null, or if item can be cast to uvm_sequence_base (see 14.2) and is_item (see 14.1.2.11)
returns 0, then the implementation shall generate an error message and return immediately.
b) The priority is determined by evaluating the set_priority argument. If the argument is greater than or
equal to 0, then priority is the set_priority value; otherwise, the priority is set to the return value of
get_priority (see 14.2.5.1).
c) The sequencer is determined by evaluating the sequencer argument.
1) If the sequencer argument is not null, then that sequencer value is used.
2) If the sequencer argument is null and the item’s get_sequencer (see 14.1.2.5) return value is not
null, then that return value is used.
3) If the sequencer argument is null, the item’s get_sequencer return value is null, and this
sequence’s get_sequencer return value is not null, then that return value is used.
4) Otherwise, the implementation shall generate an error message and return immediately.
d) The implementation shall perform the following steps in order:
1) The set_item_context method (see 14.1.2.2) on item shall be called, and passed this sequence as
a parent_seq and sequencer as determined in step c).
2) The wait_for_grant method (see 15.3.2.6) shall be called on the sequencer, with this sequence as
sequence_ptr and the priority as determined in step b) as item_priority.
3) The pre_do method (see 14.2.3.4) on this sequence is called, with is_item set to 1.
NOTE—While not strictly required, start_item is usually paired with a corresponding finish_item (see 14.2.6.3) call.
14.2.6.3 finish_item
a) If item is null, or if item can be cast to uvm_sequence_base (see 14.2) and is_item (see 14.1.2.11)
returns 0, then the implementation shall generate an error message and return immediately.
b) If the item’s get_sequencer (see 14.1.2.5) return value is null, then the implementation shall generate
an error message and return immediately.
c) The implementation shall perform the following steps in order:
1) The mid_do method (see 14.2.3.5) on this sequence is called, with item as this_item.
2) The send_request method (see 14.2.6.5) on this sequence is called, with item as request and
rerandomize set to 0.
3) The wait_for_item_done method (see 14.2.6.6) on this sequence is called, with the return value
of item’s get_transaction_id method (see 5.4.2.18) as transaction_id.
4) The post_do method (see 14.2.3.7) on this sequence is called, with item as this_item.
NOTE—finish_item returning indicates the driver has signaled that the item is done, either explicitly via item_done (see
15.2.1.2.3) or implicitly via a call to get (see 15.2.1.2.6); however, it does not strictly indicate that the driver has completed
all processing of the request.
187
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.2.6.4 wait_for_grant
This task calls sequencer.wait_for_grant (see 15.3.2.6) on the current sequencer (see 14.1.2.5).
When this method returns, the sequencer has granted the sequence, and the sequence shall call send_request
(see 14.2.6.5) without inserting any simulation delay other than delta cycles.
14.2.6.5 send_request
This function may only be called after a wait_for_grant call (see 14.2.6.4). send_request calls
sequencer.send_request (see 15.3.2.20) on the current sequencer (see 14.1.2.5).
14.2.6.6 wait_for_item_done
A sequence may optionally call wait_for_item_done. This task blocks until the driver indicates that the item is
done, either explicitly via item_done (see 15.2.1.2.3) or implicitly via a call to get (see 15.2.1.2.6).
If no transaction_id parameter is specified, or if transaction_id is -1, the call returns the next time that the
driver calls item_done or get. When a specific transaction_id is specified, the call returns when the driver
indicates completion of that specific item.
NOTE—If a specific transaction_id has been specified and the driver has already signaled item_done for that transaction,
then the call will hang waiting for that specific transaction_id. Additionally, wait_for_item_done returning indicates the
driver has signaled the item is done; however, it does not strictly indicate the driver has completed all processing of the
request.
14.2.7.1 use_reponse_handler
When called with enable set to 1, responses are sent to the response handler. Otherwise, responses need to be
retrieved using get_response (see 14.3.3.3).
By default, responses from the driver are retrieved in the sequence by calling get_response.
14.2.7.2 get_use_response_handler
188
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.2.7.3 response_handler
When the use_response_handler bit is set to 1 (see 14.2.7.1), this virtual function is called by the sequencer
for each response that arrives for this sequence. No action is taken by this function unless it is extended.
14.2.7.4 get_response_queue_error_report_enabled
When this bit is 1 (the default value), error reports are generated when the response queue overflows. When this
bit is 0, no such error reports are generated.
14.2.7.5 set_response_queue_error_report_enabled
By default, if the response queue overflows, an error shall be generated. The response queue overflows when
more responses are sent to this from the driver than get_response calls (see 14.3.3.3) are made. Setting value to
0 disables these errors, while setting it to 1 enables them.
14.2.7.6 get_response_queue_depth
14.2.7.7 set_response_queue_depth
The default maximum depth of the response queue is 8. This method is used to change the maximum depth of
the response queue. An implementation shall generate an error message if the maximum depth is set to a value
that is less than the current number of responses in the queue.
Setting the depth of the response queue to -1 indicates an arbitrarily deep response queue and no checking is
done.
14.2.7.8 clear_response_queue
The uvm_sequence class provides the interfaces necessary to create streams of sequence items and/or other
sequences.
189
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
14.3.2 Variables
14.3.2.1 req
REQ req
The sequence contains a field of the request type called req. The user can use this field or create another field to
use. The default do_print prints this field.
14.3.2.2 rsp
RSP rsp
The sequence contains a field of the response type called rsp. The user can use this field, if desired, or create
another field to use. The default do_print prints this field.
14.3.3 Methods
14.3.3.1 new
14.3.3.2 get_current_item
Returns the request item currently being executed by the sequencer. If the sequencer is not currently executing
an item, this method returns null.
The sequencer is executing an item from the time that get_next_item (see 15.2.1.2.1) or peek (see 12.2.10) is
called until the time that get (see 15.2.1.2.6) or item_done (see 15.2.1.2.3) is called.
14.3.3.3 get_response
By default, sequences retrieve responses by calling get_response. If no transaction_id is specified, this task
returns the next response sent to this sequence. If no response is available in the response queue, the method
blocks until a response is received.
If a transaction_id parameter is specified, the task blocks until a response with that transaction_id is received in
the response queue. -1 indicates wait for the next response.
190
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The get_response method needs to be called soon enough to avoid an overflow of the response queue to
prevent responses from being dropped. See also 14.2.7.6.
If a response is dropped in the response queue, an error shall be generated unless the error reporting is disabled
via set_response_queue_error_report_enabled (see 14.2.7.5).
14.4 uvm_sequence_library
The uvm_sequence_library is a sequence that contains a list of registered sequence types. It can be configured
to create and execute these sequences any number of times using one of several modes of operation (see
F.2.4.3), including a user-defined mode.
When started (as any other sequence), the sequence library randomly selects and executes a sequence from its
sequences queue. If in UVM_SEQ_LIB_RAND mode (see F.2.4.3), its select_rand property (see 14.4.4.7) is
randomized and used as an index into sequences. When in UVM_SEQ_LIB_RANDC mode (see F.2.4.3), the
select_randc property (see 14.4.4.8) is used. When in UVM_SEQ_LIB_ITEM mode (see F.2.4.3), only
sequence items of the REQ type are generated and executed—no sequences are executed. Finally, when in
UVM_SEQ_LIB_USER mode (see F.2.4.3), the select_sequence method (see 14.4.4.9) is called to obtain the
index for selecting the next sequence to start. Users can override this method in subtypes to implement custom
selection algorithms.
Creating a subtype of a sequence library requires invocation of the `uvm_sequence_library_utils macro (see
B.3.2.2) in its declaration. The macro is needed to populate the sequence library with any sequences that were
statically registered with it or any of its base classes.
class uvm_sequence_library#(
type REQ = uvm_sequence_item,
RSP = REQ
) extends uvm_sequence #(REQ,RSP)
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
14.4.2 Example
new
function new( string name = "" )
191
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.4.4.1 selection_mode
Specifies the mode used to select sequences for execution. If set_selection_mode has not been called since the
sequence library was constructed, then get_selection_mode shall return UVM_SEQ_LIB_RAND.
14.4.4.2 min_random_count
Specifies the minimum number of sequences to execute. If set_min_random_count has not been called since
the sequence library was constructed, then get_min_random_count shall return 10.
14.4.4.3 max_random_count
Specifies the maximum number of sequences to execute. If set_max_random_count has not been called since
the sequence library was constructed, then get_max_random_count shall return 10.
14.4.4.4 get_num_sequences_executed
Returns the number of sequences executed, not including the currently executing sequence, if any.
14.4.4.5 sequences_executed
Indicates the number of sequences executed, not including the currently executing sequence, if any.
14.4.4.6 sequence_count
Specifies the number of sequences to execute when this sequence library is started. This value is constrained to
be inside {[min_random_count:max_random_count]}. If in UVM_SEQ_LIB_ITEM mode (see F.2.4.3),
specifies the number of sequence items to generate.
14.4.4.7 select_rand
This is the index variable that is randomized to select the next sequence to execute when in
UVM_SEQ_LIB_RAND mode (see F.2.4.3). This variable is constrained to be a valid index into the array of
registered sequences.
192
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.4.4.8 select_randc
This is the index variable that is randomized to select the next sequence to execute when in
UVM_SEQ_LIB_RANDC mode (see F.2.4.3). This variable is constrained to be a valid index into the array of
registered sequences.
14.4.4.9 select_sequence
Implementation hook that returns the index used to select the next sequence to execute when in
UVM_SEQ_LIB_USER selection mode (see F.2.4.3). Overrides shall return a value between 0 and max,
inclusive.
The default implementation returns 0, incrementing on successive calls, wrapping back to 0 when reaching
max. Extensions may use get_sequence (see 14.4.4.10) to assist in selecting an index.
14.4.4.10 get_sequence
Returns the sequence registered with the sequence library at idx. An error message shall be generated if idx
exceeds the current number of sequences registered with the sequence library and null shall be returned.
14.4.5.1 add_typewide_sequence
Registers the provided sequence type with this sequence library type. The sequence type is available for
selection by all instances of this class. Sequence types already registered are silently ignored. This method does
not have any effect on sequence libraries that have already been constructed.
14.4.5.2 add_typewide_sequences
Registers the provided sequence types with this sequence library type. The sequence types are available for
selection by all instances of this class. Sequence types already registered are silently ignored. This method does
not have any effect on sequence libraries that have already been constructed. seq_types shall be a queue.
14.4.5.3 add_sequence
Registers the provided sequence type with this sequence library instance. Sequence types already registered are
silently ignored.
193
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
14.4.5.4 add_sequences
Registers the provided sequence types with this sequence library instance. Sequence types already registered
are silently ignored. seq_types shall be a queue.
14.4.5.5 remove_sequence
Removes the given sequence type from this sequence library instance. If the type was registered statically, the
sequence queues of all instances of this sequence library are updated accordingly. A warning shall be issued if
the sequence is not registered.
14.4.5.6 get_sequences
Appends to the provided seq_types array the list of registered sequences. seq_types shall be a queue.
15.1 Overview
The sequencer serves as an arbiter for controlling transaction flow from multiple stimulus generators. More
specifically, the sequencer controls the flow of uvm_sequence_item–based transactions (see 14.1) generated
by one or more uvm_sequence #(REQ,RSP)–based sequences (see 14.3).
a) uvm_sequencer #(REQ,RSP)—Requests for new sequence items are initiated by the driver (see 15.5).
Upon such requests, the sequencer selects a sequence from a list of available sequences to produce and
delivers the next item to execute. This sequencer is typically connected to a user-extension of
uvm_driver #(REQ,RSP) (see 13.7).
b) uvm_push_sequencer #(REQ,RSP)—Sequence items (from the currently running sequences) are
pushed by the sequencer to the driver, which blocks item flow when it is not ready to accept new
transactions (see 15.6). This sequencer is typically connected to a user-extension of uvm_push_driver
#(REQ,RSP) (see 13.8).
Sequencer-driver communication follows a pull or push semantic, depending on which sequencer type is used.
However, sequence-sequencer communication is always initiated by the user-defined sequence, i.e., it follows a
push semantic.
The uvm_sequencer #(REQ,RSP) (see 15.5) and uvm_driver #(REQ,RSP) (see 13.7) pair uses a sequence
item pull port (see 15.2.2) to achieve the special execution semantic needed by the sequencer-driver pair.
194
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This class defines an interface for sequence drivers [uvm_driver #(REQ,RSP) (see 13.7)] to communicate
with sequencers. The driver connects to the interface be via a port, and the sequencer implements it and
provides it via an export.
This class provides timestamp properties, notification events, and transaction recording support. Its subtype,
uvm_sequence_item (see 14.1), shall be used as the base class for all user-defined transaction types.
Users can also use the transaction’s event pool, uvm_transaction::get_event_pool (see 5.4.2.13), to define
custom events for the driver to trigger and the sequences for waiting. Any in-between events, such as marking
the beginning of the address and data phases of transaction execution, can be implemented via the event’s pool.
In pipelined protocols, the driver can release a sequence (return from finish_item [see 14.2.6.3] or its `uvm_do
macro [see B.3]) before the item has been completed. If the driver uses the begin_tr/end_tr API in
uvm_component (see 13.1), the sequence can wait on the event at key end in the item’s event pool (see
5.4.2.13) to block until the item was fully executed.
15.2.1.2 Methods
15.2.1.2.1 get_next_item
Returns the next available sequence_item, the call shall block until an item is available.
15.2.1.2.2 try_next_item
Returns immediately with the request t set to the next available sequence_item, if there is one available,
otherwise returns with the t set to null.
15.2.1.2.3 item_done
195
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
15.2.1.2.4 wait_for_sequences
Waits for a sequence to have a new item available. User-derived sequencers may override its
wait_for_sequences implementation to perform some other application-specific implementation.
15.2.1.2.5 has_do_available
Indicates whether a sequence item is available for immediate processing. Implementations shall return 1 if an
item is available, 0 otherwise.
15.2.1.2.6 get
Returns the next available sequence_item from a sequence, the call shall block until an item is available.
15.2.1.2.7 peek
15.2.1.2.8 put
Sends a response back to the sequence that issued the request. The put task shall be non-blocking.
15.2.1.2.9 put_response
15.2.1.2.10 disable_auto_item_recording
Calling this function disables automatic recording of sequence_items by the sequencer. Once this function has
been called, automatic recording cannot be re-enabled.
15.2.1.2.11 is_auto_item_recording_enabled
Returns TRUE if automatic item recording is enabled for this port instance.
196
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This defines the port, export, and imp port classes for communicating sequence items between uvm_sequencer
#(REQ,RSP) (see 15.5) and uvm_driver #(REQ,RSP) (see 13.7).
UVM provides a port, export, and imp connector for use in sequencer-driver communication. All have standard
port connector constructors.
Class declaration
class uvm_seq_item_pull_port #(
type REQ = int,
type RSP = REQ
) extends uvm_port_base #(uvm_sqr_if_base #(REQ, RSP))
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
This export type is used in sequencer-driver communication. It has the standard constructor for exports.
Class declaration
class uvm_seq_item_pull_export #(
type REQ = int,
type RSP = REQ
) extends uvm_port_base #(uvm_sqr_if_base #(REQ, RSP))
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
This imp type is used in sequencer-driver communication. It has the standard constructor for imp-type ports.
Class declaration
class uvm_seq_item_pull_imp #(
type REQ = int,
type RSP = REQ,
type IMP = int
) extends uvm_port_base #(uvm_sqr_if_base #(REQ, RSP))
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
15.3 uvm_sequencer_base
Controls the flow of sequences, which generate the stimulus (sequence item transactions) that is passed on to
drivers for execution.
197
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
15.3.2 Methods
15.3.2.1 new
function new (
string name,
uvm_component parent
)
Creates and initializes an instance of this class using the following constructor arguments for uvm_component:
name is the name of the instance, and parent is the handle to the hierarchical parent, if any (see 13.1).
15.3.2.2 is_child
15.3.2.3 user_priority_arbitration
When the sequencer arbitration mode is specified as UVM_SEQ_ARB_USER (using the set_arbitration method)
(see 15.3.2.19), the sequencer calls this function each time that any sequencer API arbitrates among sequences
(e.g., uvm_sqr_if_base#(T1,T2)::get, see 15.2.1.2.6). This function is called even if there is only one sequence
available.
Derived sequencers may override this method to perform a custom arbitration policy. The override shall return
one of the entries from the avail_sequences queue, which contains the index of each sequence available for
arbitration. The associated sequence for each index can be obtained via get_arbitration_sequence (see
15.3.2.4).
15.3.2.4 get_arbitration_sequence
15.3.2.5 execute_item
15.3.2.6 wait_for_grant
198
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This task issues a request for the specified sequence_ptr sequence. If item_priority is not specified or is -1, the
current sequence priority is used by the arbiter. This is the default condition and item_priority shall be -1. If a
lock_request is made (lock_request==1), the sequencer issues a lock immediately before granting the
sequence. (The lock may be granted without the sequence being granted if is_relevant [see 14.2.5.3] for the
sequence is not asserted). The default value of lock_request shall be 0.
When this method returns, the sequencer has granted the sequence, and the sequence shall call send_request
(see 15.3.2.20) without inserting any simulation delay other than delta cycles. The driver will be waiting for the
next item to be sent via the send_request call.
15.3.2.7 wait_for_item_done
A sequence may optionally call wait_for_item_done. This task blocks until the driver indicates that the item is
done, either explicitly via item_done (see 15.2.1.2.3) or implicitly via a call to get (see 15.2.1.2.6) on a
transaction issued by the specified sequence_ptr sequence. If no transaction_id parameter is specified, or the
transaction_id is -1, the call returns the next time that the driver calls item_done or get on a transaction issued
by the specified sequence_ptr sequence. When a specific transaction_id is used, the call only returns when the
driver indicates it has completed that specific item.
NOTE—wait_for_item_done returning indicates the driver has signaled the item is done; however, it does not strictly
indicate the driver has completed all processing of the request.
15.3.2.8 is_blocked
Returns 1 if the sequence referred to by sequence_ptr is currently locked out of the sequencer. It returns 0 if the
sequence is currently allowed to issue operations.
15.3.2.9 has_lock
Returns 1 if the sequence referred to in by sequence_ptr currently has a lock on this sequencer, 0 otherwise.
Note that even if this sequence has a lock, a child sequence may also have a lock, in which case the sequence is
still blocked from issuing operations on the sequencer.
15.3.2.10 lock
A lock request is arbitrated the same as any other request. A lock is granted after all previously granted requests
are completed and no other locks or grabs are blocking this sequence.
The lock call returns once the lock has been granted.
199
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
15.3.2.11 grab
A grab request is put in the front of the arbitration queue. It is arbitrated before any other requests. A grab is
granted when no other grabs or locks are blocking this sequence.
The grab call returns once the grab has been granted.
15.3.2.12 unlock
15.3.2.13 ungrab
Calls unlock (see 15.3.2.12). Provided to give user code the symmetry of calling grab (see 15.3.2.11) and
ungrab.
15.3.2.14 stop_sequences
Tells the sequencer to kill all sequences and child sequences currently operating on the sequencer, and remove
all requests, locks, and responses that are currently queued. This essentially resets the sequencer to an idle state.
15.3.2.15 is_grabbed
Returns 1 if any sequence currently has a lock or grab on this sequencer, 0 otherwise.
15.3.2.16 current_grabber
Returns a reference to the sequence that currently has a lock or grab on the sequence. If multiple hierarchical
sequences have a lock, this returns the child that is currently allowed to perform operations on the sequencer.
15.3.2.17 has_do_available
Returns 1 if any sequence running on this sequencer is ready to supply a transaction, 0 otherwise. A sequence
is ready if it is not blocked (via grab [see 15.3.2.11] or lock [see 15.3.2.10]) and is_relevant (see 14.2.5.3)
returns 1.
200
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
15.3.2.18 get_arbitration
Returns the current arbitration mode for this sequencer. See F.2.4.1 for a list of possible modes.
If the arbitration mode has not been set via a call to set_arbitration (see 15.3.2.19), then UVM_SEQ_ARB_FIFO
shall be returned.
15.3.2.19 set_arbitration
15.3.2.20 send_request
Derived classes shall implement this function to send a request item to the sequencer, which then forwards it to
the driver. If the rerandomize bit is set to 1, the item shall be randomized before being sent to the driver. The
default value of rerandomize shall be 0, which is not set.
This function may only be called after a wait_for_grant call (see 15.3.2.6).
15.3.2.21 set_max_zero_time_wait_relevant_count
Can be called at any time to change the maximum number of times wait_for_relevant can be called by the
sequencer in zero time before an error is declared. The default maximum is 10.
15.3.2.22 disable_auto_item_recording
By default, item recording is performed automatically when get_next_item (see 15.2.1.2.1) and item_done
(see 15.2.1.2.3) are called in the uvm_sequencer#(REQ,RSP) (see 15.5) or when the
uvm_push_sequencer#(REQ,RSP) (see 15.6) puts an item on the req_port (see 15.6.2). However, this
behavior might not be desired.
This automatic recording can be disabled by calling this function. Once disabled, automatic recording cannot be
re-enabled.
15.3.2.23 is_auto_enabled_recording_enabled
201
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
15.3.3 Requests
15.3.3.1 get_num_reqs_sent
Returns the number of requests that have been sent by this sequencer.
15.3.3.2.1 set_num_last_reqs
Specifies the size of the last requests buffer. The maximum buffer size is 1024. If max is greater than 1024, a
warning shall be issued and the buffer is set to 1024. The default value is 1.
15.3.3.2.2 get_num_last_reqs
Returns the size of the last requests buffer, as specified in set_num_last_reqs (see 15.3.3.2.1).
15.3.4 Responses
15.3.4.1 get_num_rsps_received
15.3.4.2.1 get_num_last_rsps
Returns the maximum size of the last responses buffer, as specified in set_num_last_rsps (see 15.3.4.2.2).
15.3.4.2.2 set_num_last_rsps
Specifies the size of the last response buffer. The maximum buffer size is 1024. If max is greater than 1024, a
warning shall be issued and the buffer is set to 1024. The default value is 1.
A default sequence can be associated with a specified sequencer and uvm_phase (see 9.3.1).
A default sequence is specified via a uvm_resource (see Annex C for ways to set a resource or G.2.9 for the
uvm_set_default_sequence command line option that sets the resource). The resource specifying a default
sequence shall have a scope consisting of the concatenation {"path.to.sequencer", ".",
"phase_name"} (where path.to.sequencer stands for the sequencer’s full name and phase_name stands
202
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
for the name of the targeted phase), the name "default_sequence", and the type uvm_object_wrapper (see
8.3.2) or uvm_sequence_base (see 14.2).
a) When the phase starts, lookup_name (see C.2.4.4.1) is called with the appropriate scope and name as
described in the preceding paragraphs.
b) The result of lookup_name shall be filtered to remove any resources that are not of type
uvm_object_wrapper (see 8.3.2) or uvm_sequence_base (see 14.2). The relative ordering of the
remaining resources in the queue shall be maintained.
c) get_highest_precedence (see C.2.4.4.2) shall be called on the queue.
If the return value of get_highest_precedence is null, then no default sequence exists for the given
sequencer/phase pair.
If get_highest_precedence (see C.2.4.4.2) returns a valid resource, however that resource contains a null value,
then the default sequence for the given sequencer/phase pair has been explicitly disabled. How resources with
non-null values are handled depends on the type of resource returned.
For resources of uvm_object_wrapper type (see 8.3.2), the object wrapper within the resource shall be passed
to the create_object_by_type method (see 8.3.1.5) of the current factory (see F.4.1.4.2). The parent_inst_path
shall be the full name of the sequencer and the name shall be the value returned by the wrapper’s
get_type_name method (see 8.3.2.2.3). If the object returned by create_object_by_type cannot be cast to a
uvm_sequence_base (see 14.2), then an error message shall be generated and no default sequence shall be
started for the given sequencer/phase pair. If the object can be cast into a uvm_sequence_base, then that
sequence is the default sequence for this sequencer/phase pair.
For resources of uvm_sequence_base type, the sequence within the resource is the default sequence for this
sequencer/phase pair.
The default sequence shall have its sequencer (see 14.1.2.6) and starting phase (see 14.2.4.2) set and shall be
randomized (unless get_randomize_enabled returns 0 [see 14.2.2.2]), prior to being automatically started on
the sequencer. If the default sequence is still running when the run-time phase ends, then it shall be killed.
This subclause describes the API implemented in both uvm_sequencer#(REQ,RSP) (see 15.5) and
uvm_push_sequencer#(REQ,RSP) (see 15.6).
15.4.1 Method
get_current_item
function REQ get_current_item()
Returns the request_item currently being executed by the sequencer. If the sequencer is not currently
executing an item, this method returns null.
The sequencer is executing an item from the time that get_next_item (see 15.2.1.2.1) or peek (see 12.2.10) is
called until the time that get (see 15.2.1.2.6) or item_done (see 15.2.1.2.3) is called.
Note that a driver that only calls get does not show a current item, since the item is completed at the same time
as it is requested.
203
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
15.4.2 Request
last_req
function REQ last_req( int unsigned n = 0 )
Returns the last request item by default, when n is 0. If n is not 0, it returns the nth-before-last request item. If n
is greater than the last request buffer size, the function returns null.
15.4.3 Responses
15.4.3.1 rsp_export
Drivers or monitors can connect to this port to send responses to the sequencer. Alternatively, a driver can send
responses via its seq_item_port, e.g.,
seq_item_port.item_done(response)
seq_item_port.put(response)
rsp_port.write(response) <--- via this export
The rsp_port in the driver and/or monitor (see 13.7.2.2) needs to be connected to the rsp_export in this
sequencer in order to send responses through the response analysis port.
15.4.3.2 last_rsp
Returns the last response item by default, when n is 0. If n is not 0, it returns the nth-before-last response item.
If n is greater than the last response buffer size, the function returns null.
Requests for new sequence items are initiated by the driver. Upon such requests, the sequencer selects a
sequence from a list of available sequences to produce and delivers the next item to execute. This sequencer is
typically connected to a user-extension of uvm_driver #(REQ,RSP) (see 13.7).
class uvm_sequencer #(
type REQ = uvm_sequence_item,
type RSP = REQ
) extends uvm_sequencer_base
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
15.5.2 Methods
15.5.2.1 new
function new (
string name,
uvm_component parent
)
204
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Creates and initializes an instance of this class using the following constructor arguments for uvm_component:
name is the name of the instance, and parent is the handle to the hierarchical parent, if any (see 13.1).
15.5.2.2 seq_item_export
uvm_seq_item_pull_imp #(
REQ,
RSP,
uvm_sequencer#(REQ, RSP) ) seq_item_export
This export provides access to the uvm_sequencer’s implementation of the sequencer/driver interface,
uvm_seqr_if_base (see 15.2.1).
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
15.5.2.3 get_next_item
Retrieves the next available item from a sequence. The call shall block until an item is available. The following
steps occur on this call:
a) Arbitrate among requesting, unlocked, and relevant sequences: Choose the highest priority sequence
based on the current sequencer arbitration mode. If no sequence is available, wait for a requesting
unlocked relevant sequence, then re-arbitrate.
b) The chosen sequence returns from uvm_sequence_base::wait_for_grant (see 14.2.6.4).
c) The chosen sequence calls uvm_sequencer_base::send_request (see 15.3.2.20).
d) Return with a reference to the item.
Once get_next_item is called, item_done (see 15.5.2.5) needs to be called to indicate the completion of the
request to the sequencer.
15.5.2.4 try_next_item
Returns immediately with the request t set to the next available sequence_item, if there is one available,
otherwise returns with the t set to null. The following steps occur on this call:
a) Arbitrate among requesting, unlocked, and relevant sequences: Choose the highest priority sequence
based on the current sequencer arbitration mode. If no sequence is available, return null.
b) The chosen sequence returns from uvm_sequence_base::wait_for_grant (see 14.2.6.4)
c) The chosen sequence calls uvm_sequencer_base::send_request (see 15.3.2.20).
d) Return with a reference to the item.
If try_next_item returns with a non-null request t, item_done (see 15.5.2.5) needs to be called to indicate the
completion of the request to the sequencer; this removes the request item from the sequencer FIFO.
15.5.2.5 item_done
205
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Indicates the request is completed to the sequencer. Any uvm_sequence_base::wait_for_item_done calls (see
14.2.6.6) made by a sequence for this item shall return.
If the response item is not null, it will be sent back to the requesting sequence. The response item shall have its
sequence ID and transaction ID specified correctly, using the uvm_sequence_item::set_id_info method (see
14.1.2.4):
rsp.set_id_info(req)
Before item_done is called, any calls to peek (see 15.5.2.7) retrieve the current item that was obtained by
get_next_item (see 15.5.2.3). After item_done is called, peek (see 15.5.2.7) causes the sequencer to arbitrate
for a new item.
15.5.2.6 get
Retrieves the next available item from a sequence. The call shall block until an item is available. The following
steps occur on this call.
a) Arbitrate among requesting, unlocked, and relevant sequences: Choose the highest priority sequence
based on the current sequencer arbitration mode. If no sequence is available, wait for a requesting
unlocked relevant sequence, then re-arbitrate.
b) The chosen sequence returns from uvm_sequence_base::wait_for_grant (see 14.2.6.4).
c) The chosen sequence calls uvm_sequencer_base::send_request (see 15.3.2.20).
d) Indicate item_done (see 15.5.2.5) to the sequencer.
e) Return with a reference to the item.
When get is called, item_done (see 15.5.2.5) shall not be called. A new item can be obtained by calling get
again, or a response shall be sent using either put (see 15.5.2.8) or uvm_driver::rsp_port.write (see 13.7.2.2).
15.5.2.7 Peek
Returns the current request item (see 15.3.3) if one is available. If no item is currently available, the following
steps are performed in order:
a) Arbitrate among requesting, unlocked, and relevant sequences: Choose the highest priority sequence
based on the current sequencer arbitration mode. If no sequence is available, wait for a requesting
unlocked relevant sequence, then re-arbitrate.
b) The chosen sequence returns from uvm_sequence_base::wait_for_grant (see 14.2.6.4).
c) The chosen sequence calls uvm_sequencer_base::send_request (see 15.3.2.20).
d) Return with a reference to the item.
Once a request item has been retrieved, subsequent calls to peek return the same item until get (see 15.5.2.6) or
item_done (see 15.5.2.5) is called.
15.5.2.8 put
206
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Sends a response back to the sequence that issued the request. Before the response is put, it shall have its
sequence ID and transaction ID specified to match the request. This can be done using the
uvm_sequence_item::set_id_info call (see 14.1.2.4):
rsp.set_id_info(req)
While this is a task, it shall not consume time (including delta cycles). The response is put into the sequence
response queue or sent to the sequence response handler.
15.5.2.9 put_response
Sends a response back to the sequence that issued the request. If the sequence has reached the UVM_STOPPED or
UVM_FINISHED state (see F.2.4.2), then the implementation shall drop the response and issue a warning
message. Before the response is put, it shall have its sequence ID and transaction ID specified to match the
request. This can be done using the uvm_sequence_item::set_id_info call (see 14.1.2.4), e.g.,
rsp.set_id_info(req)
Sequence items (from the currently running sequences) are pushed by the sequencer to the driver. The driver
blocks item flow when it is not ready to accept new transactions. This sequencer is typically connected to a
user-extension of uvm_push_driver #(REQ,RSP) (see 13.8).
class uvm_push_sequencer #(
type REQ = uvm_sequence_item,
type RSP = REQ
) extends uvm_sequencer_base
The type of REQ and RSP shall be derived from uvm_sequence_item (see 14.1).
15.6.2 Ports
req_port
This is a uvm_blocking_put_port #(REQ) (see 12.2.2.3). The push sequencer requires access to a
blocking put interface. A continuous stream of sequence items are sent out this port, based on the list of
available sequences loaded into this sequencer.
15.6.3 Methods
15.6.3.2 new
function new (
string name,
207
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_component parent
)
Creates and initializes an instance of this class using the following constructor arguments for uvm_component:
name is the name of the instance, and parent is the handle to the hierarchical parent, if any (see 13.1).
15.6.3.3 run_phase
Retrieves the next available item from a sequence, and puts that item on req_port (see 15.6.2). The following
steps shall execute continuously during this task, in order:
a) Arbitrate among requesting, unlocked, and relevant sequences: Choose the highest priority sequence
based on the current sequencer arbitration mode. If no sequence is available, wait for a requesting
unlocked relevant sequence, then re-arbitrate.
b) The chosen sequence returns from uvm_sequence_base::wait_for_grant (see 14.2.6.4).
c) The chosen sequence calls uvm_sequencer_base::send_request (see 15.3.2.20).
d) The chosen sequence optionally calls uvm_sequence_base::wait_for_item_done (see 14.2.6.6).
e) The item passed to the sequencer in c) is passed to put (see 12.2.2.1) on req_port (see 15.6.2).
f) The put call on req_port returns.
g) The optional call to uvm_sequence_base::wait_for_item_done in d) returns.
Each policy class includes several user-configurable parameters that control the operation. Users may also
customize operations by deriving new policy subtypes from these base types. For example, UVM provides four
different uvm_printer-based (see 16.2) policy classes, each of which print objects in a different format.
a) uvm_printer (see 16.2)—Performs deep printing of uvm_object–based objects. UVM provides several
subtypes to uvm_printer that print objects in a specific format: uvm_table_printer (see 16.2.10),
uvm_tree_printer (see 16.2.11), and uvm_line_printer (see 16.2.12). Each such printer has many
configuration options that govern what and how object members are printed.
b) uvm_comparer (see 16.3)—Performs deep comparison of uvm_object–based objects. Users may
configure what is compared and how miscompares are reported.
c) uvm_recorder (see 16.4.1)—Performs the task of recording uvm_object–based objects to a
transaction database. An implementation is application-specific.
d) uvm_packer (see 16.5)—Used to pack and unpack uvm_object–based properties into arrays of type
bit, byte, or int.
e) uvm_copier (see 16.6)—Performs the task of copying fields of uvm_object–based objects.
16.1 uvm_policy
The abstract uvm_policy class provides a common base from which all UVM policy classes derive.
208
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.1.2 Methods
16.1.2.1 new
Creates a policy with the specified instance name. If name is not provided, then the policy instance is unnamed.
16.1.2.2 flush
The flush method resets the internal state of the policy, such that it can be reused.
16.1.2.3 Extensions
The policy extensions mechanism allows the user to pass additional information along with the policy class
when executing a policy-based procedure. Objects may use these extensions to alter their interactions with the
policy. For example: An object may use extensions to selectively filter some of its fields from being processed.
Policy extensions are not cleared via a call to the policy flush method (see 16.1.2.2), and need to be removed
manually by using clear_extension (see 16.1.2.3.4) or clear_extensions (see 16.1.2.3.5).
16.1.2.3.1 extension_exists
Returns 1 if an extension exists within the policy with type matching ext_type; otherwise, returns 0.
16.1.2.3.2 set_extension
Sets the given extension inside of the policy, indexed using return value from extension’s get_object_type
method (see 5.3.4.6). Only a single instance of an extension is stored per type. If there is an existing extension
instance matching extension’s type, extension replaces the instance and the replaced instance handle is returned;
otherwise, null is returned.
16.1.2.3.3 get_extension
Returns the extension value stored within the policy with type matching ext_type. Returns null if no extension
exists matching that type.
16.1.2.3.4 clear_extension
Removes the extension value stored within the policy matching type ext_type. If no extension exists matching
type ext_type, the request is silently ignored.
209
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.1.2.3.5 clear_extensions
The active object methods are used to determine which object is actively being operated on by a policy. When a
policy operates on an object, such as via print_object (see 16.2.3.1), compare_object (see 16.3.3.4),
record_object (see 16.4.6.4), pack_object (see 16.5.4.2), unpack_object (16.5.4.4) or copy_object (see
16.6.4.1), it pushes the object onto the active object stack (see 16.1.3.1). When the policy completes the
operation on the object, it pops the object off of the active object stack (see 16.1.3.2).
16.1.3.1 push_active_object
Pushes obj on to the internal object stack for this policy, making it the current active object, as retrieved by
get_active_object (see 16.1.3.3). An implementation shall generate an error message if obj is null and the
request will be ignored.
Additionally, the policy shall push itself onto the active policy stack for obj using push_active_policy (see
5.3.14.1) when push_active_object is called.
16.1.3.2 pop_active_object
Pops the current active object off of the internal object stack for this policy and returns the popped off value. If
the internal object stack for this object is empty when pop_active_object is called, then null is returned and no
error message is generated.
Additionally, the policy shall pop itself off of the active policy stack on obj using pop_active_policy (see
5.3.14.2) when pop_active_object is called.
16.1.3.3 get_active_object
Returns the head of the internal object stack for this policy. If the internal object stack for this policy is empty,
null is returned.
16.1.3.4 get_active_object_depth
Returns the current depth of the internal object stack for this policy.
16.1.4 recursion_state_e
An enum type that indicates whether a policy has operated on a given object or objects; it has the following
values:
210
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
STARTED—The policy has started operating on the object(s), but has not yet completed the operation.
16.2 uvm_printer
The uvm_printer class provides an interface for printing uvm_objects (see 5.3) in various formats. Subtypes
of uvm_printer implement different print formats or policies.
A user-defined printer format can be created or one of the following built-in printers can be used.
16.2.2 Methods
16.2.2.1 new
Creates a new uvm_printer with the specified instance name. If name is not provided, the printer is unnamed.
16.2.2.2 set_default
Helper method for setting the default printer policy instance via uvm_coreservice_t::set_default_printer (see
F.4.1.4.12).
16.2.2.3 get_default
Helper method for retrieving the default printer policy instance via uvm_coreservice_t::get_default_printer
(see F.4.1.4.13).
16.2.3.1 print_object
211
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Prints an object:
name is the name to use when printing the object. Note that this may be different than the value returned
by the object’s get_name method (see 5.3.4.2).
value is the value of the object. null can be passed as a value.
scope_separator is used to find the leaf name since many printers only print the leaf name of a field.
The default value of scope_separator shall be ".".
Whether a non-null value is recursed depends on the settings for printer configuration (see 16.2.5). For objects
that are being recursed, the following steps occur in order:
a) The object is pushed onto the active object stack via push_active_object (see 16.1.3.1).
b) The return value for object_printed (see 16.2.3.2) when passed value and the current recursion policy
(see 16.2.5.9) is set to uvm_policy::STARTED.
c) The do_execute_op method (see 5.3.13) on the object is passed a uvm_field_op (see 5.7) with op_type
UVM_PRINT and policy set to this printer.
d) If user_hook_enabled (see 5.7.2.7) returns 1, the printer passes itself the do_print method (see
5.3.6.3) on the object; otherwise, the method returns without calling do_print.
e) The return value for object_printed (see 16.2.3.2) when passed value and the current recursion policy
(see 16.2.5.9) is set to uvm_policy::FINISHED.
f) The object is popped off of the active object stack via pop_active_object (see 16.1.3.2).
16.2.3.2 object_printed
Returns the current recursion state (see 16.1.4) for value and recursion within the printer, as defined by
print_object (see 16.2.3.1). For objects that have never been passed to print_object, the return value shall be
uvm_policy::NEVER.
16.2.3.3 print_generic
Prints a field having the given name, type_name, size, value, and scope_separator. name is the name of the
field.
212
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
scope_separator is used to find the leaf name since many printers only print the leaf name of a field.
Typical values for the separator are a dot (.) or an open bracket ([). The default value of
scope_separator shall be ".".
16.2.3.4 print_generic_element
An element is added as a child of the top element (see 16.2.7.2) with the given parameters.
16.2.3.5 print_array_header
Prints the header of an array. This function is called before each individual element is printed.
print_array_footer (see 16.2.3.7) is called to mark the completion of array printing.
The size argument indicates the size of the array which is about to be printed. The arraytype argument indicates
what type of array is being printed. While it defaults to "array", the user can set it to indicate queues,
associative arrays, or other types. The scope_separator argument declares where the leaf name starts if the
printer is configured to print only the leaf name of the identifier. The default value of scope_separator shall be
".".
16.2.3.6 print_array_range
Prints a range using ellipses for values. This is used in honoring the partial printing of large arrays for
uvm_printer::set_begin_elements and uvm_printer:: set_end_elements (see 16.2.6). min and max align to
array indices. min should be the index of the first skipped value and max should be the index of the last skipped
value.
This function should be called after printing the beginning of the array (as determined by
uvm_printer::get_begin_elements) and before printing the end of the array (as determined by
uvm_printer::get_end_elements).
213
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.2.3.7 print_array_footer
Prints the footer of an array. This function marks the end of an array print.
The optional size argument indicates the size of the array which has been printed. The default value of size shall
be 0.
NOTE—There may be no output associated with the array footer, however this method lets the printer know that the array
printing is complete.
16.2.3.8 print_field
16.2.3.9 print_field_int
214
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.2.3.10 print_string
16.2.3.11 print_time
16.2.3.12 print_real
215
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.2.4.1 emit
Emits a string representing the contents of an object in a format defined by an extension of this object.
16.2.4.2 flush
The flush method resets the internal state of the printer. This includes clearing the internal element stack (see
16.2.7), and setting both the bottom element (see 16.2.7.1) and the top element (see 16.2.7.2) to null.
An implementation of the printer is allowed to reuse elements after a flush. Any outstanding handles to
elements accessed prior to the flush via get_bottom_element (see 16.2.7.1) or get_top_element (see 16.2.7.2)
shall be considered unstable after the flush.
The following methods define the printer settings available to all printer subtypes for use with the print_*
methods (see 16.2.3) and emit (see 16.2.4.1).
Controls whether field names shall be printed during emit (see 16.2.4.1). A value of 1 indicates field names
shall be printed; a value of 0 indicates field names shall be omitted.
If set_name_enabled has not been called since the printer was constructed, then get_name_enabled shall
return 1.
Controls whether field type names shall be printed during emit (see 16.2.4.1). A value of 1 indicates field type
names shall be printed; a value of 0 indicates field type names shall be omitted.
If set_type_name_enabled has not been called since the printer was constructed, then
get_type_name_enabled shall return 1.
216
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Controls whether field sizes shall be printed during emit (see 16.2.4.1). A value of 1 indicates field sizes shall
be printed; a value of 0 indicates field sizes shall be omitted.
If set_size_enabled has not been called since the printer was constructed, then get_size_enabled shall return 1.
16.2.5.4 ID enabled
Controls whether a unique reference ID shall be printed for object fields during print_object (see 16.2.3.1). A
value of 1 indicates a unique reference ID shall be printed; a value of 0 indicates the unique reference ID shall
be omitted.
If set_id_enabled has not been called since the printer was constructed, then get_id_enabled shall return 1.
Controls whether a radix string (see 16.2.5.6) shall be prepended to integral value fields print_field (see
16.2.3.8) or print_field_int (see 16.2.3.9). A value of 1 indicates the radix string shall be prepended; a value
of 0 indicates the radix string shall be omitted.
If set_radix_enabled has not been called since the printer was constructed, then get_radix_enabled shall
return 1.
Controls the prefix strings used by print_field (see 16.2.3.8) or print_field_int (see 16.2.3.9) when
get_radix_enabled (see 16.2.5.5) returns 1.
If set_radix_string has not been called since the printer was constructed, then get_radix_string shall have a
return value for each radix as shown in Table 2.
217
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
UVM_DEC 'd
UVM_BIN 'b
UVM_OCT 'o
UVM_UNSIGNED 'd
UVM_HEX 'h
The return value for any radix value not shown in Table 2 is undefined.
Controls the default radix used by print_field (see 16.2.3.8) or print_field_int (see 16.2.3.9) when
get_radix_enabled (see 16.2.5.5) returns 1 and radix equals UVM_NORADIX.
If set_default_radix has not been called since the printer was constructed, then get_default_radix shall return
UVM_HEX.
If set_root_enabled has not been called since the printer was constructed, then get_root_enabled shall return
1.
Controls the recursion policy to use for object values supplied to print_object (see 16.2.3.1).
UVM_DEEP—Prints all fields of the target, doing a “deep” print (any object fields are printed using a
DEEP recursion).
UVM_SHALLOW—Prints all fields of the target using a “shallow” print (any object fields are printed as
REFERENCES).
UVM_REFERENCE—Prints the target as a reference.
218
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If set_recursion_policy has not been called since the printer was constructed, then get_recursion_policy shall
return UVM_DEFAULT_POLICY.
Controls the maximum recursion depth for objects printed via print_object (see 16.2.3.1). A maximum depth
less than 0 indicates all objects shall be recursed using the current recursion policy (see 16.2.5.9); otherwise,
for objects whose scope depth (see 16.1.3.4) exceeds the current maximum recursion depth, the printer shall
print the object as if the recursion policy was UVM_REFERENCE.
If set_max_depth has not been called since the printer was constructed then get_max_depth shall return -1.
16.2.5.11 File
Controls fl [the current UVM_FILE (see F.2.8)], which specifies where the output of uvm_object::print (see
5.3.6.1) shall be directed.
If set_file has not been called since the printer was constructed, then get_file shall return UVM_STDOUT (see
F.2.9).
Controls the string to use as a prefix to all lines of text generated by the printer during emit (see 16.2.4.1).
If set_line_prefix has not been called since the printer was constructed, then get_line_prefix shall return an
empty string ("").
The following methods define values that may be used in do_print (see 5.3.6.3) or do_execute_op (see 5.3.13)
to control how fields are printed within an object.
Array elements
These options can control the number of elements at the beginning and end of an array to print. A value less
than 0 for either begin_elements or end_elements indicates all elements of the array shall be printed. If both
values are 0 or greater, then the object may omit array elements that are both:
Greater than or equal to begin_elements from the beginning of the array
Greater than or equal to end_elements from the end of the array
219
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
When omitting array elements in this fashion, print_array_range (see 16.2.3.6) shall be used to represent the
skipped elements.
If set_begin_elements has not been called since the printer was constructed then get_begin_elements shall
return 5. If set_end_elements has not been called since the printer was constructed then get_end_elements
shall return 5.
Within the printer, a stack of uvm_printer_element (see 16.2.8) is maintained. Each element stores the name,
type_name, size, and value to be printed as strings. The element stack allows for a separation between the
content of the data being printed and the structure of the eventual output string. For example, an integral value
that is printed looks the same regardless of whether it is printed in a tree structure or as a row in a tabular
structure. The bottom of the stack represents the outermost layer of encapsulation being printed, while the top
of the stack represents the layer of encapsulation currently being used.
When printing an individual field via print_generic (see 16.2.3.3), print_generic_element (see 16.2.3.4),
print_array_range (see 16.2.3.6), print_field (see 16.2.3.8), print_field_int (see 16.2.3.9), print_string (see
16.2.3.10), print_time (see 16.2.3.11), and print_real (see 16.2.3.12), the printer shall push a new element
onto the stack (see 16.2.7.3) and immediately pop the element from the stack (see 16.2.7.4).
When printing structured data via print_object (see 16.2.3.1), print_array_header (see 16.2.3.5), and
print_array_footer (see 16.2.3.7), the printer shall push a new element onto the stack and eventually pop the
element from the stack when the structure is done being printed, i.e., immediately before print_object
returning or when print_array_footer is called.
16.2.7.1 get_bottom_element
Returns the bottom element of the internal stack. This element represents the outermost layer of encapsulation
being printed.
16.2.7.2 get_top_element
Returns the top element of the internal stack. This element represents the layer of encapsulation currently being
used.
16.2.7.3 push_element
Pushes an element with the provided name, type_name, size, and value onto the top of the internal element
stack, becoming the new return value for get_top_element (see 16.2.7.2). If the bottom element (see 16.2.7.1)
is currently null, then the pushed element becomes the new bottom. If the top element (see 16.2.7.2) was not
previously null, then the pushed element is a child of the previous top.
220
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.2.7.4 pop_element
Pops the top element (see 16.2.7.2) off of the internal element stack, thereby restoring the next element on the
stack to top.
If the top element on the stack is also the bottom element (see 16.2.7.1), then this request is silently ignored.
16.2.8 uvm_printer_element
This class is used by the uvm_printer (see 16.2) to represent the structure being printed in string form. The
uvm_printer::emit method (see 16.2.4) is responsible for parsing the elements to produce properly formatted
output.
16.2.8.2 Methods
16.2.8.2.1 new
Initializes a new uvm_printer_element with the specified name. The default value of name shall be an empty
string ("").
16.2.8.2.2 set
Convenience method for setting the element_name (see 16.2.8.2.3), element_type_name (see 16.2.8.2.4),
element_size (see 16.2.8.2.5), and element_value (see 16.2.8.2.6). The default value of all arguments shall be
an empty string ("").
16.2.8.2.3 element_name
Controls the name of the element to be printed. The get_element_name method shall return element_name, as
defined by the most recent call to set (see 16.2.8.2.2) or set_element_name. If set and set_element_name have
not been called since this printer element was constructed, then get_element_name shall return an empty string
("").
221
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.2.8.2.4 element_type_name
Controls the type name associated with the element being printed. The get_element_type_name method shall
return element_type_name, as defined by the most recent call to set (see 16.2.8.2.2) or
set_element_type_name. If set and set_element_type_name have not been called since this printer element
was constructed, then get_element_type_name shall return an empty string ("").
16.2.8.2.5 element_size
Controls the size of the element to be printed. The get_element_size method shall return element_size, as
defined by the most recent call to set (see 16.2.8.2.2) or set_element_size. If set and set_element_size have not
been called since this printer element was constructed, then get_element_size shall return an empty string ("").
16.2.8.2.6 element_value
Controls the value of the element to be printed. The get_element_value method shall return element_value, as
defined by the most recent call to set (see 16.2.8.2.2) or set_element_value. If set and set_element_value have
not been called since this printer element was constructed, then get_element_value shall return an empty string
("").
16.2.9 uvm_printer_element_proxy
This is a structural proxy class (see F.5.2) for the uvm_printer_element (see 16.2.8). It can be used to
determine the children of an element.
uvm_printer_element (see 16.2.8) can be used to represent hierarchical elements, such as classes, arrays,
structs, etc. Each field/value within the printed structure can be stored as additional children elements within the
parent, e.g., an array of depth 2 could be represented using three elements; the parent element representing the
array itself, and then one child element per value within the array.
16.2.9.2 Methods
16.2.9.2.1 new
222
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Initializes a new uvm_printer_element_proxy with the specified name. The default value of name shall be an
empty string ("").
16.2.9.2.2 get_immediate_children
This is an extension of the uvm_structure_proxy’s get_immediate_children method (see F.5.2). This method
pushes the children elements of s to the back of the children queue. Any previously existing values within the
children queue remain untouched.
16.2.10 uvm_table_printer
16.2.10.2 Methods
16.2.10.2.1 new
Creates a new instance of uvm_table_printer with the specified instance name. If name is not provided, the
printer is unnamed.
16.2.10.2.2 get_type_name
16.2.10.2.3 set_default
Overrides the default table printer instance printer, as retrieved by get_default (see 16.2.10.2.4).
16.2.10.2.4 get_default
Retrieves the default table printer instance, as set by set_default (see 16.2.10.2.3). If set_default has not been
called prior to the first get_default call, or if the most recent call to set_default was passed null, then the
implementation shall instance a uvm_table_printer and pass that instance to set_default automatically.
The following method defines the printer settings available to table printers:
223
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Indentation
Returns the number of spaces to use for indentation (indent) when printing the children of a
uvm_printer_element (see 16.2.8).
If set_indent has not been called since the printer was constructed or since the last call to flush (see 16.2.4.2),
then get_indent shall return 2.
16.2.11 uvm_tree_printer
16.2.11.2 Methods
16.2.11.2.1 new
Creates a new instance of uvm_tree_printer with the specified instance name. If name is not provided, the
printer is unnamed.
16.2.11.2.2 get_type_name
16.2.11.2.3 set_default
Overrides the default tree printer instance, as retrieved by get_default (see 16.2.11.2.4).
16.2.11.2.4 get_default
Retrieves the default tree printer instance, as set by set_default (see 16.2.11.2.3). If set_default has not been
called prior to the first get_default call, or if the most recent call to set_default was passed null, then the
implementation shall instance a uvm_tree_printer and pass that instance to set_default automatically.
The following methods define the printer settings available to tree printers.
224
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.2.11.3.1 Indentation
Returns the number of spaces to use for indentation (indent) when printing the children of a
uvm_printer_element (see 16.2.8).
If set_indent has not been called since the printer was constructed or since the last call to flush (see 16.2.4.2),
then get_indent shall return 2.
16.2.11.3.2 Separators
Controls the separators used for printing the children of a uvm_printer_element (see 16.2.8). The first
character of the string represents the opening separator and the second character represents the closing
separator; all other characters are ignored.
If set_separators has not been called since the printer was constructed or since the last call to flush (see
16.2.4.2), then get_separators shall return the curly brackets as string ("{}").
16.2.12 uvm_line_printer
16.2.12.2 Methods
16.2.12.2.1 new
Creates a new instance of uvm_line_printer with the specified instance name. If name is not provided, the
printer is unnamed.
16.2.12.2.2 get_type_name
16.2.12.2.3 set_default
Overrides the default line printer instance, as retrieved by get_default (see 16.2.12.2.4).
225
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.2.12.2.4 get_default
Retrieves the default line printer instance, as set by set_default (see 16.2.10.2.3). If set_default has not been
called prior to the first get_default call, or if the most recent call to set_default was passed null, then the
implementation shall instance a uvm_line_printer and pass that instance to set_default automatically.
The following method defines the printer settings available to line printers:
Separators
Controls the separators used for printing the children of a uvm_printer_element (see 16.2.8). The first
character of the string represents the opening separator and the second character represents the closing
separator; all other characters are ignored.
If set_separators has not been called since the printer was constructed or since the last call to flush (see
16.2.4.2), then get_separators shall return the curly brackets as string ("{}").
16.3 uvm_comparer
The uvm_comparer class provides a policy object for doing comparisons. The policies determine how
miscompares are treated and counted. Results of a comparison are stored in the comparer object. The
uvm_object::compare (see 5.3.9.1) and uvm_object::do_compare (see 5.3.9.2) methods are passed a
uvm_comparer policy object.
16.3.2 Methods
16.3.2.1 new
Creates a new uvm_comparer with the specified instance name. If name is not provided, the object is
unnamed.
16.3.2.2 flush
The flush method resets the internal state of the comparer. This includes setting the value returned by
get_result (see 16.3.3.9) to 0 and setting the value returned by get_miscompares (see 16.3.3.8) to an empty
string ("").
226
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.3.2.3 get_type_name
16.3.2.4 set_default
Helper method for setting the default comparer policy instance via
uvm_coreservice_t::set_default_comparer (see F.4.1.4.16).
16.3.2.5 get_default
Helper method for retrieving the default comparer policy instance via
uvm_coreservice_t::get_default_comparer (see F.4.1.4.17).
16.3.3.1 compare_field
16.3.3.2 compare_field_int
The name variable is used for purposes of storing and printing a miscompare.
The left-hand-side lhs and right-hand-side rhs variables are the two values used for comparison.
227
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The size variable indicates the number of bits to compare; size shall be less than or equal to 64.
The radix variable is used for the purposes of formatting the stored miscompare string.
16.3.3.3 compare_field_real
The name variable is used for purposes of storing and printing a miscompare.
The left-hand-side lhs and right-hand-side rhs variables are the two values used for comparison.
16.3.3.4 compare_object
Compares two class objects using the recursion policy (see 16.3.4.1) to determine whether the comparison
should be deep, shallow, or reference:
The name input is used for purposes of storing and printing a miscompare.
The lhs and rhs objects are the two objects used for comparison.
For objects that are being compared, the following steps occur in order:
a) The object is pushed onto the active object stack via push_active_object (see 16.1.3.1).
b) The return value for object_compared (see 16.3.3.5) when passed lhs, rhs, and the current recursion
policy (see 16.3.4.1) is set to uvm_policy::STARTED.
c) The do_execute_op method (see 5.3.13) on the object is passed a uvm_field_op (see 5.7) with op_type
UVM_COMPARE and policy set to this comparer.
d) If user_hook_enabled (see 5.7.2.7) returns 1, the comparer passes itself and the rhs to the
do_compare method (see 5.3.9.2) on lhs.
e) The return value for object_compared when passed lhs, rhs, and the current recursion policy is set to
uvm_policy::FINISHED. The comparison value output for object_compared when passed lhs, rhs,
and the current recursion policy is set as follows:
1) If the value of the get_result counter (see 16.3.3.9) increased during c) or d) then the comparison
value is set to 0.
2) If the do_compare call in d) returned 0, then the comparison value is set to 0.
3) If the value of the get_result counter did not increase during c) or d), and the do_compare call in
d) returned 1, then the comparison value is set to 1.
f) The object is popped off of the active object stack via pop_active_object (see 16.1.3.2).
g) compare_object returns the value determined in e).
228
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.3.3.5 object_compared
Returns the current recursion state (see 16.1.4) for lhs, rhs, and recursion within the comparer, as defined by
compare_object (see 16.3.3.4). For objects that have never been passed to compare_object, the return value
shall be uvm_policy::NEVER.
If the recursion state is uvm_policy::FINISHED, then ret_val is the return value of the comparison as defined
by compare_object. If the recursion state is a value other than uvm_policy::FINISHED, then the value of
ret_val is 0.
The values passed to lhs and rhs need to be passed to object_compared using the same ordering as
compare_object.
16.3.3.6 compare_string
16.3.3.7 print_msg
Causes the error count to be incremented and the message, msg, to be appended to the get_miscompares string
(see 16.3.3.8). (A newline character is used to separate messages.)
If the message count is less than set_show_max (see 16.3.5.1), the message is printed to the standard output
using the current verbosity and severity settings.
16.3.3.8 get_miscompares
Returns the set of miscompares, if any, that have occurred since the comparer was constructed or since the last
call to flush (see 16.2.4.2).
If no miscompares have occurred, then get_miscompares shall return an empty string ("").
229
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.3.3.9 get_result
Returns the number of miscompares that have occurred since the comparer was constructed or since the last call
to flush (see 16.2.4.2).
Controls the recursion policy to use for object values supplied to compare_object (see 16.3.3.4).
UVM_DEEP—Compares all fields of the object, doing a “deep” compare (any object fields are compared
using a DEEP recursion).
UVM_SHALLOW—Compares all fields of the object using a “shallow” compare (any object fields are
compared as REFERENCES).
UVM_REFERENCE—Compares the object as a reference.
If set_recursion_policy has not been called since the comparer was constructed, then get_recursion_policy
shall return UVM_DEFAULT_POLICY.
Controls (via enabled) whether the compare_object method (see 16.3.3.4) compares the object types, given by
uvm_object::get_object_type (see 5.3.4.6).
If set_check_type has not been called since the comparer was constructed, then get_check_type shall return 1.
Controls the maximum allowed number of miscompare messages (show_max) generated by the comparer
during a compare operation.
If set_show_max has not been called since the comparer was constructed, then get_show_max shall return 1.
230
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.3.5.2 Verbosity
Controls the verbosity value to be used by the comparer when generating messages.
If set_verbosity has not been called since the comparer was constructed, then get_verbosity shall return
UVM_LOW.
16.3.5.3 Severity
Controls the severity value to be used by the comparer when generating messages.
If set_severity has not been called since the comparer was constructed, then get_severity shall return
UVM_INFO.
The following methods define values that may be used in do_compare (see 5.3.9.2) or do_execute_op (see
5.3.13) to control how fields are printed within an object:
Return threshold
A threshold value greater than 0 indicates that the do_compare (see 5.3.9.2) or do_execute_op (see 5.3.13)
method may return as quickly as possible after the result, as returned by get_result (see 16.3.3.9) reaches the
threshold value, potentially skipping additional field comparisons. This allows for a “fast failure” mode, which
can detect a miscompare faster at the sacrifice of additional debugging information. A return value of 0
indicates all fields should be compared, even if miscompares have already been detected.
If set_threshold has not been called since the comparer was constructed or since the last call to flush (see
16.2.4.2), then get_threshold shall return 1.
16.4 uvm_recorder
231
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.4.2.1 recursion_policy
Controls the recursion policy to use for object values supplied to record_object (see 16.4.6.4).
UVM_DEEP—Records all fields of the target, doing a “deep” record (any object fields are recorded using
a DEEP recursion).
UVM_SHALLOW—Records all fields of the target using a “shallow” record (any object fields are recorded
as REFERENCES).
UVM_REFERENCE—Records the target as a reference.
A value of UVM_DEFAULT_POLICY shall be treated as UVM_DEEP.
If set_recursion_policy has not been called since the recorder was constructed or since the last call to flush
(see 16.2.4.2), then get_recursion_policy shall return UVM_DEFAULT_POLICY.
16.4.2.2 ID enabled
Controls (via enabled) whether a unique reference ID shall be printed for object fields during record_object
(see 16.4.6.4). A value of 1 indicates a unique reference ID shall be recorded; a value of 0 indicates the unique
reference ID shall be omitted.
If set_id_enabled has not been called since the recorder was constructed or since the last call to flush (see
16.2.4.2), then get_id_enabled shall return 1.
Controls the default radix used by record_field (see 16.4.6.1) or record_field_int (see 16.4.6.2) when
get_radix_enabled (see 16.2.5.5) returns 1 and radix equals UVM_NORADIX.
If set_default_radix has not been called since the recorder was constructed or since the last call to flush (see
16.2.4.2), then get_default_radix shall return UVM_HEX.
get_stream
232
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
A warning shall be issued if get_stream is called prior to the record being initialized via do_open (see
16.4.7.1).
Once a recorder has been opened via uvm_tr_stream::open_recorder (see 7.2.5.1), the user can then close
(see 16.4.4.2) the recorder.
Since many database implementations cross a language boundary, an additional step of freeing the recorder is
required.
A link can be established within the database any time between when uvm_tr_stream::open_recorder (see
7.2.5.1) and then free (see 16.4.4.3) are called, however it shall be an error to establish a link after freeing the
recorder.
16.4.4.1 flush
The flush method resets the internal state of the recorder. If the recorder is currently open (see 16.4.4.4), then
the implementation shall call free (see 16.4.4.3) with a close_time value of 0.
16.4.4.2 close
Closing a recorder marks the end of the transaction in the stream; it has the following parameter:
close_time—Optional time to record as the closing time of this transaction. The default value of
close_time shall be 0.
16.4.4.3 free
Freeing a recorder indicates the stream and database can release any references to the recorder; it has the
following parameter:
close_time—Optional time to record as the closing time of this transaction. The default value of
close_time shall be 0.
If a recorder has not yet been closed (via a call to close [see 16.4.4.2]), close is automatically called and passed
the close_time. If the recorder has already been closed, the close_time is ignored.
16.4.4.4 is_open
233
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns True if this uvm_recorder was opened on its stream, but has not yet been closed.
16.4.4.5 get_open_time
16.4.4.6 is_closed
Returns True if this uvm_recorder was closed on its stream, but has not yet been freed.
16.4.4.7 get_close_time
16.4.5 Handles
16.4.5.1 get_handle
A value of 0 indicates the recorder has been freed and no longer has a valid ID.
16.4.5.2 get_recorder-from_handle
This static accessor returns a recorder reference for a given unique id.
If no recorder exists with the given id or if the recorder with that id has been freed, then null is returned.
This method can be used to access the recorder associated with a call to uvm_transaction::begin_tr (see
5.4.2.4) or uvm_component::begin_tr (see 13.1.7.3).
16.4.6.1 record_field
234
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Records an integral field (less than or equal to the value defined by `UVM_MAX_STREAMBITS [see B.6.2] bits);
it has the following parameters:
16.4.6.2 record_field_int
Records an integral field (less than or equal to 64 bits); it has the following parameters:
16.4.6.3 record_field_real
16.4.6.4 record_object
235
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
name—Is the name to use when recording the object. Note that this may be different then the value
returned by the object’s get_name method (see 5.3.4.2).
value—Is the value of the object to be recorded. null can be passed as a value.
This method triggers a do_record_object call (see 16.4.7.7).
Whether a non-null value is recursed depends on a variety of knobs, such as recursion_policy (see 16.4.2.1).
For objects that are being recursed, the following steps occur in order:
a) The object is pushed onto the active object stack via push_active_object (see 16.1.3.1).
b) The return value for object_recorded (see 16.4.7.8) when passed value and the current recursion
policy (see 16.4.2.1) is set to uvm_policy::STARTED.
c) The do_record_object method is called (see 16.4.7.7).
d) The return value for object_recorded when passed value and the current recursion policy is set to
uvm_policy::FINISHED.
e) The object is popped off of the active object stack via pop_active_object (see 16.1.3.2).
16.4.6.5 record_string
16.4.6.6 record_time
16.4.6.7 record_generic
236
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Records a name/value pair, where value has been converted to a string; it has the following parameters:
16.4.6.8 use_record_attribute
Indicates that this recorder does (or does not) support usage of the `uvm_record_attribute macro (see B.2.3.1).
The default return value is 0 (not supported). uvm_recorder can be extended (set its value to 1) to support
`uvm_record_attribute.
16.4.6.9 get_record_attribute_handle
This provides a tool-specific handle that is compatible with `uvm_record_attribute (see B.2.3.1).
By default, this method returns the same value as get_handle. Applications can override this method to provide
tool-specific handles to passed to the `uvm_record_attribute macro.
16.4.7.1 do_open
This is a callback triggered via uvm_tr_stream::open_recorder (see 7.2.5.1); it has the following parameters:
16.4.7.2 do_close
237
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This is a callback triggered via close (see 16.4.4.2); it has the following parameter:
The do_close callback can be used to specify the internal state within the recorder, as well as providing a
location to record any closing information.
16.4.7.3 do_free
The do_free callback can be used to release the internal state within the recorder, as well as providing a
location to record any “freeing” information.
16.4.7.4 do_record_field
Intended to record an integral field (less than or equal to the value defined by `UVM_MAX_STREAMBITS [see
B.6.2] bits).
16.4.7.5 do_record_field_int
16.4.7.6 do_record_field_real
238
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.4.7.7 do_record_object
a) The do_execute_op method (see 5.3.13) on the object is passed a uvm_field_op (see 5.7) with op_type
UVM_RECORD and policy set to this recorder.
b) If user_hook_enabled (see 5.7.2.7) returns 1, the recorder passes itself the do_record method (see
5.3.7.2) on the object; otherwise, the method returns without calling do_record_object.
16.4.7.8 object_recorded
Returns the current recursion state (see 16.1.4) for value and recursion within the recorder, as defined by
record_object (see 16.4.6.4). For objects that have never been passed to record_object, the return value shall
be uvm_policy::NEVER.
16.4.7.9 do_record_string
16.4.7.10 do_record_time
16.4.7.11 do_record_generic
239
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
string type_name
)
Intended to record a name/value pair, where value has been converted to a string.
16.5 uvm_packer
The uvm_packer class provides a policy object for packing and unpacking uvm_objects (see 5.3). The policies
determine how packing and unpacking shall be done.
16.5.2 Methods
16.5.2.1 new
Creates a new uvm_packer with the specified instance name. If name is not provided, the object is unnamed.
16.5.2.2 flush
The flush method resets the internal state of the packer. This includes clearing any data that has been
previously packed via a call to one of the packing methods (see 16.5.2.4).
16.5.2.3 get_type_name
16.5.2.4 set_default
Helper method for setting the default packer policy instance via uvm_coreservice_t::set_default_packer (see
F.4.1.4.14).
16.5.2.5 get_default
Helper method for retrieving the default packer policy instance via uvm_coreservice_t::get_default_packer
(see F.4.1.4.15).
240
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The state assignment methods set the internal state of the packer, such that the unpack methods can be used to
retrieve previously packed data. The stream argument is a bit, byte, int, or longint array of unspecified
length and format. Calling the state assignment methods with a stream that was not obtained from an identically
typed state retrieval method (see 16.5.3.2) of a compatible packer implementation is undefined. Packers are
considered compatible if their state retrieval methods return identical streams after packing identical fields.
The state retrieval methods copy the internal state of the packer to the stream argument, which is a bit, byte,
int, or longint array of unspecified length and format. The length and contents of the stream are
implementation dependent.
16.5.3.3 get_packed_size
Returns the current number of bits that can be unpacked from the packer.
16.5.4.1 pack_bits
Packs bits (value) from an unpacked array of bits. This method allows for fields of arbitrary length to be passed
in using the SystemVerilog stream operator.
An optional size parameter is provided, which defaults to -1. If set to any value greater than -1 (including 0),
the packer uses size as the number of bits to pack; otherwise, the packer simply packs the entire stream.
16.5.4.2 pack_object
241
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
For objects that are being packed, the following steps occur in order:
a) The object is pushed onto the active object stack via push_active_object (see 16.1.3.1).
b) The do_execute_op method (see 5.3.13) on the object is passed a uvm_field_op (see 5.7) with op_type
UVM_PACK and policy set to this packer.
c) If user_hook_enabled (see 5.7.2.7) returns 1, the packer passes itself to the do_pack method (see
5.3.10.2) on value.
d) The object is popped off of the active object stack via pop_active_object (see 16.1.3.2).
16.5.4.3 is_null
This method is used during unpack operations to determine if the object at the current location in the pack data
is null (whether to allocate a new object or not). If the object is null, the return value is a 1; otherwise, it is 0.
While is_null can be used to determine if an object in the packed data is null, it does not change the internal
state of the packer. As such, regardless of the return value of is_null, unpack_object (see 16.5.4.4), needs to be
called to move the packer’s internal state to the next field.
16.5.4.4 unpack_object
Unpacks an object and stores the result into value, which shall be an allocated object that has enough space for
the data being unpacked or is null.
Use is_null (see 16.5.4.3) to determine if the object shall be set to null before calling this method. It shall be an
error to pass a value argument that is incompatible with the return value of is_null, e.g., passing a null value
when is_null returns 0 or passing a non-null value when is_null returns 1. When this occurs, the packer shall
generate an error message and the resulting behavior of any further unpack_* calls on the packer is undefined.
For non-null objects which are being unpacked, the following steps occur in order:
a) The object is pushed onto the active object stack via push_active_object (see 16.1.3.1).
b) The do_execute_op method (see 5.3.13) on the object is passed a uvm_field_op (see 5.7) with op_type
UVM_UNPACK and policy set to this packer.
c) If user_hook_enabled (see 5.7.2.7) returns 1, the packer passes itself to the do_unpack method (see
5.3.11.2) on value.
d) The object is popped off of the active object stack via pop_active_object (see 16.1.3.2).
16.5.4.5 pack_string
16.5.4.6 pack_time
242
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
16.5.4.7 pack_real
16.5.4.8 pack_field
Packs an integral value into the packed array. size is the number of bits of value to pack. An error message shall
be generated if the size is larger than `UVM_MAX_STREAMBITS (see B.6.2).
16.5.4.9 pack_field_int
Packs an integral value into the pack array. size is the number of bits to pack. An error message shall be
generated if the size is larger that 64 bits.
NOTE—This optimized version of pack_field (see 16.5.4.8) is useful for sizes up to 64 bits.
16.5.4.10 pack_bytes
Packs bits from an unpacked array of bytes into the pack array. size represents the number of bits to pack from
the array. Setting size to -1 indicates that the entire array shall be packed. The default value of size shall be -1.
An implementation shall generate an error message if the size is less than -1 or greater than the total number of
bits within the array.
16.5.4.11 pack_ints
Packs bits from an unpacked array of ints into the pack array. size represents the number of bits to pack from
the array. Setting size to -1 indicates that the entire array shall be packed. The default value of size shall be -1.
243
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
An implementation shall generate an error message if the size is less than -1 or greater than the total number of
bits within the array.
16.5.4.12 unpack_ints
Unpacks bits from the pack array into an unpacked array of ints.
The unpacked array is unpacked from the internal pack array. This method allows for fields of arbitrary length
to be passed in without expanding into a predefined integral type first.
An optional size parameter is provided, which defaults to -1. If set to any value greater than -1 (including 0),
the packer uses size as the number of bits to unpack; otherwise, the packer simply unpacks the entire stream.
It shall be an error to specify a size that exceeds the size of the source array.
16.5.4.13 unpack_string
Unpacks a string.
16.5.4.14 unpack_time
16.5.4.15 unpack_real
16.5.4.16 unpack_field
Unpacks bits from the pack array and returns the bitstream that was unpacked. size is the number of bits to
unpack; the maximum is the value defined by `UVM_MAX_STREAMBITS (see B.6.2) bits.
16.5.4.17 unpack_field_int
Unpacks bits from the pack array and returns the bitstream that was unpacked.
244
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
size is the number of bits to unpack; the maximum is 64 bits. This is a more efficient variant than
unpack_field (see 16.5.4.16) when unpacking into smaller vectors.
16.5.4.18 unpack_bits
Unpacks bits from the pack array into an unpacked array of bits.
An optional size parameter is provided, which defaults to -1. If set to any value greater than -1 (including 0),
the packer uses size as the number of bits to unpack; otherwise, the packer simply unpacks the entire stream.
16.5.4.19 unpack_bytes
Unpacks bits from the pack array into an unpacked array of bytes.
An optional size parameter is provided, which defaults to -1. If set to any value greater than -1 (including 0),
the packer uses size as the number of bits to unpack; otherwise, the packer simply unpacks the entire stream.
16.6 uvm_copier
The uvm_copier class provides a policy object for copying uvm_objects (see 5.3). The policies determine how
copying should be done.
16.6.2 Methods
16.6.2.1 new
Creates a new uvm_copier with the specified instance name. If name is not provided, the object is unnamed.
16.6.2.2 get_type_name
16.6.2.3 set_default
245
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Helper method for setting the default copier policy instance via uvm_coreservice_t::set_default_copier (see
F.4.1.4.18).
16.6.2.4 get_default
Helper method for retrieving the default copier policy instance via uvm_coreservice_t::get_default_copier
(see F.4.1.4.19).
The following methods define values that may be used in do_copy (see 5.3.8.2) or do_execute_op (see 5.3.13)
to control how fields are copied within an object:
Recursion policy
Controls the recursion policy to use for object fields during do_copy (see 5.3.8.2) or do_execute_op (see
5.3.13).
UVM_DEEP—Copy all fields of rhs to lhs, doing a “deep” copy [any object fields are copied using a
DEEP recursion, i.e., copier.copy_object(tgt, src)].
UVM_SHALLOW—Copy all fields of rhs to lhs, using a “shallow” copy (any object fields are copied as
REFERENCES, i.e., tgt = src).
UVM_REFERENCE—Copy the rhs to lhs as a reference.
If set_recursion_policy has not been called since the copier was constructed or since the last call to flush (see
16.2.4.2), then get_recursion_policy shall return UVM_DEFAULT_POLICY.
16.6.4.1 copy_object
Copies the fields of rhs to lhs using the recursion policy (see 16.6.3) to determine whether the copy should be
deep or shallow. Objects that are meant to be copied by reference shall use an assignment operation.
Unlike other policies, the copier relies on do_copy (see 5.3.8.2) and do_execute_op (see 5.3.13) to process
copies via direct assignment when the recursion policy is set to UVM_REFERENCE. The copier shall generate an
error message if copy_object is called when the recursion policy is set to UVM_REFERENCE, and the result of
the copy_object operation is undefined.
246
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
For objects that are being copied, the following steps occur in order:
a) The object is pushed onto the active object stack via push_active_object (see 16.1.3.1).
b) The return value for object_copied (see 16.6.4.2) when passed lhs, rhs, and the current recursion
policy (see 16.6.3) is set to uvm_policy::STARTED.
c) The do_execute_op method (see 5.3.13) on the object is passed a uvm_field_op (see 5.7) with op_type
UVM_COPY and policy set to this copier.
d) If user_hook_enabled (see 5.7.2.7) returns 1, the copier passes itself and the rhs to the do_copy
method (see 5.3.8.2) on lhs; otherwise, the method returns without calling do_copy.
e) The return value for object_copied (see 16.6.4.2) when passed lhs, rhs, and the current recursion
policy (see 16.6.3) is set to uvm_policy::FINISHED.
f) The object is popped off of the active object stack via pop_active_object (see 16.1.3.2).
16.6.4.2 object_copied
Returns the current recursion state (see 16.1.4) for lhs, rhs, and recursion within the copier, as defined by
copy_object (see 16.6.4.1). For objects that have never been passed to copy_object, the return value shall be
uvm_policy::NEVER.
The values passed to lhs and rhs need to be passed to object_copied using the same ordering as copy_object.
17.1 Overview
The UVM register layer defines base classes that, when properly extended, abstract the read/write operations to
registers and memories in a design under test (DUT).
This subclause defines the globally available types, enums, and utility classes.
17.2.1 Types
17.2.1.1 uvm_reg_data_t
17.2.1.2 uvm_reg_data_logic_t
247
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
17.2.1.3 uvm_reg_addr_t
17.2.1.4 uvm_reg_addr_logic_t
17.2.1.5 uvm_reg_byte_en_t
17.2.1.6 uvm_reg_cvr_t
Symbolic values for individual coverage models are defined by the uvm_coverage_model_e type (see
17.2.2.9).
Bits
0-7 Reserved.
8-15 Coverage models defined by applications, implemented in a register model
generator.
16-23 User-defined coverage models.
24-`UVM_REG_CVR_ WIDTH-1 Reserved.
17.2.1.7 uvm_hdl_path_slice
This is a struct that specifies the HDL variable corresponding to all of or a portion of a register; it has the
following parameters:
17.2.2 Enumerations
17.2.2.1 uvm_status_e
Return status for register operations; it has the following enumerated types:
UVM_IS_OK—Operation completed successfully.
248
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
17.2.2.2 uvm_door_e
Door used for register operation; it has the following enumerated types:
17.2.2.3 uvm_check_e
UVM_NO_CHECK—Read only.
UVM_CHECK—Read and check.
17.2.2.4 uvm_endianness_e
17.2.2.5 uvm_elem_kind_e
Type of element being read or written; it has the following enumerated types:
UVM_REG—Register.
UVM_FIELD—Field.
UVM_MEM—Memory location.
17.2.2.6 uvm_access_e
UVM_READ—Read operation.
UVM_WRITE—Write operation.
17.2.2.7 uvm_hier_e
Whether to provide the requested information from a hierarchical context; it has the following enumerated
types:
249
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
17.2.2.8 uvm_predict_e
17.2.2.9 uvm_coverage_model_e
UVM_NO_COVERAGE—None.
17.2.2.10 uvm_reg_mem_tests_e
Selects which predefined test sequence to execute; it has the following parameters:
17.2.3 uvm_hdl_path_concat
17.2.3.1 Overview
This class contains a dynamic array of uvm_hdl_path_slice that specifies a concatenation of the HDL variables
that implement a register.
The slices shall be specified in most-to-least significant order. The slices shall not overlap. Gaps may exist in
the concatenation array if portions of the register are not implemented.
If the register is implemented using a single HDL variable, then the array shall contain a single slice with its
offset and size set to -1.
250
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
class uvm_hdl_path_concat
17.2.3.3 Methods
17.2.3.3.1 New
Creates a new instance of this class with the specified instance name. If name is not provided, the instance is
unnamed.
17.2.3.3.2 set_slices
Initializes the array of slices to t. t shall conform to the restrictions listed in 17.2.3.1.
17.2.3.3.3 get_slices
17.2.3.3.4 add_slice
Appends slice to the array of slices. slice shall conform to the restrictions listed in 17.2.3.1.
18.1 uvm_reg_block
A block represents a design hierarchy. It can contain registers, register files, memories, and sub-blocks. A block
has one or more address maps, each corresponding to a physical interface on the block.
18.1.2 Methods
18.1.2.1 new
function new(
string name = "",
251
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This creates an instance of a block abstraction class with the specified name.
has_coverage specifies which functional coverage models are present in the extension of the block abstraction
class. Multiple functional coverage models may be specified by adding their symbolic names, as defined by the
uvm_coverage_model_e type (see 17.2.2.9). The default value of has_coverage shall be UVM_NO_COVERAGE.
18.1.2.2 configure
This is an instance-specific configuration; it specifies the parent block of this block. A block without parent is a
root block.
If the block file corresponds to a hierarchical register transfer level (RTL) structure, its contribution to the HDL
path is specified as the hdl_path. Otherwise, the block does not correspond to a hierarchical RTL structure (i.e.,
it is physically flattened) and does not contribute to the hierarchical HDL path of any contained registers or
memories.
18.1.2.3 create_map
This creates an address map with the specified name, then configures it with the following properties:
a) base_addr—The base address for the map. All registers, memories, and sub-blocks within the map will
be at offsets to this address.
b) n_bytes—The byte-width of the bus on which this map is used.
c) endian—The endian format. See uvm_endianness_e for possible values (17.2.2.4).
d) byte_addressing—Indicates whether consecutive elements in the map are indexed in units of bytes or in
units of words (where a word is n_bytes). When TRUE (default), addresses within the map are byte
aligned, i.e., address 0x1 is one byte greater than address 0x0. When FALSE, addresses within the map
are word aligned, i.e., address 0x1 is n_bytes greater than address 0x0.
18.1.2.4 set_default_map
This makes the specified address map the default mapping for this block. The address map needs to be a map of
this address block.
252
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.1.2.5 get_default_map
This returns the default address map for this block. If create_map (see 18.1.2.3) has never been called, this
returns null. If set_default_map (see 18.1.2.4) has been called, this returns the value set in the most recent call.
Otherwise, this returns the map created in the first call to create_map.
18.1.2.6 lock_model
This recursively locks an entire register model and builds the address maps to enable the
uvm_reg_map::get_reg_by_offset (see 18.2.4.17) and uvm_reg_map::get_mem_by_offset (see 18.2.4.18)
methods.
When locked, no structural changes, such as adding registers or memories, can be made. Hence, it is important
that all sub-blocks, maps, and registers have been created before the lock_model is called.
18.1.2.7 unlock_model
Unlocks the register model, bringing the register mode to the state before lock_model (see 18.1.2.6), such that
structural changes are allowed again.
This invalidates all precomputed information derived in a previous call to lock_model, as well as any
information that has been cached since the last call to lock_model.
18.1.2.8 set_lock
Sets the lock mode to v for the current register block and all its sub-blocks.
18.1.2.9 wait_for_lock
task wait_for_lock()
18.1.2.10 is_locked
18.1.2.11 unregister
Removes all knowledge of map m from the current block and, therefore, all registers, memories, and virtual
registers contained in m from the current block.
253
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.1.3 Introspection
18.1.3.1 get_parent
18.1.3.2 get_root_blocks
This returns an array of all root blocks in the simulation. blks shall be a queue.
18.1.3.3 find_blocks
Finds the blocks whose hierarchical names match the specified name glob. If a root block is specified, the name
of the blocks are relative to that block; otherwise, they are absolute. blks shall be a queue.
18.1.3.4 find_block
Finds the first block whose hierarchical names match the specified name glob. If a root block is specified, the
name of the blocks are relative to that block; otherwise, they are absolute.
This returns the first block found or null otherwise. A warning shall be issued if more than one block is found.
18.1.3.5 get_blocks
Returns the sub-blocks instantiated in these blocks. If hier is UVM_HIER, recursively includes any sub-blocks.
The default value of hier shall be UVM_HIER. blks shall be a queue.
254
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.1.3.6 get_maps
Returns the address maps instantiated in this block. maps shall be a queue.
18.1.3.7 get_registers
Returns the registers instantiated in this block. If hier is TRUE, recursively includes the registers in the sub-
blocks. The default value of hier shall be UVM_HIER. regs shall be a queue.
Note that registers may be located in different and/or multiple address maps. To find the registers in a specific
address map, use the uvm_reg_map::get_registers method (see 18.2.4.11).
18.1.3.8 get_fields
Returns the fields in the registers instantiated in this block. If hier is TRUE, recursively includes the fields of the
registers in the sub-blocks. The default value of hier shall be UVM_HIER. fields shall be a queue.
18.1.3.9 get_memories
Returns the memories instantiated in this block. If hier is TRUE, recursively includes the memories in the sub-
blocks. The default value of hier shall be UVM_HIER. mems shall be a queue.
Note that memories may be located in different and/or multiple address maps. To find the memories in a
specific address map, use the uvm_reg_map::get_memories method (see 18.2.4.13).
18.1.3.10 get_virtual_registers
Returns the virtual registers instantiated in this block. If hier is TRUE, recursively includes the virtual registers
in the sub-blocks. The default value of hier shall be UVM_HIER. regs shall be a queue.
255
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.1.3.11 get_virtual_fields
Returns the virtual fields from the virtual registers instantiated in this block. If hier is TRUE, recursively
includes the virtual fields in the virtual registers in the sub-blocks. The default value of hier shall be UVM_HIER.
fields shall be a queue.
18.1.3.12 get_block_by_name
The name is the simple name of the block, not a hierarchical name relative to this block. If no block with that
name is found in this block, the sub-blocks are searched for a block of that name and the first one to be found is
returned.
18.1.3.13 get_map_by_name
The name is the simple name of the address map, not a hierarchical name relative to this block. If no map with
that name is found in this block, the sub-blocks are searched for a map of that name and the first one to be found
is returned.
18.1.3.14 get_reg_by_name
The name is the simple name of the register, not a hierarchical name relative to this block. If no register with that
name is found in this block, the sub-blocks are searched for a register of that name and the first one to be found is
returned.
18.1.3.15 get_field_by_name
256
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The name is the simple name of the field, not a hierarchical name relative to this block. If no field with that
name is found in this block, the sub-blocks are searched for a field of that name and the first one to be found is
returned.
18.1.3.16 get_mem_by_name
The name is the simple name of the memory, not a hierarchical name relative to this block. If no memory with
that name is found in this block, the sub-blocks are searched for a memory of that name and the first one to be
found is returned.
18.1.3.17 get_vreg_by_name
The name is the simple name of the virtual register, not a hierarchical name relative to this block. If no virtual
register with that name is found in this block, the sub-blocks are searched for a virtual register of that name and
the first one to be found is returned.
18.1.3.18 get_vfield_by_name
The name is the simple name of the virtual field, not a hierarchical name relative to this block. If no virtual field
with that name is found in this block, the sub-blocks are searched for a virtual field of that name and the first one
to be found is returned.
18.1.4 Coverage
18.1.4.1 build_coverage
Checks if all of the specified coverage model needs to be built in this instance of the block abstraction class, as
specified by calls to uvm_reg::include_coverage (see 18.4.7.1).
models are specified by adding the symbolic value of individual coverage models as defined in 17.2.2.9. This
returns the sum of all coverage models to be built in the block model.
257
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.1.4.2 add_coverage
Adds the specified coverage model to the coverage models available in this class. models are specified by
adding the symbolic value of individual coverage model as defined in 17.2.2.9.
This method shall be only called in the constructor of subsequently derived classes.
18.1.4.3 has_coverage
This returns TRUE if the block abstraction class contains a coverage model for all of the models specified.
models are specified by adding the symbolic value of individual coverage model as defined in 17.2.2.9.
18.1.4.4 get_coverage
This returns TRUE if measurement for all of the specified functional coverage models are currently on. Multiple
functional coverage models can be specified by adding the functional coverage model identifiers. The default
value of is_on shall be UVM_CVR_ALL.
18.1.4.5 set_coverage
Turns the collection of functional coverage measurements on or off for this block and all blocks, registers,
fields, and memories within it. The functional coverage measurement is turned on for every coverage model
specified using uvm_coverage_model_e symbolic identifiers (see 17.2.2.9). Multiple functional coverage
models can be specified by adding the functional coverage model identifiers. All other functional coverage
models are turned off.
This returns the sum of all functional coverage models whose measurements were previously on.
This method can only control the measurement of functional coverage models that are present in the various
abstraction classes, then enabled during construction. See 18.1.4.3 to identify the available functional coverage
models.
18.1.4.6 sample
258
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
bit is_read,
uvm_reg_map map
)
This is a functional coverage sampling method; it is invoked by the block abstraction class whenever an address
within one of its address maps is successfully read or written. The specified offset is the offset within the block,
not an absolute address. Offset is in units returned by get_addr_unit_bytes() (see 18.2.4.6).
Empty by default, this method may be extended by the abstraction class generator to perform the required
sampling in any provided functional coverage model.
18.1.4.7 sample_values
This is a functional coverage sampling method for field values; it is invoked by the user or by the
uvm_reg_block::sample_values method of the parent block to trigger the sampling of the current field
values in the block-level functional coverage model. It also recursively invokes the
uvm_reg_block::sample_values and uvm_reg::sample_values methods (see 18.4.7.8) in the blocks and
registers within this block.
This method may be extended by the abstraction class generator to perform the required sampling in any
provided field-value functional coverage model. If this method is extended, it shall call
super.sample_values.
18.1.5 Access
18.1.5.1 get_default_door
This returns the default door for this block (UVM_FRONTDOOR or UVM_BACKDOOR), see 17.2.2.2.
18.1.5.2 set_default_door
18.1.5.3 reset
This clears all access semaphores and sets the mirror value of all registers in the block and sub-blocks to the
reset value corresponding to the specified reset event. See 18.5.5.4 for more details.
This does not actually set the value of the registers in the design, only the values mirrored in their
corresponding mirror. The default value of kind shall be "HARD".
18.1.5.4 needs_update
259
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This method returns TRUE if the uvm_reg::needs_update (see 18.4.4.4) method for at least one register in the
block or sub-blocks returns TRUE. Otherwise, FALSE is returned.
The mirror values, or actual content of registers, are not modified. Use uvm_reg_block::update (see 18.1.5.5)
to actually update the DUT registers. For additional information, see 18.5.5.8.
18.1.5.5 update
This updates all of the design registers in this block and its sub-blocks with the desired value using the
minimum number of write operations. The accesses may be performed using frontdoor or backdoor operations
(see 18.4.4.13).
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
18.1.5.6 mirror
This reads all of the registers in this block and its sub-blocks and updates their mirror values to match the
corresponding values in the design. If check is set to UVM_CHECK (see 17.2.2.3), an error message shall be
generated when the current mirrored value does not match the actual value in the design.
The accesses may be performed using frontdoor or backdoor operations (see 18.4.4.14).
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
260
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.1.5.7 Others
Interaction with the DUT can be accomplished through both the front door and the back door. A frontdoor
operation employs the bus interface (bus driver) in order to access a register or memory in the DUT, whereas a
backdoor access operation is performed by directly interacting with the hardware representation of the object in
the DUT without using the bus interface.
18.1.6.1 Kinds
Backdoor access to a register or memory in the DUT requires knowledge of the DUT’s representational model
in addition to the (hierarchical) path to the object in the DUT. The entire DUT may have a single
representational model (i.e., RTL), or more than one representational model (RTL, gate-level, C, etc.) may be
used to represent different parts of the DUT. The backdoor API allows the specification of one or more kinds of
backdoor path representation when accessing an object in the DUT.
The kind argument in the backdoor API refers to the type or kind of backdoor path of the UVM object in the
DUT. The string value of this argument is entirely arbitrary. It is therefore possible to record and refer to more
than one kind of backdoor path for the same register or memory object.
See 19.6 for the UVM default DPI implementation of the backdoor access mechanism.
18.1.6.2 get_backdoor
This returns the user-defined back door for all registers in this block and all sub-blocks—unless it is overridden
by a back door specified in a lower-level block or in the register itself.
If inherited is TRUE, and no back door has been specified for this block, and a parent block has been specified,
then this returns the value of the get_backdoor (inherited) from the parent block. The default value of inherited
shall be 1, which is TRUE.
18.1.6.3 set_backdoor
This defines the backdoor mechanism for all registers instantiated in this block and sub-blocks, unless
overridden by a definition in a lower-level block or register. The filename (fname) and line number (lineno)
arguments are available for an implementation to use for debug purposes only; their value shall have no
functional effect on the outcome of this method. The default value of lineno shall be 0.
18.1.6.4 clear_hdl_path
This removes any previously specified HDL path to the block instance for the specified design abstraction kind.
261
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
kind refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1). The default
value of kind shall be "RTL".
18.1.6.5 add_hdl_path
This adds the specified HDL path to the block instance for the specified design abstraction kind. This method
may be called more than once for the same design abstraction if the block is physically duplicated in the design
abstraction.
kind refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1). The default
value of kind shall be "RTL".
18.1.6.6 has_hdl_path
This returns TRUE if the block instance has a HDL path defined for the specified design abstraction kind. If no
design abstraction is specified, it uses the default design abstraction specified for this block or the nearest block
ancestor with a specified default design abstraction.
kind refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
18.1.6.7 get_hdl_path
This returns the HDL path(s) defined for the specified design abstraction, kind, in the block instance. It returns
only the component of the HDL paths that corresponds to the block, not a full hierarchical path. paths shall be a
queue. kind refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
If no design abstraction is specified, the default design abstraction for this block is used.
18.1.6.8 get_full_hdl_path
This returns the full hierarchical HDL path(s) defined for the specified design abstraction, kind, in the block
instance. There may be more than one path returned when any of the parent components have more than one
path defined for the same design abstraction, even if only one path was defined for the block instance. paths
shall be a queue. The separator is used in the concatenation of path segments to form the full path, e.g.,
{segment1, separator, segment2}. The default value for separator shall be “.”. kind refers to the type of
underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
262
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If no design abstraction is specified for the current block, then it is determined via the default design abstraction
(see 18.1.6.9).
18.1.6.9 get_default_hdl_path
This returns the default design abstraction for this block instance. If a default design abstraction has not been
explicitly specified for this block instance, it returns the default design abstraction for the nearest block
ancestor. This returns the string "RTL" if no default design abstraction has been specified.
18.1.6.10 set_default_hdl_path
Specifies the default design abstraction, kind, for this block instance. kind refers to the type of underlying
backdoor path of the UVM object in the DUT (see 18.1.6.1).
18.1.6.11 set_hdl_path_root
This sets the specified path as the absolute HDL path to the block instance for the specified design abstraction
kind. This absolute root path is prepended to all hierarchical paths under this block. The HDL path of any
ancestor block is ignored. This method overrides any incremental path for the same design abstraction specified
using add_hdl_path (see 18.1.6.5). The default value of kind shall be "RTL".
kind refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
18.1.6.12 is_hdl_path_root
This returns TRUE if an absolute HDL path to the block instance for the specified design abstraction, kind, has
been defined. If no design abstraction is specified, the default design abstraction for this block is used.
kind refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
18.2 uvm_reg_map
This class represents an address map. An address map is a collection of registers and memories accessible via a
specific physical interface. Address maps can be composed into higher-level address maps.
Address maps are created using the uvm_reg_block::create_map method (see 18.1.2.3).
263
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
backdoor
static function uvm_reg_map backdoor()
This pseudo-map is used to specify or configure the back door instead of a real address map.
18.2.3 Methods
18.2.3.1 new
18.2.3.2 configure
18.2.3.3 add_reg
264
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The register is located at the specified address offset from this map’s configured base address, and is in units
returned by get_addr_unit_bytes() (see 18.2.4.6). If byte_addressing (see 18.2.3.2) is TRUE, then this offset is
byte aligned; otherwise, the offset is word aligned.
The rights specify the register’s accessibility via this map. Valid values are “RW”, “RO”, and “WO”.
Whether a register field can be read or written depends on both the field’s configured access policy (see 18.4.4)
and the register’s rights in the map being used to access the field. The default value of rights shall be "RW".
The number of consecutive physical addresses occupied by the register depends on the width of the register and
the number of bytes in the physical interface corresponding to this address map.
If unmapped is True, the register does not occupy any physical addresses and the base address is ignored.
Unmapped registers require a user-defined front door to be specified. The default value of unmapped shall be 0,
which is FALSE.
A register may be added to multiple address maps if it is accessible from multiple physical interfaces. A register
may only be added to an address map whose parent block is the same as the register’s parent block.
18.2.3.4 add_mem
The memory is located at the specified base address, offset, which is in units returned by get_addr_unit_bytes()
(see 18.2.4.6). If byte_addressing (see 18.2.3.2) is TRUE, then this offset is byte aligned; otherwise, the offset
is word aligned.
The memory has the specified access rights (valid values are “RW”, “RO”, and “WO”). The default value of
rights shall be "RW".
The number of consecutive physical addresses occupied by the memory depends on the width and size of the
memory and the number of bytes in the physical interface corresponding to this address map.
If unmapped is True, the memory does not occupy any physical addresses and the base address is ignored.
Unmapped memories require a user-defined front door to be specified. The default value of unmapped shall be
0, which is FALSE.
A memory may be added to multiple address maps if it is accessible from multiple physical interfaces. A
memory may only be added to an address map whose parent block is the same as the memory’s parent block.
18.2.3.5 add_submap
265
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Adds the specified address map instance to this address map. The address map is located at the specified base
address. The number of consecutive physical addresses occupied by the submap depends on the number of
bytes in the physical interface that corresponds to the submap, the number of addresses used in the submap, and
the number of bytes in the physical interface corresponding to this address map.
18.2.3.6 set_sequencer
Specifies the sequencer and adapter associated with this map. This method needs to be called before starting any
sequences based on uvm_reg_sequence (see 19.4.1).
18.2.3.7 get_submap_offset
Returns the offset of the given submap. If the submap does not exist, or if the handle to the submap is null, this
generates an error and returns -1.
18.2.3.8 set_submap_offset
Specifies the offset of the given submap as offset, which is in units returned by get_addr_unit_bytes() (see
18.2.4.6).
18.2.3.9 set_base_addr
Specifies the base address of this map as offset, which is in units returned by get_addr_unit_bytes() (see
18.2.4.6).
18.2.3.10 reset
Sets the mirror value of all registers in this address map and all of its submaps to the reset value corresponding
to the specified reset event. See 18.5.5.4 for more details.
This does not actually set the value of the registers in the design, only the values mirrored in their
corresponding mirror.
Note that, unlike the other reset method (see 18.5.5.4), the default reset event for this method is “SOFT”.
266
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.2.3.11 unregister
Disassociates all content (registers, memories, virtual registers, submaps, etc.) from this map.
18.2.3.12 clone_and_update
Clones the current map into a new map instance. In contrast to the source map, the new map has the rights for
the content set to rights.
18.2.4 Introspection
18.2.4.1 get_root_map
Returns the top-most address map where this address map is instantiated, which corresponds to the externally
visible address map that can be accessed by the verification environment.
18.2.4.2 get_parent
This returns the block that is the parent of this address map.
18.2.4.3 get_parent_map
This returns the address map in which this address map is mapped. This returns null if this is a top-level address
map.
18.2.4.4 get_base_addrr
Returns the base offset address for this map. If this map is the root map, the base address is that set with the
base_addr argument to uvm_reg_block::create_map (see 18.1.2.3). If this map is a submap of a higher-level
map, the base address is submap offset added to the parent map base address. See 18.2.3.7. The default value of
hier shall be UVM_HIER.
18.2.4.5 get_n_bytes
Returns the width in bytes of the bus associated with this map. If hier is UVM_HIER, this retrieves the effective
bus width relative to the system level. The effective bus width is the narrowest bus width from this map to the
top-level root map. Each bus access is limited to this bus width. The default value of hier shall be UVM_HIER.
267
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.2.4.6 get_addr_unit_bytes
Returns the number of bytes in the smallest addressable unit in the map. Returns 1 if the address map was
configured using byte-level addressing. Returns get_n_bytes otherwise (see 18.2.4.5).
18.2.4.7 get_endian
Returns the endianness (see 17.2.2.4) of the bus associated with this map. If hier is set to UVM_HIER (see
17.2.2.7), returns the system-level endianness.
18.2.4.8 get_sequencer
Returns the sequencer for the bus associated with this map. If hier is set to UVM_HIER, this returns the
sequencer for the bus at the system-level. The default value of hier shall be UVM_HIER. See 18.2.3.6.
18.2.4.9 get_adapter
Returns the bus adapter for the bus associated with this map. If hier is set to UVM_HIER, this returns the adapter
for the bus used at the system level. The default value of hier shall be UVM_HIER. See 18.2.3.6.
18.2.4.10 get_submaps
Returns the address sub-maps instantiated in this address map. If hier is UVM_HIER, this recursively includes
the address maps in the sub-maps. maps shall be a queue. The default value of hier shall be UVM_HIER.
18.2.4.11 get_registers
Returns the registers instantiated in this address map. If hier is UVM_HIER, this recursively includes the registers
in the sub-maps. regs shall be a queue. The default value of hier shall be UVM_HIER.
18.2.4.12 get_fields
268
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns the fields in the registers instantiated in this address map. If hier is UVM_HIER, this recursively includes
the fields of the registers in the sub-maps. The default value of hier shall be UVM_HIER. fields shall be a queue.
18.2.4.13 get_memories
Returns the memories instantiated in this address map. If hier is UVM_HIER, recursively includes the memories
in the sub-maps. The default value of hier shall be UVM_HIER. mems shall be a queue.
18.2.4.14 get_virtual_registers
Returns the virtual registers instantiated in this address map. If hier is UVM_HIER, this recursively includes the
virtual registers in the sub-maps. The default value of hier shall be UVM_HIER. regs shall be a queue.
18.2.4.15 get_virtual_fields
Returns the virtual fields instantiated in this address map. If hier is UVM_HIER, this recursively includes the
virtual fields in the sub-maps. The default value of hier shall be UVM_HIER. fields shall be a queue.
18.2.4.16 get_physical_addresses
This identifies the sequence of addresses that need to be accessed physically to access the specified number of
bytes at the specified address within this address map. This returns the number of bytes of valid data in each
access.
The return in addr is a list of address in little endian order, with the granularity of the top-level address map. A
register is specified using a base address with a mem_offset of 0. A location within a memory is specified using
the base address of the memory and the index of the location within that memory. base_addr is in units returned
269
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
by get_add_unit_bytes() (see 18.2.4.6). n_bytes is the number of bytes being accessed. For a memory object,
mem_offset is the index of an entry in the memory, where the first entry is at mem_offset 0, the next entry is at
mem_offset 1, etc.
18.2.4.17 get_reg_by_offset
Returns the register mapped at offset, which is in units returned by get_add_unit_bytes() (see 18.2.4.6).
This identifies the register located at the specified offset within this address map for the specified type of
access. This returns null if no such register is found. The default value of read shall be 1.
The model needs to be locked using uvm_reg_block::lock_model (see 18.1.2.6) to enable this functionality.
18.2.4.18 get_mem_by_offset
Returns the memory mapped at offset, which is in units returned by get_add_unit_bytes() (see 18.2.4.6).
This identifies the memory located at the specified offset within this address map. The offset may refer to any
memory location in that memory. This returns null if no such memory is found.
The model needs to be locked using uvm_reg_block::lock_model (see 18.1.2.6) to enable this functionality.
18.2.5.1 get_auto_predict
18.2.5.2 set_auto_predict
When on is 1, the register model automatically updates its mirror (what it thinks should be in the DUT)
immediately after any bus read or write operation via this map. Before a uvm_reg::write (see 18.4.4.9) or
uvm_reg::read operation (see 18.4.4.10) returns, the register’s uvm_reg::predict method (see 18.4.4.15) is
called to update the mirrored value in the register. The default value of on shall be 1, which is TRUE.
When on is False (the default), bus reads and writes via this map do not automatically update the mirror. For
real-time updates to the mirror in this mode, connect a uvm_reg_predictor instance (see 19.3) to the bus
monitor. The predictor takes observed bus transactions from the bus monitor, looks up the associated uvm_reg
register (see 18.4) given the address, then calls that register’s uvm_reg::predict method (see 18.4.4.15). While
more complex, this mode captures all register read/write activity, including any not directly descendant from
calls to uvm_reg::write (see 18.4.4.9) and uvm_reg::read (see 18.4.4.10).
270
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.2.5.3 set_check_on_read
Specifies the check-on-read mode for this map and all of its submaps.
When on is 1, the register model automatically checks any value read back from a register or field against the
current value in its mirror and report any discrepancy. This effectively combines the functionality of the
uvm_reg::read (see 18.4.4.10) and uvm_reg::mirror(UVM_CHECK) (see 18.4.4.14) methods. This mode is
useful when the register model is used passively. The default value of on shall be 1, which is TRUE.
When on is False (the default), no check is made against the mirrored value.
At the end of the read operation, the mirror value is updated based on the value that was read regardless of this
mode setting.
18.2.5.4 get_transaction_order_policy
18.2.5.5 set_transaction_order_policy
18.3 uvm_reg_file
A register file is a collection of register files and registers used to create regular repeated structures.
18.3.2 Methods
18.3.2.1 new
Creates a new instance of a register file abstraction class with the specified name.
18.3.2.2 configure
271
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This specifies the parent block and register file of the register file instance. If the register file is instantiated in a
block, regfile_parent is specified as null. If the register file is instantiated in a register file, blk_parent shall be
the block parent of that register file and regfile_parent is specified as that register file.
If the register file corresponds to a hierarchical RTL structure, its contribution to the HDL path is specified as
the hdl_path. Otherwise, the register file does not correspond to a hierarchical RTL structure (i.e., it is
physically flattened) and does not contribute to the hierarchical HDL path of any contained registers.
18.3.3 Introspection
18.3.3.1 get_parent
18.3.3.2 get_regfile
18.3.4.1 clear_hdl_path
This removes any previously specified HDL paths to the register file instance for the specified design
abstraction. The default value of kind shall be "RTL".
18.3.4.2 add_hdl_path
This adds the specified HDL path to the register file instance for the specified design abstraction. This method
may be called more than once for the same design abstraction if the register file is physically duplicated in the
design abstraction. The default value of kind shall be "RTL".
18.3.4.3 has_hdl_path
272
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This returns TRUE if the register file instance has a HDL path defined for the specified design abstraction. If no
design abstraction is specified, it uses the default design abstraction specified for the nearest enclosing register
file or block.
18.3.4.4 get_hdl_path
This returns the HDL path(s) defined for the specified design abstraction in the register file instance. If no
design abstraction is specified, it uses the default design abstraction specified for the nearest enclosing register
file or block. Only the component of the HDL paths that corresponds to the register file is returned, not a full
hierarchical path. paths shall be a queue.
18.3.4.5 get_full_hdl_path
This returns the full hierarchical HDL path(s) defined for the specified design abstraction in the register file
instance. If no design abstraction is specified, it uses the default design abstraction specified for the nearest
enclosing register file or block. If any of the parent components have more than one path defined for the same
design abstraction, there may be more than one path returned, even if only one path was defined for the register
file instance. paths shall be a queue.
18.3.4.6 get_default_hdl_path
This returns the default design abstraction for this register file instance. If a default design abstraction has not
been explicitly specified for this register file instance, it returns the default design abstraction for the nearest
register file or block ancestor. The default is "RTL".
18.3.4.7 set_default_hdl_path
Specifies the default design abstraction for this register file instance.
18.4 uvm_reg
A register represents a set of fields that are accessible as a single entity. A register may be mapped to one or
more address maps, each with different access rights and policy.
273
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.4.2 Methods
18.4.2.1 new
function new (
string name = "",
int unsigned n_bits,
int has_coverage
)
This creates an instance of a register abstraction class with the specified name.
n_bits specifies the total number of bits in the register. Not all bits need to be implemented.
has_coverage specifies which functional coverage models are present in the extension of the register
abstraction class. Multiple functional coverage models may be specified by adding their symbolic names, as
defined by the uvm_coverage_model_e type (see 17.2.2.9).
18.4.2.2 configure
This is an instance-specific configuration. It specifies the parent block of this register. This may also set a
parent register file for this register.
If the register is implemented in a single HDL variable, its name is specified as the hdl_path. Otherwise, if the
register is implemented as a concatenation of variables (usually one per field), then the HDL path shall be
specified using the add_hdl_path (see 18.4.6.4) or add_hdl_path_slice (see 18.4.6.5) methods.
18.4.2.3 set_offset
This function modifies the offset, in units returned by get_add_unit_bytes() (see 18.2.4.6), of this register in a
given address map. The offset of a register within an address map is set using the uvm_reg_map::add_reg
method (see 18.2.3.3). This method is used to modify that offset dynamically. Modifying the offset of a register
shall make the register model diverge from the specification that was used to create it.
The affected map is the map returned from calling get_local_map (see 18.4.3.6) and passing map. The offset
and unmapped arguments are treated as if they had been passed to add_reg (see 18.2.3.3) of the affected map.
The default value of unmapped shall be 0.
274
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.4.2.4 uvm_reg_transaction_order_policy
order
The order function may reorder the sequence of bus transactions produced by a single uvm_reg transaction
(read/write) (see 18.4.4). This can be used in scenarios when the register width differs from the bus width and
one register access results in a series of bus transactions. q shall be a queue.
The first item (0) of the queue is the first bus transaction; the last item ($) is the final transaction.
18.4.2.5 unregister
Removes the association that the current register instance resides in map.
18.4.3 Introspection
18.4.3.1 get_parent
18.4.3.2 get_regfile
18.4.3.3 get_n_maps
18.4.3.4 is_in_map
18.4.3.5 get_maps
Returns all of the address maps where this register is mapped. maps shall be a queue.
275
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.4.3.6 get_local_map
Returns the local map associated with the map argument, if any. If map is null, it returns the default map of the
parent block. If map is one of the maps in the queue produced by get_maps (see 18.4.3.5), it returns map. If
map contains one of the maps in the queue produced by get_maps, it returns that contained map. If none of
those conditions are true, it returns null.
18.4.3.7 get_rights
Returns the accessibility (“RW”, “RO”, or “WO”) of this register in the given map.
If map is null and the register is mapped in only one address map, that address map is used. If map is null and
the register is mapped in more than one address map, the default address map of the parent block is used.
Whether a register field can be read or written depends on both the field’s configured access policy (see
18.5.4.6) and the register’s accessibility rights in the map being used to access the field.
If an address map is specified and the register is not mapped in the specified address map, an error message
shall be generated and "RW" is returned.
18.4.3.8 get_n_bits
18.4.3.9 get_n_bytes
Returns the width, in bytes, of this register. Rounds up to next whole byte if the register is not a multiple of 8.
18.4.3.10 get_max_size
18.4.3.11 get_fields
Fills the specified array with the abstraction class for all of the fields contained in this register. Fields are
ordered from least-significant position to most-significant position within the register. fields shall be a queue.
18.4.3.12 get_field_by_name
276
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Finds a field with the specified name in this register and returns its abstraction class. If no fields are found, this
returns null.
18.4.3.13 get_offset
If map is null and the register is mapped in only one address map, that address map is used. If map is null and
the register is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the register is not mapped in the specified address map, a warning message
shall be issued and -1 is returned.
18.4.3.14 get_address
Returns the base external physical address of this register if accessed through the specified address map.
If map is null and the register is mapped in only one address map, that address map is used. If map is null and
the register is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the register is not mapped in the specified address map, a warning message
shall be issued and -1 is returned.
18.4.3.15 get_addresses
This computes all of the external physical addresses, addr, that need to be accessed to completely read or write
this register. The addressees are specified in little endian order. This returns the number of bytes transferred on
each access.
If map is null and the register is mapped in only one address map, that address map is used. If map is null and
the register is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the register is not mapped in the specified address map, a warning message
shall be issued and -1 is returned, and addr is unmodified.
18.4.4 Access
18.4.4.1 get
277
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns the desired value of the fields in the register. This does not actually read the value of the register in the
design, only the desired value in the abstraction class. Unless set to a different value using uvm_reg::set (see
18.4.4.2), the desired value and the mirrored value are identical. The filename (fname) and line number (lineno)
arguments are available for an implementation to use for debug purposes only; their value shall have no
functional effect on the outcome of this method. The default value of lineno shall be 0.
Use the uvm_reg::read (see 18.4.4.10) or uvm_reg::peek (see 18.4.4.12) methods to retrieve the actual
register value.
If the register contains write-only fields, the desired/mirrored value for those fields are the value last written
and presumed to reside in the bits implementing these fields. Although a physical read operation would return
something different for these fields, the returned value is the actual content.
18.4.4.2 set
Specifies the desired value of the fields in the register. This does not actually set the value of the register in the
design, only the desired value in its corresponding abstraction class in the register model. Use the
uvm_reg::update method (see 18.4.4.13) to update the actual register with the mirrored value or the
uvm_reg::write method (see 18.4.4.9) to specify the actual register and its desired value. This method is also
invoked by uvm_reg::write() method. The filename (fname) and line number (lineno) arguments are available
for an implementation to use for debug purposes only; their value shall have no functional effect on the
outcome of this method. The default value of lineno shall be 0.
Unless this method is used, the desired value is equal to the mirrored value.
Refer to 18.5.5.2 for more details on the effect of setting mirror values on fields with different access policies.
To modify the mirrored field values to a specific value, and thus use the mirrored values as a scoreboard for the
register values in the DUT, use the uvm_reg::predict method (see 18.4.4.15).
18.4.4.3 get_mirrored_value
Returns the mirrored value of the fields in the register. This does not actually read the value of the register in
the design. The filename (fname) and line number (lineno) arguments are available for an implementation to
use for debug purposes only; their value shall have no functional effect on the outcome of this method. The
default value of lineno shall be 0.
If the register contains write-only fields, the desired/mirrored value for those fields are the value last written
and presumed to reside in the bits implementing these fields.
Although a physical read operation would return something different for these fields, the returned value is the
actual content.
278
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.4.4.4 needs_update
This method returns TRUE if the uvm_reg_field::needs_update (see 18.5.5.8) method for at least one field in
the register returns TRUE. Otherwise, FALSE is returned.
The mirror values, or actual content of the register, are not modified. Use uvm_reg::update (see 18.4.4.13) to
actually update the DUT registers. For additional information, see 18.5.5.8.
18.4.4.5 reset
This sets the desired and mirror value of the fields in this register to the reset value for the specified reset kind.
The default value of kind shall be "HARD". See 18.5.5.4 for more details.
It also resets the semaphore that prevents concurrent access to the register. This semaphore needs to be
explicitly reset if a thread accessing this register array was killed before the access was completed.
18.4.4.6 get_reset
Returns the specified reset value for this register; this returns the reset value for this register for the specified
reset kind. The default value of kind shall be "HARD".
18.4.4.7 has_reset
Checks if any field in the register has a reset value specified for the specified reset kind. The default value of
kind shall be "HARD".
If delete is TRUE, this removes the reset value, if any. The default value of delete shall be 0, which is FALSE.
18.4.4.8 set_reset
Specifies or modifies the reset value for all the fields in the register corresponding to the cause specified by
kind. The default value of kind shall be "HARD".
279
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.4.4.9 write
This initiates a write (using value for data) to the register in the design that corresponds to this abstraction class
instance.
The write may be performed using either frontdoor or backdoor operations (as defined by path). If back door is
specified, the effect of writing the register through a physical access is mimicked. For example, read-only bits in
the register will remain unchanged.
If front door is specified, and if the register is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
This method affects the register’s desired value in both FRONTDOOR and BACKDOOR modes. Auto-
prediction (See 18.2.5.2) shall determine how the mirror value is updated.
18.4.4.10 read
This reads and returns the current value from the register in the design that corresponds to this abstraction class
instance.
280
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The read may be performed using either frontdoor or backdoor operations (as defined by path). If back door is
specified, the effect of reading the register through a physical access is mimicked. For example, clear-on-read
bits in the registers are set to 0.
If front door is specified, and if the register is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.4.4.11 poke
This deposits the value in the DUT register corresponding to this abstraction class instance, as is, using a
backdoor access. Uses the HDL path for the design abstraction specified by kind. The value of parent sequence
and extension are set into the uvm_reg_item (see 19.1.1), which is provided to the uvm_reg_backdoor::read
(see 19.5.2.7) and uvm_reg_backdoor::write (see 19.5.2.6) methods. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.4.4.12 peek
This samples the value in the DUT register corresponding to this abstraction class instance using a backdoor
access. The register value is sampled, not modified. Uses the HDL path for the design abstraction specified by
281
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
kind. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is provided
to the uvm_reg_backdoor::read method. The status output argument reflects the success or failure of the
operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.4.4.13 update
Updates the content of the register in the design with the desired value if uvm_reg::needs_update (see
18.4.4.4) indicates an update is necessary. A call to uvm_reg::update() shall result in a call to uvm_reg::write()
method (See 18.4.4.9).
The update may be performed using either frontdoor or backdoor operations (as defined by path). If back door
is specified, the effect of writing the register through a physical access is mimicked (see 18.4.4.11). For
example, read-only bits in the register will remain unchanged.
If front door is specified, and if the register is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.4.4.14 mirror
282
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This reads the register and optionally compares the read back value with the current mirrored value if check is
UVM_CHECK (see 17.2.2.3). The mirrored value is then updated using the uvm_reg::predict method (see
18.4.4.15), based on the read back value.
The mirroring may be performed using either frontdoor or backdoor operations (as defined by path). If back
door is specified, the effect of writing the register through a physical access is mimicked (see 18.4.4.11). The
content of write-only fields is mirrored and optionally checked.
If front door is specified, and if the register is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
If check is specified as UVM_CHECK, an error message shall be generated if the current mirrored value does not
match the read back value. Any field whose check has been disabled with uvm_reg_field::set_compare (see
18.5.5.15) shall not be considered in the comparison.
18.4.4.15 predict
Updates the mirrored and desired value for this register. The default value of be shall be -1. The default value
of kind shall be UVM_PREDICT_DIRECT. The default value of path shall be UVM_FRONTDOOR. The filename
(fname) and line number (lineno) arguments are available for an implementation to use for debug purposes
only; their value shall have no functional effect on the outcome of this method. The default value of lineno shall
be 0. The default value of lineno shall be 0.
This predicts the mirror (and desired) value of the fields in the register based on the specified observed value on
a specified address map, or based on a calculated value. See 18.5.5.17 for more details.
This returns TRUE if the prediction was successful for each field in the register.
283
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.4.4.16 is_busy
18.4.5.1 get_frontdoor
If null, no user-defined front door has been defined. A user-defined front door is defined by using the
uvm_reg::set_frontdoor method (see 18.4.5.2).
If the register is mapped in multiple address maps, an address map shall be specified.
18.4.5.2 set_frontdoor
Specifies a user-defined front door for this register. The default value of lineno shall be 0.
By default, registers are mapped linearly into the address space of the address maps that instantiate them. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. If registers are accessed using a different mechanism, a user-defined access mechanism shall
be defined and associated with the corresponding register abstraction class.
If the register is mapped in multiple address maps, an address map shall be specified.
18.4.6.1 get_backdoor
If null, no user-defined back door has been defined. A user-defined back door is defined by using the
uvm_reg::set_backdoor method (see 18.4.6.2).
If inherited is TRUE, this returns the back door of the parent block if none have been specified for this register.
The default value of inherited shall be 1, which is TRUE.
284
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.4.6.2 set_backdoor
Specifies a user-defined back door for this register. The filename (fname) and line number (lineno) arguments
are available for an implementation to use for debug purposes only; their value shall have no functional effect
on the outcome of this method. The default value of lineno shall be 0.
By default, registers are accessed via the built-in string-based DPI routines if an HDL path has been specified
using the uvm_reg::configure (see 18.3.2.2) or uvm_reg::add_hdl_path (see 18.4.6.4) methods.
If this default mechanism is not suitable (e.g., because the register is not implemented in pure SystemVerilog) a
user-defined access mechanism needs to be defined and associated with the corresponding register abstraction
class. A user-defined back door is required if an active update of the mirror of this register abstraction class,
based on observed changes of the corresponding DUT register, is used.
18.4.6.3 clear_hdl_path
Deletes any HDL paths. kind refers to the type of underlying backdoor path of the UVM object in the DUT (see
18.1.6.1). The default value of kind shall be "RTL".
This removes any previously specified HDL path to the register instance for the specified design abstraction.
18.4.6.4 add_hdl_path
Adds the specified HDL path to the register instance for the specified design abstraction. kind refers to the type
of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1). The default value of kind shall be
"RTL".
This method may be called more than once for the same design abstraction if the register is physically
duplicated in the design abstraction.
18.4.6.5 add_hdl_path_slice
285
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Appends the specified HDL slice to the HDL path of the register instance for the specified design abstraction.
The name argument is the path to the HDL variable for the slice to be added. The offset argument is the LSB in
the register that this HDL variable implements. The size argument is the number of bits that this HDL variable
implements. If first is TRUE, this starts the specification of a duplicate HDL implementation of the register. The
default value of first shall be 0, which is FALSE. kind refers to the type of underlying backdoor path of the
UVM object in the DUT (see 18.1.6.1). The default value of kind shall be "RTL".
If the HDL variable implements the entire register, offset and size may be specified as -1. This shall not result
in different functionality, however the implementation may be more efficient.
18.4.6.6 has_hdl_path
This returns TRUE if the register instance has a HDL path defined for the specified design abstraction. If no
design abstraction is specified, it uses the default design abstraction specified for the parent block. kind refers to
the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
18.4.6.7 get_hdl_path
This returns the HDL path(s) defined for the specified design abstraction in the register instance. It returns only
the component of the HDL paths that corresponds to the register, not a full hierarchical path. paths shall be a
queue. kind refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
If no design abstraction is specified, the default design abstraction for the parent block is used.
18.4.6.8 get_hdl_path_kinds
Returns any design abstractions for which HDL paths have been defined. kinds shall be a queue. Each entry in
kinds refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
18.4.6.9 get_full_hdl_path
This returns the full hierarchical HDL path(s) defined for the specified design abstraction in the register
instance. There may be more than one path returned even if only one path was defined for the register instance,
286
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
if any of the parent components have more than one path defined for the same design abstraction. paths shall be
a queue. kind refers to the type of underlying backdoor path of the UVM object in the DUT (see 18.1.6.1).
If no design abstraction is specified, the default design abstraction for each ancestor block is used to retrieve
each incremental path. The default value of separator shall be ".".
18.4.6.10 backdoor_read
The implementation shall use the UVM HDL backdoor access support routines (see 19.6) to perform a read for
this register.
18.4.6.11 backdoor_write
This overrides the default string-based DPI backdoor access write for this register type.
18.4.6.12 backdoor_watch
This watches the DUT register corresponding to this abstraction class instance for any change in value and
returns when a value change occurs.
18.4.7 Coverage
18.4.7.1 include_coverage
Specifies which coverage model shall be included in various block, register, or memory abstraction class
instances.
The coverage models are specified by ORing or adding the uvm_coverage_model_e coverage model identifiers
(see 17.2.2.9) corresponding to the coverage model to be included.
The scope specifies a hierarchical name or pattern identifying a block, memory, or register abstraction class
instances. Any block, memory, or register whose full hierarchical name matches the specified scope shall have
the specified functional coverage models included in them.
287
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The scope can be specified as a POSIX® regular expression or simple pattern. See C.2.4 for more details. 9
The specification of which coverage model to include in which abstraction class is stored in a
uvm_reg_cvr_t resource (see 17.2.1.6) in the uvm_resource_db resource database (see C.3.2), in the
uvm_reg:: scope namespace.
18.4.7.2 build_coverage
Models are specified by adding the symbolic value of individual coverage model as defined in
uvm_coverage_model_e (see 17.2.2.9). This returns the sum of all coverage models to be built in the register
model.
18.4.7.3 add_coverage
This adds the specified coverage model to the coverage models available in this class. Models are specified by
adding the symbolic value of individual coverage model as defined in uvm_coverage_model_e (see 17.2.2.9).
This method shall only be called in the constructor of subsequently derived classes.
18.4.7.4 has_coverage
This returns True if the register abstraction class contains a coverage model for all of the models specified.
Models are specified by adding the symbolic value of individual coverage model as defined in
uvm_coverage_model_e (see 17.2.2.9).
18.4.7.5 get_coverage
This returns 1 if measurement for all of the specified functional coverage models are currently on. Multiple
functional coverage models can be specified by adding the functional coverage model identifiers.
18.4.7.6 set_coverage
9
POSIX is a registered trademark in the U.S. Patent & Trademark Office, owned by The Institute of Electrical and Electronics Engineers,
Incorporated.
288
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This turns the collection of functional coverage measurements on or off for this register. The functional
coverage measurement is turned on for every coverage model specified using uvm_coverage_model_e
coverage model identifiers (see 17.2.2.9). Multiple functional coverage models can be specified by adding the
functional coverage model identifiers. All other functional coverage models are turned off. This returns the sum
of all functional coverage models whose measurements were previously on.
This method can only control the measurement of functional coverage models that are present in the register
abstraction classes, then enabled during construction. See the uvm_reg::has_coverage method (see 18.4.7.4) to
identify the available functional coverage models.
18.4.7.7 sample
This method is invoked by the register abstraction class whenever it is read or written with the specified data via
the specified address map. It is invoked after the read or write operation has completed, but before the mirror
has been updated.
Empty by default, this method may be extended by the abstraction class generator to perform the required
sampling in any provided functional coverage model.
18.4.7.8 sample_values
This method is invoked by the user or by the uvm_reg_block::sample_values method (see 18.1.4.7) of the
parent block to trigger the sampling of the current field values in the register-level functional coverage model.
This method may be extended by the abstraction class generator to perform the required sampling in any
provided field-value functional coverage model.
18.4.8 Callbacks
18.4.8.1 pre_write
If the specified data value, access path, or address map are modified, the updated data value, access path, or
address map is used to perform the register operation. If the status is modified to anything other than
UVM_IS_OK (see 17.2.2.1), the operation is aborted.
The registered callback methods are invoked after the invocation of this method. All register callbacks are
executed before the corresponding field callbacks.
289
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.4.8.2 post_write
If the specified status is modified, the updated status is returned by the register operation.
The registered callback methods are invoked before the invocation of this method. All register callbacks are
executed before the corresponding field callbacks.
18.4.8.3 pre_read
If the specified access path or address map are modified, the updated access path or address map is used to
perform the register operation. If the status is modified to anything other than UVM_IS_OK (see 17.2.2.1), the
operation is aborted.
The registered callback methods are invoked after the invocation of this method. All register callbacks are
executed before the corresponding field callbacks.
18.4.8.4 post_read
If the specified read back data or status is modified, the updated read back data or status is returned by the
register operation.
The registered callback methods are invoked before the invocation of this method. All register callbacks are
executed before the corresponding field callbacks.
18.5 uvm_reg_field
A field is contained within a single register, but may have different access policies depending on the address
map used to access the register (thus the field).
value
rand uvm_reg_data_t value
290
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This is a mirrored field value; it can be sampled in a functional coverage model or constrained when
randomized.
18.5.3 Methods
18.5.3.1 new
18.5.3.2 configure
It specifies the parent register of this field, its size in bits, the position of its LSB within the register relative to
the LSB of the register, its access policy, volatility, “HARD” reset value, whether the field value is actually
reset (the reset value is ignored if FALSE), whether the field value may be randomized, and whether the field is
the only one to occupy a byte lane in the register.
If the field access policy is a predefined policy and NOT one of "RW", "WRC", "WRS", "WO", "W1", or "WO1",
the value of is_rand is ignored and the rand_mode for the field instance is turned off since it cannot be
written.
18.5.4 Introspection
18.5.4.1 get_parent
18.5.4.2 get_lsb_pos
This returns the index of the least significant bit (LSB) of the field in the register that instantiates it. An offset
of 0 indicates a field that is aligned with the LSB of the register.
291
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.5.4.3 get_n_bits
18.5.4.4 get_max_size
18.5.4.5 get_access
This returns the current access policy of the field when written and read through the specified address map. If
the register containing the field is mapped in multiple address maps, an address map shall be specified. The
access policy of a field from a specific address map may be restricted by the register’s access policy in that
address map, e.g., a RW field may only be writable through one of the address maps and read-only through all
of the other maps.
If the field access contradicts the map’s access value (e.g., a field access of WO and map access value of RO), the
method’s return value is "NOACCESS" (see 18.5.4.6).
18.5.4.6 set_access
Modifies the access policy of the field to the specified one and return the previous access policy.
The predefined access policies are as follows (W = write; R = read). The effects of a read operation are applied
after the current value of the field is sampled. The read operation returns the current value, not the value
affected by the read operation (if any). For R, the “no effect” behavior either returns 0s or the return value; an
“error” needs to define an error for negative testing.
292
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.5.4.7 define_access
Because field access policies are specified using string values, there is no way for SystemVerilog to verify if a
specific access value is valid or not. To help catch typing errors, user-defined access values shall be defined
using this method to avoid being reported as an invalid access policy.
The name of field access policies are always converted to all uppercase.
This returns TRUE if the new access policy was not previously defined. It returns FALSE otherwise, but does
not issue an error message.
18.5.4.8 is_known_access
This returns TRUE if the current access policy of the field, when written and read through the specified address
map, is a built-in access policy.
18.5.4.9 set_volatility
293
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
It is important to remember that modifying the volatility of a field makes the register model diverge from the
specification that was used to create it.
18.5.4.10 is_volatile
Indicates if the field value is volatile. UVM uses the IEEE Std 1685™ definition of “volatility” [B3]. 10
If TRUE, the mirrored value in the register cannot be trusted. This typically indicates a field whose change in
value cannot be observed by UVM. The nature or cause of the change is not specified.
18.5.5 Access
18.5.5.1 get
Returns the desired value of the field. The filename (fname) and line number (lineno) arguments are available
for an implementation to use for debug purposes only; their value shall have no functional effect on the
outcome of this method. The default value of lineno shall be 0.
This does not actually read the value of the field in the design, only the desired value in the abstraction class.
Unless set to a different value using uvm_reg_field::set (see 18.5.5.2), the desired value and the mirrored value
are identical. Use the uvm_reg_field::read (see 18.5.5.10) or uvm_reg_field::peek (see 18.5.5.12) methods to
retrieve the actual field value.
If the field is write-only, the desired/mirrored value is the value last written and presumed to reside in the bits
implementing it. Although a physical read operation would return something different, the returned value is the
actual content.
18.5.5.2 set
Sets the desired value for this field to the specified value modified by the field access policy. This does not
actually set the value of the field in the design, only the desired value in the abstraction class. Use the
uvm_reg::update method (see 18.4.4.13) to update the actual register with the desired value or the
uvm_reg_field::write method (see 18.5.5.9) to actually write the field and update its mirrored value. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
10
The numbers in brackets correspond to those of the bibliography in Annex A.
294
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The final desired value in the mirror is a function of the field access policy and the set value, just like a normal
physical write operation to the corresponding bits in the hardware. As such, this method (when eventually
followed by a call to uvm_reg::update [see 18.4.4.13]) is a zero-time functional replacement for the
uvm_reg_field::write method (see 18.5.5.9). For example, the desired value of a read-only field is not
modified by this method, and the desired value of a write-once field can only be set if the field has not yet been
written to using a physical (for example, frontdoor) write operation.
Use the uvm_reg_field::predict (see 18.5.5.17) to modify the mirrored value of the field.
18.5.5.3 get_mirrored_value
Returns the mirrored value of the field. The filename (fname) and line number (lineno) arguments are available
for an implementation to use for debug purposes only; their value shall have no functional effect on the
outcome of this method. The default value of lineno shall be 0.
This does not actually read the value of the field in the design, only the mirrored value in the abstraction class.
If the field is write-only, the desired/mirrored value is the value last written and presumed to reside in the bits
implementing it. Although a physical read operation would something different, the returned value is the actual
content.
18.5.5.4 reset
This sets the desired and mirror value of the field to the reset event specified by kind. If the field does not have
a reset value specified for the specified reset kind, the field is unchanged. The default value of kind shall be
"HARD".
This does not actually reset the value of the field in the design, only the value mirrored in the field abstraction
class.
18.5.5.5 has_reset
Check if the field has a reset value specified. The default value of kind shall be "HARD".
Return TRUE if this field has a reset value specified for the specified reset kind. If delete is TRUE, the reset
value is removed, if any. The default value of delete shall be 0, which is FALSE.
295
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.5.5.6 get_reset
This returns the reset value for this field for the specified reset kind. It returns the current field value if no reset
value has been specified for the specified reset event. The default value of kind shall be "HARD".
18.5.5.7 set_reset
Specifies or modifies the reset value for this field corresponding to the cause specified by kind. The default
value of kind shall be "HARD".
18.5.5.8 needs_update
If a mirror value has been modified in the abstraction model without actually updating the actual register (either
through randomization or via the uvm_reg::set method [see 18.4.4.2] or the uvm_reg_field::set method [see
18.5.5.2]), the mirror and state of the register is outdated. Then, the corresponding register in the DUT needs to
be updated.
This method returns TRUE if the field is writable and the state of the field in the DUT needs to be updated to
match the desired value. Otherwise, FALSE is returned.
The mirror values, or actual content of the register, are not modified. Use uvm_reg::update (see 18.4.4.13) to
actually update the DUT field.
18.5.5.9 write
This writes the value in the DUT field that corresponds to this abstraction class instance.
296
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The write may be performed using either frontdoor or backdoor operations (as defined by path). If back door is
specified, the effect of writing the register through a physical access is mimicked. For example, read-only bits
in the register will remain unchanged.
If front door is specified, and if the register is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
If a frontdoor access is used, and if the field is the only field in a byte lane and if the physical interface
corresponding to the address map used to access the field supports byte-enabling, then only the field is written.
Otherwise, the entire register containing the field is written and the mirrored values of the other fields in the
same register are used in a best effort not to modify their value. If a backdoor access is used, a peek-modify-
poke process is used in a best effort not to modify the value of the other fields in the register.
This method affects the field’s desired value only if the map’s get_auto_predict method (see 18.2.5.1) returns
a value 1, and the field’s is_indv_accessible method (see 18.5.5.16) returns a value of 1. Otherwise, the field’s
parent register’s write method (see 18.4.4.9) determines if the field’s desired value is updated.
18.5.5.10 read
This reads and returns the value in the DUT field that corresponds to this abstraction class instance.
The read may be performed using either frontdoor or backdoor operations (as defined by path). If back door is
specified, the effect of reading the register through a physical access is mimicked. For example, clear-on-read
field bits are set to 0.
If front door is specified, and if the register is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
297
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
If a frontdoor access is used, and if the field is the only field in a byte lane and if the physical interface
corresponding to the address map used to access the field supports byte-enabling, then only the field is read.
Otherwise, the entire register containing the field is read and the mirrored values of the other fields in the same
register are updated. If a backdoor access is used, the entire containing register is peeked and the mirrored value
of the other fields in the register is updated.
18.5.5.11 poke
Deposits the specified value in this DUT field corresponding to this abstraction class instance, as is, using a
backdoor access. The entire register shall automatically be peeked prior to the poke operation in order to not
modify the value of the other fields in the register. Uses the HDL path for the design abstraction specified by
kind. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_backdoor::read (see 19.5.2.7) and uvm_reg_backdoor::write (see 19.5.2.6)
methods. The status output argument reflects the success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.5.5.12 peek
This samples the value in the DUT register corresponding to this abstraction class instance using a backdoor
access. The field value is sampled, not modified. Uses the HDL path for the design abstraction specified by
kind. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is provided
to the uvm_reg_backdoor::read method. The status output argument reflects the success or failure of the
operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
298
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.5.5.13 mirror
This reads the register and optionally compares the read back value with the current mirrored value if check is
UVM_CHECK (see 17.2.2.3). The mirrored value is then updated using the uvm_reg::predict method (see
18.4.4.15), based on the read back value.
The mirroring may be performed using either frontdoor or backdoor operations (as defined by path). If back
door is specified, the effect of writing the register through a physical access is mimicked (see 18.4.4.11). The
content of write-only fields is mirrored and optionally checked.
If front door is specified, and if the register is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
If check is specified as UVM_CHECK, an error message shall be generated if the current mirrored value does not
match the read back value, unless set_compare (see 18.5.5.15) was used to disable the check.
18.5.5.14 get_compare
18.5.5.15 set_compare
Specifies the compare policy during a mirror update. The field value is checked against its mirror only when
both the check argument in uvm_reg_block::mirror (see 18.1.5.6), uvm_reg::mirror (see 18.4.4.14), or
uvm_reg_field::mirror (see 18.5.5.13) and the compare policy for the field is UVM_CHECK (see 17.2.2.3).
299
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.5.5.16 is_indv_accessible
Checks if this field can be written individually. A field is individually accessible if it fits within local_map’s
data width and can be accessed via path without affecting any other field(s) in the register.
18.5.5.17 predict
Updates the mirrored and desired value for this field. The default value of be shall be -1. The default value of
kind shall be UVM_PREDICT_DIRECT. The default value of path shall be UVM_FRONTDOOR. The filename
(fname) and line number (lineno) arguments are available for an implementation to use for debug purposes
only; their value shall have no functional effect on the outcome of this method. The default value of lineno shall
be 0.
This predicts the mirror and desired value of the field based on the specified observed value on a bus using the
specified address map.
If kind is specified as UVM_PREDICT_READ (see 17.2.2.8), the value was observed in a read transaction on the
specified address map or back door (if path is UVM_BACKDOOR [see 17.2.2.2]). If kind is specified as
UVM_PREDICT_WRITE (see 17.2.2.8), the value was observed in a write transaction on the specified address
map or back door (if path is UVM_BACKDOOR [see 17.2.2.2]). If kind is specified as UVM_PREDICT_DIRECT
(see 17.2.2.8), the value was computed and is updated as is, without regard to any access policy.
This method does not allow an update of the mirror (or desired) values when the register containing this field is
busy executing a transaction because the results are unpredictable and indicative of a race condition in the
testbench.
18.5.6 Callbacks
18.5.6.1 pre_write
If the specified data value, access path, or address map are modified, the updated data value, access path, or
address map is used to perform the register operation. If the status is modified to anything other than
UVM_IS_OK (see 17.2.2.1), the operation is aborted.
300
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The field callback methods are invoked after the callback methods on the containing register. The registered
callbacks are invoked after the invocation of this method.
18.5.6.2 post_write
If the specified status is modified, the updated status is returned by the register operation.
The field callback methods are invoked after the callback methods on the containing register. The registered
callbacks are invoked before the invocation of this method.
18.5.6.3 pre_read
If the specified access path or address map are modified, the updated access path or address map is used to
perform the register operation. If the status is modified to anything other than UVM_IS_OK (see 17.2.2.1), the
operation is aborted.
The field callback methods are invoked after the callback methods on the containing register. The registered
callbacks are invoked after the invocation of this method.
18.5.6.4 post_read
If the specified read back data or status is modified, the updated read back data or status is returned by the
register operation.
The field callback methods are invoked after the callback methods on the containing register. The registered
callbacks are invoked before the invocation of this method.
18.6 uvm_mem
A memory is a collection of contiguous locations. A memory may be accessible via more than one address map.
Unlike registers, memories are not mirrored because of the potentially large data space; tests that walk the
entire memory space would negate any benefit from sparse memory modeling techniques.
The uvm_mem class is not factory registered because it has a complex constructor signature.
301
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.6.2 Variables
mam
uvm_mem_mam mam
This is the memory allocation manager for the memory corresponding to this abstraction class instance. It can
be used to allocate regions of consecutive addresses of specific sizes, such as DMA buffers, or to locate virtual
register array.
18.6.3 Methods
18.6.3.1 new
function new (
string name,
longint unsigned size,
int unsigned n_bits,
string access = "RW",
int has_coverage = UVM_NO_COVERAGE
)
Creates a new instance and type-specific configuration; this creates an instance of a memory abstraction class
with the specified name.
size specifies the total number of memory locations. n_bits specifies the total number of bits in each memory
location. access specifies the access policy of this memory and may be one of “RW” for RAMs and “RO” for
ROMs. The default value of access shall be "RW".
has_coverage specifies which functional coverage models are present in the extension of the register
abstraction class. Multiple functional coverage models may be specified by adding their symbolic names, as
defined by the uvm_coverage_model_e type (see 17.2.2.9). The default value of has_coverage shall be
UVM_NO_COVERAGE.
18.6.3.2 configure
If this memory is implemented in a single HDL variable, its name is specified as the hdl_path. Otherwise, if the
memory is implemented as a concatenation of variables (usually one per bank), then the HDL path shall be
specified using the add_hdl_path (see 18.6.7.4) or add_hdl_path_slice (see 18.6.7.4) methods.
18.6.3.3 set_offset
302
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Modifies the offset of the memory. offset is in units returned by get_add_unit_bytes() (see 18.2.4.6).
The offset of a memory within an address map is set using the uvm_reg_map::add_mem method (see
18.2.3.4). This method is used to modify that offset dynamically.
Modifying the offset of a memory makes the abstract model diverge from the specification that was used to
create it.
18.6.4 Introspection
18.6.4.1 get_parent
18.6.4.2 get_n_maps
18.6.4.3 is_in_map
18.6.4.4 get_maps
Returns all of the address maps where this memory is mapped. maps shall be a queue.
18.6.4.5 get_rights
This returns "RW", "RO", or "WO". The access rights of a memory is always "RW", unless it is a shared memory
with access restriction in a particular address map.
If no address map is specified and the memory is mapped in only one address map, that address map is used. If
the memory is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the memory is not mapped in the specified address map, a warning message
shall be issued and "RW" is returned.
18.6.4.6 get_access
Returns the access policy of the memory when written and read via an address map.
303
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If the memory is mapped in more than one address map, an address map shall be specified. If access restrictions
are present when accessing a memory through the specified address map, the access mode returned takes the
access restrictions into account, e.g., a read-write memory accessed through a domain with read-only
restrictions would return "RO".
18.6.4.7 get_size
18.6.4.8 get_n_bytes
Returns the width, in number of bytes, of each memory location. Rounds up to next whole byte if the memory
word is not a multiple of 8 bits.
18.6.4.9 get_n_bits
18.6.4.10 get_max_size
18.6.4.11 get_virtual_registers
This fills the specified array with the abstraction class for all of the virtual registers implemented in this
memory. The order in which the virtual registers are located in the array is not specified. regs shall be a queue.
18.6.4.12 get_virtual_fields
This fills the specified dynamic array with the abstraction class for all of the virtual fields implemented in this
memory. The order in which the virtual fields are located in the array is not specified. fields shall be a queue.
18.6.4.13 get_vreg_by_name
Finds a virtual register with the specified name implemented in this memory and returns its abstraction class
instance. If no virtual register with the specified name is found, this returns null.
304
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.6.4.14 get_vfield_by_name
Finds a virtual field with the specified name implemented in this memory and returns its abstraction class
instance. If no virtual field with the specified name is found, this returns null.
18.6.4.15 get_offset
Returns the base offset of the specified location in this memory in an address map. The default value of offset
shall be 0.
If map is null and the memory is mapped in only one address map, that address map is used. If map is null and
the memory is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the memory is not mapped in the specified address map, a warning message
shall be issued.
18.6.4.16 get_address
Returns the base external physical address of the specified location in this memory if accessed through the
specified address map. The default value of offset shall be 0.
If map is null and the memory is mapped in only one address map, that address map is used. If map is null and
the memory is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the memory is not mapped in the specified address map, a warning message
shall be issued.
18.6.4.17 get_addresses
Identifies the external physical address(es), addr, that need to be accessed to completely read or write the
memory location specified by offset. The default value of offset shall be 0.
The addresses are specified in little endian order. This returns the number of bytes transferred on each access.
If map is null and the memory is mapped in only one address map, that address map is used. If map is null and
the memory is mapped in more than one address map, the default address map of the parent block is used.
305
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If an address map is specified and the memory is not mapped in the specified address map, a warning message
shall be issued and -1 is returned, and addr is unmodified.
18.6.5.1 write
This initiates a write (using value for data) to the memory location that corresponds to this abstraction class
instance at the specified offset.
The write may be performed using either frontdoor or backdoor operations (as defined by path). If back door is
specified, the effect of writing the memory through a physical access is mimicked. For example, read-only
memory will remain unchanged.
If front door is specified, and if the memory is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.6.5.2 read
306
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This reads and returns the value from the memory location that corresponds to this abstraction class instance at
the specified offset.
The read may be performed using either frontdoor or backdoor operations (as defined by path). If back door is
specified, the effect of reading the memory through a physical access is mimicked.
If front door is specified, and if the memory is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.6.5.3 burst_write
This initiates a burst-write (using the elements in value for data) to the memory locations that correspond to this
abstraction class instance beginning at the specified offset.
The write may be performed using either frontdoor or backdoor operations (as defined by path). If back door is
specified, the effect of writing the memory through a physical access is mimicked. For example, read-only
memory will remain unchanged.
If front door is specified, and if the memory is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The burst-write shall take the content of the value array and convert it to accesses that match the width of the
memory. The value array is converted to a bit stream from which the number of write beats is determined by
the width of the memory. Each burst-write data beat shall be aligned to the memory offset whose value shall be
determined by the beat number, endianness, and the memory width. In frontdoor mode, if the field is the only
field in a byte lane and if the physical interface corresponding to the address map used to access the field
supports byte-enabling, then the field is considered individually accessible. When the content of the value array
307
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
does not map to a whole number of memory locations of the memory width, the last write beat will only be
partially valid.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.6.5.4 burst_read
This initiates a burst-read that returns the date in the elements in value from the memory location that
corresponds to this abstraction class instance at the specified offset.
The read may be performed using either frontdoor or backdoor operations (as defined by path). If back door is
specified, the effect of reading the memory through a physical access is mimicked.
If front door is specified, and if the memory is mapped in more than one address map, an address map shall be
specified. The value of parent sequence and extension are set into the uvm_reg_item (see 19.1.1), which is
provided to the uvm_reg_frontdoor (see 19.4.2) or uvm_reg_backdoor (see 19.5) associated with this
request. If the built-in front door is being used and parent is not null, the bus item returned by the
uvm_reg_adapter (see 19.2.1) shall be started as a child of parent. If the built-in front door is used, the bus
item returned by the adapter shall be started with the priority prior. Optionally, users may provide additional
information for the physical access with the extension argument. The status output argument reflects the
success or failure of the operation.
The burst-read shall take the size of the value array and convert it to read accesses that match the width of the
memory. The value array is converted to a bit stream from which the number of read beats is determined by the
width of the memory. Each burst-read data beat shall be aligned to the memory offset whose value shall be
determined by the beat number, endianness, and the memory width. When the content of the value array does
not map to a whole number of memory locations of the memory width, the content of the last read beat will
only be partially valid. At the end of the burst-read, the data read back from the memory is returned in the value
array.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method.
18.6.5.5 poke
308
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Deposits the value in the DUT memory location corresponding to this abstraction class instance at the specified
offset, as is, using a backdoor access.
Uses the HDL path for the design abstraction specified by kind. The filename (fname) and line number (lineno)
arguments are available for an implementation to use for debug purposes only; their value shall have no
functional effect on the outcome of this method. The default value of lineno shall be 0.
18.6.5.6 peek
This samples the value in the DUT memory location corresponding to this abstraction class instance at the
specified offset using a backdoor access. The memory location value is sampled, not modified.
Uses the HDL path for the design abstraction specified by kind. The filename (fname) and line number (lineno)
arguments are available for an implementation to use for debug purposes only; their value shall have no
functional effect on the outcome of this method. The default value of lineno shall be 0.
18.6.6.1 get_frontdoor
If null, no user-defined front door has been defined. A user-defined front door is defined by using the
uvm_mem::set_frontdoor method (see 18.6.6.1).
If the memory is mapped in multiple address maps, an address map shall be specified.
18.6.6.2 set_frontdoor
309
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
int lineno = 0
)
Specifies a user-defined front door for this memory. The filename (fname) and line number (lineno) arguments
are available for an implementation to use for debug purposes only; their value shall have no functional effect
on the outcome of this method. The default value of lineno shall be 0.
By default, memories are mapped linearly into the address space of the address maps that instantiate them. If
memories are accessed using a different mechanism, a user-defined access mechanism shall be defined and
associated with the corresponding memory abstraction class.
If the memory is mapped in multiple address maps, an address map shall be specified.
18.6.7.1 get_backdoor
If null, no user-defined back door has been defined. A user-defined back door is defined by using the
uvm_mem::set_backdoor method (see 18.6.7.2).
If inherited is TRUE, this returns the back door of the parent block if none have been specified for this memory.
The default value of inherited shall be 1, which is TRUE.
18.6.7.2 set_backdoor
Specifies a user-defined back door for this memory. The filename (fname) and line number (lineno) arguments
are available for an implementation to use for debug purposes only; their value shall have no functional effect
on the outcome of this method. The default value of lineno shall be 0.
By default, memories are accessed via the built-in string-based DPI routines if an HDL path has been specified
using the uvm_mem::configure (see 18.6.3.2) or uvm_mem::add_hdl_path (see 18.6.7.4) methods.
If this default mechanism is not suitable (e.g., because the register is not implemented in pure SystemVerilog) a
user-defined access mechanism needs to be defined and associated with the corresponding memory abstraction
class.
18.6.7.3 clear_hdl_path
Deletes any HDL paths. The default value of kind shall be "RTL".
This removes any previously specified HDL path to the memory instance for the specified design abstraction.
310
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.6.7.4 add_hdl_path
Adds the specified HDL path to the memory instance for the specified design abstraction. The default value of
kind shall be "RTL".
This method may be called more than once for the same design abstraction if the memory is physically
duplicated in the design abstraction.
18.6.7.5 add_hdl_path_slice
Appends the specified HDL slice to the HDL path for the specified design abstraction. If first is TRUE, this
starts the specification of a duplicate HDL implementation of the memory. The default value of first shall be 0,
which is FALSE. The default value of kind shall be "RTL".
18.6.7.6 has_hdl_path
This returns True if the memory instance has a HDL path defined for the specified design abstraction. If no
design abstraction is specified, it uses the default design abstraction specified for the parent block.
18.6.7.7 get_hdl_path
This returns the HDL path(s) defined for the specified design abstraction in the memory instance. It returns only
the component of the HDL paths that corresponds to the memory, not a full hierarchical path. paths shall be a
queue.
If no design abstraction is specified, the default design abstraction for the parent block is used.
18.6.7.8 get_hdl_path_kinds
311
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Returns any design abstractions for which HDL paths have been defined. kinds shall be a queue.
18.6.7.9 get_full_hdl_path
This returns the full hierarchical HDL path(s) defined for the specified design abstraction in the memory
instance. If any of the parent components have more than one path defined for the same design abstraction,
there may be more than one path returned (even if only one path was defined for the memory instance).
If no design abstraction is specified, the default design abstraction for each ancestor block is used to retrieve
each incremental path.
18.6.7.10 backdoor_read
The implementation shall use the UVM HDL backdoor access support routines (see 19.6) to perform a read for
this register.
18.6.7.11 backdoor_write
This overrides the default string-based DPI backdoor access write for this memory type.
18.6.8 Coverage
18.6.8.1 build_coverage
This checks which of the specified coverage model need to be built in this instance of the memory abstraction
class, as specified by calls to uvm_reg::include_coverage (see 18.4.7.1).
Models are specified by adding the symbolic value of individual coverage model as defined in
uvm_coverage_model_e (see 17.2.2.9). This returns the sum of all coverage models to be built in the memory
model.
18.6.8.2 add_coverage
312
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This adds the specified coverage model to the coverage models available in this class. Models are specified by
adding the symbolic value of individual coverage model as defined in uvm_coverage_model_e (see 17.2.2.9).
This method shall only be called in the constructor of subsequently derived classes.
18.6.8.3 has_coverage
This returns True if the memory abstraction class contains a coverage model for all of the models specified.
Models are specified by adding the symbolic value of individual coverage model as defined in
uvm_coverage_model_e (see 17.2.2.9).
18.6.8.4 get_coverage
This returns True if measurement for all of the specified functional coverage models are currently on. Multiple
functional coverage models can be specified by adding the functional coverage model identifiers. See 18.6.8.5
for more details.
18.6.8.5 set_coverage
This turns the collection of functional coverage measurements on or off for this memory. The functional
coverage measurement is turned on for every coverage model specified using uvm_coverage_model_e
coverage model identifiers (see 17.2.2.9). Multiple functional coverage models can be specified by adding the
functional coverage model identifiers. All other functional coverage models are turned off. This returns the sum
of all functional coverage models whose measurements were previously on.
This method can only control the measurement of functional coverage models that are present in the memory
abstraction classes, then enabled during construction. See the uvm_mem::has_coverage method (see 18.6.8.3)
to identify the available functional coverage models.
18.6.8.6 sample
313
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This method is invoked by the memory abstraction class whenever it is read or written with the specified data
via the specified address map. It is invoked after the read or write operation has completed, but before the
mirror has been updated.
Empty by default, this method may be extended by the abstraction class generator to perform the required
sampling in any provided functional coverage model.
18.6.9 Callbacks
18.6.9.1 pre_write
If the specified data value access path or address map are modified, the updated data value, access path, or
address map is used to perform the memory operation. If the status is modified to anything other than
UVM_IS_OK (see 17.2.2.1), the operation is aborted.
The registered callback methods are invoked after the invocation of this method.
18.6.9.2 post_write
If the specified status is modified, the updated status is returned by the memory operation.
The registered callback methods are invoked before the invocation of this method.
18.6.9.3 pre_read
If the specified access path or address map are modified, the updated access path or address map is used to
perform the memory operation. If the status is modified to anything other than UVM_IS_OK (see 17.2.2.1), the
operation is aborted.
The registered callback methods are invoked after the invocation of this method.
18.6.9.4 post_read
If the specified read back data or status is modified, the updated read back data or status is returned by the
memory operation.
The registered callback methods are invoked before the invocation of this method.
314
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.7 uvm_reg_indirect_data
This models the behavior of a register used to indirectly access a register array, indexed by a second address
register.
The uvm_reg_indirect_data class is not factory registered because it has a complex constructor signature.
18.7.2 Methods
18.7.2.1 new
function new(
string name = "uvm_reg_indirect",
int unsigned n_bits,
int has_cover
)
This should not be called directly, other than via super.new. The value of n_bits needs to match the number of
bits in the indirect register array.
18.7.2.2 configure
The idx register specifies the index, in the reg_a register array, of the register to access. The idx needs to be
written to first. A read or write operation to this register will subsequently read or write the indexed register in
the register array.
The number of bits in each register in the register array shall be equal to n_bits of this register.
18.8 uvm_reg_fifo
This special register models a DUT FIFO accessed via write/read, where writes push to the FIFO and reads pop
from it.
Backdoor access is not enabled, as it is not possible to force complete FIFO state, i.e., the write and read
indexes used to access the FIFO data.
315
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The uvm_reg_fifo class is not factory registered because it has a complex constructor signature.
fifo
rand uvm_reg_data_t fifo[$]
This is the abstract representation of the FIFO. It is constrained to be no larger than the size parameter and is
public to enable subtypes to add constraints on it and randomize. fifo shall be a queue.
18.8.3 Methods
18.8.3.1 new
function new(
string name = "reg_fifo",
int unsigned size,
int unsigned n_bits,
int has_cover
)
18.8.3.2 set_compare
Specifies the compare policy during a mirror (read) of the DUT FIFO. The DUT read value is checked against
its mirror only when both the check argument in the mirror call (see 18.8.5.6) and the compare policy for the
field is UVM_CHECK (see 17.2.2.3).
18.8.4 Introspection
18.8.4.1 size
18.8.4.2 capacity
316
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.8.5 Access
18.8.5.1 get
Returns the next value from the abstract FIFO, but does not pop it. Used to find the expected value in a mirror
operation (see 18.8.5.6). The filename (fname) and line number (lineno) arguments are available for an
implementation to use for debug purposes only; their value shall have no functional effect on the outcome of
this method. The default value of lineno shall be 0. See 18.4.4.1 for additional information.
18.8.5.2 set
Pushes the given value to the abstract FIFO. This method may be called several times before an update (see
18.8.5.5) as a means of preloading the DUT FIFO. Calls to set a full FIFO are ignored. Call update to update
the DUT FIFO with the appropriate values. See 18.4.4.2 for additional information.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
18.8.5.3 write
Pushes the given value to the DUT FIFO. If auto-prediction is enabled, the written value is also pushed to the
abstract FIFO before the call returns. If auto-prediction is not enabled (via uvm_reg_map::set_auto_predict
[see 18.2.5.2]), the value is pushed to abstract FIFO only when the write operation is observed on the target bus.
This mode requires using the uvm_reg_predictor class (see 19.3). If the write is called by an update operation
(see 18.8.5.5), the abstract FIFO already contains the written value and is thus not affected by either prediction
mode. See 18.4.4.9 for additional information.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
317
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.8.5.4 read
Reads the next value out of the DUT FIFO. If auto-prediction is enabled, the frontmost value in abstract FIFO
is popped. See 18.4.4.10 for additional information.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
18.8.5.5 update
Pushes (writes) all values preloaded using set (see 18.8.5.2) to the DUT. This method needs to be used after set
and before any blocking statements, otherwise reads/writes to the DUT FIFO may cause the mirror to become
out of sync with the DUT. See 18.4.4.13 for additional information.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
18.8.5.6 mirror
318
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Reads the next value out of the DUT FIFO. If auto-prediction is enabled, the frontmost value in abstract FIFO is
popped when the check argument is set and comparison is enabled with set_compare (see 18.8.3.2). See
18.4.4.14 for additional information.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
18.8.5.7 predict
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
18.9 uvm_vreg
A virtual register is a collection of fields, overlaid on top of a memory, usually in an array. The semantics and
layout of virtual registers comes from an agreement between the software and the hardware, not any physical
structures in the DUT. uvm_reg is the virtual register abstraction base class.
A virtual register represents a set of fields that are logically implemented in consecutive memory locations. All
virtual register accesses eventually turn into memory accesses. A virtual register array may be implemented on
top of any memory abstraction class and possibly dynamically resized and/or relocated.
18.9.1.1 Methods
18.9.1.1.1 new
function new(
string name,
int unsigned n_bits
)
Creates a new instance and type-specific configuration; this creates an instance of a virtual register abstraction
class with the specified name.
319
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
n_bits specifies the total number of bits in a virtual register. Not all bits need to be mapped to a virtual field.
This value is usually a multiple of 8.
18.9.1.1.2 configure
This specifies the parent block of this virtual register array. If one of the other parameters is specified, the
virtual register is presumed to be dynamic and can be later (re-)implemented using the uvm_vreg::implement
method (see 18.9.1.1.3).
If mem is specified, the virtual register array is presumed to be statically implemented in the memory
corresponding to the specified memory abstraction class and the size, offset, and incr also need to be specified.
size is the number of elements in the virtual register array; offset, in units of memory words, is the offset of the
register array in the memory; incr is the offset, in units of memory words, of a virtual register element from the
previous one. If incr is zero, virtual registers are packed as closely as possible in memory. Static virtual register
arrays cannot be re-implemented. The default values for size, offset, and incr shall each be 0.
18.9.1.1.3 implement
This implements an array of virtual registers of the specified size, n, at the specified offset in memory. offset is
specified in units of memory words. incr is the number of memory words between two consecutive virtual
registers in aregister array. If an incr value of 0 is specified, virtual registers are packed as closely as possible in
the memory. The default values for size and offset, shall be 0.
If no memory is specified, the virtual register array is in the same memory, at the same base offset using the
same incr as originally implemented. Only the number of virtual registers in the virtual register array is
modified.
The initial value of the newly implemented or relocated set of virtual registers is whatever values are currently
stored in the memory now implementing them.
This returns TRUE if the memory can implement the number of virtual registers at the specified base offset and
incr. Otherwise, it returns FALSE.
The memory region used to implement a virtual register array is reserved in the memory allocation manager
associated with the memory to prevent it from being allocated for another purpose.
320
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.9.1.1.4 allocate
This implements a virtual register array of the specified size, n, in a randomly allocated region of the
appropriate size in the address space managed by the specified memory allocation manager. If a memory
allocation policy is specified, it is passed to the uvm_mem_mam::request_region method (see 18.12.5.2).
The initial value of the newly implemented or relocated set of virtual registers is whatever values are currently
stored in the memory region now implementing them.
This returns a reference to a uvm_mem_region memory region descriptor (see 18.12.7) if the memory
allocation manager was able to allocate a region that can implement the virtual register array with the specified
allocation policy. Otherwise, it returns null.
A region implementing a virtual register array cannot be released using the uvm_mem_mam::release_region
method (see 18.12.5.3); instead, use the uvm_vreg::release_region method (see 18.9.1.1.6).
18.9.1.1.5 get_region
This returns a reference to the uvm_mem_region memory region descriptor (see 18.12.7) that implements the
virtual register array.
It returns null if the virtual registers array is not currently implemented. A region implementing a virtual
register array cannot be released using the uvm_mem_mam::release_region method (see 18.12.5.3); instead,
use the uvm_vreg::release_region method (see 18.9.1.1.6).
18.9.1.1.6 release_region
This releases the memory region used to implement a virtual register array and returns it to the pool of available
memory that can be allocated by the memory’s default allocation manager. The virtual register array is
subsequently considered as unimplemented and can no longer be accessed.
18.9.1.2 Introspection
18.9.1.2.1 get_parent
321
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.9.1.2.2 get_memory
18.9.1.2.3 get_n_maps
Returns the number of address maps mapping this virtual register array.
18.9.1.2.4 is_in_map
Returns TRUE if this virtual register array is in the specified address map.
18.9.1.2.5 get_maps
Returns all of the address maps where this virtual register array is mapped. maps shall be a queue.
18.9.1.2.6 get_rights
This returns “RW”, “RO”, or “WO”. The access rights of a virtual register array is always “RW”, unless it is
implemented in a shared memory with access restriction in a particular address map.
If no address map is specified and the memory is mapped in only one address map, that address map is used. If
the memory is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the memory is not mapped in the specified address map, an error message
shall be generated and "RW" is returned.
18.9.1.2.7 get_access
Returns the access policy of the virtual register array when written and read via an address map.
If the memory implementing the virtual register array is mapped in more than one address map, an address map
shall be specified. If access restrictions are present when accessing a memory through the specified address
map, the access mode returned takes the access restrictions into account. For example, a read-write memory
accessed through an address map with read-only restrictions returns "RO".
322
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.9.1.2.8 get_size
18.9.1.2.9 get_n_bytes
The width of a virtual register is always a multiple of the width of the memory locations used to implement it.
For example, a virtual register containing two 1-byte fields implemented in a memory with 4-byte memory
locations is 4-bytes wide.
18.9.1.2.10 get_n_memlocs
18.9.1.2.11 get_incr
Returns the number of memory locations between two individual virtual registers in the same array.
18.9.1.2.12 get_fields
Fills the specified array with the abstraction class for all of the virtual fields contained in this virtual register.
Fields are ordered from least significant position to most significant position within the register. fields shall be a
queue.
18.9.1.2.13 get_field_by_name
This finds a virtual field with the specified name in this virtual register and returns its abstraction class. If no
fields are found, it returns null.
18.9.1.2.14 get_offset_in_memory
This returns the base offset of the specified virtual register, in the overall address space of the memory that
implements the virtual register array.
323
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.9.1.2.15 get_address
Returns the base external physical address, in units returned by get_addr_unit_bytes() (see 18.2.4.6), of the
specified virtual register if accessed through the specified address map.
If no address map is specified and the memory implementing the virtual register array is mapped in only one
address map, that address map is used. If the memory is mapped in more than one address map, the default
address map of the parent block is used.
If an address map is specified and the memory is not mapped in the specified address map, a warning message
shall be issued.
18.9.1.3.1 write
This writes the value in the DUT memory location(s) (specified by idx) that implements the virtual register
array corresponding to this abstraction class instance using the specified access path. The filename (fname) and
line number (lineno) arguments are available for an implementation to use for debug purposes only; their value
shall have no functional effect on the outcome of this method. The default value of lineno shall be 0. See
18.6.5.1 for additional information.
18.9.1.3.2 read
324
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This reads from the DUT memory location(s) (specified by idx) that implements the virtual register array
corresponding to this abstraction class instance using the specified access path and returns the read back value.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. See 18.6.5.2 for additional information.
18.9.1.3.3 poke
Deposits the specified value in a virtual register; this deposits the value in the DUT memory location(s)
(specified by idx) that implements the virtual register array corresponding to this abstraction class instance
using the memory backdoor access. The filename (fname) and line number (lineno) arguments are available for
an implementation to use for debug purposes only; their value shall have no functional effect on the outcome of
this method. The default value of lineno shall be 0. See 18.6.5.5 for additional information.
18.9.1.3.4 peek
Samples the DUT memory location(s) (specified by idx) that implements the virtual register array
corresponding to this abstraction class instance using the memory backdoor access and returns the sampled
value. The filename (fname) and line number (lineno) arguments are available for an implementation to use for
debug purposes only; their value shall have no functional effect on the outcome of this method. The default
value of lineno shall be 0. See 18.6.5.6 for additional information.
18.9.1.3.5 reset
Resets the semaphore that prevents concurrent access to the virtual register. This semaphore shall be explicitly
reset if a thread accessing this virtual register array was killed before the access was completed. The default
value of kind shall be "HARD".
325
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.9.1.4 Callbacks
18.9.1.4.1 pre_write
If the specified data value, access path, or address map are modified, the updated data value, access path, or
address map are used to perform the virtual register operation.
The registered callback methods are invoked after the invocation of this method. All register callbacks are
executed after the corresponding field callbacks. The pre-write virtual register and field callbacks are executed
before the corresponding pre-write memory callbacks.
18.9.1.4.2 post_write
If the specified status is modified, the updated status is returned by the virtual register operation.
The registered callback methods are invoked before the invocation of this method. All register callbacks are
executed before the corresponding field callbacks. The post-write virtual register and field callbacks are
executed after the corresponding post-write memory callbacks.
18.9.1.4.3 pre_read
If the specified access path or address map are modified, the updated access path or address map are used to
perform the virtual register operation.
The registered callback methods are invoked after the invocation of this method. All register callbacks are
executed after the corresponding field callbacks. The pre-read virtual register and field callbacks are executed
before the corresponding pre-read memory callbacks.
326
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.9.1.4.4 post_read
If the specified read back data or status is modified, the updated read back data or status is returned by the
virtual register operation.
The registered callback methods are invoked before the invocation of this method. All register callbacks are
executed before the corresponding field callbacks. The post-read virtual register and field callbacks are
executed after the corresponding post-read memory callbacks.
18.9.2 uvm_vreg_cbs
18.9.2.2 Callbacks
18.9.2.2.1 pre_write
The registered callback methods are invoked after the invocation of the uvm_vreg::pre_write method (see
18.9.1.4.1). All virtual register callbacks are executed after the corresponding virtual field callbacks. The pre-
write virtual register and field callbacks are executed before the corresponding pre-write memory callbacks.
If the specified wdat value, access path, or address map are modified, the updated value, access path, or address
map are used to perform the virtual register operation.
18.9.2.2.2 post_write
327
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_door_e path,
uvm_reg_map map,
ref uvm_status_e status
)
The registered callback methods are invoked before the invocation of the uvm_vreg::post_write method (see
18.9.1.4.2). All virtual register callbacks are executed before the corresponding virtual field callbacks. The
post-write virtual register and field callbacks are executed after the corresponding post-write memory callbacks.
If the specified status is modified, the updated status is returned by the virtual register operation.
18.9.2.2.3 pre_read
The registered callback methods are invoked after the invocation of the uvm_vreg::pre_read method (see
18.9.1.4.3). All virtual register callbacks are executed after the corresponding virtual field callbacks. The pre-
read virtual register and field callbacks are executed before the corresponding pre-read memory callbacks.
If the specified access path or address map are modified, the updated access path or address map are used to
perform the virtual register operation.
18.9.2.2.4 post_read
The registered callback methods are invoked before the invocation of the uvm_vreg::post_read method (see
18.9.1.4.4). All virtual register callbacks are executed before the corresponding virtual field callbacks. The
post-read virtual register and field callbacks are executed after the corresponding post-read memory callbacks.
If the specified read back rdat value or status is modified, the updated read back value or status is returned by
the virtual register operation.
18.10 uvm_vreg_field
328
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
A virtual field is a set of contiguous bits in one or more memory locations. The semantics and layout of virtual
fields comes from an agreement between the software and the hardware, not any physical structures in the
DUT. uvm_reg_field is the virtual field abstraction base class.
18.10.2 Methods
18.10.2.1 new
This method should not be used directly. The uvm_vreg_field::type_id::create method should be used
instead.
18.10.2.2 configure
This specifies the parent virtual register of this virtual field, its size in bits, and the position of its LSB within the
virtual register relative to the LSB of the virtual register.
18.10.3 Introspection
18.10.3.1 get_parent
18.10.3.2 get_lsb_pos_in_register
Returns the position of the virtual field. Or returns the index of the LSB of the virtual field in the virtual register
that instantiates it. An offset of 0 indicates a field that is aligned with the LSB of the register.
18.10.3.3 get_n_bits
329
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.10.3.4 get_access
Returns the access policy of the virtual field register when written and read via an address map.
If the memory implementing the virtual field is mapped in more than one address map, an address map shall be
specified. If access restrictions are present when accessing a memory through the specified address map, the
access mode returned takes the access restrictions into account. For example, a read-write memory accessed
through an address map with read-only restrictions returns "RO".
18.10.4.1 write
This writes the value in the DUT memory location(s) (specified by idx) that implements the virtual field that
corresponds to this abstraction class instance using the specified access path. The filename (fname) and line
number (lineno) arguments are available for an implementation to use for debug purposes only; their value shall
have no functional effect on the outcome of this method. The default value of lineno shall be 0. See 18.6.5.1 for
additional information.
18.10.4.2 read
This reads from the DUT memory location(s) (specified by idx) that implements the virtual field that
corresponds to this abstraction class instance using the specified access path and returns the read back value. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. See 18.6.5.2 for additional information.
330
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.10.4.3 poke
This deposits the value in the DUT memory location(s) (specified by idx) that implements the virtual field
corresponding to this abstraction class instance using the specified access path. The filename (fname) and line
number (lineno) arguments are available for an implementation to use for debug purposes only; their value shall
have no functional effect on the outcome of this method. The default value of lineno shall be 0. See 18.6.5.5 for
additional information.
18.10.4.4 peek
This samples from the DUT memory location(s) (specified by idx) that implements the virtual field
corresponding to this abstraction class instance using the specified access path and returns the read back value.
The filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. See 18.6.5.6 for additional information.
18.10.5 Callbacks
18.10.5.1 pre_write
If the specified data value, access path, or address map are modified, the updated data value, access path, or
address map are used to perform the virtual register operation.
331
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The virtual field callback methods are invoked before the callback methods on the containing virtual register.
The registered callback methods are invoked after the invocation of this method. The pre-write virtual register
and field callbacks are executed before the corresponding pre-write memory callbacks.
18.10.5.2 post_write
If the specified status is modified, the updated status is returned by the virtual register operation.
The virtual field callback methods are invoked after the callback methods on the containing virtual register. The
registered callback methods are invoked before the invocation of this method. The post-write virtual register
and field callbacks are executed after the corresponding post-write memory callbacks.
18.10.5.3 pre_read
If the specified access path or address map are modified, the updated access path or address map are used to
perform the virtual register operation.
The virtual field callback methods are invoked after the callback methods on the containing virtual register. The
registered callback methods are invoked after the invocation of this method. The pre-read virtual register and
field callbacks are executed before the corresponding pre-read memory callbacks.
18.10.5.4 post_read
If the specified read back data rdat or status is modified, the updated read back data or status is returned by the
virtual register operation.
332
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The virtual field callback methods are invoked after the callback methods on the containing virtual register. The
registered callback methods are invoked before the invocation of this method. The post-read virtual register and
field callbacks are executed after the corresponding post-read memory callbacks.
18.10.6 uvm_vreg_field_cbs
18.10.6.2 Callbacks
18.10.6.2.1 pre_write
The registered callback methods are invoked before the invocation of the virtual register pre-write callbacks
and after the invocation of the uvm_vreg_field::pre_write method (see 18.10.5.1).
If the specified wdat value, access path, or address map are modified, the updated value, access path, or address
map are used to perform the register operation.
18.10.6.2.2 post_write
The registered callback methods are invoked after the invocation of the virtual register post-write callbacks and
before the invocation of the uvm_vreg_field::post_write method (see 18.10.5.2).
If the specified status is modified, the updated status is returned by the operation.
18.10.6.2.3 pre_read
333
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The registered callback methods are invoked after the invocation of the virtual register pre-read callbacks and
after the invocation of the uvm_vreg_field::pre_read method (see 18.10.5.3).
If the specified access path or address map are modified, the updated access path or address map are used to
perform the register operation.
18.10.6.2.4 post_read
The registered callback methods are invoked after the invocation of the virtual register post-read callbacks and
before the invocation of the uvm_vreg_field::post_read method (see 18.10.5.4).
If the specified read back data rdat or status is modified, the updated read back data or status is returned by the
operation.
18.11 uvm_reg_cbs
This subclause defines the base class used for all register callback extensions. It also includes predefined
callback extensions for use on read-only and write-only registers. uvm_reg_cbs is the facade class for field,
register, memory, and backdoor access callback methods.
18.11.2 Methods
18.11.2.1 new
This creates an instance of the register call back class with the specified name.
18.11.2.2 pre_write
334
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
All registered pre_write callback methods are invoked after the invocation of the pre_write method of
associated object (uvm_reg_backdoor [see 19.5], uvm_reg [see 18.4], uvm_reg_field [see 18.5], or
uvm_mem [see 18.6]).
18.11.2.3 post_write
All registered post_write callback methods are invoked before the invocation of the post_write method of
associated object (uvm_reg_backdoor [see 19.5], uvm_reg [see 18.4], uvm_reg_field [see 18.5], or
uvm_mem [see 18.6]).
18.11.2.4 pre_read
335
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
All registered pre_read callback methods are invoked after the invocation of the pre_read method of
associated object (uvm_reg_backdoor [see 19.5], uvm_reg [see 18.4], uvm_reg_field [see 18.5], or
uvm_mem [see 18.6]).
18.11.2.5 post_read
All registered post_read callback methods are invoked before the invocation of the post_read method of
associated object (uvm_reg_backdoor [see 19.5], uvm_reg [see 18.4], uvm_reg_field [see 18.5], or
uvm_mem [see 18.6]).
336
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.11.2.6 post_predict
previous is the previous value in the mirror and value is the latest predicted value. Any change to value
modifies the predicted mirror value.
18.11.2.7 encode
The registered callback methods are invoked in order of registration after all the pre_write methods (see
18.11.2.2) have been called. The encoded data is passed through each invocation in sequence. This allows the
pre_write methods to deal with clear-text data.
18.11.2.8 decode
The registered callback methods are invoked in reverse order of registration before all the post_read methods
(see 18.11.2.5) are called. The decoded data is passed through each invocation in sequence. This allows the
post_read methods to deal with clear-text data.
The reversal of the invocation order is to allow the decoding of the data to be performed in the opposite order of
the encoding, with both operations specified in the same callback extension.
18.11.3 Types
For a description of the convenience callback types for uvm_reg_cbs, see D.4.5.
18.11.4 uvm_reg_read_only_cbs
This is a predefined register callback class for read-only registers that generates an error if a write operation is
attempted.
337
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.11.4.2 Methods
18.11.4.2.1 pre_write
18.11.4.2.2 add
Adds this callback to the specified register and its contained fields.
18.11.4.2.3 remove
Removes this callback from the specified register and its contained fields.
18.11.5 uvm_reg_write_only_cbs
This is a predefined register callback method for write-only registers that generates an error if a read operation
is attempted.
18.11.5.2 Methods
18.11.5.2.1 pre_read
18.11.5.2.2 add
Adds this callback to the specified register and its contained fields.
18.11.5.2.3 remove
Removes this callback from the specified register and its contained fields.
338
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.12 uvm_mem_mam
The memory allocation management utility class is similar to C’s malloc and free functions. A single
instance of this class is used to manage the exclusive allocation of consecutive memory locations called
regions. The regions can subsequently be accessed like little memories of their own, without knowing in which
memory or offset they are actually located.
The memory allocation manager should be used by any application-level process that requires reserved space in
the memory, such as DMA buffers.
class uvm_mem_mam
18.12.2 Types
18.12.2.1 alloc_mode_e
18.12.2.2 locality_e
18.12.3 Variables
default_alloc
uvm_mem_mam_policy default_alloc
339
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.12.4 Methods
18.12.4.1 new
function new(
string name,
uvm_mem_mam_cfg cfg,
uvm_mem mem = null
)
Creates a new manager instance of a memory allocation manager with the specified name and configuration.
This instance manages all memory region allocation within the address range specified in the configuration
descriptor.
If a reference to a memory abstraction class is provided, the memory locations within the regions can be
accessed through the region descriptor, using the uvm_mem_region::read (see 18.12.7.2.9) and
uvm_mem_region::write (see 18.12.7.2.8) methods. See 18.12.9 for more details on cfg.
18.12.4.2 reconfigure
This modifies the maximum and minimum addresses of the address space managed by the allocation manager,
allocation mode, or locality. The number of bytes per memory location cannot be modified once an allocation
manager has been constructed. All currently allocated regions must fall within the new address space.
This returns the previous configuration. If no new configuration is specified, this simply returns the current
configuration.
18.12.5.1 reserve_region
Reserves a specific memory region of the specified number of bytes starting at the specified offset. A descriptor
of the reserved region is returned. If the specified region cannot be reserved, null is returned. The filename
(fname) and line number (lineno) arguments are available for an implementation to use for debug purposes
only; their value shall have no functional effect on the outcome of this method. The default value of lineno shall
be 0.
It may not be possible to reserve a region because it overlaps with an already allocated region or it lies outside
the address range managed by the memory manager.
340
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.12.5.2 request_region
Requests and reserves a memory region of the specified number of bytes starting at a random location. If a
policy is specified, it is randomized to determine the start offset of the region. If no policy is specified, the
policy found in the uvm_mem_mam::default_alloc class property (see 18.12.3) is randomized. The filename
(fname) and line number (lineno) arguments are available for an implementation to use for debug purposes
only; their value shall have no functional effect on the outcome of this method. The default value of lineno shall
be 0.
A descriptor of the allocated region is returned. If no region can be allocated, null is returned.
It may not be possible to allocate a region because there is no area in the memory with enough consecutive
locations to meet the size requirements or there is another contradiction when randomizing the policy.
18.12.5.3 release_region
Releases a previously allocated memory region. An error shall be generated if the specified region has not been
previously allocated or is no longer allocated. See 18.12.7 for more details on region.
18.12.5.4 release_all_regions
18.12.6 Introspection
18.12.6.1 convert2string
Creates a human-readable description of the state of the memory manager and the currently allocated regions.
18.12.6.2 for_each
If reset is TRUE, this resets the iterator and returns the first allocated region. It returns null when there are no
additional allocated regions to iterate. The default value of reset shall be 0, which is FALSE.
18.12.6.3 get_memory
341
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This returns the reference to the memory abstraction class for the memory implementing the locations managed
by this instance of the allocation manager. It returns null if no memory abstraction class was specified at
construction time.
18.12.7 uvm_mem_region
Each instance of this class describes an allocated memory region. Instances of this class are created only by the
memory manager and returned by the uvm_mem_mam::reserve_region (see 18.12.5.1) and
uvm_mem_mam::request_region (see 18.12.5.2) methods.
class uvm_mem_region
18.12.7.2 Methods
18.12.7.2.1 get_start_offset
This returns the address offset, within the memory, where this memory region starts.
18.12.7.2.2 get_end_offset
This returns the address offset, within the memory, where this memory region ends.
18.12.7.2.3 get_len
This returns the number of consecutive memory locations (not necessarily bytes) in the allocated region.
18.12.7.2.4 get_n_bytes
This returns the number of consecutive bytes in the allocated region. If the managed memory contains more
than one byte per address, the number of bytes in an allocated region may be greater than the number of
requested or reserved bytes.
18.12.7.2.5 release_region
342
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.12.7.2.6 get_memory
This returns a reference to the memory abstraction class for the memory implementing this allocated memory
region. It returns null if no memory abstraction class was specified for the allocation manager that allocated this
region.
18.12.7.2.7 get_virtual_registers
This returns a reference to the virtual register array abstraction class implemented in this region. It returns null
if the memory region is not known to implement virtual registers.
18.12.7.2.8 write
task write(
output uvm_status_e status,
input uvm_reg_addr_t offset,
input uvm_reg_data_t value,
input uvm_door_e path = UVM_DEFAULT_DOOR,
input uvm_reg_map map = null,
input uvm_sequence_base parent = null,
input int prior = -1,
input uvm object extension = null,
input string fname = "",
input int lineno = 0
)
Writes to the memory location that corresponds to the specified offset within this region. This requires that the
memory abstraction class be associated with the memory allocation manager that allocated this region. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. See 18.6.5.1 for additional information.
18.12.7.2.9 read
task read(
output uvm_status_e status,
input uvm_reg_addr_t offset,
output uvm_reg_data_t value,
input uvm_door_e path = UVM_DEFAULT_DOOR,
input uvm_reg_map map = null,
input uvm_sequence_base parent = null,
input int prior = -1,
input uvm_object extension = null,
input string fname = "",
343
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Reads from the memory location that corresponds to the specified offset within this region. This requires that the
memory abstraction class be associated with the memory allocation manager that allocated this region. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. See 18.6.5.2 for additional information.
18.12.7.2.10 burst_write
task burst_write(
output uvm_status_e status,
input uvm_reg_addr_t offset,
input uvm_reg_data_t value[],
input uvm_door_e path = UVM_DEFAULT_DOOR,
input uvm_reg_map map = null,
input uvm_sequence_base parent = null,
input int prior = -1,
input uvm_object extension = null,
input string fname = "",
input int lineno = 0
)
Writes to the memory locations that corresponds to the specified burst within this region. This requires that the
memory abstraction class be associated with the memory allocation manager that allocated this region. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. See 18.6.5.3 for additional information.
18.12.7.2.11 burst_read
task burst_read(
output uvm_status_e status,
input uvm_reg_addr_t offset,
output uvm_reg_data_t value[],
input uvm_door_e path = UVM_DEFAULT_DOOR,
input uvm_reg_map map = null,
input uvm_sequence_base parent = null,
input int prior = -1,
input uvm_object extension = null,
input string fname = "",
input int lineno = 0
)
Reads from the memory locations that corresponds to the specified burst within this region. This requires that
the memory abstraction class be associated with the memory allocation manager that allocated this region. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. See 18.6.5.4 for additional information.
344
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.12.7.2.12 poke
task poke(
output uvm_status_e status,
input uvm_reg_addr_t offset,
input uvm_reg_data_t value,
input uvm_sequence_base parent = null,
input uvm_object extension = null,
input string fname = "",
input int lineno = 0
)
Deposits the specified value in the memory location that corresponds to the specified offset within this region.
This requires that the memory abstraction class be associated with the memory allocation manager that
allocated this region. The filename (fname) and line number (lineno) arguments are available for an
implementation to use for debug purposes only; their value shall have no functional effect on the outcome of
this method. The default value of lineno shall be 0. See 18.6.5.5 for additional information.
18.12.7.2.13 peek
task peek(
output uvm_status_e status,
input uvm_reg_addr_t offset,
output uvm_reg_data_t value,
input uvm_sequence_base parent = null,
input uvm_object extension = null,
input string fname = "",
input int lineno = 0
)
Samples the memory location that corresponds to the specified offset within this region. This requires that the
memory abstraction class be associated with the memory allocation manager that allocated this region. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0. See 18.6.5.6 for additional information.
18.12.8 uvm_mem_mam_policy
An instance of this class is randomized to determine the starting offset of a randomly allocated memory region.
This class can be extended to provide additional constraints on the starting offset, such as word alignment or
location of the region within a memory page. If a procedural region allocation policy is required, it can be
implemented in the pre_randomize/post_randomize method.
class uvm_mem_mam_policy
18.12.8.2 Variables
18.12.8.2.1 len
345
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.12.8.2.2 start_offset
18.12.8.2.3 min_offset
uvm_reg_addr_t min_offset
18.12.8.2.4 max_offset
uvm_reg_addr_t max_offset
18.12.8.2.5 in_use
uvm_mem_region in_use[$]
The regions already allocated in the managed address space. in_use shall be a queue.
18.12.9 uvm_mem_mam_cfg
This specifies the memory managed by an instance of a uvm_mem_mam memory allocation manager class
(see 18.12).
class uvm_mem_mam_cfg
18.12.9.2 Variables
18.12.9.2.1 n_bytes
18.12.9.2.2 start_offset
18.12.9.2.3 end_offset
346
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
18.12.9.2.4 mode
18.12.9.2.5 locality
This subclause defines the abstract register transaction item. It also defines a descriptor for a physical bus
operation that is used by uvm_reg_adapter subtypes (see 19.2.1) to convert from a protocol-specific
address/data/rw operation to a bus-independent, canonical rw operation.
19.1.1 uvm_reg_item
Defines an abstract register transaction item. No bus-specific information is present, although a handle to a
uvm_reg_map (see 18.2) is provided in case a user wishes to implement a custom address translation
algorithm.
Kind of element being accessed: UVM_REG, UVM_MEM, or UVM_FIELD (see 18.2.5). get_element_kind
shall return the most recent element_kind assigned via set_element_kind. The value returned by
get_element_kind prior to any set_element_kind call is undefined.
19.1.1.2.2 Element
A handle to the RegModel model element associated with this transaction. Use the element kind (see
19.1.1.2.1) to determine the type to cast to: uvm_reg (see 18.4), uvm_mem (see 18.6), or uvm_reg_field (see
18.5). get_element shall return the most recent element assigned via set_element. The value returned by
get_element prior to any set_element call shall be null.
347
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
19.1.1.2.3 Kind
The value to write to, or after completion, the value read from the DUT.
get_value_size shall return the size of the item’s internal value array. By default, the item stores a single value
element (i.e., get_value_size returns 1). Burst operations may change the size of the item’s internal value array
using set_value_size. Data values at indexes less than sz are unaffected by set_value_size. Any new data
values created by passing a sz greater than the current get_value_size shall be initialized to 0.
A warning message shall be issued if the idx of set_value is equal to or greater than the current get_value_size,
and the request shall be ignored. If get_value is called with an idx equal to or greater than get_value_size, then
a warning message shall be issued and 0 shall be returned.
Additionally, methods are provided for efficiently getting or setting item value(s) using dynamic arrays.
set_value_array shall be functionally equivalent to calling set_value_size, followed by set_value for each
value in the value array. get_value_array shall be functionally equivalent to calling
new[item.get_value_size] on value and then passing in the values returned by get_value.
19.1.1.2.5 Offset
For memory accesses, the offset address. For bursts, the starting offset address. get_offset shall return the most
recent offset assigned via set_offset. The value returned by get_offset prior to any set_offset call is 0.
19.1.1.2.6 Status
The result of the transaction: UVM_IS_OK, UVM_HAS_X, or UVM_NOT_OK (see 17.2.2.1). get_status
shall return the most recent status assigned via set_status. The value returned by get_status prior to any
set_status call is undefined.
348
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The local map used to obtain addresses. Users may customize address-translation using this map. Access to the
sequencer and bus adapter can be obtained by retrieving this map’s root map, then calling
uvm_reg_map::get_sequencer (see 18.2.4.8) and uvm_reg_map::get_adapter (see 18.2.4.9). get_local_map
shall return the most recent map assigned via set_local_map. The value returned by get_local_map prior to
any set_local_map call is null.
19.1.1.2.8 Map
The original map specified for the operation. The actual map used may differ when a test or sequence written at
the block level is reused at the system level. get_map shall return the most recent map assigned via set_map.
The value returned by get_map prior to any set_map call is null.
19.1.1.2.9 Door
The door being used (see 17.2.2.2). get_door shall return the most recent door assigned via set_door. The
value returned by get_door prior to any set_door call is undefined.
The sequence from which the operation originated. get_parent_sequence shall return the most recent parent
assigned via set_parent_sequence. The value returned by get_parent_sequence prior to any
set_parent_sequence call is null.
19.1.1.2.11 Priority
19.1.1.2.12 Extension
A handle to optional user data, as conveyed in the call to write, read, mirror, or update, which is used to
trigger the operation. get_extension shall return the most recent extension assigned via set_extension. The
value returned by get_extension prior to any set_extension call is null.
349
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
When path is UVM_BACKDOOR (see 19.1.1.2.9), this member specifies the abstraction kind for the backdoor
access, e.g., "RTL". get_bd_kind shall return the most recent bd_kind assigned via set_bd_kind. The value
returned by get_bd_kind prior to any set_bd_kind call is an empty string ("").
The file name from where this transaction originated, if provided at the call site. get_fname shall return the
most recent fname assigned via set_fname. The value returned by get_fname prior to any set_fname call is an
empty string ("").
The line number from where this transaction originated, if provided at the call site. get_line shall return the
most recent line assigned via set_line. The value returned by get_line prior to any set_line call is 0.
19.1.1.3.1 new
19.1.1.3.2 convert2string
19.1.2 uvm_reg_bus_op
A struct that defines a generic bus transaction for register and memory accesses, having kind (read or write),
address, data, and byte enable information. The uvm_reg_bus_op is passed to the reg2bus() method of the
uvm_reg_adapter (see 19.2.1.2.5) by the uvm_reg_map when initiating a frontdoor register or memory
access, and is passed to the bus2reg() method of the uvm_reg_adapter (see 19.2.1.2.6) by the uvm_reg_map
when processing a read response, or by the predictor when receiving a bus analysis transaction, on completion
of a frontdoor bus cycle.
Both the register adapter and the register map should be aware of the endianness and bus width of the target bus
interface, and the adapter should take this information into account when processing uvm_reg_bus_op structs
and target bus sequence_items.
350
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If the bus byte-width setting in the address map is narrower than the register or memory location being accessed,
there shall be multiples of these bus operations for every abstract uvm_reg_item transaction (see 19.1.1). In
this case, data represents the portion of uvm_reg_item::value (see 19.1.1.2.4) being transferred during this bus
cycle. If the bus is wide enough to perform the register or memory operation in a single cycle, data is the same
as the uvm_reg_item::value.
19.1.2.1 kind
uvm_access_e kind
19.1.2.2 addr
uvm_reg_addr_t addr
This is the bus address, address, calculated by the uvm_reg_map and should be used by the uvm_reg_adapter
extension as the basis of a bus transaction.
If the width of the register is equal to or less than the bus width configured in the address map, then the address
value corresponds to the offset of the register or memory location. Otherwise, two or more uvm_reg_bus_op
structs will be processed by the adapter for one register or memory access, and after the first address each
subsequent address offset shall be data aligned, calculated to take into account the endianness and bus width.
19.1.2.3 data
uvm_reg_data_t data
The data to write or read, aligned with the address, according to endianness and address map bus width. If the
bus width is smaller than the register or memory width, data represents only the portion of value that is being
transferred this bus cycle.
19.1.2.4 n_bits
int n_bits
The number of bits of uvm_reg_item::value (see 19.1.1.2.4) being transferred by this transaction.
19.1.2.5 byte_en
uvm_reg_byte_en_t byte_en
Specifies the enables for the byte lanes on the bus, as with the data, aligned to the address.
19.1.2.6 status
uvm_status_e status
351
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This subclause defines the classes used to convert transaction streams between generic register address/data
reads and writes and physical bus accesses.
19.2.1 uvm_reg_adapter
This class defines an interface for converting between a uvm_reg_bus_op (see 19.1.2) and a specific bus
transaction.
19.2.1.2.1 new
19.2.1.2.2 supports_byte_enable
bit supports_byte_enable
Specifies this bit in extensions of this class if the bus protocol supports byte enables.
19.2.1.2.3 provides_responses
bit provides_responses
Specifies this bit in extensions of this class if the bus driver provides separate response items.
19.2.1.2.4 parent_sequence
uvm_sequence_base parent_sequence
Specifies this member in extensions of this class if the bus driver requires bus items be executed via a particular
sequence base type. The sequence assigned to this member needs to implement do_clone.
19.2.1.2.5 reg2bus
Extensions of this class need to implement this method to convert the specified uvm_reg_bus_op (see 19.1.2)
to a corresponding uvm_sequence_item subtype (see 14.1) that defines the bus transaction.
The method shall allocate a new bus-specific uvm_sequence_item, assign its members from the corresponding
members from the given generic rw bus operation, then return it.
352
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
19.2.1.2.6 bus2reg
Extensions of this class need to implement this method to copy members of the given bus-specific bus_item to
corresponding members of the provided rw instance. Unlike reg2bus (see 19.2.1.2.5), the resulting transaction
is not allocated from scratch. This is to accommodate applications where the bus response needs to be returned
in the original request.
19.2.1.2.7 get_item
This returns the bus-independent read/write information corresponding to the generic bus transaction currently
translated to a bus-specific transaction. This function returns a value reference only when called in the
uvm_reg_adapter::reg2bus method (see 19.2.1.2.5); otherwise, it returns null. The content of the returned
uvm_reg_item instance (see 19.1.1) shall not be modified and is used strictly to obtain additional information
about the operation.
19.2.2 uvm_reg_tlm_adapter
This class defines an interface for converting between uvm_reg_bus_op (see 19.1.2) and uvm_tlm_gp (see
12.3.4.3) items.
19.2.2.2 Methods
19.2.2.2.1 reg2bus
19.2.2.2.2 bus2reg
Converts a uvm_tlm_gp item (see 12.3.4.3) to a uvm_reg_bus_op (see 19.1.2), using the provided rw
transaction.
19.3 uvm_reg_predictor
The uvm_reg_predictor class defines a predictor component, which is used to update the register model’s
mirror values based on transactions explicitly observed on a physical bus.
353
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This class converts observed bus transactions of type BUSTYPE to generic registers transactions, determines how
the register is being accessed based on the bus address, then updates the register’s mirror value with the
observed bus data, subject to the register’s access mode. See 18.4.4.15 for details.
19.3.2 Variables
19.3.2.1 bus_in
uvm_analysis_imp #(
BUSTYPE,
uvm_reg_predictor #(BUSTYPE)
) bus_in
Observed bus transactions of type BUSTYPE are received from this port and processed.
For each incoming transaction, the predictor attempts to find the register handle corresponding to the observed
bus address.
If there is a match, the predictor calls the register’s predict method, passing in the observed bus data. The
register mirror is updated with this data, subject to its configured access behavior: RW, RO, etc. The predictor
also converts the bus transaction to a generic uvm_reg_item (see 19.1.1) and sends it out the reg_ap analysis
port (see 19.3.2.2).
If the register is wider than the bus, the predictor collects the multiple bus transactions needed to determine the
value being read or written.
19.3.2.2 reg_ap
This is an analysis output port that publishes uvm_reg_item transactions (see 19.1.1) converted from bus
transactions received on bus_in (see 19.3.2.1).
19.3.2.3 map
uvm_reg_map map
This is the map used to convert a bus address to the corresponding register or memory handle. It needs to be
configured before the run phase.
19.3.2.4 adapter
uvm_reg_adapter adapter
This is the adapter used to convey the parameters of a bus operation in terms of a canonical uvm_reg_bus_op
datum (see 19.1.2). The uvm_reg_adapter (see 19.2.1) needs to be configured before the run phase.
354
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
19.3.3 Methods
19.3.3.1 new
function new (
string name,
uvm_component parent
)
Creates a new instance of this type, giving it the optional name and parent.
19.3.3.2 pre_predict
Override this method to change the value or redirect the target register.
19.3.3.3 check_phase
This subclause defines the base classes used for register stimulus generation.
19.4.1 uvm_reg_sequence
This class provides base functionality for both user-defined RegModel test sequences and “register translation
sequences.”
When used as a base for user-defined RegModel test sequences, this class provides convenience
methods for reading and writing registers and memories. Users implement the body method to interact
directly with the RegModel model (held in the model property [see 19.4.1.3.1]) or indirectly via the
delegation methods in this class.
When used as a translation sequence, objects of this class are executed directly on a bus sequencer,
which are used in support of a layered sequencer use model; a predefined convert-and-execute
algorithm is also provided.
Register operations do not require extending this class if none of the preceding services are needed. Register test
sequences can be extended from the uvm_sequence #(REQ,RSP) base class (see 14.3) or even from outside a
sequence.
BASE
355
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
When used as a translation sequence running on a bus sequencer, BASE shall be compatible with the
sequence type expected by the bus sequencer.
When used as a test sequence running on a particular sequencer, BASE shall be compatible with the
sequence type expected by that sequencer.
When used as a virtual test sequence without a sequencer, BASE does not need to be specified, i.e., the
default specialization is adequate.
To maximize opportunities for reuse, user-defined RegModel sequences should “promote” the BASE parameter.
This way, the RegModel sequence can be extended from user-defined base sequences.
19.4.1.3 Variables
19.4.1.3.1 model
uvm_reg_block model
Block abstraction on which this sequence executes, defined only when this sequence is a user-defined test
sequence.
19.4.1.3.2 adapter
uvm_reg_adapter adapter
This is an adapter to use for translating between abstract register transactions and physical bus transactions,
defined only when this sequence is a translation sequence.
19.4.1.3.3 reg_seqr
It specifies the upstream sequencer between abstract register transactions and physical bus transactions. This is
defined only when this sequence is a translation sequence to “pull” from an upstream sequencer.
19.4.1.4.1 new
19.4.1.4.2 body
356
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Continually retrieves a register transaction from the configured upstream sequencer, reg_seqr (see 19.4.1.3.3),
and executes the corresponding bus transaction via do_reg_item (see 19.4.1.4.3).
User-defined RegModel test sequences need to override body and not call super.body(); otherwise, a
warning shall be issued and the calling process does not return.
19.4.1.4.3 do_reg_item
Executes the given register transaction, rw, via the sequencer on which this sequence was started. This uses the
configured adapter (see 19.4.1.3.2) to convert the register transaction into the type expected by this sequencer.
The following methods delegate to the corresponding method in the register or memory element. They allow a
sequence body (see 19.4.1.4.2) to do reads and writes without having to explicitly supply itself to the parent
sequence argument. Thus, a register write
19.4.1.5.1 write_reg
Writes the given register rg using uvm_reg::write (see 18.4.4.9), supplying this as the parent argument. The
default value of path shall be UVM_DEFAULT_DOOR. The default value of prior shall be -1. The filename
(fname) and line number (lineno) arguments are available for an implementation to use for debug purposes
only; their value shall have no functional effect on the outcome of this method. The default value of lineno shall
be 0.
19.4.1.5.2 read_reg
357
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Reads the given register rg using uvm_reg::read (see 18.4.4.10), supplying this as the parent argument. The
default value of path shall be UVM_DEFAULT_DOOR. The default value of prior shall be -1. The filename
(fname) and line number (lineno) arguments are available for an implementation to use for debug purposes
only; their value shall have no functional effect on the outcome of this method. The default value of lineno shall
be 0.
Thus,
is equivalent to
19.4.1.5.3 poke_reg
Pokes the given register rg using uvm_reg::poke (see 18.4.4.11), supplying this as the parent argument. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
Thus,
is equivalent to
19.4.1.5.4 peek_reg
358
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Peeks the given register rg using uvm_reg::peek (see 18.4.4.12), supplying this as the parent argument. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
Thus,
is equivalent to
19.4.1.5.5 update_reg
Updates the given register rg using uvm_reg::update (see 18.4.4.13), supplying this as the parent argument.
The default value of path shall be UVM_DEFAULT_DOOR. The default value of prior shall be -1. The filename
(fname) and line number (lineno) arguments are available for an implementation to use for debug purposes
only; their value shall have no functional effect on the outcome of this method. The default value of lineno shall
be 0.
Thus,
is equivalent to
19.4.1.5.6 mirror_reg
359
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Mirrors the given register rg using uvm_reg::mirror (see 18.4.4.14), supplying this as the parent argument.
The default value of check shall be UVM_NO_CHECK. The default value of path shall be UVM_DEFAULT_DOOR.
The default value of prior shall be -1. The filename (fname) and line number (lineno) arguments are available
for an implementation to use for debug purposes only; their value shall have no functional effect on the
outcome of this method. The default value of lineno shall be 0.
Thus,
is equivalent to
19.4.1.5.7 write_mem
Writes the given memory mem using uvm_mem::write (see 18.6.5.1), supplying this as the parent
argument. The default value of path shall be UVM_DEFAULT_DOOR. The default value of prior shall be -1. The
filename (fname) and line number (lineno) arguments are available for an implementation to use for debug
purposes only; their value shall have no functional effect on the outcome of this method. The default value of
lineno shall be 0.
Thus,
is equivalent to
19.4.1.5.8 read_mem
360
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Reads the location offset in the given memory mem using uvm_mem::read (see 18.6.5.2), supplying this as
the parent argument. The default value of path shall be UVM_DEFAULT_DOOR. The default value of prior shall
be -1. The filename (fname) and line number (lineno) arguments are available for an implementation to use for
debug purposes only; their value shall have no functional effect on the outcome of this method. The default
value of lineno shall be 0.
Thus,
is equivalent to
19.4.1.5.9 poke_mem
Pokes the location offset in the given memory mem using uvm_mem::poke (see 18.6.5.5), supplying this as
the parent argument. The filename (fname) and line number (lineno) arguments are available for an
implementation to use for debug purposes only; their value shall have no functional effect on the outcome of
this method. The default value of lineno shall be 0.
Thus,
is equivalent to
19.4.1.5.10 peek_mem
361
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Peeks the location offset in the given memory mem using uvm_mem::peek (see 18.6.5.6), supplying this as
the parent argument. The filename (fname) and line number (lineno) arguments are available for an
implementation to use for debug purposes only; their value shall have no functional effect on the outcome of
this method. The default value of lineno shall be 0.
Thus,
is equivalent to
19.4.2 uvm_reg_frontdoor
The facade class for register and memory frontdoor access; a user-defined frontdoor access sequence.
This is the base class for user-defined access to register and memory reads and writes through a physical
interface. By default, different registers and memories are mapped to different addresses in the address space and
are accessed via those physical addresses.
The frontdoor allows access using a non-linear and/or non-mapped mechanism. Users can extend this class to
provide the physical access to these registers.
19.4.2.2 Variables
19.4.2.2.1 rw_info
uvm_reg_item rw_info
19.4.2.2.2 sequencer
uvm_sequencer_base sequencer
19.4.2.3 Methods
new
function new( string name = "" )
362
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
19.5 uvm_reg_backdoor
The base class for user-defined backdoor register and memory access.
This class can be extended by users to provide user-specific backdoor access to registers and memories that are
not implemented in pure SystemVerilog or that are not accessible using the default DPI backdoor mechanism.
19.5.2 Methods
19.5.2.1 new
Initializes an instance of the user-defined backdoor class for the specified register or memory.
19.5.2.2 do_pre_read
This method shall be called as the first statement in a user extension of the read method (see 19.5.2.7).
19.5.2.3 do_post_read
This method shall be called as the last statement in a user extension of the read method (see 19.5.2.7).
19.5.2.4 do_pre_write
This method shall be called as the first statement in a user extension of the write method (see 19.5.2.6).
19.5.2.5 do_post_write
This method shall be called as the last statement in a user extension of the write method (see 19.5.2.6).
363
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
19.5.2.6 write
This calls do_pre_write (see 19.5.2.4) and deposits the specified value in the specified register HDL
implementation. Then it calls do_post_write (see 19.5.2.5) and returns an indication of the success of the
operation.
19.5.2.7 read
A user-defined backdoor read operation; overload this method only if the back door requires the use of task.
This calls do_pre_read (see 19.5.2.2) and peeks the current value of the specified HDL implementation. Then
it calls do_post_read (see 19.5.2.3) and returns the current value and an indication of the success of the
operation.
By default, this calls read_func (see 19.5.2.8) to perform the peek step.
19.5.2.8 read_func
This peeks the current value in the HDL implementation. It then returns the current value and an indication of
the success of the operation.
19.5.2.9 pre_read
The registered callback methods are invoked after the invocation of this method.
19.5.2.10 post_read
The registered callback methods are invoked before the invocation of this method.
19.5.2.11 pre_write
The registered callback methods are invoked after the invocation of this method.
364
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
19.5.2.12 post_write
The registered callback methods are invoked before the invocation of this method.
NOTE—To avoid having to use these APIs, define the UVM_HDL_NO_DPI macro at compile time.
19.6.1 Variables
UVM_HDL_MAX_WIDTH
parameter int UVM_HDL_MAX_WIDTH = `UVM_HDL_MAX_WIDTH
19.6.2 Methods
19.6.2.1 uvm_hdl_check_path
Checks that the given HDL path exists. This returns 0 if not found, 1 otherwise.
19.6.2.2 uvm_hdl_deposit
Specifies the given HDL path as the specified value. This returns 1 if the call succeeded, 0 otherwise.
19.6.2.3 uvm_hdl_force
Forces the value on the given path. This returns 1 if the call succeeded, 0 otherwise.
365
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
19.6.2.4 uvm_hdl_force_time
task uvm_hdl_force_time(
string path,
uvm_hdl_data_t value,
time force_time = 0
)
Forces the value on the given path for the specified amount of force_time. If force_time is 0, uvm_hdl_deposit
(see 19.6.2.2) is called. This returns 1 if the call succeeded, 0 otherwise. The default value of force_time shall
be 0.
19.6.2.5 uvm_hdl_release_and_read
Releases a value previously specified by uvm_hdl_force (see 19.6.2.3). This returns 1 if the call succeeded, 0
otherwise. value is reset to the HDL value after the release. For reg, the value remains the forced value until it
has been procedurally reassigned. For wire, the value changes immediately to the resolved value of its
continuous drivers, if any. If none, its value remains as forced until the next direct assignment.
19.6.2.6 uvm_hdl_release
Releases a value previously specified by uvm_hdl_force (see 19.6.2.3). This returns 1 if the call succeeded, 0
otherwise.
19.6.2.7 uvm_hdl_read
Returns the value at the given path. This returns 1 if the call succeeded, 0 otherwise.
366
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Annex A
(informative)
Bibliography
Bibliographical references are resources that provide additional or helpful material but do not need to be
understood or used to implement this standard. Reference to these resources is made for informational use only.
[B1] IEEE Std 1003.1™-2008, IEEE Standard for Information Technology—Portable Operating System
Interface (POSIX) Base Specifications, Issue 7. 11, 12
[B2] IEEE Std 1666™, IEEE Standard for SystemC Language Reference Manual.
[B3] IEEE Std 1685™, IEEE Standard for IP-XACT, Standard Structure for Packaging, Integrating, and
Reusing IP within Tool Flows.
11
The IEEE standards or products referred to in Annex A are trademarks owned by The Institute of Electrical and Electronics Engineers,
Incorporated.
12
IEEE publications are available from The Institute of Electrical and Electronics Engineers (http://standards.ieee.org).
367
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Annex B
(normative)
Universal Verification Methodology (UVM) includes some macros to allow the user to specify intent without
the need to specify multiple types of SystemVerilog constructs. These macros assist with reporting, object
behavior (interaction with the factory and field usage in comparing/copying, etc.), sequence specification, and
UVM transaction-level modeling (TLM) connection.
UVM also includes some defines to specify sizing in the register space and to determine version of the UVM
standard and/or implementation.
This set of macros provides wrappers around the uvm_report_* reporting functions (see F.2.2). The macros
serve two essential purposes, as follows:
To reduce the processing overhead associated with filtered out info messages, a check is made against
the report’s verbosity setting and the action for the id/severity pair before any string formatting is
performed.
The ` FILE and ` LINE information is automatically provided to the underlying uvm_report_*
call. Having the file and line number from where a report was issued aides in debugging.
The macros also enforce a verbosity setting of UVM_NONE for warnings, errors, and fatals.
While the implementation of the macros is not strictly defined, the following restrictions are placed upon the
implementation:
B.1.1.1 `uvm_info
Calls uvm_report_info (see F.3.2.3) if VERBOSITY is lower than the configured verbosity of the associated
reporter. ID is the message tag and MSG is the message text. The file and line are also sent to the
uvm_report_info call.
B.1.1.2 `uvm_warning
`uvm_warning(ID, MSG)
Calls uvm_report_warning (see F.3.2.3) with a verbosity of UVM_NONE. ID is the message tag and MSG is the
message text. The file and line are also sent to the uvm_report_warning call.
368
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.1.1.3 `uvm_error
`uvm_error(ID, MSG)
Calls uvm_report_error (see F.3.2.3) with a verbosity of UVM_NONE. ID is the message tag and MSG is the
message text. The file and line are also sent to the uvm_report_error call.
B.1.1.4 `uvm_fatal
`uvm_fatal(ID, MSG)
Calls uvm_report_fatal (see F.3.2.3) with a verbosity of UVM_NONE. ID is the message tag and MSG is the
message text. The file and line are also sent to the uvm_report_fatal call.
B.1.1.5 `uvm_info_context
Operates identically to `uvm_info (see B.1.1.1), but requires that the context, or uvm_report_object (see 6.3),
in which the message is printed is also explicitly supplied as a macro argument. RO is an optional reference to a
user-declared report message that will be used by the macro.
B.1.1.6 `uvm_warning_context
Operates identically to `uvm_warning (see B.1.1.2), but requires that the context, or uvm_report_object (see
6.3), in which the message is printed is also explicitly supplied as a macro argument. RO is an optional
reference to a user-declared report message that will be used by the macro.
B.1.1.7 `uvm_error_context
Operates identically to `uvm_error (see B.1.1.3), but requires that the context, or uvm_report_object (see
6.3), in which the message is printed is also explicitly supplied as a macro argument.
B.1.1.8 `uvm_fatal_context
Operates identically to `uvm_fatal (see B.1.1.4), but requires that the context, or uvm_report_object (see 6.3),
in which the message is printed is also explicitly supplied as a macro argument. RO is an optional reference to a
user-declared report message that will be used by the macro.
The utils macros define the infrastructure needed to enable the object/component for correct factory operation.
See B.2.1.2 and B.2.1.3 for details.
A utils macro should be used inside every user-defined class that extends uvm_object directly or indirectly (see
5.3), including uvm_sequence_item (see 14.1) and uvm_component (see 13.1).
369
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Examples
These macros form a block in which `uvm_field_* macros (see B.2.2) can be placed, as shown in the following
meta-example:
`uvm_field_utils_begin(TYPE)
`uvm_field_* macros here
`uvm_field_utils_end
These macros do not perform factory registration nor implement the get_type_name and create methods. Use
this form when custom implementations of these two methods are needed or to set up field macros for an
abstract class (i.e., a virtual class).
The `uvm_object*_utils_begin and _end macros, as well as their `uvm_component* counterparts, use these
macros.
uvm_object–based class declarations (see 5.3) may contain one of these forms of utility macros. For simple
objects with no field macros, use:
`uvm_object_utils(TYPE)
`uvm_object_utils_begin(TYPE)
`uvm_field_* macro invocations here
`uvm_object_utils_end
370
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
`uvm_object_param_utils(TYPE)
`uvm_object_param_utils_begin(TYPE)
`uvm_field_* macro invocations here
`uvm_object_utils_end
Simple (non-parameterized) objects use the uvm_object_utils* versions, which do the following:
Abstract classes shall use the uvm_object_abstract* versions. They only differ from the uvm_object_utils*
and uvm_object_param_utils* in that they use uvm_abstract_object_registry instead of
uvm_object_registry.
Any macros with _begin suffixes are the same as the non-suffixed versions except they also start a block in
which `uvm_field_* macros (see B.2.2) can be placed. This block shall be terminated by
`uvm_object_utils_end.
uvm_component–based class declarations (see 13.1) may contain one of these forms of utility macros. For
simple components with no field macros, use:
`uvm_component_utils(TYPE)
`uvm_component_utils_begin(TYPE)
`uvm_field_* macro invocations here
`uvm_component_utils_end
`uvm_component_param_utils(TYPE)
371
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
`uvm_component_param_utils_begin(TYPE)
`uvm_field_* macro invocations here
`uvm_component_utils_end
Simple (non-parameterized) components use the uvm_component_utils* versions, which do the following:
Abstract classes shall use the uvm_component_abstract* versions. They only differ from the
uvm_component_utils* and uvm_component_param_utils* in that they use
uvm_abstract_component_registry instead of uvm_component_registry.
Any macros with _begin suffixes are the same as the non-suffixed versions except they also start a block in
which `uvm_field_* macros (see B.2.2) can be placed. This block shall be terminated by
`uvm_component_utils_end.
B.2.1.4 `uvm_object_registry
`uvm_object_registry(T,S)
Registers a uvm_object–based class T and lookup string S with the factory (see 5.3). S typically is the name of
the class in quotes (""). The `uvm_object_utils family of macros (see B.2.1.2) uses this macro.
B.2.1.5 `uvm_component_registry
`uvm_component_registry(T,S)
Registers a uvm_component–based class T and lookup string S with the factory (see 13.1). S typically is the
name of the class in quotes (""). The `uvm_component_utils family of macros (see B.2.1.3) uses this macro.
The `uvm_field_* macros are invoked inside of the `uvm_*_utils_begin and `uvm_*_utils_end macro blocks
(see B.2.1) to leverage implementation-specific versions of the core data methods: copy, compare, pack,
unpack, record, print, and sprint. If these macros are used, the do_* methods inherited from uvm_object (see
5.3) do not have to be implemented.
NOTE—The field macros expand into general inline code that may not be as run-time efficient nor as flexible as direct
implementations of the do_* methods. If specific run-time semantics or efficiency are required, then direct implementations
of the do_* methods should be used instead.
372
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Each `uvm_field_* macro is named according to the particular data type it handles: integrals, strings, objects,
queues, etc.; each also has at least two arguments, ARG and FLAG:
a) ARG—is the instance name of the variable, whose type shall be compatible with the macro being
invoked. ARG shall not be a constant, such as const variables, compile time constants, or elaboration
time constants.
b) FLAG—specifies the operations, abstraction, radix, and recursion policy to be applied by the macro
when operating on ARG. Flag options are bitwise ORed to form a complete description.
Any number of field operation types (see F.2.1.8) and field macro operation flags (see F.2.1.9) may be bitwise
ORed, however, the negative flags (UVM_NO*) take precedence over their positive counterparts (including
UVM_ALL_ON and UVM_DEFAULT). For example: (UVM_COPY | UVM_NOCOPY) is treated as UVM_NOCOPY
within the macro. Additionally, the packing and unpacking operations are paired, such that UVM_PACK enables
both packing and unpacking, and UVM_NOPACK disables both packing and unpacking.
All uvm_radix_enum values (see F.2.1.5), as well as all uvm_recursion_policy_enum values (see F.2.1.6),
are supported as flags; however, only a single radix and a single recursion policy can be selected for a given
declaration. This has the consequence of mandating that the two enums shall use compatible values. The result
of bitwise ORing multiple radix or recursion policy values within a single FLAG description is undefined. If no
uvm_radix_enum value is provided, then the macro shall proceed as though UVM_NORADIX had been
provided. If no uvm_recursion_policy_enum is provided, then the macro shall proceed as though
UVM_DEFAULT_POLICY had been provided.
These are macros that implement data operations for scalar properties.
B.2.2.1.1 `uvm_field_int
`uvm_field_int(ARG,FLAG=UVM_DEFAULT)
ARG is an integral non constant property of the class, and FLAG is a bitwise OR of one or more flag settings as
described in B.2.2.
B.2.2.1.2 `uvm_field_object
`uvm_field_object(ARG,FLAG=UVM_DEFAULT)
ARG is an object property of the class, and FLAG is a bitwise OR of one or more flag settings as described in
B.2.2.
B.2.2.1.3 `uvm_field_string
`uvm_field_string(ARG,FLAG=UVM_DEFAULT)
ARG is a string property of the class, and FLAG is a bitwise OR of one or more flag settings as described in
B.2.2.
373
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.2.2.1.4 `uvm_field_enum
`uvm_field_enum(T, ARG,FLAG=UVM_DEFAULT)
T is an enumerated type, ARG is an instance of that type, and FLAG is a bitwise OR of one or more flag settings
as described in B.2.2.
B.2.2.1.5 `uvm_field_real
`uvm_field_real(ARG,FLAG=UVM_DEFAULT)
ARG is a real property of the class, and FLAG is a bitwise OR of one or more flag settings as described in
B.2.2.
B.2.2.1.6 `uvm_field_event
`uvm_field_event(ARG,FLAG=UVM_DEFAULT)
ARG is an event property of the class, and FLAG is a bitwise OR of one or more flag settings as described in
B.2.2.
These are macros that implement data operations for one-dimensional static array properties.
B.2.2.2.1 `uvm_field_sarray_int
`uvm_field_sarray_int(ARG,FLAG=UVM_DEFAULT)
ARG is a one-dimensional static array of integrals, and FLAG is a bitwise OR of one or more flag settings as
described in B.2.2.
B.2.2.2.2 `uvm_field_sarray_object
`uvm_field_sarray_object(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for a one-dimensional static array of uvm_object–based objects (see 5.3).
ARG is a one-dimensional static array of uvm_object–based objects, and FLAG is a bitwise OR of one or
more flag settings as described in B.2.2.
B.2.2.2.3 `uvm_field_sarray_string
`uvm_field_sarray_string(ARG,FLAG=UVM_DEFAULT)
374
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
ARG is a one-dimensional static array of strings, and FLAG is a bitwise OR of one or more flag settings as
described in B.2.2.
B.2.2.2.4 `uvm_field_sarray_enum
`uvm_field_sarray_enum(T, ARG,FLAG=UVM_DEFAULT)
T is a one-dimensional static array of enums type, ARG is an instance of that type, and FLAG is a bitwise OR of
one or more flag settings as described in B.2.2.
These are macros that implement data operations for one-dimensional dynamic array properties.
B.2.2.3.1 `uvm_field_array_int
`uvm_field_array_int(ARG,FLAG=UVM_DEFAULT)
ARG is a one-dimensional dynamic array of integrals, and FLAG is a bitwise OR of one or more flag settings as
described in B.2.2.
B.2.2.3.2 `uvm_field_array_object
`uvm_field_array_object(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for a one-dimensional dynamic array of uvm_object–based objects (see 5.3).
ARG is a one-dimensional dynamic array of uvm_object–based objects, and FLAG is a bitwise OR of one or
more flag settings as described in B.2.2.
B.2.2.3.3 `uvm_field_array_string
`uvm_field_array_string(ARG,FLAG=UVM_DEFAULT)
ARG is a one-dimensional dynamic array of strings, and FLAG is a bitwise OR of one or more flag settings as
described in B.2.2.
B.2.2.3.4 `uvm_field_array_enum
`uvm_field_array_enum(T, ARG,FLAG=UVM_DEFAULT)
T is a one-dimensional dynamic array of enums type, ARG is an instance of that type, and FLAG is a bitwise OR
of one or more flag settings as described in B.2.2.
375
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These are macros that implement data operations for dynamic queues.
B.2.2.4.1 `uvm_field_queue_int
`uvm_field_queue_int(ARG,FLAG=UVM_DEFAULT)
ARG is a one-dimensional queue of integrals, and FLAG is a bitwise OR of one or more flag settings as
described in B.2.2.
B.2.2.4.2 `uvm_field_queue_object
`uvm_field_queue_object(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for a one-dimensional queue of uvm_object–based objects (see 5.3).
ARG is a one-dimensional queue of uvm_object–based objects, and FLAG is a bitwise OR of one or more flag
settings as described in B.2.2.
B.2.2.4.3 `uvm_field_queue_string
`uvm_field_queue_string(ARG,FLAG=UVM_DEFAULT)
ARG is a one-dimensional queue of strings, and FLAG is a bitwise OR of one or more flag settings as
described in B.2.2.
B.2.2.4.4 `uvm_field_queue_enum
`uvm_field_queue_enum(T, ARG,FLAG=UVM_DEFAULT)
T is a one-dimensional queue of enums type, ARG is an instance of that type, and FLAG is a bitwise OR of one
or more flag settings as described in B.2.2.
These are macros that implement data operations for associative arrays indexed by string.
B.2.2.5.1 `uvm_field_aa_int_string
`uvm_field_aa_int_string(ARG,FLAG)
Implements the data operations for an associative array of integrals indexed by string.
ARG is the name of a property that is an associative array of integrals with the string key, and FLAG is a
bitwise OR of one or more flag settings as described in B.2.2.
376
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.2.2.5.2 `uvm_field_aa_object_string
`uvm_field_aa_object_string(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of uvm_object–based objects (see 5.3).
ARG is the name of a property that is an associative array of objects with the string key, and FLAG is a bitwise
OR of one or more flag settings as described in B.2.2.
B.2.2.5.3 `uvm_field_aa_string_string
`uvm_field_aa_string_string(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of string indexed by string.
ARG is the name of a property that is an associative array of strings with the string key, and FLAG is a bitwise
OR of one or more flag settings as described in B.2.2.
These are macros that implement data operations for associative arrays indexed by an integral type.
B.2.2.6.1 `uvm_field_aa_object_int
`uvm_field_aa_object_int(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of uvm_object–based objects (see 5.3) indexed by the
int data type.
ARG is the name of a property that is an associative array of objects with the int key, and FLAG is a bitwise OR
of one or more flag settings as described in B.2.2.
B.2.2.6.2 `uvm_field_aa_int_int
`uvm_field_aa_int_int(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by the int data type.
ARG is the name of a property that is an associative array of integrals with the int key, and FLAG is a bitwise
OR of one or more flag settings as described in B.2.2.
B.2.2.6.3 `uvm_field_aa_int_int_unsigned
`uvm_field_aa_int_int_unsigned(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by the int unsigned data type.
ARG is the name of a property that is an associative array of integrals with the int unsigned key, and FLAG is a
bitwise OR of one or more flag settings as described in B.2.2.
B.2.2.6.4 `uvm_field_aa_int_integer
`uvm_field_aa_int_integer(ARG,FLAG=UVM_DEFAULT)
377
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Implements the data operations for an associative array of integral types indexed by the integer data type.
ARG is the name of a property that is an associative array of integrals with the integer key, and FLAG is a
bitwise OR of one or more flag settings as described in B.2.2.
B.2.2.6.5 `uvm_field_aa_int_integer_unsigned
`uvm_field_aa_int_integer_unsigned(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by the integer unsigned data
type.
ARG is the name of a property that is an associative array of integrals with the integer unsigned key, and FLAG
is a bitwise OR of one or more flag settings as described in B.2.2.
B.2.2.6.6 `uvm_field_aa_int_byte
`uvm_field_aa_int_byte(ARG,FLAG)
Implements the data operations for an associative array of integral types indexed by the byte data type.
ARG is the name of a property that is an associative array of integrals with the byte key, and FLAG is a bitwise
OR of one or more flag settings as described in B.2.2.
B.2.2.6.7 `uvm_field_aa_int_byte_unsigned
`uvm_field_aa_int_byte_unsigned(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by the byte unsigned data type.
ARG is the name of a property that is an associative array of integrals with the byte unsigned key, and FLAG is
a bitwise OR of one or more flag settings as described in B.2.2.
B.2.2.6.8 `uvm_field_aa_int_shortint
`uvm_field_aa_int_shortint(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by the shortint data type.
ARG is the name of a property that is an associative array of integrals with the shortint key, and FLAG is a
bitwise OR of one or more flag settings as described in B.2.2.
B.2.2.6.9 `uvm_field_aa_int_shortint_unsigned
`uvm_field_aa_int_shortint_unsigned(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by the shortint unsigned data
type.
ARG is the name of a property that is an associative array of integrals with the shortint unsigned key, and FLAG
is a bitwise OR of one or more flag settings as described in B.2.2.
378
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.2.2.6.10 `uvm_field_aa_int_longint
`uvm_field_aa_int_longint(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by the longint data type.
ARG is the name of a property that is an associative array of integrals with the longint key, and FLAG is a
bitwise OR of one or more flag settings as described in B.2.2.
B.2.2.6.11 `uvm_field_aa_int_longint_unsigned
`uvm_field_aa_int_longint_unsigned(ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by the longint unsigned data
type.
ARG is the name of a property that is an associative array of integrals with the longint unsigned key, and FLAG
is a bitwise OR of one or more flag settings as described in B.2.2.
B.2.2.6.12 `uvm_field_aa_int_key
`uvm_field_aa_int_key(KEY,ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by any integral key data type.
KEY is the data type of the integral key, ARG is the name of a property that is an associative array of integrals,
and FLAG is a bitwise OR of one or more flag settings as described in B.2.2.
B.2.2.6.13 `uvm_field_aa_int_enumkey
`uvm_field_aa_int_enumkey(KEY,ARG,FLAG=UVM_DEFAULT)
Implements the data operations for an associative array of integral types indexed by any enumeration key data
type.
KEY is the enumeration type of the integral key, ARG is the name of a property that is an associative array of
integrals, and FLAG is a bitwise OR of one or more flag settings as described in B.2.2.
The recording macros assist users who implement the uvm_object::do_record method (see 5.3.7.2). They
allow fields to be recorded using a user-specific API. Unlike the uvm_recorder policy (see 16.4.1), fields
recorded using the macros do not lose type information—they are passed directly to the user-specific API. This
results in more efficient recording and no artificial limit on bit-widths.
B.2.3.1 `uvm_record_attribute
This is a macro to hide a tool-specific interface for recording attributes (fields) to a transaction database.
379
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The default implementation of the macro passes NAME and VALUE through to the
uvm_recorder::record_generic method (see 16.4.6.7).
B.2.3.2 `uvm_record_int
`uvm_record_int(NAME,VALUE,SIZE[,RADIX])
This macro takes the same arguments as the uvm_recorder::record_field method (see 16.4.6.1) (including the
optional RADIX).
The default implementation passes the name/value pair to `uvm_record_attribute if enabled (see B.2.3.1);
otherwise, the information is passed to uvm_recorder::record_field.
B.2.3.3 `uvm_record_string
`uvm_record_string(NAME,VALUE)
This macro takes the same arguments as the uvm_recorder::record_string method (see 16.4.6.5).
The default implementation passes the name/value pair to `uvm_record_attribute if enabled (see B.2.3.1);
otherwise, the information is passed to uvm_recorder::record_string.
B.2.3.4 `uvm_record_time
`uvm_record_time(NAME,VALUE)
This macro takes the same arguments as the uvm_recorder::record_time method (see 16.4.6.6).
The default implementation passes the name/value pair to `uvm_record_attribute if enabled (see B.2.3.1);
otherwise, the information is passed to uvm_recorder::record_time.
B.2.3.5 `uvm_record_real
`uvm_record_real(NAME,VALUE)
This macro takes the same arguments as the uvm_recorder::record_field_real method (see 16.4.6.3).
The default implementation passes the name/value pair to `uvm_record_attribute if enabled (see B.2.3.1);
otherwise, the information is passed to uvm_recorder::record_field_real.
B.2.3.6 `uvm_record_field
`uvm_record_field(NAME,VALUE)
This is a macro for recording arbitrary name-value pairs into a transaction recording database. It requires a valid
transaction handle, as provided by the uvm_transaction::begin_tr (see 5.4.2.4) and
uvm_component::begin_tr (see 13.1.7.3) methods.
The default implementation passes the name/value pair to `uvm_record_attribute if enabled (see B.2.3.1);
otherwise, the information is passed to uvm_recorder::record_generic (see 16.4.6.7), with the VALUE being
converted to a string using %p notation, i.e.,
recorder.record_generic(NAME,$sformatf("%p",VALUE))
380
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The packing macros assist users who implement the uvm_object::do_pack method (see 5.3.10.2). See also
B.2.5.
The N versions of these macros take an explicit size argument, which shall be a compile-time constant value
greater than 0.
B.2.4.1 `uvm_pack_intN
`uvm_pack_intN(VAR,SIZE)
B.2.4.2 `uvm_pack_enumN
`uvm_pack_enumN(VAR,SIZE)
B.2.4.3 `uvm_pack_sarrayN
`uvm_pack_sarrayN(VAR,SIZE)
B.2.4.4 `uvm_pack_arrayN
`uvm_pack_arrayN(VAR,SIZE)
B.2.4.5 `uvm_pack_queueN
`uvm_pack_queueN(VAR,SIZE)
B.2.4.6 `uvm_pack_int
`uvm_pack_int(VAR)
Packs an integral variable without having to also specify the bit size.
B.2.4.7 `uvm_pack_enum
`uvm_pack_enum(VAR)
Packs enumeration value. Packing this does not require its type be specified.
B.2.4.8 `uvm_pack_string
`uvm_pack_string(VAR)
381
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.2.4.9 `uvm_pack_real
`uvm_pack_real(VAR)
B.2.4.10 `uvm_pack_sarray
`uvm_pack_sarray(VAR)
Packs a static array without having to also specify the bit size of its elements. The array elements shall be of
integral type.
B.2.4.11 `uvm_pack_array
`uvm_pack_array(VAR)
Packs a dynamic array without having to also specify the bit size of its elements. The array size shall be
non-zero. The array elements shall be of integral type.
B.2.4.12 `uvm_pack_queue
`uvm_pack_queue(VAR)
Packs a queue without having to also specify the bit size of its elements. The queue shall not be empty. The
array elements shall be of integral type.
The unpacking macros assist users who implement the uvm_object::do_unpack method (see 5.3.11.2). See
also B.2.4.
The N versions of these macros take an explicit size argument, which shall be a compile-time constant value
greater than 0.
B.2.5.1 `uvm_unpack_intN
`uvm_unpack_intN(VAR,SIZE)
B.2.5.2 `uvm_unpack_enumN
`uvm_unpack_enumN(VAR,SIZE,TYPE)
B.2.5.3 `uvm_unpack_sarrayN
`uvm_unpack_sarrayN(VAR,SIZE)
382
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.2.5.4 `uvm_unpack_arrayN
`uvm_unpack_arrayN(VAR,SIZE)
B.2.5.5 `uvm_unpack_queueN
`uvm_unpack_queueN(VAR,SIZE)
B.2.5.6 `uvm_unpack_int
`uvm_unpack_int(VAR)
Unpacks an integral variable without having to also specify the bit size.
B.2.5.7 `uvm_unpack_enum
`uvm_unpack_enum(VAR)
B.2.5.8 `uvm_unpack_string
`uvm_unpack_string(VAR)
B.2.5.9 `uvm_unpack_real
`uvm_unpack_real(VAR)
B.2.5.10 `uvm_unpack_sarray
`uvm_unpack_sarray(VAR)
Unpacks a static array without having to also specify the bit size of its elements. The array elements shall be of
integral type.
B.2.5.11 `uvm_unpack_array
`uvm_unpack_array(VAR)
Unpacks a dynamic array without having to also specify the bit size of its elements. The array size shall be
non-zero. The array elements shall be of integral type.
B.2.5.12 `uvm_unpack_queue
`uvm_unpack_queue(VAR)
383
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Unpacks a queue without having to also specify the bit size of its elements. The queue shall not be empty. The
array elements shall be of integral type.
These macros are used to create and start sequences and sequence items.
B.3.1.1 `uvm_create
`uvm_create(SEQ_OR_ITEM, SEQR=get_sequencer())
This action creates a child item or sequence using create_item (see 14.2.6.1), passing the return value of
SEQ_OR_ITEM.get_type as type_var, SEQR as l_sequencer, and the string equivalent of SEQ_OR_ITEM as
name. After this action completes, the user can manually specify values, manipulate the rand_mode and
constraint_mode, etc.
B.3.1.2 `uvm_send
`uvm_send(SEQ_OR_ITEM, PRIORITY=-1)
a) For items, the implementation shall perform the following steps in order:
1) The start_item method (see 14.2.6.2) is called on this sequence, with SEQ_OR_ITEM as item
and PRIORITY as set_priority.
2) The finish_item method (see 14.2.6.3) is called on this sequence, with SEQ_OR_ITEM as item
and PRIORITY as set_priority.
b) For sequences, the start method (see 14.2.3.1) is called on SEQ_OR_ITEM with this for
parent_sequence, PRIORITY for this_priority, and 0 for call_pre_post.
B.3.1.3 `uvm_rand_send
a) For items, the implementation shall perform the following steps in order:
1) The start_item method (see 14.2.6.2) is called on this sequence, with SEQ_OR_ITEM as item
and PRIORITY as set_priority.
2) SEQ_OR_ITEM is randomized with CONSTRAINTS.
3) The finish_item method (see 14.2.6.3) is called on this sequence, with SEQ_OR_ITEM as item
and PRIORITY as set_priority.
b) For sequences, the implementation shall perform the following steps in order:
1) If the get_randomize_enabled method (see 14.2.2.2) on SEQ_OR_ITEM returns 1, then the
sequence is randomized with CONSTRAINTS.
2) The start method (see 14.2.3.1) is called on SEQ_OR_ITEM with this for parent_sequence,
PRIORITY for this_priority, and 0 for call_pre_post.
384
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.3.1.4 `uvm_do
This action creates and processes a child item or sequence, with randomization. The implementation shall
perform the following steps in order:
B.3.2.1 `uvm_add_to_sequence_library
`uvm_add_to_seq_lib(TYPE,LIBTYPE)
Adds the given sequence TYPE to the given sequence library LIBTYPE.
This can be invoked once for a specific combination of TYPE and LIBTYPE within a sequence class to statically
add the TYPE sequence to the LIBTYPE library. The sequence will then be available for selection and execution
in all instances of the given library type.
A sequence class can invoke this macro for any number of combinations of TYPE and LIBTYPE, potentially
adding TYPE to multiple LIBTYPEs.
B.3.2.2 `uvm_sequence_library_utils
`uvm_sequence_library_utils(TYPE)
This shall be invoked in extensions to the uvm_sequence_library class (see 14.4), with TYPE equal to the type
of the extension. It enables the extension class to hold a static list of member sequences. See also B.3.2.1 for
more information.
`uvm_declare_p_sequencer
`uvm_declare_p_sequencer(SEQUENCER)
This macro is used to declare a variable p_sequencer whose type is specified by SEQUENCER.
These macros are used to register and execute callbacks extending from uvm_callbacks (see 10.7.2).
B.4.1 `uvm_register_cb
`uvm_register_cb(T,CB)
Registers the given CB callback type with the given T object type. If a type-callback pair is not registered, then
a warning shall be issued if an attempt is made to use the pair (add, delete, etc.).
Callback type CB is used to construct the name of bit that holds the result of registration. When the callback
type is parameterized, this results in errors. To avoid this, a typedef-ed name should be used instead.
385
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The registration typically occurs in the component that executes the given type of callback.
B.4.2 `uvm_set_super_type
`uvm_set_super_type(T,ST)
Defines the super type of T to be ST. This allows for derived class objects to inherit type-wide callbacks that are
registered with the base class.
The registration typically occurs in the component that executes the given type of callback.
B.4.3 `uvm_do_callbacks
`uvm_do_callbacks(T,CB,METHOD)
Calls the given METHOD of all callbacks of type CB registered with the calling object (i.e., this object), which
is, or is based on, type T. This macro takes the following arguments:
CB is the class type of the callback objects to execute. The class type shall have a function signature
that matches the METHOD argument.
T is the type associated with the callback. Typically, an instance of type T is passed as one the
arguments in the METHOD call.
METHOD is the method call to invoke, containing all required arguments as if they were invoked
directly.
B.4.4 `uvm_do_obj_callbacks
`uvm_do_obj_callbacks(T,CB,OBJ,METHOD)
Calls the given METHOD of all callbacks based on type CB registered with the given object, OBJ, which is or
is based on type T.
This macro is identical to `uvm_do_callbacks macro (see B.4.3), but it has an additional OBJ argument to
allow the specification of an external object with which to associate the callback.
B.4.5 `uvm_do_callbacks_exit_on
`uvm_do_callbacks_exit_on(T,CB,METHOD,VAL)
Calls the given METHOD of all callbacks of type CB registered with the calling object (i.e., this object), which
is, or is based on, type T, returning upon the first callback returning the bit value given by VAL. This macro
takes the following arguments:
CB is the class type of the callback objects to execute. The class type shall have a function signature
that matches the METHOD argument.
T is the type associated with the callback. Typically, an instance of type T is passed as one the
arguments in the METHOD call.
METHOD is the method call to invoke, containing all required arguments as if they were invoked
directly.
VAL, when 1, means return upon the first callback invocation that returns 1. When 0, it means return
upon the first callback invocation that returns 0.
Since this macro calls return, its use is restricted to implementations of functions that return a bitvalue.
386
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.4.6 `uvm_do_obj_callbacks_exit_on
`uvm_do_obj_callbacks_exit_on(T,CB,OBJ,METHOD,VAL)
Calls the given METHOD of all callbacks of type CB registered with the given object OBJ, which is, or is based
on, type T, returning upon the first callback returning the bit value given by VAL. This is the same as
`uvm_do_callbacks_exit_on (see B.4.5) except this has a specific object instance (instead of the implicit this
instance) as the third argument.
Since this macro calls return, its use is restricted to implementations of functions that return a bit value.
The UVM TLM implementation declaration macros are a way for components to provide multiple
implementation ports of the same implementation interface. When an implementation port is defined using the
built-in set of imps, there shall be exactly one implementation of the interface.
Be aware each `uvm_interface_imp_decl creates a new class of type uvm_interface_imp_suffix, where suffix
is the input argument to the macro. Given this, typically these macros should be put into separate packages to
avoid collisions and to allow sharing of the definitions.
B.5.1 `uvm_blocking_put_imp_decl
`uvm_blocking_put_imp_decl(SFX)
Defines the class uvm_blocking_put_impSFX for providing blocking put implementations. SFX is the suffix
for the new class type.
B.5.2 `uvm_nonblocking_put_imp_decl
`uvm_nonblocking_put_imp_decl(SFX)
Defines the class uvm_nonblocking_put_impSFX for providing non-blocking put implementations. SFX is
the suffix for the new class type.
B.5.3 `uvm_put_imp_decl
`uvm_put_imp_decl(SFX)
Defines the class uvm_put_impSFX for providing both blocking and non-blocking put implementations. SFX
is the suffix for the new class type.
B.5.4 `uvm_blocking_get_imp_decl
`uvm_blocking_get_imp_decl(SFX)
Defines the class uvm_blocking_get_impSFX for providing blocking get implementations. SFX is the suffix
for the new class type.
B.5.5 `uvm_nonblocking_get_imp_decl
`uvm_nonblocking_get_imp_decl(SFX)
387
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Defines the class uvm_nonblocking_get_impSFX for providing non-blocking get implementations. SFX is
the suffix for the new class type.
B.5.6 `uvm_get_imp_decl
`uvm_get_imp_decl(SFX)
Defines the class uvm_get_impSFX for providing both blocking and non-blocking get implementations. SFX
is the suffix for the new class type.
B.5.7 `uvm_blocking_peek_imp_decl
`uvm_blocking_peek_imp_decl(SFX)
Defines the class uvm_blocking_peek_impSFX for providing blocking peek implementations. SFX is the
suffix for the new class type.
B.5.8 `uvm_nonblocking_peek_imp_decl
`uvm_nonblocking_peek_imp_decl(SFX)
Defines the class uvm_nonblocking_peek_impSFX for providing non-blocking peek implementations. SFX
is the suffix for the new class type.
B.5.9 `uvm_peek_imp_decl
`uvm_peek_imp_decl(SFX)
Defines the class uvm_peek_impSFX for providing both blocking and non-blocking peek implementations.
SFX is the suffix for the new class type.
B.5.10 `uvm_blocking_get_peek_imp_decl
`uvm_blocking_get_peek_imp_decl(SFX)
Defines the class uvm_blocking_get_peek_impSFX for providing blocking get_peek implementations. SFX
is the suffix for the new class type.
B.5.11 `uvm_nonblocking_get_peek_imp_decl
`uvm_nonblocking_peek_imp_decl(SFX)
B.5.12 `uvm_get_peek_imp_decl
`uvm_get_peek_imp_decl(SFX)
Defines the class uvm_get_peek_impSFX for providing both blocking and non-blocking get_peek
implementations. SFX is the suffix for the new class type.
388
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.5.13 `uvm_blocking_master_imp_decl
`uvm_blocking_master_imp_decl(SFX)
Defines the class uvm_blocking_master_impSFX for providing blocking master implementations. SFX is
the suffix for the new class type.
B.5.14 `uvm_nonblocking_master_imp_decl
`uvm_nonblocking_master_imp_decl(SFX)
B.5.15 `uvm_master_imp_decl
`uvm_master_imp_decl(SFX)
Defines the class uvm_master_impSFX for providing both blocking and non-blocking master
implementations. SFX is the suffix for the new class type.
B.5.16 `uvm_blocking_slave_imp_decl
`uvm_blocking_slave_imp_decl(SFX)
Defines the class uvm_blocking_slave_impSFX for providing blocking slave implementations. SFX is the
suffix for the new class type.
B.5.17 `uvm_nonblocking_slave_imp_decl
`uvm_nonblocking_slave_imp_decl(SFX)
Defines the class uvm_nonblocking_slave_impSFX for providing non-blocking slave implementations. SFX
is the suffix for the new class type.
B.5.18 `uvm_slave_imp_decl
`uvm_slave_imp_decl(SFX)
Defines the class uvm_slave_impSFX for providing both blocking and non-blocking slave implementations.
SFX is the suffix for the new class type.
B.5.19 `uvm_blocking_transport_imp_decl
`uvm_blocking_transport_imp_decl(SFX)
B.5.20 `uvm_nonblocking_transport_imp_decl
`uvm_nonblocking_transport_imp_decl(SFX)
389
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.5.21 `uvm_transport_imp_decl
`uvm_transport_imp_decl(SFX)
Defines the class uvm_transport_impSFX for providing both blocking and non-blocking transport
implementations. SFX is the suffix for the new class type.
B.5.22 `uvm_analysis_imp_decl
`uvm_analysis_imp_decl(SFX)
Defines the class uvm_analysis_impSFX for providing an analysis implementation. SFX is the suffix for the
new class type.
The analysis implementation is the write function. `uvm_analysis_imp_decl allows a scoreboard (or another
analysis component) to support input from many places.
B.6.1 `UVM_FIELD_FLAG_SIZE
Defines the number of bits in uvm_field_flag_t (see F.2.1.2). This size may be defined by the user; if so, the
defined value needs to be greater than or equal to UVM_FIELD_FLAG_RESERVED_BITS (see F.2.1.1).
The default value of `UVM_FIELD_FLAG_SIZE is implementation specific; however, it shall be greater than
or equal to UVM_FIELD_FLAG_RESERVED_BITS.
While the user may use this define to extend the size of uvm_field_flag_t, the exact definition of the lower bits,
i.e., [UVM_FIELD_FLAG_RESERVED_BITS-1:0], is reserved for an implementation.
B.6.2 `UVM_MAX_STREAMBITS
Defines the maximum bit vector size for integral types. Can be defined by the user; otherwise, this defaults to
4096.
B.6.3 `UVM_PACKER_MIN_BITS
Defines the minimum number of bits that the default implementation of uvm_packer (see 16.5) shall be
capable of storing internally. The default value of `UVM_PACKER_MIN_BITS shall be 32768.
B.6.4 `UVM_REG_ADDR_WIDTH
This is the maximum address width in bits. The default value is 64. This macro is used to define the
uvm_reg_addr_t type (see 17.2.1.3).
B.6.5 `UVM_REG_DATA_WIDTH
This is the maximum data width in bits. The default value is 64. This macro is used to define the
uvm_reg_data_t type (see 17.2.1.2).
390
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
B.6.6 `UVM_REG_BYTENABLE_WIDTH
This is the maximum number of byte enable bits. The default value is one per byte in
`UVM_REG_DATA_WIDTH (see B.6.5). This macro is used to define the uvm_reg_byte_en_t type (see
17.2.1.5).
B.6.7 `UVM_REG_CVR_WIDTH
This is the maximum number of bits in a uvm_reg_cvr_t (see 17.2.1.6) coverage model set. The default value
is 32.
B.7.1 `UVM_VERSION
A define shall be provided that indicates the version of UVM being used.
B.7.2 UVM_VERSION_STRING
A string parameter shall be provided in uvm_pkg that creates a version string identifying the implementation
being used.
One define shall be provided for each version of UVM prior to this version. For example, the presence of
UVM_VERSION_POST_2017 means that this version of the standard is more recent than IEEE Std 1800.2-
2017.
`UVM_VERSION_POST_2017
`define UVM_VERSION_POST_2017
Define indicating this LRM standard version is after IEEE Std 1800.2-2017.
391
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Annex C
(normative)
C.1 Overview
The configuration and resource classes provide access to a centralized database where type-specific information
can be stored and retrieved. The uvm_resource_db (see C.3.2) is the low-level resource database that users can
write to or read from. The uvm_config_db (see C.4.2) is layered on top of the resource database and provides a
typed interface for a configuration setting that is consistent with the configuration interface of uvm_component
(see 13.1.5).
Information can be read from or written to the database at any time during simulation. A resource may be
associated with a specific hierarchical scope of a uvm_component (see 13.1) or it may be visible to all
components regardless of their hierarchical position.
C.2 Resources
C.2.1 Introduction
A resource is a parameterized container that holds arbitrary data. Resources can be used to configure
components, supply data to sequences, or enable sharing of information across disparate parts of a testbench.
They are stored using scoping information such that their visibility can be constrained to certain parts of the
testbench. Resource containers can hold any type of data, as constrained by the data types available in
SystemVerilog. Resources can contain scalar objects, class handles, queues, lists, or even virtual interfaces.
Resources are stored in a resource database such that each resource can be retrieved by name or by type. The
database is globally accessible. To support type lookup, each resource has a static type handle that uniquely
identifies the type of each specialized resource container.
Each resource has a set of scopes over which it is visible (see C.2.4). When a resource is looked up, the scope
of the entity doing the looking up is supplied to the lookup function. This is called the current scope. If the
current scope is in the set of scopes over which a resource is visible, the resource can be returned in the lookup.
Multiple resources that have the same name are stored in a queue. Each resource is pushed into a queue with the
first one at the front of the queue and each subsequent one behind it. The same happens for multiple resources
that have the same type. The resource queues are searched front to back, so those placed earlier in the queue
have precedence over those placed later.
The precedence of resources with the same name or same type can be altered. One way is to set the name (see
C.2.3.2.1) of the resource container to any arbitrary value. The search algorithm returns the resource with the
highest precedence. In the case where there are multiple resources that match the search criteria and have the
same (highest) precedence, the earliest one located in the queue is the one returned. Another way to change the
precedence is to use the set_priority function (see C.2.4.5.3) to move a resource to either the front or back of
the queue.
The classes defined here form the low-level layer of the resource database. The classes include the resource
container and the database that holds the containers. The following set of classes are defined in this C.2:
a) uvm_resource_types—A class for containing definitions of types used by resources. See C.2.2.
392
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
b) uvm_resource_base—The base (untyped) resource class living in the resource database. This class
includes the interface for setting a resource as read-only, notification, scope management, and altering
search priority. See C.2.3.
c) uvm_resource_pool—The resource database. This is a singleton class object. See C.2.4.
d) uvm_resource#(T)—A parameterized resource container. This class includes the interfaces for reading
and writing each resource. Because the class is parameterized, all the access functions are type safe.
See C.2.5.
C.2.2 uvm_resource_types
This class provides a namespace for types that are used by the resource facility.
C.2.2.1 rsrc_q_t
C.2.2.2 priority_e
C.2.3 uvm_resource_base
This is a non-parameterized base class for resources. It supports interfaces for scope matching and virtual
functions for printing the resource.
C.2.3.2.1 new
This is a constructor for uvm_resource_base to create a resource with the given instance name. If name is not
supplied then the resource is unnamed.
C.2.3.2.2 get_type_handle
C.2.3.3.1 set_read_only
393
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Establishes this resource as a read-only resource. An attempt to call uvm_resource#(T)::write (see C.2.5) on
the resource shall generate an error.
C.2.3.3.2 is_read_only
C.2.3.4 Notification
wait_modified
task wait_modified()
This task blocks until the resource has been modified, i.e., until a uvm_resource#(T)::write operation (see
C.2.5.4.2) has been performed.
C.2.4 uvm_resource_pool
Each resource is stored both by primary name and by type handle. Each resource has a regular expression that
represents the set of scopes over which it is visible.
Resources are added to the pool by calling set_scope (see C.2.4.3.1); they are retrieved from the pool by calling
get_by_name (see C.2.4.4.4) or get_by_type (see C.2.4.4.6).
class uvm_resource_pool
C.2.4.2.1 new
function new()
C.2.4.2.2 get
This method is provided as a wrapper function to conveniently retrieve the resource pool via the
uvm_coreservice_t::get_resource_pool method (see F.4.1.4.22).
C.2.4.3 Scope
Resource scope matching shall be determined using uvm_is_match (see F.3.3.1), with the stored scope as the
expr and the lookup as str.
394
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
C.2.4.3.1 set_scope
Adds a resource to the resource pool, with the provided scope. If the resource already exists in the pool, then its
scope is replaced with the new scope.
The resource is inserted with low priority (see C.2.4.5) into both the name map and type map so it can be
located by either. Later, other objects that want to access the resource need to retrieve it using the lookup
interface (see C.2.4.4).
If rsrc is null, the implementation shall issue a warning message, and the request is ignored.
To override existing resources, use the set_override (see C.2.4.3.2), set_name_override (see C.2.4.3.3), or
set_type_override (see C.2.4.3.4) functions.
C.2.4.3.2 set_override
Adds a resource to the resource pool, placing it with high priority (see C.2.4.5) in both the name and type maps.
This is functionally identical to calling set_scope (see C.2.4.3.1), immediately followed by set_priority (see
C.2.4.5.3).
C.2.4.3.3 set_name_override
Adds a resource to the resource pool, placing it with high priority (see C.2.4.5) in the name map and low
priority in the type map.
This is functionally identical to calling set_scope (see C.2.4.3.1), immediately followed by set_priority_name
(see C.2.4.5.2).
C.2.4.3.4 set_type_override
Adds a resource to the resource pool, placing it with high priority (see C.2.4.5) in the type map and low priority
in the name map.
395
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This is functionally identical to calling set_scope (see C.2.4.3.1), immediately followed by set_priority_type
(see C.2.4.5.1).
C.2.4.3.5 get_scope
If rsrc exists within the pool, then scope is set to the scope of the resource within the pool, and 1 is returned. If
rsrc does not exist within the pool, then scope is set to an empty string (""), and 0 is returned.
C.2.4.3.6 delete
If rsrc exists within the pool, then it is removed from all internal maps. If the rsrc is null, or does not exist
within the pool, then the request is silently ignored.
C.2.4.4 Lookup
lookup_name (see C.2.4.4.1) and lookup_type (see C.2.4.4.5) locate the set of resources that matches
the name or type (respectively) and is visible in the current scope. These functions return a queue of
resources.
get_highest_precedence (see C.2.4.4.2) traverses a queue of resources and returns the one with the
highest precedence, i.e., the one whose precedence member has the highest value.
get_by_name (see C.2.4.4.4) and get_by_type (see C.2.4.4.6) use lookup_name (see C.2.4.4.1) and
lookup_type (see C.2.4.4.5) (respectively) and get_highest_precedence (see C.2.4.4.2) to find the
resource with the highest priority that matches the other search criteria.
C.2.4.4.1 lookup_name
This looks up resources by name. It returns a queue of resources that match the name, scope, and type_handle.
If no resources match or if name is an empty string (""), the queue is returned empty. If rpterr is set to 1, a
warning is issued when no matches are found. If type_handle is null, a type check is not made and only
resources that match the name and scope are returned. The default value of rpterr shall be 1.
C.2.4.4.2 get_highest_precedence
396
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This traverses a queue, q, of resources and returns the one with the highest precedence. When more than one
resource with the highest precedence value exists, the first one that has that precedence is the one that is
returned.
C.2.4.4.3 sort_by_precedence
Given a list of resources, this sorts the resources in precedence order. The highest precedence resource is first in
the list and the lowest precedence is last. Resources that have the same precedence are ordered by whichever is
most recently set first.
C.2.4.4.4 get_by_name
This looks up a resource by name, scope, and type_handle and returns the highest precedence match. The rpterr
flag indicates whether to report errors or not. The default value of rpterr shall be 1.
C.2.4.4.5 lookup_type
This is a convenience method, functionally equivalent to calling get_highest_precedence (see C.2.4.4.2) on the
result of lookup_name (see C.2.4.4.1).
This looks up resources by type. It returns a queue of resources that match the type_handle and scope. If no
resources match, the returned queue is empty.
C.2.4.4.6 get_by_type
This is a convenience method, functionally equivalent to calling lookup_type (see C.2.4.4.5) and returning the
first resource in the queue.
C.2.4.4.7 lookup_regex
397
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
string scope
)
Looks for all the resources whose name matches the regular expression argument and whose scope matches the
current scope.
C.2.4.4.8 lookup_scope
This is a utility function that answers the question: For a given scope, what resources are visible to it? It locates
all the resources that are visible to a particular scope. This operation could be quite expensive, as it has to
traverse all of the resources in the database.
C.2.4.5 Prioritization
The resource pool supports prioritization of the resources contained within. This prioritization is represented by
two values: the priority and the precedence.
Priority is used to determine how the resource pool should act when new resources are added to the pool with
identical types and/or names to pre-existing resources within the pool. The type and name maps maintained
within the pool are maps of queues, allowing multiple resources to appear at a given key within the map.
Resources with high priority are moved to the front of the queue, whereas resources with low priority are
moved to the back of the queue. The default priority when adding resources to the pool is low.
Precedence is used to determine how the resource pool should react when it encounters multiple resources that
match a given scope and name for a lookup (see C.2.4.4). Resources with a higher precedence outrank
resources with a lower precedence. Precedence has no effect on type-based lookups. The default precedence
when adding resources to the pool is determined via get_default_precedence (see C.2.4.5.5).
C.2.4.5.1 set_priority_type
This changes the priority of the rsrc based on the value of pri, the priority enum argument. This function
changes the priority only in the type map, leaving the name map untouched.
C.2.4.5.2 set_priority_name
This changes the priority of the rsrc based on the value of pri, the priority enum argument. This function
changes the priority only in the name map, leaving the type map untouched.
C.2.4.5.3 set_priority
398
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_resource_types::priority_e pri
)
This changes the search priority of the rsrc based on the value of pri, the priority enum argument. This function
changes the priority in both the name and type maps.
C.2.4.5.4 set_default_precedence
Overrides the current default precedence being used by the resource pool.
This method is provided as a wrapper function to conveniently assign the resource pool default precedence via
the uvm_coreservice_t::set_resource_pool_default_precedence method (see F.4.1.4.23).
C.2.4.5.5 get_default_precedence
This method is provided as a wrapper function to conveniently retrieve the resource pool default precedence via
the uvm_coreservice_t::get_resource_pool_default_precedence method (see F.4.1.4.24).
C.2.4.5.6 set_precedence
An implementation shall issue an warning message if the user passes in a null or a resource that has not
previously been placed within the pool, and the request shall be ignored.
C.2.4.5.7 get_precedence
An implementation shall issue an warning message if the argument r is set to null or if the resource is not stored
within the resource pool, and the function shall return the current default precedence, as determined by
get_default_precedence (see C.2.4.5.5).
This is a parameterized resource. It provides access methods to store in, read from, and write to a resource.
399
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
C.2.5.2 new
Constructs a resource with the given instance name. If name is not supplied, then the resource is unnamed.
Resources can be identified by type using a static type handle. The parent class provides the virtual function
interface get_type_handle (see C.2.5.3.2). This can be implemented by returning the static type handle.
C.2.5.3.1 get_type
This is a static function that returns the static type handle. The return type is uvm_resource #(T), which is the
type of the parameterized class.
C.2.5.3.2 get_type_handle
This returns the static type handle of this resource in a polymorphic fashion. The return type is
uvm_resource_base. This function is not static and, therefore, can only be used by instances of a parameterized
resource.
read (see C.2.5.4.1) and write (see C.2.5.4.2) provide a type-safe interface for retrieving and specifying the
object in the resource container. The interface is type safe because the value argument for write and the return
value of read are T, the type supplied in the class parameter. If either of these functions is used in an incorrect
type context, the compiler will complain.
C.2.5.4.1 read
This returns the object stored in the resource container. The accessor is available for an implementation to use
for debug purposes only; its value shall have no functional effect on the outcome of this method.
C.2.5.4.2 write
This modifies the object stored in this resource container. If the resource is read-only, this generates an error
message and returns without modifying the object in the container. Lastly, it replaces the value in the container
with the value supplied as the argument, t, and releases any processes blocked on
uvm_resource_base::wait_modified (see C.2.3.4). If the value to be written is the same as the value already
present in the resource: the write is not done, the accessor record is not updated, and the modified bit is not set.
The accessor is available for an implementation to use for debug purposes only; its value shall have no
functional efect on outcome of this method.
400
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
C.3.1 Introduction
The uvm_resource_db class (see C.3.2) provides a convenience interface for the resources facility. In many
cases, basic operations, such as creating and specifying a resource or retrieving a resource, could take multiple
lines of code using the interfaces in uvm_resource_base (see C.2.3) or uvm_resource#(T) (see C.2.5). The
uvm_resource_db convenience layer reduces many of those operations to a single line of code.
C.3.2 uvm_resource_db
All of the functions in uvm_resource_db#(T) are static, so they need to be called using the Scope
Resolution Operator (::), e.g., uvm_resource_db#(int)::set("A", "*", 17, this).
The parameter value int identifies the resource type as uvm_resource#(int). Thus, the type of the object in
the resource container is int. This maintains the type-safety characteristics of resource operations.
C.3.2.2 rsrc_t
C.3.2.3 Methods
C.3.2.3.1 set
Create a new resource, write a val to it, and set it into the database using name and scope as the lookup
parameters. The accessor is available for an implementation to use for debug purposes only; its value shall have
no functional effect on outcome of this method.
C.3.2.3.2 set_default
Adds a new item into the resources database. The item will not be written to, so it uses its default value. The
resource is created using name and scope as the lookup parameters.
401
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
C.3.2.3.3 set_anonymous
Creates a new resource, writes a val to it, and sets it into the database. The resource has no name and, therefore,
cannot be entered into the name map. It can still be retrieved by type, using scope for lookup purposes. The
accessor is available for an implementation to use for debug purposes only; its value shall have no functional
effect on outcome of this method.
C.3.2.3.4 get_by_name
Imports a resource by name. The first argument is the current scope of the resource to be retrieved and the
second argument is the name. The rpterr flag indicates whether or not to issue a warning if no matching
resource is found. The default value of rpterr shall be 1.
C.3.2.3.5 get_by_type
Returns a resource by type. The type is specified in the db class parameter, so the only argument to this
function is the scope.
C.3.2.3.6 read_by_name
Locates a resource by name and scope and reads its value. The return value is a bit that indicates whether or not
the read was successful. If the read is successful, then val shall be updated to the read value, otherwise val shall
remain unchanged. The accessor is available for an implementation to use for debug purposes only; its value
shall have no functional effect on outcome of this method.
C.3.2.3.7 read_by_type
402
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Reads a value by type. The scope is used for the lookup. The return value is a bit that indicates whether or not
the read is successful. If the read is successful, then val shall be updated to the read value, otherwise val shall
remain unchanged. The accessor is available for an implementation to use for debug purposes only; its value
shall have no functional effect on outcome of this method.
C.3.2.3.8 write_by_name
Writes a val into the resources database. First, look up the resource by name and scope. If it is not located,
write_by_name returns 0. If the resource is located, then val is written to the resource. The accessor is
available for an implementation to use for debug purposes only; its value shall have no functional effect on
outcome of this method.
Because the scope is matched to a resource that may be a regular expression, and consequently may target other
scopes beyond the scope argument, be careful using this function. If a get_by_name match (see C.3.2.3.4) is
found for name and scope, then val is written to that matching resource and, thus, may impact other scopes that
also match the resource.
C.3.2.3.9 write_by_type
Writes a val into the resources database. First, look up the resource by type. If it is not located, write_by_name
returns 0. If the resource is located, then val is written to the resource. The accessor is available for an
implementation to use for debug purposes only; its value shall have no functional effect on outcome of this
method.
Because the scope is matched to a resource that may be a regular expression and consequently may target other
scopes beyond the scope argument, be careful using this function. If a get_by_name match (see C.3.2.3.4) is
found for name and scope, then val is written to that matching resource and, thus, may impact other scopes that
also match the resource.
C.3.2.3.10 get_highest_precedence
In a queue of resources, this locates the first one with the highest precedence whose type is T. This function is
static so that it can be called from anywhere.
403
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
C.4.1 Introduction
The uvm_config_db class (see C.4.2) provides a convenience interface on top of the uvm_resource_db (see
C.3.2) to simplify the basic interface that is used for configuring uvm_component instances (see 13.1).
C.4.2 uvm_config_db
All of the functions in uvm_config_db#(T) are static, so they need to be called using the Scope Resolution
Operator (::), e.g., uvm_config_db#(int)::set(this, "*", "A").
The parameter value “int” identifies the configuration type as an int property.
C.4.2.2 Methods
C.4.2.2.1 set
Creates a new, or updates an existing, configuration specification for field_name in inst_name from cntxt. The
setting is made at cntxt, with the full scope of the set being {cntxt,”.”,inst_name}. If cntxt is null or cntxt
equals the return from uvm_root::get (see F.7.2.2), then inst_name provides the complete scope information of
the setting. field_name is the target field. Both inst_name and field_name may be simplified notation or regular
expression style expressions.
If a setting is made at build time, the cntxt hierarchy is used to determine the setting’s precedence in the
database. Settings from hierarchically higher levels have higher precedence. All settings use PRI_HIGH
priority. A precedence setting of uvm_resource_pool:: set_default_precedence (see C.2.4.5.4) is used for the
implicit top-level component (see F.7), and each hierarchical level below it is decremented by 1.
After build time, all settings use the default precedence and PRI_HIGH priority. So, if at run time, a low-level
component makes a run-time setting of some field, that setting shall have precedence over a setting from the
test level that was made earlier in the simulation.
C.4.2.2.2 get
Returns the value for field_name in inst_name, using the component cntxt as the starting search point.
inst_name is an explicit instance name relative to cntxt and may be an empty string ("") if the cntxt is the
404
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
instance to which the configuration object applies. field_name is the specific field in the scope that is being
searched.
C.4.2.2.3 exists
Checks if a value for field_name is available in inst_name, using the component cntxt as the starting search
point. inst_name is an explicit instance name relative to cntxt and may be an empty string ("") if the cntxt is the
instance to which the configuration object applies. field_name is the specific field in the scope that is being
searched for. spell_chk is available for an implementation to use for debug purposes only; its value shall have
no functional effect on outcome of this method. The function returns 1 if a config parameter exists and 0 if it
does not exist. The default value of spell_chk shall be 0.
C.4.2.2.4 wait_modified
Waits for a configuration setting to be set for field_name in cntxt and inst_name. The task blocks until a new
configuration setting is applied that effects the specified field.
C.4.2.3 Types
C.4.2.3.1 uvm_config_int
C.4.2.3.2 uvm_config_string
C.4.2.3.3 uvm_config_object
405
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
C.4.2.3.4 uvm_config_wrapper
406
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Annex D
(normative)
This annex details additional convenience classes, interfaces, and methods that can be used in Universal
Verification Methodology (UVM).
D.1 uvm_callback_iter
This class can be used as part of the callbacks classes (see 10.7).
The uvm_callback_iter class is an iterator class for iterating over callback queues of a specific callback type.
The typical usage of the class is:
class uvm_callback_iter#(
type T = uvm_object,
type CB = uvm_callback
)
D.1.2 Methods
D.1.2.1 new
Creates a new callback iterator object. It is required that the object context be provided.
D.1.2.2 first
function CB first()
Returns the first valid (enabled) callback of the callback type (or a derivative) that is in the queue of the context
object. If the queue is empty, null is returned.
D.1.2.3 last
function CB last()
Returns the last valid (enabled) callback of the callback type (or a derivative) that is in the queue of the context
object. If the queue is empty, null is returned.
407
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
D.1.2.4 next
function CB next()
Returns the next valid (enabled) callback of the callback type (or a derivative) that is in the queue of the context
object. If there are no more valid callbacks in the queue, null is returned.
D.1.2.5 prev
function CB prev()
Returns the previous valid (enabled) callback of the callback type (or a derivative) that is in the queue of the
context object. If there are no more valid callbacks in the queue, null is returned.
D.1.2.6 get_cb
function CB get_cb()
Returns the last callback accessed via a first (see D.1.2.2), next (see D.1.2.4), last (see D.1.2.3), or prev (see
D.1.2.5) call.
The factory interface provides convenient access to a portion of the uvm_factory interface (see 8.3.1). For
creating new objects and components, the preferred method of accessing the factory is via the object or
component wrapper (see 8.2.4 and 8.2.3, respectively). The wrapper also provides functions for setting type and
instance overrides.
D.2.1.1 create_component
A convenience function for uvm_factory::create_component_by_name (see 8.3.1.5), this method calls upon
the factory to create a new child component whose type corresponds to the preregistered type name,
requested_type_name, and instance name, name. This method is equivalent to:
If the factory determines that a type or instance override exists, the type of the component created may be
different from the requested type. See set_type_override (see D.2.1.5) and set_inst_override (see D.2.1.6). See
also 8.3.1 for details on factory operation.
408
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
D.2.1.2 create_object
A convenience function for uvm_factory::create_object_by_name (see 8.3.1.5), this method calls upon the
factory to create a new object whose type corresponds to the preregistered type name, requested_type_name,
and instance name, name. This method is equivalent to:
If the factory determines that a type or instance override exists, the type of the object created may be different
from the requested type. See 8.3.1 for details on factory operation.
D.2.1.3 set_type_override_by_type
The original_type and override_type arguments are lightweight proxies to the types they represent. See D.2.1.4
for information on usage.
D.2.1.4 set_inst_override_by_type
409
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
D.2.1.5 set_type_override
original_type_name typically refers to a preregistered type in the factory. It may, however, be any arbitrary
string. Subsequent calls to create_component (see D.2.1.1) or create_object (see D.2.1.2) with the same string
and matching instance path produce the type represented by override_type_name. override_type_name shall
refer to a preregistered type in the factory. The default value of replace shall be 1.
D.2.1.6 set_inst_override
relative_inst_path is relative to this component and may include wildcards. original_type_name represents a
preregistered type in the factory. It may, however, be any arbitrary string. Subsequent calls to
create_component (see D.2.1.1) or create_object (see D.2.1.2) with the same string and matching instance
path produce the type represented by override_type_name. override_type_name shall refer to a preregistered
type in the factory.
This interface provides versions of the set_report_* methods in the uvm_report_object base class (see 6.3)
that are applied recursively to this component and all its children.
When a report is issued and its associated action has the LOG bit set to 1, the report is sent to its associated
FILE descriptor.
410
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These methods recursively associate the specified verbosity with reports of the given severity, id, or severity-id
pair. A verbosity associated with a particular severity-id pair takes precedence over a verbosity associated with
id, which takes precedence over a verbosity associated with a severity.
These methods recursively associate the specified action with reports of the given severity, id, or severity-id
pair. A action associated with a particular severity-id pair takes precedence over a action associated with id,
which takes precedence over a action associated with a severity.
411
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
These methods recursively associate the specified FILE descriptor with reports of the given severity, id, or
severity-id pair. A FILE associated with a particular severity-id pair takes precedence over a FILE associated
with id, which takes precedence over a FILE associated with a severity.
For a list of severities and other information related to the report mechanism, refer to 6.4.
D.2.2.4 set_report_verbosity_level_hier
This method recursively specifies the maximum verbosity level for reports for this component and all those
below it. Any report from this component subtree whose verbosity exceeds this maximum is ignored.
See 6.4 for a list of predefined message verbosity levels and their meaning.
This interface provides a version of the set_recording_enabled (see 13.1.7.13) method in uvm_component
that are applied recursively to this component and all its children.
set_recording_enabled_hier
This method recursively calls set_recording_enabled (see 13.1.7.13), passing enabled, on this component and
all its children.
D.3.1 write_reg_by_name
Writes the named register. The default value of path shall be UVM_DEFAULT_DOOR. The default value of prior
shall be -1. The filename (fname) and line number (lineno) arguments are available for an implementation to
412
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
use for debug purposes only; their value shall have no functional effect on the outcome of this method. The
default value of lineno shall be 0.
D.3.2 read_reg_by_name
Reads the named register. The default value of path shall be UVM_DEFAULT_DOOR. The default value of prior
shall be -1. The filename (fname) and line number (lineno) arguments are available for an implementation to
use for debug purposes only; their value shall have no functional effect on the outcome of this method. The
default value of lineno shall be 0.
D.3.3 write_mem_by_name
Writes the named memory. The default value of path shall be UVM_DEFAULT_DOOR. The default value of prior
shall be -1. The filename (fname) and line number (lineno) arguments are available for an implementation to
use for debug purposes only; their value shall have no functional effect on the outcome of this method. The
default value of lineno shall be 0.
D.3.4 read_mem_by_name
413
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Reads the named memory. The default value of path shall be UVM_DEFAULT_DOOR. The default value of prior
shall be -1. The filename (fname) and line number (lineno) arguments are available for an implementation to
use for debug purposes only; their value shall have no functional effect on the outcome of this method. The
default value of lineno shall be 0.
The following uvm_callbacks#(T,CB) (see 10.7.2) typedefs are provided as a convenience to the user.
D.4.1 uvm_phase_cb_pool
D.4.2 uvm_objection_cbs_t
D.4.3 uvm_report_cb
D.4.4 uvm_report_cb_iter
These callback types can be used as part of the typedefs for uvm_reg_cbs (see 18.11.3).
D.4.5.1 uvm_reg_cb
D.4.5.2 uvm_reg_cb_iter
414
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
D.4.5.3 uvm_reg_bd_cb
D.4.5.4 uvm_reg_bd_cb_iter
D.4.5.5 uvm_mem_cb
D.4.5.6 uvm_mem_cb_iter
D.4.5.7 uvm_reg_field_cb
D.4.5.8 uvm_reg_field_cb_iter
D.4.5.9 uvm_vreg_cb
D.4.5.10 uvm_vreg_cb_iter
D.4.5.11 uvm_vreg_field_cb
D.4.5.12 uvm_vreg_field_cb_iter
415
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Annex E
(normative)
Test sequences
E.1 uvm_reg_hw_reset_seq
a) Resets the DUT and the block abstraction class associated with this sequence.
b) Reads all of the registers in the block, including any sub blocks, via all of the available address maps,
comparing the value read with the expected reset value.
If a bit-type resource named "NO_REG_TESTS", "NO_REG_HW_RESET_TEST" in the "REG::" namespace
matches the full name of the block or register, the block or register is not tested. This is usually the first test
executed on any DUT.
E.1.2 Variables
model
The block to be tested. This is declared in the base class, e.g., uvm_reg_block model.
E.1.2.1 Methods
E.1.2.1.1 new
E.1.2.1.2 body
This subclause defines classes that test individual bits of the registers defined in a register model.
416
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
E.2.1 uvm_reg_single_bit_bash_seq
Verifies the implementation of a single register by attempting to write 1s and 0s to every bit in it, via every
address map in which the register is mapped, making sure that the resulting value matches the mirrored value.
Registers that contain fields with unknown access policies cannot be tested.
The DUT should be idle and not modify any register during this test.
class uvm_reg_single_bit_bash_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.2.1.2 Variables
rg
uvm_reg rg
E.2.1.3 Methods
new
function new(string name = "uvm_reg_single_bit_bash_seq")
E.2.2 uvm_reg_bit_bash_seq
Verifies the implementation of all registers in a block, and its sub-blocks, recursively, by executing the
uvm_reg_single_bit_bash_seq sequence (see E.2.1) on it.
class uvm_reg_bit_bash_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.2.2.2 Variables
E.2.2.2.1 model
The block to be tested. This is declared in the base class, e.g., uvm_reg_block model.
E.2.2.2.2 req_seq
417
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
E.2.2.3 Methods
E.2.2.3.1 new
E.2.2.3.2 body
This subclause defines sequences that test DUT register access via the available frontdoor and backdoor paths
defined in the provided register model.
E.3.1 uvm_reg_single_access_seq
Verifies the accessibility of a register by writing it through its default address map, then reading it via the back
door and reversing the process, making sure the resulting value matches the mirrored value.
Registers that either do not have an available back door, or only contain read-only fields and/or fields with
unknown access policies, cannot be tested.
The DUT should be idle and not modify any register during this test.
class uvm_reg_single_access_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.3.1.2 Variables
rg
uvm_reg rg
E.3.1.3 Methods
new
function new(string name = "uvm_reg_single_access_seq")
418
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
E.3.2 uvm_reg_access_seq
Verifies the accessibility of all registers in a block by executing the uvm_reg_single_access_seq sequence (see
E.3.1) on every register within it.
class uvm_reg_access_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.3.2.2 Variables
E.3.2.2.1 model
The block to be tested. This is declared in the base class, e.g., uvm_reg_block model.
E.3.2.2.2 req_seq
E.3.2.3 Methods
E.3.2.3.1 new
E.3.2.3.2 body
E.3.3 uvm_reg_mem_access_seq
Verifies the accessibility of all registers and memories in a block by executing the uvm_reg_access_seq (see
E.3.2) and uvm_mem_access_seq sequence (see E.5.2), respectively, on every register and memory within it.
Blocks and registers with the NO_REG_TESTS or NO_REG_ACCESS_TEST attributes are not verified.
class uvm_reg_mem_access_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.3.3.2 Methods
new
419
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This subclause defines sequences for testing registers and memories that are shared between two or more
physical interfaces, i.e., are associated with more than one uvm_reg_map instance (see 18.2).
E.4.1 uvm_reg_shared_access_seq
Verifies the accessibility of a shared register by writing through each address map, then reading it via every
other address map in which the register is readable, making sure the resulting value matches the mirrored value.
Registers that contain fields with unknown access policies cannot be tested.
The DUT should be idle and not modify any register during this test.
class uvm_reg_shared_access_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.4.1.2 Variables
rg
uvm_reg rg
E.4.1.3 Methods
new
function new(string name = "uvm_reg_shared_access_seq")
E.4.2 uvm_mem_shared_access_seq
Verifies the accessibility of a shared memory by writing through each address map, then reading it via every
other address map in which the memory is readable, making sure the resulting value matches the mirrored
value.
The DUT should be idle and not modify the memory during this test.
420
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
class uvm_mem_shared_access_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.4.2.2 Variables
mem
uvm_mem mem
E.4.2.3 Methods
new
function new(string name = "uvm_mem_shared_access_seq")
E.4.3 uvm_reg_mem_shared_access_seq
Verifies the accessibility of all shared registers and memories in a block by executing the
uvm_reg_shared_access_seq (see E.4.1) and uvm_mem_shared_access_seq (see E.4.2) sequences,
respectively, on every register and memory within it.
class uvm_reg_mem_shared_access_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.4.3.2 Variables
E.4.3.2.1 model
The block to be tested. This is declared in the base class, e.g., uvm_reg_block model.
E.4.3.2.2 req_seq
E.4.3.2.3 mem_seq
421
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
E.4.3.3 Methods
E.4.3.3.1 new
E.4.3.3.2 body
E.5.1 uvm_mem_single_access_seq
Verifies the accessibility of a memory by writing through its default address map, then reading it via the back
door and reversing the process, making sure the resulting value matches the mirrored value.
The DUT should be idle and not modify the memory during this test.
class uvm_mem_single_access_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.5.1.2 Variables
mem
uvm_mem mem
E.5.1.3 Methods
new
function new(string name = "uvm_mem_single_access_seq")
E.5.2 uvm_mem_access_seq
Verifies the accessibility of all memories in a block by executing the uvm_mem_single_access_seq sequence
(see E.5.1) on every memory within it.
422
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
class uvm_mem_access_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.5.2.2 Variables
E.5.2.2.1 model
The block to be tested. This is declared in the base class, e.g., uvm_reg_block model.
E.5.2.2.2 mem_seq
E.5.2.3 Methods
E.5.2.3.1 new
E.5.2.3.2 body
This subclause defines sequences for applying a “walking-ones” algorithm on one or more memories.
E.6.1 uvm_mem_single_walk_seq
Runs the walking-ones algorithm on the memory given by the mem class property (see E.6.1.2), which needs to
be assigned prior to starting this sequence.
The walking-ones algorithm is performed for each map in which the memory is defined.
class uvm_mem_single_walk_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
423
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
E.6.1.2 Variables
mem
uvm_mem mem
The memory to test; this needs to be assigned prior to starting the sequence.
E.6.1.3 Methods
E.6.1.3.1 new
E.6.1.3.2 body
Performs the walking-ones algorithm on each map of the memory specified in mem (see E.6.1.2).
E.6.2 uvm_mem_walk_seq
Verifies all the memories in a block by executing the uvm_mem_single_walk_seq sequence (see E.6.1) on
every memory within it.
class uvm_mem_walk_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.6.2.2 Variables
E.6.2.2.1 model
The block to be tested. This is declared in the base class, e.g., uvm_reg_block model.
E.6.2.2.2 mem_seq
E.6.3 Methods
E.6.3.1 new
424
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
E.6.3.2 body
E.7 uvm_reg_mem_hdl_paths_seq
Verifies the correctness of the HDL paths specified for registers and memories.
This sequence checks that the specified backdoor paths are indeed accessible by the simulator. By default, the
check is performed for the default design abstraction. If the simulation contains multiple models of the DUT,
HDL paths for multiple design abstractions can be checked.
If a path is not accessible by the simulator, it cannot be used for read/write backdoor accesses. In that case, a
warning is issued. A simulator may have finer-grained access permissions, such as separate read or write
permissions. These extra access permissions are not checked.
The test is performed in zero time and does not require any reads/writes to/from the DUT.
class uvm_reg_mem_hdl_paths_seq
extends uvm_reg_sequence #( uvm_sequence #(uvm_reg_item) )
E.7.2 Variables
abstractions
string abstractions[$]
When not empty, this checks the HDL paths for the specified design abstractions. If empty, it checks the HDL
path for the default design abstraction, as specified with uvm_reg_block::set_default_hdl_path (see 18.1.6.9).
abstractions shall be a queue.
E.7.3 Methods
new
E.8 uvm_reg_mem_built_in_seq
A sequence that executes a user-defined selection of predefined register and memory test sequences.
425
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
E.8.2 Variables
E.8.2.1 model
The block to be tested. This is declared in the base class, e.g., uvm_reg_block model.
E.8.2.2 tests
By default, all the predefined register and memory tests are executed. tests can also be set to execute any
combination of the predefined register and/or memory tests by bitwise ORing the desired values defined by
uvm_reg_mem_tests_e (see 17.2.2.10). The default value of tests shall be UVM_DO_ALL_REG_MEM_TESTS.
E.8.3 Methods
E.8.3.1 new
E.8.3.2 body
426
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Annex F
(normative)
F.1 Overview
Universal Verification Methodology (UVM) provides other functionality at the package scope including
methods, enums, defines, and classes. Some of these are targeted toward specific aspects of the functionality
described in this standard and others are useful across multiple aspects.
F.2.1.1 UVM_FIELD_FLAG_RESERVED_BITS
parameter UVM_FIELD_FLAG_RESERVED_BITS
F.2.1.2 uvm_field_flag_t
bit[`UVM_FIELD_FLAG_SIZE-1:0] uvm_field_flag_t
The field flag type is a type for storing flag values passed onto the `uvm_field_* macros (see B.2.2).
F.2.1.3 uvm_bitstream_t
The bitstream type is used as an argument type for passing integral values in such methods as
uvm_object::set_local (see 5.3.12), uvm_config_int (see C.4.2.3.1), uvm_printer::print_field (see 16.2.3.8),
uvm_recorder::record_field (see 16.4.6.1), uvm_packer::pack_field (see 16.5.4.8), and
uvm_packer::unpack_field (see 16.5.4.16).
F.2.1.4 uvm_integral_t
The integral type is used as an argument type for passing integral values of 64 bits or less in such methods as
uvm_printer::print_field_int (see 16.2.3.9), uvm_recorder::record_field_int (see 16.4.6.2),
uvm_packer::pack_field_int (see 16.5.4.9), and uvm_packer::unpack_field_int (see 16.5.4.17).
427
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.2.1.5 uvm_radix_enum
Specifies the radix for printing or recording; it can contain the following literals:
UVM_REAL—Selects real (%g) in the exponential or decimal format, whichever results in the shorter
printed output.
UVM_REAL_DEC—Selects real (%f) in the decimal format.
UVM_NORADIX—No radix information is provided, the printer/recorder can use its default radix.
F.2.1.6 uvm_recursion_policy_enum
Specifies the policy for recursively entering object-based member variables; it has the following parameters:
UVM_DEFAULT_POLICY—No policy information is provided, the operation can use its default policy.
UVM_DEEP—Deep recursion. The operation shall recursively enter object-based member variables of
the target object.
UVM_SHALLOW—Shallow recursion. The operation shall not recursively enter object-based member
variables of the target object, instead treating them as simple references.
UVM_REFERENCE—Zero recursion. The target object itself shall be treated as a simple reference.
F.2.1.7 uvm_active_passive_enum
Defines whether a component, usually an agent, is in “active” mode or “passive” mode; it has the following
values:
UVM_PASSIVE—“Passive” mode.
UVM_ACTIVE—“Active” mode.
The following flags describe the operation types supported by uvm_field_op (see 5.7):
428
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
UVM_SET—The field will participate in uvm_object::configuration methods (see 5.3.12) and during
the uvm_component::apply_config_settings operation (see 13.1.5.1).
The following values describe additional flags that are supported by the `uvm_field_* macros (see B.2.2):
F.2.1.10 UVM_DEFAULT
The default value for FLAG (see B.2.2) is UVM_DEFAULT, which is functionally identical to UVM_ALL_ON (see
F.2.1.9).
F.2.2 Reporting
F.2.2.1 uvm_severity
An enumerated type representing all possible values for report severity; it has the following values:
UVM_INFO—Informative message.
UVM_ERROR—Indicates a real problem. Simulation continues subject to the configured message action.
F.2.2.2 uvm_action_type
An enumerated type representing all possible report actions; it has the following values:
UVM_LOG—Sends the report to the log file(s) specified within the report object.
UVM_COUNT—The report server shall increment its internal quit counter, see 6.5.1.
429
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.2.2.3 uvm_action
Defines an integer representing possible report actions (see F.2.2.2). Each of the bits of this type determines
whether a corresponding action is taken (1) or not (0). Multiple actions can be specified by doing a bitwise OR
of any number of the enumerated values. The exact size of the uvm_action vector is implementation specific;
however, it shall be sufficiently large to store the result of bitwise ORing all uvm_action_type values (see
F.2.2.2).
F.2.2.4 uvm_verbosity
Defines the standard verbosity levels for reports; it has the following parameters:
UVM_NONE—The report is always printed (NONE = 0); the verbosity level setting cannot disable it.
UVM_LOW—The report is issued if the configured verbosity is set to UVM_LOW (LOW = 100) or above.
UVM_MEDIUM—The report is issued if the configured verbosity is set to UVM_MEDIUM (MEDIUM = 200)
or above.
UVM_HIGH—The report is issued if the configured verbosity is set to UVM_HIGH (HIGH = 300) or above.
UVM_FULL—The report is issued if the configured verbosity is set to UVM_FULL (FULL = 400) or above.
uvm_port_type_e
UVM_EXPORT—The port provides the interface that is its type parameter via a connection to some other
export or implementation.
UVM_IMPLEMENTATION—The port provides the interface that is its type parameter, and it is bound to
the component that implements the interface.
F.2.4 Sequences
F.2.4.1 uvm_sequencer_arb_mode
430
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.2.4.2 uvm_sequence_state_enum
Defines the current sequence state. These enumeration values shall be one-hot to support bitwise ORing, such as
that used by uvm_sequence_base::wait_for_sequence_state (see 14.2.2.5).
F.2.4.3 uvm_sequence_lib_mode
Specifies the random selection mode of a sequence library; it has the following parameters:
F.2.5 Phasing
F.2.5.1 uvm_phase_type
This is the set of possible objects of a uvm_phase object (see 9.3.1); it has the following parameters:
UVM_PHASE_IMP—This phase object is used to traverse the component hierarchy and call the
component phase method as well as the phase_started (see 13.1.4.3.1) and phase_ended (see
13.1.4.3.3) callbacks.
UVM_PHASE_NODE—This object represents a simple node instance in the graph (see 9.3.1). These nodes
contain a reference to their corresponding UVM_PHASE_IMP object.
UVM_PHASE_SCHEDULE—This object represents a portion of the phasing graph, typically consisting of
several UVM_PHASE_NODE types, in series, in parallel, or both.
431
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
UVM_PHASE_DOMAIN—This object represents an entire graph segment that executes in parallel with the
“run” phase. Domains may define any network of UVM_PHASE_NODEs and UVM_PHASE_SCHEDULEs.
The built-in domain, uvm, consists of a single schedule of all the run-time phases, starting with
pre_reset and ending with post_shutdown.
F.2.5.2 uvm_phase_state
UVM_PHASE_UNINITIALIZED—The state is uninitialized. This is the default state for phases and for
nodes that have not yet been added to a schedule.
UVM_PHASE_DORMANT—The phase is part of a schedule, but not currently executing. It could be
scheduled at some point in the future when its predecessors are done.
UVM_PHASE_SCHEDULED—The immediate predecessors of the phase are all done.
UVM_PHASE_SYNCING—All predecessors complete; waiting for all synced phases (e.g., across
domains) to be at or beyond this point.
UVM_PHASE_STARTED—Any synced phases are at UVM_PHASE_SYNCING or beyond; call the
phase_started callback (see 13.1.4.3.1) for each component in the domain, then wait a delta cycle.
UVM_PHASE_EXECUTING—Past the delta cycle after calling phase_started (see 13.1.4.3.1); executing
phase behavior until terminated by all objections being dropped, a jump, or a timeout.
UVM_PHASE_READY_TO_END—No objections remain in this phase or in any predecessors of its
successors or in any synched phases. In this state, if an objection is raised to this phase, the state returns
to UVM_PHASE_EXECUTING. If no objection is raised before a delta cycle elapses, the state transitions to
UVM_PHASE_ENDED.
UVM_PHASE_ENDED—The phase has completed execution; it is now running the phase_ended callback
(see 13.1.4.3.3). Completes in a delta cycle.
UVM_PHASE_CLEANUP—(No jump is in progress.) All processes related to phase are being killed.
Completes in a delta cycle.
UVM_PHASE_JUMPING—(A jump is in progress.) All processes related to phase are being killed.
Completes in a delta cycle. All predecessors are forced into the UVM_PHASE_DONE state and the phase
target is forced to UVM_DORMANT state.
UVM_PHASE_DONE—The phase has finished execution, which may enable a waiting successor phase to
execute.
F.2.5.3 uvm_wait_op
Specifies the operand when using methods like uvm_phase::wait_for_state (see 9.3.1.8.3); it can be one of the
following:
UVM_EQ—Equal.
UVM_NE—Not equal.
UVM_LT—Less than.
UVM_GT—Greater than.
432
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.2.6 Objections
uvm_objection_event
Enumerates the possible objection events on which one could wait; it has the following parameters. See also
10.5.1.5.2.
F.2.7 uvm_apprepend
Specifies whether order-dependent API should put new items at the front or at the back, as follows:
F.2.8 UVM_FILE
The UVM_STDIN, UVM_STDOUT, and UVM_STDERR values align to the SystemVerilog file descriptor
values for STDIN, STDOUT, and STDERR, respectively.
F.2.10 uvm_core_state
This is an enumeration containing the set of possible states for the UVM core; it has the following values:
433
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
UVM_CORE_ABORTED—The die method has been called, and the pre_abort and post_run_test
callbacks have completed. $finish is about to be called.
F.2.11 uvm_heartbeat_modes
F.3.1.1 get_core_state
F.3.1.2 run_test
F.3.1.3 uvm_init
Initializes the UVM framework and sets the uvm_coreservice_t instance (see F.4) returned by
uvm_coreservice_t::get (see F.4.1.3). If cs is null, then uvm_coreservice_t::get returns an implementation
defined core service instance; otherwise, the provided cs is returned.
Additionally, the initialize hook on all registered uvm_object_registry#(T,Tname) (see 8.2.4) and
uvm_component_registry#(T,Tname) (see 8.2.3) types shall be called, after which the UVM core state (see
F.3.1.1) is set to UVM_CORE_INITIALIZED. Only the first call to uvm_init shall initialize the UVM
framework. Subsequent calls to uvm_init shall not reinitialize the UVM framework.
F.3.2 Reporting
F.3.2.1 uvm_get_report_object
434
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.3.2.2 uvm_report_enabled
Returns 1 if the configured verbosity in the implicit top-level component (see F.7) for this severity/id is greater
than or equal to verbosity, else returns 0. See also 6.3.3.2.
435
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
bit report_enabled_checked = 0
)
function void uvm_report_fatal(
string id,
string message,
int verbosity = UVM_NONE,
string filename = "",
int line = 0,
string context_name = "",
bit report_enabled_checked = 0
)
function void uvm_process_report_message(
uvm_report_message report_message
)
These methods, defined in the package scope, delegate to the corresponding component methods in the implicit
top-level component (see F.7). They can be used in module-based code to use the same reporting mechanism as
class-based components. See 6.3 for details on the reporting mechanism.
F.3.3 Miscellaneous
F.3.3.1 uvm_is_match
The expr can be made to match multiple str by using either POSIX regular expression notation (IEEE Std
1003.1™-2008 [B1]) or a simplified notation.
Each resource within the pool has a set of scopes over which it is visible. When attempting to retrieve resources
from the pool via the lookup interface (see C.2.4.4), the scope of the lookup is compared against any stored
scopes set via set_scope (see C.2.4.3.1), set_override (see C.2.4.3.2), set_name_override (see C.2.4.3.3), or
set_type_override (see C.2.4.3.4).
A single resource can be made to match multiple lookup scopes by using either POSIX regular expression
notation (IEEE Std 1003.1-2008 [B1]) or a simplified notation when setting its scope within the pool.
Regular expressions are identified as such when they are surrounded by “/” characters. The enclosing “/”
characters are not part of the actual regular expression. For example, the scope /^top\.*/ is interpreted as the
regular expression ^top\.*. Any expressions not surrounded by “/” shall be treated as simplified notation.
The simplified notation has only three meta-characters: *, +, and ?. Table F.1 shows the regular expression
equivalents of the simplified notation’s meta-characters.
436
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.3.3.2 uvm_string_split
Returns a queue of strings, values, that is the result of the str split based on the sep. values shall be a queue.
Consecutive separators are not grouped together, and are deemed to delimit empty strings (""). For example
"," results in '{"",""}, and "1,,2" results in '{"1","","2"}. Splitting an empty string shall result in
'{""}.
NOTE—The length of values after calling uvm_string_split will always be 1 more than the number of sep in value.
F.3.4 uvm_enum_wrapper#(T)
The uvm_enum_wrapper#(T) class is a utility mechanism provided as a convenience to the user. It provides a
from_name method (see F.3.4.2), which is the logical inverse of the SystemVerilog name method that is built
into all enumerations.
F.3.4.2 Methods
from_name
static function bit from_name(
string name,
ref T value
)
The name passed in to the method is case sensitive and needs to exactly match the value that would be
produced by enum::name.
437
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The UVM core service provides a common point for all central UVM services, such as uvm_factory (see
8.3.1), uvm_report_server (see 6.5.1), etc. The service class provides a static ::get (see F.4.1.3), which returns
an instance adhering to uvm_coreservice_t.
The rest of the set_facility get_facility pairs provide access to internal UVM services.
F.4.1 uvm_coreservice_t
F.4.1.2 Constructor
function new
F.4.1.3 get
Returns the uvm_coreservice_t instance, as defined by uvm_init (see F.3.1.3). If get_core_state (see F.3.1.1)
returns UVM_CORE_UNINITIALIZED, then get shall call uvm_init with cs set to null and return the
implementation defined core service instance (see F.4.2).
F.4.1.4.1 get_root
F.4.1.4.2 get_factory
F.4.1.4.3 set_factory
F.4.1.4.4 get_report_server
438
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.4.1.4.5 set_report_server
F.4.1.4.6 get_default_tr_database
F.4.1.4.7 set_default_tr_database
F.4.1.4.8 get_component_visitor
F.4.1.4.9 set_component_visitor
Intended to set the component visitor to v (this visitor is being used for the traversal at
end_of_elaboration_phase, e.g., for name checking).
F.4.1.4.10 set_phase_max_ready_to_end
Intended to set the default value for maximum iterations of ready_to_end for all phases (see 9.3.1.3.5).
F.4.1.4.11 get_phase_max_ready_to_end
Intended to get the default value for maximum iterations of ready_to_end for all phases.
F.4.1.4.12 set_default_printer
F.4.1.4.13 get_default_printer
439
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Retrieves the default printer policy instance, as defined by set_default_printer (see F.4.1.4.12). If
set_default_printer has not been called or has been called with a value of null, the implementation returns the
implementation’s default printer instance.
F.4.1.4.14 set_default_packer
F.4.1.4.15 get_default_packer
Retrieves the default packer policy instance, as defined by set_default_packer (see F.4.1.4.14). If
set_default_packer has not been called or has been called with a value of null, the implementation returns the
implementation’s default packer instance.
F.4.1.4.16 set_default_comparer
F.4.1.4.17 get_default_comparer
Retrieves the default comparer policy instance, as defined by set_default_comparer (see F.4.1.4.16). If
set_default_comparer has not been called or has been called with a value of null, the implementation returns
the implementation’s default comparer instance.
F.4.1.4.18 set_default_copier
F.4.1.4.19 get_default_copier
Retrieves the default copier policy instance, as defined by set_default_copier (see F.4.1.4.18). If
set_default_copier has not been called or has been called with a value of null, the implementation shall return
the implementation’s default copier instance.
F.4.1.4.20 get_global_seed
Returns a seed that shall be used by the UVM base class library to initialize the random number generators of
objects and/or processes.
The return value is implementation specific, however the return value shall be immutable. Successive calls to
get_global_seed within a single simulation shall return the same value.
440
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The mechanism for generating seeds based off of the return value of get_global_seed is implementation
specific. The seeds generated within the UVM base class library shall be deterministic, such that if all
interactions with the UVM base class library between two simulations are identical, including the global seed
value, then the seeds generated within the UVM base class library shall be identical.
Refer to use_uvm_seeding (see 5.3.3.1) and random stability (see 1.4.6) for additional information regarding
random stability within the UVM base class library.
F.4.1.4.21 set_resource_pool
F.4.1.4.22 get_resource_pool
F.4.1.4.23 set_resource_pool_default_precedence
Overrides the current default precedence being used by the resource pool.
Calling this method only changes the value used for future calls to get_default_precedence (see C.2.4.5.5).
The precedence of any resources already stored within the pool remains unchanged.
F.4.1.4.24 get_resource_pool_default_precedence
Returns the current default precedence being used by the resource pool.
This value shall be 1000, unless overwritten via a call to set_default_precedence (see C.2.4.5.4).
F.4.1.4.25 get_uvm_seeding
Returns the current UVM seeding enable value, as set by set_uvm_seeding (see F.4.1.4.26). If
set_uvm_seeding has not been called, this returns 1.
F.4.1.4.26 set_uvm_seeding
This bit enables or disables the UVM seeding mechanism. It globally affects the operation of the reseed method
(see 5.3.3.3). The default value shall be 1 (enabled).
441
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
When enabled, UVM-based objects are seeded based on their type and full hierarchical name rather than
allocation order. This improves random stability for objects whose instance names are unique across each type.
The uvm_component class (see 13.1) is an example of a type that has a unique instance name.
F.4.2 uvm_default_coreservice_t
Default implementation of the UVM core service. uvm_default_coreservice_t can be extended; it provides a
full implementation of all uvm_coreservice_t methods (see F.4.1.4).
F.4.2.2 Constructor
function new
F.5 Traversal
The uvm_visitor class provides an abstract base class for a visitor. The visitor visits instances of type NODE.
F.5.1.2 Methods
F.5.1.2.1 begin_v
This method is invoked by the visitor before the first NODE is visited. This base version does nothing.
F.5.1.2.2 end_v
This method is invoked by the visitor after the last NODE is visited. This base version does nothing.
F.5.1.2.3 visit
Intended to be invoked by the visitor for every visited node of the provided structure. The user needs to provide
the functionality in this function.
442
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The uvm_structure_proxy is a wrapper that provides a set of elements of the STRUCTURE to the caller on
demand. This is to decouple the retrieval of the STRUCTURE’s subelements from the actual function being
invoked on STRUCTURE.
F.5.2.2 Methods
F.5.2.2.1 new
Initializes a new uvm_structure_proxy with the specified name. The default value of name shall be an empty
string ("").
F.5.2.2.2 get_immediate_children
Intended to return a set of the direct subelements of s within children. children shall be a queue.
This visitor adapter traverses all nodes of the STRUCTURE and invokes visitor.visit on every node.
F.5.3.2 Methods
F.5.3.2.1 new
Initializes a new uvm_visitor_adapter with the specified name. The default value of name shall be an empty
string ("").
F.5.3.2.2 accept
443
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
uvm_structure_proxy#(STRUCTURE) p,
bit invoke_begin_end = 1
)
Intended to traverse through s (and every subnode of s), invoking v.visit(node) for each node found. The
children of s are intended to be determined by invoking p.get_immediate_children. invoke_begin_end
determines whether the visitors begin/end functions should be invoked prior to traversal. The default value of
invoke_begin_end shall be 1.
F.5.4 uvm_top_down_visitor_adapter
This adapter traverses the STRUCTURE s (and invokes the visitor) in a hierarchical fashion. During traversal, s
is visited before any subnodes of s are visited.
class uvm_top_down_visitor_adapter#(
type STRUCTURE = uvm_component,
VISITOR = uvm_visitor#(STRUCTURE)
) extends uvm_visitor_adapter#(STRUCTURE,VISITOR)
F.5.4.2 Methods
new
function new (string name="")
Initializes a new uvm_top_down_visitor_adapter with the specified name. The default value of name shall be
an empty string ("").
F.5.5 uvm_bottom_up_visitor_adapter
This adapter traverses the STRUCTURE s (and invokes the visitor) in a hierarchical fashion. During traversal, all
the children of s are visited before s is visited.
class uvm_bottom_up_visitor_adapter#(
type STRUCTURE = uvm_component,
VISITOR = uvm_visitor#(STRUCTURE)
) extends uvm_visitor_adapter#(STRUCTURE,VISITOR)
F.5.5.2 Methods
new
function new (string name="")
Initializes a new uvm_bottom_up_visitor_adapter with the specified name. The default value of name shall
be an empty string ("").
F.5.6 uvm_by_level_visitor_adapter
This adapter traverses the STRUCTURE s (and invokes the visitor) in a hierarchical fashion. During traversal, all
the direct children of s are visited before any grandchildren are visited.
444
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
class uvm_by_level_visitor_adapter#(
type STRUCTURE = uvm_component,
VISITOR = uvm_visitor#(STRUCTURE)
) extends uvm_visitor_adapter#(STRUCTURE,VISITOR)
F.5.6.2 Methods
new
function new (string name="")
Initializes a new uvm_by_level_visitor_adapter with the specified name. The default value of name shall be
an empty string ("").
F.5.7 uvm_component_proxy
F.5.7.2 Methods
new
function new (string name="")
Initializes a new uvm_component_proxy with the specified name. The default value of name shall be an empty
string ("").
F.6 uvm_run_test_callback
Callback used for notification of the beginning and ending of a UVM test.
F.6.2 Methods
F.6.2.1 new
Creates a new uvm_run_test_callback with the given instance name. The default value of name is
uvm_run_test_callback.
F.6.2.2 pre_run_test
445
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
The pre_run_test method is called on all registered uvm_run_test_callback instances upon entry to
uvm_root::run_test (see F.7.3.1).
F.6.2.3 post_run_test
The post_run_test method is called on all registered uvm_run_test_callback instances immediately prior to
the uvm_root::run_test (see F.7.3.1) returning or calling $finish.
F.6.2.4 pre_abort
The pre_abort method is called on all registered uvm_run_test_callback instances prior to uvm_root::die
(see F.7.3.2) terminating the simulation.
F.6.2.5 add
Adds cb to the list of callbacks to be processed. The method returns 1 if cb is not already in the list of
callbacks; otherwise, a 0 is returned. If cb is null, 0 is returned.
F.6.2.6 delete
Removes cb from the list of callbacks to be processed. The method returns 1 if cb is in the list of callbacks;
otherwise, a 0 is returned. If cb is null, 0 is returned.
F.7 uvm_root
The uvm_root class serves as the implicit top-level and phase controller for all UVM components. Users do not
directly instantiate uvm_root. UVM automatically creates a singleton of uvm_root that users can access via
uvm_root::get.
a) Implicit top-level—The root instance serves as an implicit top-level component. Any component whose
parent is specified as NULL becomes a child of this instance. Thus, all UVM components in simulation
are descendants of this instance.
b) Phase control—The root instance is responsible for executing the test (see F.7.3.1).
c) Search—Use the root instance to search for components based on their hierarchical name. See F.7.4.1.
d) Report configuration—Use the root instance to globally configure report verbosity, logfiles, and
actions.
e) Global reporter—Because the root instance is accessible via the uvm_pkg scope, the reporting
mechanism can be used from anywhere. See F.3.2.3.
The root instance checks during the end_of_elaboration phase if any errors have been generated so far. If
errors are found, an UVM_FATAL error shall be generated so the simulation does not continue to the
uvm_start_of_simulation_phase (see 9.8.1.4).
446
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.7.2.1 new
This is a constructor.
As root is a singleton at the top of the component hierarchy, it does not support creation via the uvm_factory
(see 8.3.1). A fatal message shall be generated if multiple instances or extensions of uvm_root are constructed.
F.7.2.2 get
The static accessor is provided as a convenience wrapper around retrieving the root via the
uvm_coreservice_t::get_root method (see F.5).
F.7.3.1 run_test
a) The uvm_coreservice_t instance (see F.4) is retrieved via uvm_coreservice_t::get (see F.4.1.3).
b) The UVM core state (see F.3.1.1) is set to UVM_CORE_PRE_RUN.
c) The pre_run_test (see F.6.2.2) method is called on all registered uvm_run_test_callback instances
(see F.5.7.2).
d) If the command-line plusarg, +UVM_TESTNAME=<TEST_NAME> (see G.2.1), is found, then an
implementation shall call create_component_by_name (see 8.3.1.5) on the current factory (see
F.4.1.4.2) with requested_type_name set to the plusarg defined <TEST_NAME> and name set to
uvm_test_top.
e) If test_name is not an empty string ("") and no name was provided via the command-line plusarg, then
an implementation calls create_component_by_name on the current factory with
requested_type_name set to test_name and name set to uvm_test_top.
f) If no components other than uvm_root (see F.7) have been created at this point, either by run_test or
by the user, then an implementation shall generate a fatal message and run_test shall return
immediately.
g) The UVM core state is set to UVM_CORE_RUNNING.
h) All components are phased through all registered phases (see Clause 9).
i) The UVM core state is set to UVM_CORE_POST_RUN.
447
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
F.7.3.2 die
This method is called by the report server if a report reaches the maximum quit count or has an UVM_EXIT
action associated with it, e.g., as with fatal errors.
a) The UVM core state (see F.3.1.1) is set to UVM_CORE_PRE_ABORT and the previous core state value is
temporarily stored for use in c).
b) The uvm_component::pre_abort method (see 13.1.4.1.6) is called on the entire uvm_component
hierarchy (see 13.1) in a bottom-up fashion.
c) The pre_abort method (see F.6.2.4) is called on all registered uvm_run_test_callback instances (see
F.5.7.2).
d) The report_summarize method (see 6.5.1.2.17) is called on the current report server (see F.4.1.4.4).
e) The UVM core state is set to UVM_CORE_ABORTED.
f) The simulation is terminated with $finish.
F.7.3.3 set_timeout
Specifies the global timeout for the simulation, which is applied in uvm_run_phase (see 9.8.1.5). If this
method is not called, the default timeout value is implementation specific.
The timeout is simply the maximum absolute simulation time allowed before a UVM_FATAL timeout occurs. If
timeout is set to 20ns, the simulation needs to end before 20 ns or a UVM_FATAL timeout will occur. This
feature is provided so a user can prevent the simulation from potentially consuming too many resources (disk,
memory, CPU, etc.) when the testbench is essentially hung.
If overridable is 0, any future calls to set_timeout have no effect. If overridable is 1, this call puts no such
restrictions on any future calls. The default value of overridable shall be 1.
F.7.3.4 set_finish_on_completion
448
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
If this function has never been called or this function is passed a 1, run_test (see F.7.3.1) calls $finish after
all phases are executed. When this function is passed a 0, the user needs to implement a mechanism to
terminate the simulation.
F.7.3.5 get_finish_on_completion
Returns the latest value set by set_finish_on_completion (see F.7.3.4) or 1 if set_finish_on_completion has
never been called.
F.7.3.6 end_of_elaboration_phase
F.7.4 Topology
Returns the component (find) or list of components (find_all) matching a given comp_match string. Matches
are determined using uvm_is_match (see F.3.3.1), with comp_match as expr, and the component’s full name
(see 13.1.3.2) as str.
If the comp argument is not null, the search begins from that component down; otherwise, all component
instances are compared.
find does a find_all with comp = null and returns the first element in the output queue or null if there is an
empty queue. Any elements in the comps queue prior to the call to find_all are unaffected by find_all and will
still be present in the comps queue after find_all.
F.7.4.2 print_topology
Prints the verification environment’s component topology. The printer argument provides the policy class to be
used for this operation. If no printer is provided (or the value provided is null), print_topology shall use the
default printer policy, as returned by get_default_printer (see F.4.1.4.13).
449
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Annex G
(normative)
The uvm_cmdline_processor class provides an interface to the command line arguments that were provided
for the given simulation. Users can retrieve the complete arguments using methods such as get_args and
get_arg_matches and also retrieve the suffixes of arguments using get_arg_values.
The generation of the data structures that hold the command line argument information happens during
construction of the class object. Command line arguments that are in uppercase should only have one setting
per invocation. Command line arguments that are in lowercase can have multiple settings per invocation.
The uvm_cmdline_processor class also provides support for setting various UVM variables from the
command line, such as components’ verbosities and configuration settings for integral types and strings. Each
of these capabilities is described in G.2.
G.1.2 Singleton
get_inst
This is a convenience mechanism, it returns the singleton instance of the UVM command line processor.
G.1.3.1 get_args
This function returns a queue with all of the command line arguments that were used to start the simulation.
Element 0 of the array is always the name of the executable that started the simulation. args shall be a queue.
G.1.3.2 get_plusargs
This function returns a queue with all of the plus arguments that were used to start the simulation. Plus
arguments may be used by the simulator, or may be specific to a company or individual user. plusargs never
use extra arguments (i.e., if there is a plusarg as the second argument on the command line, the third
argument is unrelated); this is not necessarily the case with application specific dash arguments. args shall be a
queue.
450
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
G.1.3.3 get_uvmargs
This function loads the queue args with all of the uvm arguments that were used to start the simulation. A uvm
argument is taken to be any argument that starts with a - or + and uses the keyword UVM (case insensitive) as
the first three letters of the argument.
G.1.3.4 get_arg_matches
This function replaces any contents of the queue args with all of the arguments that match the expression in
match, and it returns the number of items that matched. If match is bracketed with //, it is taken as an extended
regular expression; otherwise, it is taken as the beginning of an argument to match. For example:
string myargs[$]
initial begin
uvm_cmdline_processor clp = uvm_cmdline_processor::get_inst();
void'(clp.get_arg_matches("+foo",myargs))
//matches +foo, +foobar
//doesn't match +barfoo
void'(clp.get_arg_matches("/foo/",myargs))
//matches +foo, +foobar,
//foo.sv, barfoo, etc.
void'(clp.get_arg_matches("/^foo.*\.sv",myargs))
//matches foo.sv
//and foo123.sv,
//not barfoo.sv.
end
G.1.4.1 get_arg_value
This function finds the first argument that matches match and assigns the suffix of the argument to value. It
then returns the number of command line arguments that match match. match is interpreted as described in
G.1.3.4.
G.1.4.2 get_arg_values
451
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
This function finds all arguments that match match and replaces any contents of the args queue with the
suffixes of the matching arguments. It then returns the number of command line arguments that match match.
match is interpreted as described in G.1.3.4. For example, if "+foo=1,yes,on +foo=5,no,off" was
provided on the command line and the following code was executed:
string foo_values[$]
initial begin
uvm_cmdline_processor clp = uvm_cmdline_processor::get_inst();
void'(clp.get_arg_values("+foo=",foo_values));
end
0"1,yes,on"
1"5,no,off"
G.2.1 +UVM_TESTNAME
+UVM_TESTNAME=<class name> can be used to specify which uvm_test (or uvm_component) should be
created via the factory and cycled through the UVM phases. If multiple settings occur, the first occurrence is
used and a warning is issued for subsequent settings. For example:
G.2.2 +UVM_VERBOSITY
+UVM_VERBOSITY=<verbosity> can be used to specify the initial verbosity for all components. If multiple
settings occur, the first occurrence is used and a warning is issued for subsequent settings. For example:
G.2.3 +uvm_set_verbosity
+uvm_set_verbosity=<comp>,<id>,<verbosity>,<phase> and
+uvm_set_verbosity=<comp>,<id>,<verbosity>,time,<time> can be used to manipulate the
verbosity of specific components at specific phases (and times during the “run” phases) of the simulation. The
id argument can be either ALL for all IDs or a specific message id. Wild carding is not supported for id due to
performance concerns. Settings for non-“run” phases are executed in order of occurrence on the command line.
Settings for “run” phases (times) are sorted by time and then executed in order of occurrence for settings of the
same time. For example:
<sim command>
+uvm_set_verbosity=uvm_test_top.env0.agent1.*,_ALL_,UVM_FULL,time,800
452
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
G.2.4 +uvm_set_action
<sim command>
+uvm_set_action=uvm_test_top.env0.*,_ALL_,UVM_ERROR,UVM_NO_ACTION
G.2.5 +uvm_set_severity
<sim command>
+uvm_set_severity=uvm_test_top.env0.*,BAD_CRC,UVM_ERROR,UVM_WARNING
G.2.6 +UVM_MAX_QUIT_COUNT
+UVM_MAX_QUIT_COUNT=<count>,<overridable> changes the max quit count for the report server. The
<overridable> argument (YES or NO) specifies whether user code can subsequently change this value. If set
to NO and the user code tries to change the max quit count value, a warning message is issued and the attempted
change is ignored.
+uvm_set_inst_override=<req_type>,<override_type>,<full_inst_path> and
+uvm_set_type_override=<req_type>,<override_type>[,<replace>] work like the name-based
overrides in the factory (see 8.2.3.2): factory.set_inst_override_by_name and
factory.set_type_override_by_name. For uvm_set_type_override, the third argument is 0 or 1 (the default
is 1 if this argument is left off); this argument specifies whether previous type overrides for the type should be
passed to the replace field of the factory calls. For example:
No equivalent of set_config_object exists as an uvm_object cannot be passed into the simulation via the
command line.
453
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
G.2.9 +uvm_set_default_sequence
<sim command>
+uvm_set_default_sequence=path.to.sequencer,main_phase,seq_type
uvm_coreservice_t cs = uvm_coreservice_t::get()
uvm_factory f = cs.get_factory()
uvm_config_db#(uvm_object_wrapper)::set(this,
"path.to.sequencer.main_phase", "default_sequence",
f.find_wrapper_by_name("seq_type"))
454
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
Annex H
(normative)
Deprecation
H.1 General
IEEE Std 1800.2-2017 included a reference to the UVM_DISABLE_RECORDING compile time definition in
subclause 15.2.1.2.10. This deprecated define does not appear in this version of the standard.
IEEE Std 1800.2-2017 included a reference to the is_auto_updated method of the uvm_reg_backdoor
class in subclause 19.5.2.9. Since this method was only used in conjunction with the deprecated
wait_for_change method (see H.2.3), it has been deprecated and does not appear in this version of the
standard.
IEEE Std 1800.2.-2017 included a reference to the wait_for_change method of the uvm_reg_backdoor
class in subclause 19.5.2.10. Since this method is a SystemVerilog class local method and therefore cannot be
extended or called by a user, it has been deprecated and does not appear in this version of the standard.
IEEE Std 1800.2-2017 defined the function begin_child_tr in subclause 5.4.2.5. When this function is
passed the value 0 for the parent_handle argument, the functionality exactly matches that of begin_tr (see
5.4.2.4), which did not have a parent_handle argument. To eliminate duplication, this begin_child_tr
function is deprecated (and does not appear in this version of the standard) and the begin_tr function now has
the optional parent_handle argument, defaulting to 0.
IEEE Std 1800.2-2017 defined a package scope variable uvm_cmdline_proc in Annex G.1 which allowed
access to the command line processor singleton (see G.1.2). This variable introduces the possibility of races
during static initialization. Therefore, this deprecated variable does not appear in this version of the standard.
455
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
IEEE Std 1800.2-2020
IEEE Standard for Universal Verification Methodology Language Reference Manual
H.2.6 uvm_split_string
IEEE Std 1800.2-2017 defined the uvm_split_string method, which was ambiguously documented with
regards to special cases of consecutive separators and empty strings. To remove the ambiguities while not
introducing any potential backwards compatibility concerns, the uvm_string_split (see F.3.3.2) method is now
provided. As such, the uvm_split_string method is deprecated, and does not appear in this version of the
standard.
456
Copyright © 2020 IEEE. All rights reserved.
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.
RAISING THE
WORLD’S
STANDARDS
Connect with us on:
Twitter: twitter.com/ieeesa
Facebook: facebook.com/ieeesa
LinkedIn: linkedin.com/groups/1791118
Beyond Standards blog: beyondstandards.ieee.org
YouTube: youtube.com/ieeesa
standards.ieee.org
Phone: +1 732 981 0060
Authorized licensed use limited to: Nanjing University. Downloaded on May 10,2021 at 09:10:49 UTC from IEEE Xplore. Restrictions apply.