Professional Documents
Culture Documents
Ovm2uvm Migration
Ovm2uvm Migration
0ea) to
UVM-1.0
Product Version 10.2
May 6, 2011
Copyright Statement
2011 Cadence Design Systems, Inc. All rights reserved worldwide. Cadence and the
Cadence logo are registered trademarks of Cadence Design Systems, Inc. All others are the
property of their respective holders.
May 6, 2011
Contents
Purpose ........................................................................................................................ 4
Audience ...................................................................................................................... 4
Migration process ......................................................................................................... 4
Specific Migration Issues ............................................................................................. 5
Phasing Changes ..................................................................................................... 5
Sequence Changes .................................................................................................. 7
Configuration .......................................................................................................... 10
Other migration issues ............................................................................................ 12
Summary .................................................................................................................... 12
References ................................................................................................................. 13
Appendix A: Deprecation Warning Mapping .............................................................. 13
Appendix B: Removed Deprecated Functionality ....................................................... 18
Removed global variables ...................................................................................... 18
Removed global functions ...................................................................................... 19
Removed classes ................................................................................................... 19
Removed class methods ........................................................................................ 19
Removed Macros ................................................................................................... 19
May 6, 2011
Purpose
UVM-1.0 is the first standard release of UVM from Accellera. While UVM is based on
OVM and moving a verification environment from OVM to UVM is largely a matter of
replacing Os with Us, there are a number of things you must be aware of when
converting your environment:
Some OVM functionality was kept but deprecated, especially in the area of
sequence libraries.
This application notes describes the process for migrating an OVM (or UVM-1.0ea)
environment to use UVM-1.0.
Audience
This document is intended for OVM users who are ready to move their environment to
UVM-1.0. It is also applicable for users using UVM-1.0ea who are ready to move
forward to UVM-1.0.
Migration process
The basic process for moving an environment is provided below:
1. Convert Os to Us using the ovm2uvm.pl script at <uvm_home>/bin/ovm2uvm.pl.
For UVM-1.0ea users, this step is not needed.
2. Compile the environment, fixing old deprecated OVM functionality that was
removed from UVM-1.0 (and thus will not compile). Refer to the appendix
Removed Deprecated Functionality for a list of functionality that was removed
(the appendix also contains the expected replacement).
3. Run the simulation with the option +UVM_USE_OVM_RUN_SEMANTIC. This option will
allow the run phase to continue running past time 0 even without an objection
having been raised.
May 6, 2011
Phasing Changes
1. The phase implementation task/function prototypes have been changed to
include _phase in the name and to include the phase object as an argument. All
phase tasks/functions should be translated:
function void build(); function void build_phase(uvm_phase phase);
function void connect(); function void connect_phase(uvm_phase phase);
function void end_of_elaboration();
function void end_of_elaboration_phase(uvm_phase phase);
function void start_of_simulation();
function void start_of_simulation_phase(uvm_phase phase);
task run(); task run_phase(uvm_phase phase);
function void extract(); function void extract_phase(uvm_phase phase);
function void check(); function void check_phase(uvm_phase phase);
function void report(); function void report_phase(uvm_phase phase);
2. It is no longer legal to manually call the build phase function. This will now result
in a run-time warning. Any direct calls to <comp>.build() should be removed;
allow the phasing system to automatically call the build method. In UVM-1.0 a
direct call to build() will result in a deprecation message.
May 6, 2011
3. UVM-1.0 adds run time phases (phases that execut in parallel to the run phase).
These phases require user information in order to proceed forward. To facilitate
this, the uvm_objection mechanism is used as the way for a component to
indicate it has an objection to a phase moving forward. This is true for all task
based phases, including the run phase. This new UVM-1.0 semantic means that
a component somewhere in the environment must object to the run phase ending
during the first delta-cycle of the run phase; if no component objects to the run
phase ending, then the run phase will end at time 0. To get the old OVM style run
semantic where a global_stop_request() or mid-simulation raise/drop of the
ovm_test_done objection indicated the end of the run phase you must use the
+UVM_USE_OVM_RUN_SEMANTIC command line argument. This will cause the run
phase to use the old OVM style run semantic. You can also replace your
global_stop_request() code with an explicit raise/drop of the run phase objection.
For example:
//Old OVM code calling global stop request
task mytest::run();
#5000 global_stop_request();
endtask
//New UVM-1.0 code that will have an identical semantic
task mytest::run_phase(uvm_phase phase);
phase.raise_objection(this, Test objection for run phase);
#5000 phase.drop_objection(this, Test objection for run phase);
endtask
endtask
endclass
May 6, 2011
enable_stop_interrupt = 0;
endtask
task stop (string ph_name);
wait(enable_stop_interrupt == 0);
endtask
Sequence Changes
In UVM-1.0 the name-based sequence library has been deprecated. The name based
sequence library has many deficiencies and Accellera has determined that it should not
be part of the standard. In UVM-2.0 a type-based sequence library is planned to be
released as part of the standard; it is currently available in an early access form as part
of the UVM-1.0 distribution.
The changes around sequence usage are for removing deprecated functionality. The
deprecated functionality is likely to be removed from UVM-2.0 (or similar release) and
therefore it is wise to remove deprecated usage as soon as possible. The deprecated
sequence features are all around the name-based sequence library, including, special
sequence/sequencer macros, simple/random/exhaustive predefined sequences and the
string based default sequence.
1. String based default sequence,
set_config_string(<inst>,default_sequence,<seq>)
May 6, 2011
NOTE: with the type based style you may provide a factory object as shown in the
example, or you may supply an explicit sequence instance using
uvm_config_db#(uvm_sequence_base)::set().
NOTE2: if you are using a generated string for the default sequence (for example,
getting a default sequence from the command line), you must convert the string to a
factory wrapper object using uvm_factory::find_by_name(). For example:
set_config_string(seqr, default_sequence, somestring_variable);
to
uvm_config_db#(uvm_object_wrapper)::set(this, seqr.run_phase,
default_sequence, factory.find_by_name(somestring_variable));
May 6, 2011
May 6, 2011
UVM-1.0
task body;
myitem item;
for(int i=0; i<p_sequencer.cnt; ++i)begin
p_sequencer.uvm_report_info(SEND,
$sformatf(Sending item: %s,
item.sprint()), UVM_MEDIUM);
`uvm_do(item)
end
endtask
endclass
endfunction
endclass
endfunction
endclass
Configuration
The configuration database from OVM was re-architected to provide a more general
purpose system, referred to in UVM as the resource database. This database is a typebased system. The old OVM style access to the database through the set_config_*
and get_config_* interface is still available. However, the resource database provides a
type based system that may be used for storing and retrieving any object type, such as
May 6, 2011
10
May 6, 2011
11
Summary
UVM-1.0 provides a standardized methodology library. OVM users have a significant
advantage in moving to this library as opposed to user of other available methodology
libraries. However, there are differences between OVM and UVM-1.0 that users must
account for when making the move. This application note provids the process for
May 6, 2011
12
References
Reason: The build method is explicitly being called by the parent component.
Example:
function void mycomponent::build();
child = subcomponent::type_id::create(child, this);
child.build();
endfunction
Resolution: Remove the explicit call to build. The phasing system will call
build/build_phase() for all components, so the explicit call is unnecessary.
Message: uvm_pkg::uvm_sequence_base.get_seq_kind deprecated."
Reason: The get_seq_kind() method is the method that the old string-based sequence
library used to convert the sequence name string into an integer that could be used for
constraints.
Example:
constraint myseq::no_rand_seq_ct {
seq_kind != get_seq_kind(uvm_random_sequence);
}
May 6, 2011
13
endtask
endtask
May 6, 2011
14
endtask
endtask
endfunction
Resolution: If the count variable was being set to 0 then the set_config_int call may be
safely removed because the uvm_random_sequence is no longer started by default for
the run phase. If a non-zero count was being used to control the random sequence, a
sequence library object should be used; the sequence library object can be set as the
run phases default sequence with an appropriate setting for the number of iterations.
May 6, 2011
15
endfunction
endfunction
Reason: The pound_zero_count was used in OVM/UVM-1.0ea to add delta cycles for
the try_get_next_item() to allow for delta cycle delays in the sequencer. However, this
type of delaying is inherently unstable. UVM-1.0 moved to a full NBA region delay
(essentially an infinite #0 delay) for the synchronization to provide better controllability.
Example:
function void mytest::build();
set_config_int(agent.seqr, pound_zero_count, 100);
May 6, 2011
16
Resolution: #0 delays are inherently unstable. UVM-1.0 moved to a full NBA region
delay (essentially an infinite #0 delay) for the synchronization to provide better
controllability. For this reason, settings of the pound_zero_delay property can safely be
removed.
Message:
Registering sequence 'uvm_exhaustive_sequence' with sequencer
'<some_seqr_name>' is deprecated.
Registering sequence 'uvm_random_sequence' with sequencer '<some_seqr_name>'
is deprecated.
Reason: The macro `uvm_update_sequence_lib or
`uvm_update_sequence_lib_and_item was used to set
endfunction
endfunction
May 6, 2011
17
endclass
endfunction
Resolution: Change the use of the string based default_sequence to use the
uvm_config_db to set a type based default sequence for the run phase. For example:
function void mytest::build();
uvm_config_db#(uvm_object_wrapper)::set(this, agent.seqr.run_phase,
default_sequence, my_seq::type_id::get());
endfunction
ovm_test_top (removed)
ovm_top_levels (moved to uvm_root::top_levels)
May 6, 2011
18
post_new_ph (removed)
export_connections_ph (removed)
import_connections_ph (removed)
configure_ph (removed)
_global_reporter (removed, use uvm_report_server::get_server())
Removed classes
Removed Macros
`OVM_REPORT_INFO/WARNING/ERROR/FATAL (replaced by
`uvm_info/warning/error/fatal)
May 6, 2011
19