Professional Documents
Culture Documents
• Introduction to UVM
• Easier UVM?
• The Easier UVM Code Generator
• Reporting
• Phases and Configuration
• TLM Connections
• The Factory
• Sequences and Tests
• An Accellera standard
• Best practice
• Consistency, uniformity, don't reinvent the wheel, avoid pitfalls
• Reuse
• Verification IP, verification environments, tests, people, knowhow
Coverage Coverage
Checking Checking
Response Stimulus
VIP VIP
Test
harness Interface Interface
Transaction-Level
Connections Config Config
Stimulus
Agent Agent
Sequ'r Seq Sequ'r Seq
Agent per-interface
Transactions
Monitor Driver Monitor Driver
Class-based
Pin wiggles
Module-based Test
harness Interface Interface
DUT
• Introduction to UVM
• Easier UVM?
• The Easier UVM Code Generator
• Reporting
• Phases and Configuration
• TLM Connections
• The Factory
• Sequences and Tests
4 days 4 days
What next?
Significant
up-skilling Coaching
UVM-aware tools
Coding guidelines
Consistency
Avoiding pitfalls
Reusability
High quality verification
• Introduction to UVM
• Easier UVM?
• The Easier UVM Code Generator
• Reporting
• Phases and Configuration
• TLM Connections
• The Factory
• Sequences and Tests
Common Template
File sim
Simulation scripts
Design Under
Pin List File
Test
tb
<agent>
<agent>
<agent>
DUT Directory
files.f
<top>
include
User-defined code
fragments inserted into
generated code
http://www.doulos.com/easier
easier_uvm_gen.pl
release_notes
examples
example_templates
minimal
minimal_plus
minimal_reg
multi_if
unzip easier_uvm_gen-2015-06-29.zip
cd examples/minimal_plus
cd generated_tb/sim
compile_ius.sh
or compile_vcs.sh
or cd ../dut
vsimsa –do ../sim/compile_riviera.do
clkndata_driver.sv
tb/top_test/sv/ Test
clkndata_monitor.sv Agent top_test.sv
clkndata_sequencer.sv top_test_pkg.sv
clkndata_agent.sv
tb/top_tb/sv/ Modules
clkndata_coverage.sv top_tb.sv
clkndata_seq_lib.sv Sequences top_th/sv
clkndata_pkg.sv Package
tb/include User-defined
Interface
in uvm_config_db
Test
Config
Env Virtual seq
Subsc'r
Config
uvm_component Agent
quasi-static
Sequ'r Seq Trans
Driver
uvm_object
Monitor dynamic
© Accellera Systems Initiative 19
Easier UVM:
Learning and Using UVM with a Code Generator
• Introduction to UVM
• Easier UVM?
• The Easier UVM Code Generator
• Reporting
• Phases and Configuration
• TLM Connections
• The Factory
• Sequences and Tests
endclass : data_tx
`uvm_warning(get_type_name(), "Message")
`uvm_warning(get_type_name(), "Message")
• Introduction to UVM
• Easier UVM?
• The Easier UVM Code Generator
• Reporting
• Phases and Configuration
• TLM Connections
• The Factory
• Sequences and Tests
connect
Env
pre_reset
Virtual seq
end_of_elaboration
reset
post_reset
Subsc'r
start_of_simulation pre_configure
configure
post_configure Agent
run Sequ'r Seq
pre_main
main
extract post_main
Monitor Driver
check pre_shutdown
shutdown
post_shutdown
report
final
© Accellera Systems Initiative 25
Configuration Database
module top
Configuration database
Config
set
Scope Name = Value
Scope Name = Value
Scope Name = Value
Test
Env get
Agent Config
Sequ'r
Monitor Driver
Test
harness interface
DUT
Config Config
Agent Agent
get get
Sequ'r Sequ'r
endclass : top_config
top_env_generate_methods_after_class = no
Test Config
Env
Env
Virtual seq
_generate_methods_inside_ Subsc'r
_generate_methods_after_
_inc_before_ Config
_inc_inside_ Agent
Sequ'r Seq
_inc_after_
_prepend_to_build_phase
Monitor Driver
_append_to_build_phase
_append_to_connect_phase
Test
harness Interface
DUT
...
top_config env_config;
initial
begin
env_config = new("env_config");
if ( !env_config.randomize() )
`uvm_fatal("top_tb", "Failed to randomize config object")
env_config.clkndata_vif = th.clkndata_if_0;
env_config.is_active_clkndata = UVM_ACTIVE;
env_config.checks_enable_clkndata = 1;
env_config.coverage_enable_clkndata = 1;
uvm_config_db #(top_config)::set(
null, "uvm_test_top.m_env", "config", env_config); config_db
run_test();
end
endmodule
m_clkndata_config = new("m_clkndata_config");
m_clkndata_config.vif = m_config.clkndata_vif;
m_clkndata_config.is_active = m_config.is_active_clkndata;
m_clkndata_config.checks_enable = m_config.checks_enable_clkndata;
m_clkndata_config.coverage_enable = m_config.coverage_enable_clkndata;
uvm_config_db #(clkndata_config)::set(
this, "m_clkndata_agent", "config", m_clkndata_config);
config_db
if (m_config.is_active_clkndata == UVM_ACTIVE )
uvm_config_db #(clkndata_config)::set(
this, "m_clkndata_agent.m_sequencer", "config", m_clkndata_config);
...
if (get_is_active() == UVM_ACTIVE)
begin
m_driver = clkndata_driver ::type_id::create("m_driver", this);
m_sequencer = clkndata_sequencer_t::type_id::create("m_sequencer", this);
end
Factory methods
endfunction : build_phase
Config
Agent
Sequ'r
Active vs passive
Monitor Driver
• Introduction to UVM
• Easier UVM?
• The Easier UVM Code Generator
• Reporting
• Phases and Configuration
• TLM Connections
• The Factory
• Sequences and Tests
Export Port
Sequencer Driver
Export Port
Sequencer Driver
m_driver.seq_item_port.connect( In agent
m_sequencer.seq_item_export);
forever
begin
seq_item_port.get_next_item(req); Get transaction from sequencer
`uvm_info(get_type_name(), {"req item\n",req.sprint}, UVM_HIGH)
do_drive();
seq_item_port.item_done();
end
endtask : run_phase
if (m_config.vif == null)
`uvm_fatal(get_type_name(), "clkndata virtual interface is not set!")
m_monitor.vif = m_config.vif;
m_monitor.analysis_port.connect(analysis_port);
if (get_is_active() == UVM_ACTIVE)
begin
m_driver.seq_item_port.connect(m_sequencer.seq_item_export); TLM connections
m_driver.vif = m_config.vif;
end
endfunction : connect_phase
uvm_analysis_export
Readonly, non-blocking
uvm_analysis_port
Agent
Sequencer
Export
uvm_analysis_port Port
`uvm_component_utils(clkndata_monitor)
endclass : clkndata_monitor
• Introduction to UVM
• Easier UVM?
• The Easier UVM Code Generator
• Reporting
• Phases and Configuration
• TLM Connections
• The Factory
• Sequences and Tests
m_trans = data_tx::type_id::create("m_trans");
Can be overridden
data_tx::type_id::set_type_override( my_tx::get_type() );
• Introduction to UVM
• Easier UVM?
• The Easier UVM Code Generator
• Reporting
• Phases and Configuration
• TLM Connections
• The Factory
• Sequences and Tests
Agent A Agent A
Coverage B
Agent B Coverage B
Coverage B
Agent B
agent_has_env = no Agent B
Env
Env
Agent
Env A
Sequencer
Coverage A
Driver
Agent A
Monitor
Coverage A
Agent A
agent_is_active = UVM_PASSIVE
Env
Agent
Monitor
Test
Factory overrides
Top-level env
Virtual seq Default sequences
Env
Virtual seq
Agent Agent
Sequ'r Seq Sequ'r Seq
Factory override
clkndata_default_seq::type_id::set_type_override(
my_clkndata_seq::get_type());
endfunction : build_phase
Top-level env
Virtual seq
Env
Virtual seq
Agent Agent
Sequ'r Seq Sequ'r Seq
...
Agent Agent
Sequ'r Seq Sequ'r Seq
task top_default_seq::body();
repeat(m_seq_count) Monitor Driver Monitor Driver
begin
fork
if (m_clkndata_agent.m_config.is_active == UVM_ACTIVE)
begin
clkndata_default_seq seq;
seq = clkndata_default_seq::type_id::create("seq");
if ( !seq.randomize() )
...
seq.start(m_clkndata_agent.m_sequencer, this);
end
... // Other agents
join
end
endtask : body
Top-level env
Virtual seq
Env
Virtual seq
Agent Agent
task clkndata_default_seq::body(); Sequ'r Seq Sequ'r Seq
req = data_tx::type_id::create("req");
start_item(req);
if ( !req.randomize() )
`uvm_error(get_type_name(), "Failed to randomize transaction")
finish_item(req);
endtask : body
create - start_item – randomize - finish_item
Common Template
File sim
Simulation scripts
Design Under
Pin List File
Test
tb
<agent>
<agent>
<agent>
DUT Directory
files.f
<top>
include
User-defined code
fragments inserted into
generated code