You are on page 1of 11

ClueLogic (http://cluelogic.

com/)
Providing the clues to solve your verification problems

(http://cluelogic.com) UVM (http://cluelogic.com/category/uvm/) UVM Tutorial for Candy Lovers 1. Overview

UVM Tutorial for Candy Lovers 1.


Overview
Keisuke Shimizu (http://cluelogic.com/author/keisuke/) July 24, 2011
9 Comments (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comments)

Last Updated: April 4, 2014

(http://cluelogic.com/wp-content/uploads/2011/07/jellybean-candy-th.png)Accelleras recently released


UVM may change the future of verification, as verification methodology seems to be consolidated in
this UVM. This post will provide a simple tutorial on this new verification methodology. Rather than
focusing on AXI, OCP, or other system buses in existence, this tutorial will be based on the hypothetical
example of a jelly-bean generator. The test bench will generate many jelly-bean flavors in a
constrained random manner and the system will evaluate palatable flavors. This does not require the knowledge of any
system bus.

The verification components used in the process will be described below.

The left figure shows the relationship of the verification components. The jelly_bean_taster is the design-under-test

(DUT) module.

The jelly_bean_sequencer will create jelly-bean recipes and send them to the jelly_bean_driver . From the information

provided in the recipe, the driver creates jelly beans. The driver passes the jelly beans through the jelly-bean interface
( jelly_bean_if ) to the jelly_bean_taster , which will check the jelly-bean taste.

Concurrently, as the jelly beans are being created, the jelly_bean_monitor will capture the flavor and color of the
recently produced. This information will be passed down to the jelly-bean functional coverage subscriber, referred to as
the jelly_bean_fc_subscriber . The subscriber records and totals the jelly beans based on their color and flavor.

The jelly_bean_scoreboard is a component that checks if the jelly_bean_taster is responding correctly. The

scoreboard subscribes the information from the jelly_bean_monitor .

The second figure shows the verification components in a class diagram. The light blue boxes refer to the classes in the
UVM basic class library, while the darker boxes indicate the classes created in this tutorial.
Though the post ends here, the next will show the
structure of the jelly-bean recipes.

(http://cluelogic.com/wp-
content/uploads/2011/07/jb_env.png)

Verification Components

(http://cluelogic.com/wp-content/uploads/2011/07/jb_comp.png)

Class Diagram of Verification Components


Getsourcecode(https://github.com/cluelogic/uvmtutorialforcandylovers)

Share this:

LinkedIn 2 (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?share=linkedin&nb=1)

Facebook 5 (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?share=facebook&nb=1)

Google (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?share=google-plus-1&nb=1)

Twitter 3 (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?share=twitter&nb=1)

Email (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?share=email&nb=1)

Print (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#print)

Like this:

Like
Bethefirsttolikethis.

Posted in UVM (http://cluelogic.com/category/uvm/)


Tagged tutorial (http://cluelogic.com/tag/tutorial/), UVM (http://cluelogic.com/tag/uvm/)
Permalink (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/)

Customizing VMM Message Format (http://cluelogic.com/2011/05/customizing-vmm-message-format/)


UVM Tutorial for Candy Lovers 2. Recipe (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-recipe/)

9 thoughts on UVM Tutorial for Candy Lovers 1.


Overview

christsu (http://www.sage-micro.com)

June 26, 2012 at 4:56 pm (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-510)

I use Synopsys vcs to run jb1.sv, get this error at simulation

UVM_FATAL@0:reporter[NOCOMP]Nocomponentsinstantiated.Youmusteitherinstantiateatleastonecompon
entbeforecallingrun_testoruserun_testtodoso.Torunatestusingrun_test,use+UVM_TESTNAMEorsup
plythetestnameintheargumenttorun_test().Exitingsimulation.

then I run jb2.sv, and got this error


Error[TMAFTC]Toomanyargumentstofunction/taskcall
/home/ichris/Desktop/project/uvm1.1a/src/base/uvm_registry.svh,197
"jelly_bean_recipe_virtual_sequence::new(name)"
Theabovefunction/taskcallisdonewithmoreargumentsthanneeded.

Error[TMAFTC]Toomanyargumentstofunction/taskcall
jb2.sv,285
"jelly_bean_recipe_virtual_sequence::new(name)"
Theabovefunction/taskcallisdonewithmoreargumentsthanneeded.

what is wrong in both cases???

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=510#respond)

Keisuke Shimizu (http://cluelogic.com)

November 10, 2012 at 4:13 pm (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-

571)

Hello,

For the jb1.sv to work, you must use +UVM_TESTNAME=jelly_bean_test option when you run VCS.

I had a bug in jb2.sv . I forgot to code the new() function of the jelly_bean_recipe_virtual_sequence class.

I have already fixed the bug, and the new code is ready to download. Thank you for pointing out the bug.

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=571#respond)

Surya

February 26, 2014 at 8:49 am (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-756)

Hi Keisuke,

I am set to verify a RTL model based on C-Golden Ref.Model. Here I would like to write into the UVM registers all
the required configurations and pass the same to C & RTL. And I am familiar with UVM registers configurations
and DPI calls from SV to C.

But, I am not sure how to implement the DPIs in UVM.


1) How/where do we add DPI calls and C-functions in the test so that the C-Code runs at first and then dumps the
values to some dynamic arrays and later, I access them to compare the results with RTL in the scoreoard ?
Can you please add some example to this. It would be some immense help

Thank You in Advance..!


Surya

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=756#respond)

Keisuke Shimizu (http://cluelogic.com)

February 28, 2014 at 9:30 am (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-

760)

Hi Surya,

I am not sure if I understand your question correctly, but you can call your C-functions from the main_phase

of your test to generate expected values. As you mentioned, you can store the expected values in a dynamic
array and use them later in the scoreboard. Did I answer your question?

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=760#respond)

Apafi Adrian

April 27, 2015 at 6:33 am (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-10362)

Hi Keisuke,

Appreciate your work done on this site makes UVM world more clear and easy to understand.

Just one question: do you have this UVM tutorial (each lesson) in other formats (presentations ppt, with sound
and everything)?
Maybe somewhere on youtube? It will be interesting to have access to each lesson in a presentation format to
listen as a class

Thank you.
Adi

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=10362#respond)
Keisuke Shimizu (http://cluelogic.com)

May 2, 2015 at 11:15 am (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-10479)

Thats a good idea, but unfortunately I dont have a presentation for the tutorial. Ill put this on my (long) to-
do list. Thanks.

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=10479#respond)

Borya Hlopunov

September 3, 2015 at 2:22 am (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-11987)

Thank you for this tutorial, Keisuke.


I assume, the makefile was written for Linux. I use questasim and run it on Windows 7. Can you tell me, how
should i modify this makefile and what do i have to do to execute it?
Thanks.
Borya

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=11987#respond)

Keisuke Shimizu (http://cluelogic.com)

September 5, 2015 at 11:20 am (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-

12030)

Unfortunately, I have no access to the Window-version of QuestaSim. You can still run a simulation on EDA
Playground (http://www.edaplayground.com/x/Ram), though.

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=12030#respond)

Tuyen
September 12, 2015 at 10:33 am (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/#comment-

12147)

Dear Borya,
What version of questasim you are running ? I think I can help you a lot.

Reply (http://cluelogic.com/2011/07/uvm-tutorial-for-candy-lovers-overview/?replytocom=12147#respond)

Leave a Reply
Enteryourcommenthere...

Search

MENU

Events
(http://cluelogic.com/events/)

About
(http://cluelogic.com/about/)

CATEGORIES

OVM
(http://cluelogic.com/category/ovm/)

SystemVerilog
(http://cluelogic.com/category/systemverilog/)

UVM
(http://cluelogic.com/category/uvm/)

VMM
(http://cluelogic.com/category/vmm/)
ARCHIVES

May 2015
(http://cluelogic.com/2015/05/)

April 2015
(http://cluelogic.com/2015/04/)

February 2015
(http://cluelogic.com/2015/02/)

November 2014
(http://cluelogic.com/2014/11/)

October 2014
(http://cluelogic.com/2014/10/)

September 2014
(http://cluelogic.com/2014/09/)

August 2014
(http://cluelogic.com/2014/08/)

April 2014
(http://cluelogic.com/2014/04/)

February 2014
(http://cluelogic.com/2014/02/)

December 2013
(http://cluelogic.com/2013/12/)

September 2013
(http://cluelogic.com/2013/09/)

February 2013
(http://cluelogic.com/2013/02/)

January 2013
(http://cluelogic.com/2013/01/)

December 2012
(http://cluelogic.com/2012/12/)

November 2012
(http://cluelogic.com/2012/11/)
October 2012
(http://cluelogic.com/2012/10/)

January 2012
(http://cluelogic.com/2012/01/)

July 2011
(http://cluelogic.com/2011/07/)

May 2011
(http://cluelogic.com/2011/05/)

TAGS

back-door (http://cluelogic.com/tag/back-

door/) do_copy

(http://cluelogic.com/tag/do_copy/)

Hidden Gems
(http://cluelogic.com/tag/hidden-
gems/) OVM
(http://cluelogic.com/tag/ovm/)

ovm_report_server

(http://cluelogic.com/tag/ovm_report_server/)

ovm_test

(http://cluelogic.com/tag/ovm_test/)

RAL
(http://cluelogic.com/tag/ral/)
randomize

(http://cluelogic.com/tag/randomize/)

TLM1

(http://cluelogic.com/tag/tlm1/)

tutorial
(http://cluelogic.com/tag/tutorial/)
UVM
(http://cluelogic.com/tag/uvm/)
uvm_agent
(http://cluelogic.com/tag/uvm_agent/)
uvm_analysis_imp

(http://cluelogic.com/tag/uvm_analysis_imp/)

uvm_analysis_port
(http://cluelogic.com/tag/uvm_analysis_port/)

uvm_component

(http://cluelogic.com/tag/uvm_component/)

uvm_config_db

(http://cluelogic.com/tag/uvm_config_db/)

uvm_driver

(http://cluelogic.com/tag/uvm_driver/)

uvm_env
(http://cluelogic.com/tag/uvm_env/)
uvm_field_enum

(http://cluelogic.com/tag/uvm_field_enum/)

uvm_field_int

(http://cluelogic.com/tag/uvm_field_int/)

uvm_monitor

(http://cluelogic.com/tag/uvm_monitor/)

uvm_object

(http://cluelogic.com/tag/uvm_object/)

uvm_object_utils

(http://cluelogic.com/tag/uvm_object_utils/)

uvm_phase

(http://cluelogic.com/tag/uvm_phase/)

uvm_port_base

(http://cluelogic.com/tag/uvm_port_base/)

uvm_reg

(http://cluelogic.com/tag/uvm_reg/)

uvm_reg_adapter

(http://cluelogic.com/tag/uvm_reg_adapter/)

uvm_reg_block

(http://cluelogic.com/tag/uvm_reg_block/)

uvm_reg_sequence

(http://cluelogic.com/tag/uvm_reg_sequence/)

uvm_report_server

(http://cluelogic.com/tag/uvm_report_server/)

uvm_scoreboard

(http://cluelogic.com/tag/uvm_scoreboard/)

uvm_sequence

(http://cluelogic.com/tag/uvm_sequence/)

uvm_sequencer

(http://cluelogic.com/tag/uvm_sequencer/)

uvm_sequence_item
(http://cluelogic.com/tag/uvm_sequence_item/)
uvm_seq_item_pull_imp

(http://cluelogic.com/tag/uvm_seq_item_pull_imp/)

uvm_seq_item_pull_port

(http://cluelogic.com/tag/uvm_seq_item_pull_port/)

uvm_sqr_if_base

(http://cluelogic.com/tag/uvm_sqr_if_base/)

uvm_subscriber
(http://cluelogic.com/tag/uvm_subscriber/)
uvm_test
(http://cluelogic.com/tag/uvm_test/)
uvm_tlm_analysis_fifo

(http://cluelogic.com/tag/uvm_tlm_analysis_fifo/)

uvm_tlm_fifo

(http://cluelogic.com/tag/uvm_tlm_fifo/)

uvm_tlm_if_base

(http://cluelogic.com/tag/uvm_tlm_if_base/)

VMM (http://cluelogic.com/tag/vmm/)

vmm_log_format

(http://cluelogic.com/tag/vmm_log_format/)

vmm_xactor

(http://cluelogic.com/tag/vmm_xactor/)

Back to top

Copyright 2015 ClueLogic (http://cluelogic.com). Powered by WordPress (http://www.wordpress.org/) and Follet


(http://github.com/andrezrv/follet).