SlideShare a Scribd company logo
Universal Verification Methodology
               (UVM)
  Verifying Blocks to IP to SOCs and Systems
 Organizers:
Dennis Brophy                      San Diego, CA
Stan Krolikoski                     June 5, 2011
 Yatin Trivedi
Workshop Outline

10:00am – 10:05am           Dennis Brophy                            Welcome

10:05am – 10:45am           Sharon Rosenberg UVM Concepts and Architecture

10:45am – 11:25am           Tom Fitzpatrick                          UVM Sequences and Phasing

11:25am – 11:40am           Break

11:40am – 12:20pm           Janick Bergeron                          UVM TLM2 and Register Package

12:20pm – 12:50pm           Ambar Sarkar                             Putting Together UVM Testbenches

12:50pm – 1:00pm            All                                      Q&A




          2         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Workshop Outline

10:00am – 10:05am          Dennis Brophy                            Welcome

10:05am – 10:45am           Sharon Rosenberg UVM Concepts and Architecture

10:45am – 11:25am           Tom Fitzpatrick                          UVM Sequences and Phasing

11:25am – 11:40am           Break

11:40am – 12:20pm           Janick Bergeron                          UVM TLM2 and Register Package

12:20pm – 12:50pm           Ambar Sarkar                             Putting Together UVM Testbenches

12:50pm – 1:00pm            All                                      Q&A




          3         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Concepts and Architecture
       Sharon Rosenberg
    Cadence Design Systems
UVM Core Capabilities
• Universal Verification Methodology
   – A methodology and a class library for building advanced
     reusable verification components
   – Methodology first!
• Relies on strong, proven industry foundations
   – The core of the success is adherence to a standard
     (architecture, stimulus creation, automation, factory usage, etc’)
• We added useful enablers and tuned a few to make
  UVM1.0 more capable
• This section covers the high-level concepts of UVM
   – Critical to successful deployment of UVM
   – Mature and proven



      5        DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
The Goal: Automation
• Coverage Driven Verification (CDV) environments
      Automated Stimulus Generation                                                                                                  Coverage

      Independent Checking
      Coverage Collection                                                                        Scoreboard
                                                                                                  Checking
                                                                                                  Coverage


 seed                             Coverage                        Monitor
 23098432                                                                                                                   Monitor
 38748932
 23432239
 17821961
 10932893
 20395483
 18902904
 23843298
 23432432
 24324322
 55252255                Random                                                                           DUT
                         Stimulus
 09273822
 13814791   Tests
             Tests       Sequence               Driver                                         APB                UART
 4098e092                Generator
 23432424                Generator
 24242355
 25262622
 26452454
                                              Packaged for Reuse
 24524522


                     6        DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Architecture:
Interface Level Encapsulation
 uvm_agent                                               •     Agents provide all the verification logic
                   uvm_                                        for a device in the system
 Config:           sequencer                             •     Instantiation and connection logic is
                                                               done by the developer in a standard
                      sequences
                                                               manner
                                                         •     A Standard agent has:
 uvm_monitor                                                      – Sequencer for generating traffic
                                                                  – Driver to drive the DUT
   events,
   status,                                                        – Monitor
                   uvm_driver
   data                                                  •     The monitor is independent of the
     vi                    vi                                  driving logic
                                                         •     Agent has standard configuration
                                                               parameters for the integrator to use
              interface

               DUT
          7        DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Agent Standard Configuration
uvm_agent                                        • A standard agent is configured using an
               uvm_                              enumeration field: is_active
Config:
               sequencer
is_active:
UVM_ACTIVE
                                                          • UVM_ACTIVE:
                  sequences
min_addr:                                                 • Actively drive an interface or device
16’h0100                                                  • Driver, Sequencer and Monitor are
 uvm_monitor
                passive                                     allocated

   events,                                                • UVM_PASSIVE:
   status,                                                • Only the Monitor is allocated
   data        uvm_driver
                                                          • Still able to do checking and collect
     vi                vi                                   coverage

                                                 • Other user-defined configuration parameters
                                                 can also be added
              DUT                                    • Example: address configuration for
                                                        slave devices
          8    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
uvm: Configurable Bus Environment
                                   Allows changing the number of
          Some agent config        agents without further
          parameters come from the configuration per agent
 Environment
          environment config
 master agent                                                                                                         Config:
  master agent                         slave agent                                                                     num_masters=3
    master agent
          sequencer                     slave agent                              arbiter agent
            sequencer                                   sequencer                                                      num_slaves=2
 Config:                                                                                         sequencer
  Config:     sequencer                Config:           sequencer
   Config: seq                          Config:                                Config:                                 Virtual
                    seq                                     seq                                                        interface
              i/f      vi
                      seq                                  i/f
                                                               seq vi                               seq
                    i/f      vi
 monitor
  monitor i/f                          monitor
   monitor i/f                          monitor            i/f                 monitor
  events,                                                                Sometimes common                                monitor
    events, driver                       events,
  status,
                                         status,
                                          events,       driver                events,
                                                                         for all agents                                      events,
  dataevents, driver
    status,
                                                                                                                             status,
                                         data
                                          status,        driver                  status,         driver
               vi driver
       status,
    data
   vi                                     vi               vi
       data
      vi          vi                      data                                   data                                        data



                                                                                                           Bus level monitoring
Env’s allow reuse at interface
                     the interface level!                                                                  can be used by all
                                                                                                           agents
                                                          DUT
        9                 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Configuration Mechanism
• The configuration mechanism allows a powerful way for
  attribute configuration
• Configuration mechanism advantages:
   – Mechanism semantic allows an upper component to
     override contained components values
       • No file changes are required
   – Can configure attributes at various hierarchy locations
   – Wild cards and regular expressions allow configuration of
     multiple attributes with a single command
   – Debug capabilities
   – Support for user defined types (e.g. SV virtual interfaces)
   – Run-time configuration support
   – Type safe solution
      10       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM1.0 Configuration
Enhancements (Cont’)                                                                       Check if configuration
                                                                                           exists
class uvm_config_db#(type T=int) extends uvm_resource_db#(T);
     static function bit set ( uvm_component cntxt,
           string inst_name,string field_name, T value);
     static function bit get ( uvm_component cntxt,
           string inst_name,string field_name, ref T value);
     static function bit exists(…);
     static function void dump();             Dump the data base
     static task wait_modified(…);
endclass                                     Wait for value to be set in
                                                                                        the uvm_config_db


// run-time configuration example:
task mycomp::run_phase (uvm_phase phase);
      uvm_config_db#(int)::set(this, “*”, “field”, 10);
      #10; uvm_config_db#(int)::set(this, “a.b.c”, “field”, 20);
endtask
                                                                    Note – all uvm_config_db
                                                                    functions are static so they
                                                                    must be called using the ::
                                                                    operator
       11      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Virtual Interface Configuration
Example
function void ubus_bus_monitor:: connect_phase( uvm_phase phase);
       if (!uvm_config_db#(virtual ubus_if)::
                 get(this, “”,"vif", vif))
       else
       `uvm_error("NOVIF",{"virtual interface must be set for: ",
                   get_full_name(),".vif"})           Built-in checking
endfunction: connect_phase
// setting the virtual interface from the top module
module ubus_top;
   …
  ubus_if ubus_if0(); // instance of the interface

  initial begin
    uvm_config_db#(virtual ubus_if)::
            set(null,"*.ubus_demo_tb0.ubus0","vif", ubus_if0);
    run_test();
                                    Setting in the top removes hierarchy
     …                              dependencies in the testbench,
   end                              allows consistency and other
endmodule                           configuration capabilities
        12      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Where SV Language Stops and UVM Begins
 Example: Data Items

              class data_packet_c ;
              class data_packet_c ;
                 string
                 string               pkt_name;
                                pkt_name;
                 rand pkt_header _c header;
                 pkt_header _c header;
                 rand byte
                 byte           payload [ ]; [ ];
                                      payload
                 byte           parity;
                                      parity;
                 parity_e
                 rand parity_e parity_type;
                                      parity_type;
                 int
                 rand int       ipg_delay;
                                      ipg_delay;
              endclass
              endclass
Does language alone support all the necessary customization operations?
   • Randomization                                No! Only randomization is defined
   • Printing                                     in the SystemVerilog LRM
   • Cloning
   • Comparing
   • Copying
                                                            UVM provides the rest!
   • Packing
   • Transaction Recording

        13       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Enabling Data Item Automation
                                                             derived from uvm_sequence_item
class data_packet_c ; extends uvm_sequence_item;
   string            rev_no = “v1.1p”;
   rand pkt_hdr _c header; //class:{dest_addr, pkt_length}
   rand byte         payload [ ];
   byte                            parity;
   rand parity_e             parity_type; Enables all automation                                                      for
   rand int                       ipg_delay;data_packet_c fields
 // field declarations and automation flags
// Constraints, constructor, methods
  `uvm_object_utils_begin(data_packet_c)
 . . .
     `uvm_field_string( rev_no, UVM_DEFAULT+ UVM_NOPACK)
endclass: data_packet_c
     `uvm_field_object( header, UVM_DEFAULT)
     `uvm_field_array_int( payload, UVM_DEFAULT)
     `uvm_field_int( parity, UVM_DEFAULT)
     `uvm_field_enum( parity_e, parity_type, UVM_DEFAULT)
     `uvm_field_int( ipg_delay, UVM_DEFAULT + UVM_NOCOMPARE)
  `uvm_object_utils_end
    // Additional: constraints, constructor, methods
endclass : data_packet_c      Specify field level flags:
                              UVM_NOCOMPARE, UVM_NOPRINT, etc.

      14      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Data Type Automation               ---------------------------------------
                                     Name            Type              Value
// two instances of data_packet_c   ---------------------------------------
data_packet_c packet1, packet2;     my_packet       data_packet_c       @479
                                     rev_no         string             v1.1p
initial begin
                                     header         pkt_header_c        @520
   // create and randomize new packet dest_addr     integral            'h25
   packet1 = new(“my_packet”);         pkt_length integral              'd29
   assert(packet1.randomize());      payload        da(integral)           -
// print using UVM automation          [0]          integral            'h2a
                                        copy_packet: (data_packet_c@489) {
   packet1.print();                 copy(): Copies integral of packet1 'hdb
                                       [1]rev_no: v1.1s
                                                    all fields
   // copy using UVM automation        ...header: (pkt_header_c@576) { ...
                                                    ...
                                    to packet2, including sub-classes 'h21
                                       [28] dest_addr: 'h25
                                                    integral
   packet2 = new(“copy_packet”);
                                    and arrays
                                     parity pkt_length: 'd29
                                                    integral            'hd9
   packet2.copy(packet1));                }
                                     parity_type    parity_e     GOOD_PARITY
   packet2.rev_no = “v1.1s”;              payload: integral
                                     ipg_delay       {                  'd20
   // print using UVM tree printer ---------------------------------------
                                            [0]: 'h2a
   packet2.print(                           [1]: 'hdb
      uvm_default_tree_printer);            ... ...
                                            [28]: 'h21
 end
                                          }
UVM also allows manual                    parity: 'hd9
implementation for performance or         parity_type: GOOD_PARITY
other reasons                             ipg_delay: 'd20
                                        }

        15      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Messaging Facility
    • Messages print trace information with advantages over
      $display:
    •    Aware of its hierarchy/scope in testbench
    •    Allows filtering based on hierarchy, verbosity, and time
                     `uvm_info("PKT", "Packet Sent“, UVM_LOW);

•Output                          file/line                  time                                                             id
UVM_INFO myfile.sv(15) @10 uvm_test_top.test.generator [PKT]:
            Packet Sent

          severity       message body                        scope
•       Simple Messaging:
         – `uvm_*(string id, string message, <verbosity>);
             • Where * (severity) is one of fatal, error, warning, info
             • <verbosity> is only valid for uvm_info


               16         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Sequences
• A sequencer controls the generation of random stimulus
  by executing sequences

• A sequence captures meaningful streams
  of transactions
   – A simple sequence is a random transaction generator
   – A more complex sequence can contain timing, additional
     constraints, parameters

• Sequences:
   – Allow reactive generation – react to DUT
   – Have many built-in capabilities like interrupt support, arbitration
     schemes, automatic factory support, etc
   – Can be nested inside other sequences
   – Are reusable at higher levels
      17       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Tests and Testbenches
module top ( );                                                             •     Placing all components in the test
 class test extends …                                                             requires lot of duplication
  class tb extends uvm_env…
                      BUS VCBFM
                        Mon
                       Mon  BFM
                                                                            •     Separate the env configuration and
  Module VC                                    SEQR                               the test
  Scoreboard                                   Mon   DRV
   coverage                                 VC3                                      – TB class instantiates and configures
                                                                                       reusable components
                             DUT                                            •     Tests instantiate a testbench
    Virtual Sequencer




                              CPU                Mem                                 – Specify the nature of generated traffic
                                                                                     – Can modify configuration parameters
                              Periph             Periph                                as needed
                                                                            •     Benefits
                               Mon
                              Mon
                                     BFM
                                    BFM            Mon
                                                  Mon
                                                         BFM
                                                        BFM
                                                                                     – Tests are shorter, and descriptive
                              Mon DRV             Mon DRV

                              SEQR                SEQR
                                                                                     – Less knowledge to create a test
                             VC1
                             VC3               VC 2
                                               VC3                                   – Easier to maintain – changes are
                                                                                       done in a central location

                        18         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Simulation Phases
• When using classes, you need to manage environment
  creation at run-time
• Test execution is divided to phases
   – Configuration, testbench creation, run-time, check, etc
• Unique tasks are performed in each simulation phase
   – Set-up activities are performed during “testbench creation”
     while expected results may be addressed in “check”
   – Phases run in order – next phase does not begin until previous
     phase is complete
• UVM provides set of standard phases enabling VIP
  plug&play
   – Allows orchestrating the activity of components that were
     created by different resources

      19      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Simulation Phases
UVM component’s built-in phases - run in order
Note: All phases except run() execute in zero time
build                                  Build Top-Level Testbench Topology
connect                                Connect environment topology
end of elaboration                    Post-elaboration activity (e.g. print topology)
start_of_simulation                   Configure verification components
              reset
              configure
run           main                    tasks - Run-time execution of the test
              shutdown

extract                               Gathers details on the final DUT state
check                                 Processes and checks the simulation results.
report                                Simulation results analysis and reporting

                   All phase names have postfix “_phase”

         20         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Testbench Example
                                                                                      Extends from uvm_env
class bridge_tb extends uvm_env;
  `uvm_component_utils(bridge_tb)
                                                                                  Instances of reusable verification
  apb_env apb;    // APB OVC                                                      components and module verif
  ahb_env ahb;    // AHB OVC                                                      component
  bridge_mod_env bridge_mod ;             // Module OVC

   virtual function void build_phase(uvm_phase phase);   Configure                                                 using wildcards
        super.build_phase(phase);
        uvm_config_db#(uvm_active_passive_enum)::set(this,
                         “apb.slave*”,”is_active”, UVM_ACTIVE);
        uvm_config_db#(int)::set(this, “ahb”,”master_num”, 3);
        uvm_config_db#(uvm_active_passive_enum)::set(this,
                 “ahb.slave[0]”, “is_active”, UVM_PASSIVE);                                                 Create and build
                                                                                                            using a standard
        apb = apb_env::type_id::create(“apb”, this);
        ahb = ahb_env::type_id::create(“ahb”, this);
                                                                                                            mechanism
        bridge_mod = bridge_mod_env::type_id::create(“bridge_mod”, this);
    endfunction
endclass: bridge_tb
                                            The test creates an instance of                          the
                                                                      tesbench, overrides constraints,
                                                                      and sets the default sequences
           21       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Overriding SV Components
    and Data Objects
•   UVM Provides a mechanism for overriding the
    default data items and objects in a testbench                                               A data_packet_c                   driver

•   “Polymorphism made easy” for test writers                                                   B short_packet_c                  driver_v1
     Replace ALL instances:
     object::type_id::set_type_override(                                                                             my_env
     Replace data_packet_c in agent[0] sequencer
                      derived_obj::get_type())                                                           agent[0]               agent[1]

     Example:               &                                                                        sequencer
                                                                                                      A
                                                                                                      B
                                                                                                                             sequencer
                                                                                                                              A
                                                                                                                              B
     Replace agent[1]’s driver with new driver (v1)
     data_packet_c::type_id::set_type_override
                       (short_packet_c::get_type());                                                 driver monitor          driver monitor
                                                                                                     BA      A
                                                                                                             B               BA      B
                                                                                                                                     A
     Replace specific instances:
        For a specific test, we want to
     object::type_id::set_inst_override
        replace all data_packet_c packets                                                                            my_env
        (derived_obj::get_type(), “hierarchical_path”);
        with short_packet_c packets                                                                      agent[0]               agent[1]

     Example:                                                                                        sequencer               sequencer
                                                                                                      B
                                                                                                      A                       A
     data_packet_c::type_id::set_inst_override
                                                                                                     driver monitor          driver monitor
                                                                                                                             driver
        (short_packet_c::get_type(),                                                                         A                       A
                                                                                                      A                      AA
         “my_env.agent[0].sequencer”);
     my_driver::type_id::set_inst_override
        (driver_v1::get_type(), “my_env.agent[1]”);
            22       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
The Test Launching
Mechanism
                                           module top()
  test3
     test2                                    import ... // uvm lib, tests, and packages
   tb test1
     tbtb                                          IF         IF          IF         rst         clks
      env
       env
        env
          env
           env                                                                                    Creates test and starts
            env                                                       DUT
                                                                                                  simulation phases for
                                              initial begin                                       all components
          Function void                         run_test();
              build();
            …                                 end
           endfunction
                                           endmodule : top
Multiple tests                                                     DUT snapshot
                               Compile the entire test suite together and use command-
                               line option to select a test:
Allows execution               of multiple tests on the same snapshot
                               % <sim> –f run.f +UVM_TESTNAME=test3


     23            DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Extensions Using Callbacks
• Like the factory, callbacks are a way to affect an existing
  component from outside
• The SystemVerilog language includes built-in callbacks
   – e.g. post_randomize(), pre_body()
• Callbacks requires the developer to predict the extension
  location and create a proper hook
• Callbacks advantages:
   – They do not require inheritance
   – Multiple callbacks can be combined




          24      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Report Catcher Callback
Goal: Message Manipulation
  class my_catcher extends            This example demotes MYID to be
                   uvm_report_catcher;an Info
     virtual function action_e catch();
        if(get_severity()==UVM_ERROR && get_id()=="MYID")
        begin
          set_severity(UVM_INFO);
          set_action(get_action() - UVM_COUNT);
        end
        return THROW; // can throw the message for more
   manipulation or catch it to avoid further processing
     endfunction
  endclass

// In testbench run phase             • can disable a callback using the
    my_catcher catcher = new;         built-in callback_mode() method
     uvm_report_cb::add(null,catcher);
     `uvm_error("MYID", "This one should be demoted")
      #100;
     catcher.callback_mode(0); //disable the catcher
     `uvm_error("MYID", "This one should not be demoted")
        25       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Command-line Processor
Class
• Provide a vendor independent general interface
  to the command line arguments
• Supported categories:
  – Basic Arguments and values
      • get_args, get_args_matches
  – Tool information
      • get_tool_name(), get_tool_version()
  – Built-in UVM aware Command Line arguments
      • Supports setting various UVM variables from the command
        line such as verbosity and configuration settings for integral
        types and strings
      • +uvm_set_config_int, +uvm_set_config_string

     26       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Command-line Processor Example
 class test extends uvm_test;
   …
   function void start_of_simulation();
     uvm_cmdline_processor clp;            Fetching the command line processor
                                           singleton class
     string arg_values[$];
     string tool, version;
     clp = uvm_cmdline_processor::get_inst();
     tool = clp.get_tool_name();            Use the class methods
     version = clp.get_tool_version();
     `uvm_info("MYINFO1", ("Tool: %s, Version : %s", tool, version,
                  UVM_LOW)                    Get argument values
     void'(clp.get_arg_values("+foo=", arg_values));
     `uvm_info("MYINFO1","arg_values size : %0d", arg_values.size(),
                 UVM_LOW));
     for(int i = 0; i < arg_values.size(); i++) begin
        `uvm_info("MYINFO1", "arg_values[%0d]: %0s", i, arg_values[i],
                  UVM_LOW));
     end
    endfunction
endclass
       27       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Concepts Summary
• UVM Basics are proven and widely in use with all
  simulators
• Provides both reuse and productivity
• UVM1.0 adds additional features to complement and
  tune the existing capabilities
   – UVM 1.1 includes bug fixes after initial users’ feedback
• If you have a new project, UVM is the way to go!




      28      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Workshop Outline

10:00am – 10:05am          Dennis Brophy                            Welcome

10:05am – 10:45am          Sharon Rosenberg UVM Concepts and Architecture

10:45am – 11:25am           Tom Fitzpatrick                          UVM Sequences and Phasing

11:25am – 11:40am           Break

11:40am – 12:20pm           Janick Bergeron                          UVM TLM2 and Register Package

12:20pm – 12:50pm           Ambar Sarkar                             Putting Together UVM Testbenches

12:50pm – 1:00pm            All                                      Q&A




         29         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Sequences & Phasing
      Tom Fitzpatrick
      Mentor Graphics
Sequences
• Decouple stimulus specification
  from structural hierarchy
  – Simple test writer API                                                                     u1
• Sequences define transaction
  streams                                                                     u1                       s1

  – May start on any matching
    sequencer
• Sequences can call children                                                          s3                          s5

• Built-in get_response() task                                                    s2

• Sequences & transactions
  customizable via the factory                                                                         s4

• Driver converts transaction
  to pin wiggles

     31    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Using Sequences And
Sequence Items
• A sequence is a UVM object – to start it:
   – Construction using the factory:
      • spi_tfer_seq spi_seq =
        spi_tfr_seq::type_id::create(“spi_seq”);
   – Configure - explicitly or via constrained randomization
   – Start execution on the target sequencer:
      • spi_seq.start(spi_sequencer);

• Within a sequence a sequence_item is:
   – Constructed
   – Scheduled on a sequencer with start_item()
      • Blocking call that returns when the driver is ready
   – Configured – explicitly or via constrained
     randomization
   – Consumed with finish_item()
     32      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Sequence_Item Example
class spi_seq_item extends uvm_sequence_item;

// UVM Factory Registration Macro
                                                             •Data fields:
`uvm_object_utils(spi_seq_item)                              •Request direction rand (stimulus generation)
                                                             •Response direction non-rand
// Data Members (Outputs rand, inputs non-rand)
rand logic[127:0] spi_data;

                                                        •UVM Object Methods
rand bit[6:0] no_bits;
rand bit RX_NEG;
                                                        •These methods get generated by the
// Analysis members:
                                                        automation macros
                                                        •Write them yourself to improve performance
logic[127:0] mosi;
logic[7:0] cs;
                                                        if desired
// Methods
extern function   new(string name = "spi_seq_item");
extern function   void do_copy(uvm_object rhs);
extern function   bit do_compare(uvm_object rhs, uvm_comparer comparer);
extern function   string convert2string();
extern function   void do_print(uvm_printer printer);
extern function   void do_record(uvm_recorder recorder);

endclass:spi_seq_item



        33          DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Basic Sequence-Driver API
                                                                                      Sequence parameterized
                                                                                      by request/response types

class my_seq extends uvm_sequence #(my_req, my_rsp);    body() method
  task body();                                              defines
    for(int unsigned i = 0; i < 20000; i++) begin       what happens
      req = my_req::type_id::create(“req”);
      start_item(req);           class my_driver extends uvm_driver;
      assert(req.randomize());     task run_phase(uvm_phase phase);
      finish_item(req);              … begin
      get_response(rsp);             seq_item_port.get_next_item(req);
    end                              drive_transfer(req);
  endtask                            rsp.set_id_info(rsp);
endclass                             seq_item_port.item_done();
                                                           seq_item_port.put_response(rsp);
                                                           end
                                                         endtask
                                                       endclass


         34      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Sequence API Options
  Explicit                                                                         Using Macros
  req = my_req::type_id::create(“req”);                                              `uvm_do(req)
  start_item(req);                                                                   get_response(rsp);
  assert(req.randomize());
  finish_item(req);
  get_response(rsp);


• Macros allow constraints to be passed in
• Macros require pre-defined callbacks to modify
  behavior
• Multiple macro variations
• Explicit API provides greater control and easier
  debug
     35      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Sequencer and Driver
typedef uvm_sequencer#(my_req,my_rsp) my_sequencer;
class my_master_agent extends uvm_agent;
  function void build_phase(uvm_phase phase);
    void’(uvm_config_db#(bitstream_t)::get(this,“”, “is_active”, is_a);
    if(is_a) begin
      seqr = my_sequencer::type_id::create(“seqr”, this);
              my_sequencer
      driver = my_driver::type_id::create(“driver”, this);
    end
  endfunction
  function void connect_phase(uvm_phase phase);
    if(is_a)
      driver.seq_item_port.connect(seqr.seq_item_export);
  endfunction                                    agent
endclass
                                                                                                 seqr                     driver
              By default, you don’t need
              to extend uvm_sequencer

         36       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Starting a Sequence
• Explicit                                                                           “xxx_phase” can be
                                                                                     any run-time phase
task xxx_phase(uvm_phase phase);
  my_seq.start(seqr);
                                                                                                      Sequencer
• Implicit (Default Sequence)                                                                                        Phase
  – Using wrapper
uvm_config_db#(uvm_object_wrapper)::set(this,“agent.sqr.xxx_phase",
                       "default_sequence", my_seq::type_id::get());

                                                                                                                     Wrapper
  – Using instance
myseq = my_seq::type_id::create(“myseq”);
uvm_config_db#(uvm_sequence_base)::set(this,“agent.sqr.xxx_phase",
                       "default_sequence", myseq);
my_seq.set_priority(200);

                                                                                              Sequence
     37      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Calling start()

 task xxx_phase(uvm_phase phase);
   my_seq.start(seqr);
   my_seq.start(uvm_sequencer_base seqr,
                uvm_sequencer_base parent = null,
                integer priority = 100,                                                           on sequencer
                bit call_pre_post = 1);




            my_seq.pre_start()
            my_seq.pre_body();
Stimulus      parent.pre_do(0);
  code        parent.mid_do(this);                                                                If call_pre_post ==1
            my_seq.body();
              parent.post_do(this);                                       If parent!=null
            my_seq.post_body();
            my_seq.post_start();


       38     DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Sequence Library (Beta)
class uvm_sequence_library #(type REQ=int,RSP=REQ)                                                       Sequence Library
                   extends uvm_sequence #(REQ,RSP);                                                       IS-A Sequence
class my_seq_lib extends uvm_sequence_library #(my_item);
                                                                                                                         my_seq_lib
  `uvm_object_utils(my_seq_lib)
  `uvm_sequence_library_utils(my_seq_lib)                                                                                 my_seq1
   function new(string name="");
     super.new(name);
                                                                                                                          my_seq2
     init_sequence_library();
   endfunction   class my_seq1 extends my_seq;
   ...             `uvm_object_utils(my_seq1)
endclass           `uvm_add_to_seq_lib(my_seq1,my_seq_lib)
                    …
                                           class my_seq2 extends my_seq;
                  endclass
                                             `uvm_object_utils(my_seq2)
                                             `uvm_add_to_seq_lib(my_seq2,my_seq_lib)
`uvm_sequence_utils
                                             …
`uvm_sequencer_utils                       endclass
  et. al. deprecated

         39      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Sequence Library
uvm_config_db #(uvm_sequence_lib_mode)::set(this,
    "sequencer.xxx_phase“, “default_sequence.selection_mode”, MODE);


typedef enum                                            •Random sequence selection
{ UVM_SEQ_LIB_RAND,
  UVM_SEQ_LIB_RANDC,                                    •Random cyclic selection
  UVM_SEQ_LIB_ITEM,
  UVM_SEQ_LIB_USER
} uvm_sequence_lib_mode;                                •Emit only items,no sequence execution

                                                        •User-defined random selection


function int unsigned select_sequence(int unsigned max);
  // pick from 0 <= select_sequence < max;
endfunction




         40      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Phasing
    common
                       Legacy
       build
                      OVM VIP                               Several new runtime phases
     connect
                                       new vip
end_of_elaboration
                                                               in parallel with run_phase()
start_of_simulation          uvm
                           pre_reset

                            •reset

                          •post_reset
                        pre_configure

                          •configure


       run
                        •post_configure                     To simplify examples, these
                           pre_main

                             main
                                                              slides will show a reduced set
                          •post_main                          of phases
                        pre_shutdown

                          •shutdown

                        post_shutdown                     reset         configure        main          shutdown
      extract

      check
                                                                                                    time
      report

       final

                41          DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Phase Synchronization
• By default, all components must allow all
  other components to complete a phase
  before all components move to next phase

  VIP 1:   reset                     configure                  main                          shutdown




  VIP 2:   reset                     configure                  main                          shutdown




  VIP 3:   reset                     configure                  main                          shutdown




                                                time

    42       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Phase Semantics
• In UVM Reference Guide, the semantics
  for each phase are defined, e.g.
reset
     Upon Entry
          •Indicates that the hardware reset signal is ready to be asserted.
     Typical Uses
          •Assert reset signals.
          •Components connected to virtual interfaces should drive their output to their
          specified reset or idle value.
          •Components and environments should initialize their state variables.
          •Clock generators start generating active edges.
          •De-assert the reset signal(s) just before exit.
          •Wait for the reset signal(s) to be de-asserted.
     Exit Criteria
          •Reset signal has just been de-asserted.
          •Main or base clock is working and stable.
          •At least one active clock edge has occurred.
          •Output signals and state variables have been initialized.
         43         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
uvm_component Basic API
                                                         Implement these to specify behavior
                                                         for a specific phase; threads started
                                                                 here are auto-killed
task/function <name>_phase(uvm_phase phase)
  phase.raise_objection(this);
  phase.drop_objection(this);


                                                           Call these to prevent and re-allow
                                                                the current phase ending

function void phase_started(uvm_phase phase)
function void phase_ended(uvm_phase phase)
                                                     Implement these to specify
                                                     behavior for the start/end of
                                                     each phase; threads started
                                                       here are not auto-killed
     44    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
uvm_component Example

task main_phase(uvm_phase phase);
  phase.raise_objection(this);
  … main test behavior, e.g. send 100 items… automatically
                                        Called
  phase.drop_objection(this);            when main phase
endtask                                   starts (after all
                                       phase_started() calls)
function void phase_started(uvm_phase phase);
  if (phase.get_name()==“post_reset”)
    fork background_thread(); join_none
endfunction
                                                                           Called automatically
                                                                          when phase first starts.
                                                                            Thread forks when
                                                                           phase is post_reset.
     45     DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
User-defined Phases
• Integrator can create one or more phases
• Integrator can create schedules with any
  mix of standard and user-defined phases
  then assign components to use one of
  those schedules
                     uvm_domain common =
  “want new phase      uvm_domain::get_common_domain();
  named cfg2 after   common.add(cfg2_phase::get(),
configure and before   .after_phase(configure_phase::get(),
   post_configure”     .before_phase(post_configure_phase.get())
                     );
     New
                                 configure             cfg2          post_configure
    sched:

     46      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Separate Domains
• Sometimes it is OK for a part of the
  design/environment to do behavior that is
  out of alignment with the remainder
  – e.g. mid-sim reset of a portion of the chip
  – e.g. one side starts main functionality while
    other side is finishing configuration




    47    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Domains
• Domains are collections of components
  that must advance phases in unison
  – By default, no inter-domain synchronization

   VIP 1:   reset                     configure                  main                          shutdown


   VIP 2:   reset                     configure                  main                          shutdown
                                                                                                                      Domain A


   VIP 3:   reset            configure                  main          shutdown
                                                                                                                      Domain B


                                                 time

     48       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Domain Synchronization
• Domains can be synchronized at one,
  many, or all phase transitions.
domainA.sync(.target(domainB),.phase(uvm_main_phase::get()));


Two domains sync’d at main


    VIP 1:   reset      configure                        main          shutdown
                                                                                                                       Domain A


    VIP 2:   reset                  configure            main                                         shutdown
                                                                                                                       Domain B


                                                  time

      49       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Fully Synchronized Domains
• If two domains are fully synchronized and
  one domain jumps back, the second
  domain will continue in its current phase
  and wait for the first to catch up
                          phase.jump(uvm_reset_phase::get())

   VIP 1:   reset            configure                  main          reset        config       main          shutdown
                                                                                                                      Domain A


   VIP 2:   reset            configure                  main                                                  shutdown
                                                                                                                      Domain B


                                                 time

     50       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Sequences and Phases
                                                                                                     Raise objection first
class my_seq extends uvm_sequence#(my_req,my_rsp);
  virtual task body();
    if (starting_phase != null)                                                                       Drop objection last
      starting_phase.raise_objection(this,
                              “Starting my_seq”);
    …//body of sequence
    if (starting_phase != null)
      starting_phase.drop_objection(this,
                             “Ending my_seq”);
  endtask
endclass


                                      Phase won’t end until my_seq completes

                                                       Unless you do a jump()



         51      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Ending Phases
                                                                         task run_phase(uvm_phase phase);
                                                                           phase.raise_objection();
                                                                           seq.start();
                                                                           phase.drop_objection();
                                                                         endtask


                   Must raise_objection()
                                                                                                  Phase ends when all
                     before first NBA                                                            objections are dropped




             my_seq
 VIP:
             run                                                                                           extract        check   report




        52            DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Ending Phases
                                                                       task main_phase(uvm_phase phase);
                                                                         phase.raise_objection();
                                                                         seq.start();
                                                                         phase.drop_objection();
                                                                       endtask


                    Must raise_objection()
                                                                                                Phase ends when all
                      before first NBA                                                         objections are dropped




             main_seq
 VIP:
             main                                                           post_main




        53          DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Delaying Phase End
 task main_phase(uvm_phase phase);       task main_phase(uvm_phase phase);
   while(!ending) begin                    phase.raise_objection();
   …                                       seq.start();
      if(ending)                           phase.drop_objection();
        phase.drop_objection();          endtask
   …       virtual function void
 endtask     phase_ready_to_end(uvm_phase phase);       all_dropped resets
             if(phase.get_name==“main”) begin             phase objection
Drop when      ending = 1;
really done    if(busy)                                        calls
                 phase.raise_objection();             phase_ready_to_end()
             end
           endfunction                                  last chance to raise
                                                                                                                        an objection


                  main_seq
      VIP:
                  main                                                                           post_main




             54          DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Ending Phases
• Phase objection must be raised before first
  NBA
• Phase forks off processes
  – wait for phase.all_dropped
  – call phase_ready_to_end()
     • component can raise objection
  – Check objection count
  – call phase_ended()
  – kill_processes
  – execute successors
    55     DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Test Phase Example
task reset_phase (uvm_phase phase);
  reset_seq rst = reset_seq::type_id::create(“rst”);
  phase.raise_objection(this, “resetting”);
                                                                              (Test) Component runs different
  rst.start(protocol_sqr);                                                       sequences in each phase.
  phase.drop_objection(this, “ending reset”);                                 Phase level sequences may run
endtask: reset_phase                                                             on different sequences in
task configure_phase (uvm_phase phase);
                                                                                           parallel
  configure_seq cfg = configure_seq::type_id::create(“cfg”);
  phase.raise_objection(this, “configuring dut”);
  cfg.start(protocol_sqr);
  phase.drop_objection(this, “dut configured”);
endtask: configure_phase

task main_phase (uvm_phase phase);
  test_function1_seq tst = test_function1_seq ::type_id::create(“tst”);
  phase.raise_objection(this, “functionality test”);
  tst.start(protocol_sqr);
  phase.drop_objection(this, “functionality tested”);
endtask: main_phase


          56       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Workshop Outline

10:00am – 10:05am          Dennis Brophy                            Welcome

10:05am – 10:45am          Sharon Rosenberg UVM Concepts and Architecture

10:45am – 11:25am          Tom Fitzpatrick                          UVM Sequences and Phasing

11:25am – 11:40am           Break

11:40am – 12:20pm           Janick Bergeron                          UVM TLM2 and Register Package

12:20pm – 12:50pm           Ambar Sarkar                             Putting Together UVM Testbenches

12:50pm – 1:00pm            All                                      Q&A




         57         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Accellera at DAC
• Accellera Breakfast at DAC: UVM User Experiences
  – An Accellera event sponsored by Cadence, Mentor, and Synopsys
  – Tuesday, June 7th, 7:00am-8:30am, Room 25AB


• Accellera IP-XACT Seminar
  – An introduction to IP-XACT, IEEE 1685, Ecosystem and Examples
  – Tuesday, June 7th, 2:00pm-4:00pm, Room 26AB


• Birds-Of-A-Feather Meeting
  – Soft IP Tagging Standardization Kickoff
  – Tuesday, June 7, 7:00 PM-8:30 PM, Room 31AB




     58       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Workshop Outline

10:00am – 10:05am          Dennis Brophy                            Welcome

10:05am – 10:45am          Sharon Rosenberg UVM Concepts and Architecture

10:45am – 11:25am          Tom Fitzpatrick                          UVM Sequences and Phasing

11:25am – 11:40am          Break

11:40am – 12:20pm           Janick Bergeron                          UVM TLM2 and Register Package

12:20pm – 12:50pm           Ambar Sarkar                             Putting Together UVM Testbenches

12:50pm – 1:00pm            All                                      Q&A




         59         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Transaction Level Modeling (TLM2)
            Janick Bergeron
               Synopsys
TLM-1.0
• Unidirectional put/get interfaces
         •Initiator         •Target                                 •Initiator                  •Target

                   •put                                                                •get

• Simple message-passing semantics
• No response model
  – E.g. What did I read back??
• Never really caught on in SystemC


    61          DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Why TLM-2.0?
• Better interoperability over TLM-1.0
  – Semantics
  – Pre-defined transaction for buses
• Performance
  – Pass by reference (in SystemC)
  – Temporal decoupling




    62    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
TLM-2.0 in SV vs SC
•   Blocking transport interface
•   Nonblocking transport interfaces
•   Direct memory interface
•   Debug transport interface
•   Initiator sockets
•   Target sockets
•   Generic payload
•   Phases
•   Convenience sockets
•   Payload event queue
•   Quantum keeper
•   Instance-specific extensions
•   Non-ignorable and mandatory extensions
•   Temporal decoupling

        63     DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
TLM-2.0 Semantics
• Blocking
  – When the call returns,                                              •Initiator                  •Target
    the transaction is done
  – Response is annotated
• Nonblocking
  – Call back and forth
     • Protocol state changes                                           •Initiator                  •Target
     • Transaction is updated
  – Until one says “done”


    64     DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Generic Payload Attributes
• Pre-defined bus transaction
Attribute                        Type                                                            Modifiable?
Command                          uvm_tlm_command_e                                               No
Address                          bit [63:0]                                                      Interconnect only
Data                             byte unsigned [ ]                                               Yes (read command)
Data length                      int unsigned                                                    No
Byte enable pointer              byte unsigned [ ]                                               No
Byte enable length               int unsigned                                                    No
Streaming width                  int unsigned                                                    No
Response status                  uvm_tlm_response_status_e                                       Target only
Extensions                       uvm_tlm_extension_base [ ]                                      Yes



          65      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Connecting to SystemC
• Tool-specific mechanism
  – Not part of UVM

         •SystemVerilog                                                             •SystemC




                                          •Copy across
                                         at method call
                                           and return




    66       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
TLM-2.0 Bridge Between SV & SC

  • Proxy sockets terminate the TLM2
    connections in each language
        – Create SV/SC bridge
                                                                                               •Predefined
                                                                                              for GP in VCS
                                                    •TLM2 Bridge


       •Initiator        •Proxy Trgt                                                  •Proxy Init                           •Target
                                                      •Pack/unpack




•Unaware of
 language                                                             •User-defined for                     •Unaware of
  crossing                                                             GP extensions                         language
                                                                         or non-GP                            crossing
              67    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
UVM Register Model
    Janick Bergeron
       Synopsys
Overall Architecture

                                            Pre-Defined                Pre-Defined
Spec                                          Pre-Defined                Pre-Defined
                                            Sequences
                                                Pre-Defined
                                              Sequences
                                                                       Sequences
                                                                          User-Defined
                                                                         Sequences
                                                                                                                 Abstract
                                                Sequences                  Sequences                            read/write


            Generator                                Register Model
                                                                                                                 Backdoor
              Generic                                    Adapter
            physical r/w

            Bus-specific
              r/w item

                 Any bus                                                              DUT
                  agent

       69         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Specification & Generation

IP-XACT
          System
           RDL
                                       SQL                          CSV
                                                                                                 MS-
                                                                                                 Word
                                                                                                                   ...



    X
    UVM                             Generator
                                     Generator
                                      Generator
                                       Generator
                                                                                    EDA
                                                                                   Vendors



    UVM
                                      Register Model


     70    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Physical Interfaces
• Register model abstracts
  – Physical interfaces
  – Addresses                                                             DUT may
                                                                           change

  – Endianness

       User
    perspective
                            R1.read(...);                                                                                 R1
                            ...
                            R2.write(...);              Register                                                          R3
                            ...
                            R3.read(...);                Model                                                            R2


       Perspective
     stays the same



    71            DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Mirror
• Register model mirrors content of registers
  in DUT
  – “Scoreboard” for registers
  – Updated on read and write()
  – Optionally checked on read()
                                      Register
                                       Model                                            R1

                                                                                       R3
                                            API
                                                                                       R2

                                             R1
                                             R2
                                             R3

    72    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Back-door Access
• Must define HDL path to register in DUT
  – Generator-specific
• Access RTL directly in zero-time via VPI
  – May affect simulator performance

                                                                                      R1

                                                                                     R3
                                          API
                                                                                     R2

                                           R1
                                           R2
         Mirror is
         implicitly                        R3
         updated
    73            DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Programmer’s View
                                                                                          R0                   R0
                                                                           F1             F2           F3      R1
                                                                                                      F4...
                   Multi-address Register                                         ...F4
                                                                                                               R2




                                                                            F5                   F6            A[0]
                                                                            F5                   F6            A[1]
                              Array of Registers

                                                                            F5                   F6            A[255]

                                                                                   F7                    F8    RF0[0]
                                                                      F9                           F10         RF1[0]
                                                                                   F7                    F8    RF0[0]

                       Array of Register Files                        F9                           F10         RF1[0]



                                                                                   F7                    F8    RF0[7]
                                                                      F9                           F10         RF1[7]




                                            Memory                                        M0                   M0[0..65535]


  74   DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Class View
• One class per field                                                             F1
                                                                                                 R0
                                                                                                 F2           F3
                                                                                                                      R0
                                                                                                                      R1


• One class per register                                                                 ...F4
                                                                                                             F4...
                                                                                                                      R2



   class R1_reg extends uvm_reg;
      uvm_reg_field F1;                                                            F5                   F6            A[0]
      uvm_reg_field F2;                                                            F5                   F6            A[1]
      uvm_reg_field F3;
   endclass
                                        Generated                                  F5                   F6            A[255]


  – Name     Make sure names
              are different from                                             F9
                                                                                          F7
                                                                                                          F10
                                                                                                                F8    RF0[0]
                                                                                                                      RF1[0]


  – Address base class methods                                                            F7                    F8    RF0[0]
                                                                             F9                           F10         RF1[0]


  – Contained fields                                                                      F7                    F8    RF0[7]
                                                                                                                      RF1[7]
  – Read/Write methods                                                       F9                           F10




                                                                                                 M0                   M0[0..65535]


     75       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Class View                                                      Make sure names
                                                                are different from
                                                               base class methods


• One class per block                                                            F1
                                                                                                R0
                                                                                                F2           F3
                                                                                                                     R0
                                                                                                                     R1
                                                                                                            F4...
  class B_blk extends uvm_reg_block;                                                                                 R2
                                                                                        ...F4
     R0_reg        R0;
     R1_reg        R1;
     R2_reg        R2;
     A_reg         A[256];                                                        F5                   F6            A[0]
     RF_rfile      RF[8];                                                         F5                   F6            A[1]
     ovm_ral_mem   M0;
  endclass
                                       Generated                                  F5                   F6            A[255]

  – Name, Base address                                                                   F7                    F8    RF0[0]
                                                                            F9                           F10         RF1[0]

  – Contained registers,                                                    F9
                                                                                         F7
                                                                                                         F10
                                                                                                               F8    RF0[0]
                                                                                                                     RF1[0]

    register files, memories
                                                                                         F7                    F8    RF0[7]
      • May be arrays                                                       F9                           F10         RF1[7]

      • Optional: contained fields
                                                                                                M0                   M0[0..65535]


     76      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
API View
• Methods in relevant                                                                F1
                                                                                                    R0
                                                                                                    F2           F3
                                                                                                                         R0
                                                                                                                         R1

  class instance                                                                            ...F4
                                                                                                                F4...
                                                                                                                         R2




                                                                                      F5                   F6            A[0]
                                                                                      F5                   F6            A[1]



  blk.R0.get_full_name()                                                              F5                   F6            A[255]

  blk.F4.read(...)                                                                           F7                    F8    RF0[0]
                                                                                F9                           F10         RF1[0]
  blk.A[1].write(...)                                                                        F7                    F8    RF0[0]
                                                                                F9                           F10         RF1[0]
  blk.A[255].F5.write(...)

  foreach (blk.RF[i]) begin                                                                                              RF0[7]
                                                                                             F7                    F8
      blk.RF[i].R0.F7.read(..._);
  end                                                                           F9                           F10         RF1[7]


  blk.M0.read(...)
                                                                                                    M0                   M0[0..65535]


      77         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Reading and Writing
• Specify target register by hierarchical
  reference in register model
  – Compile-time checking
                                                                                          By-name API
         blk.blk[2].regfile[4].reg.fld
                                                                                          also available

• Use read() and write() method on
  – Register
                               blk.blk[2].regfile[4].reg.fld.read(...);
  – Field                      blk.mem.write(...);

  – Memory

    78    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Register Sequences
• Sequences accessing registers should be
  virtual sequences
  – Not associated with a particular sequencer
    type
                                                          class my_test_seq
• Contain a reference                                        extends uvm_sequence;

  to register model                                               my_dut_model regmodel;

                                                             virtual task body();
• Access registers in                                           regmodel.R1.write(...);
                                                                regmodel.R2.read(...);
  body() task                                                   ...
                                                             endtask
                                                          endclass


    79    DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Register Sequences
• Includes pre-defined sequences
  – Check reset values
  – Toggle & check every bit
  – Front-door/back-door accesses
  – Memory walking




    80   DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Introspection
 • Rich introspection API
                                             get_blocks()

                 get_block()                                                get_maps()
Register File                                      Block                                                       Map

                        get_parent()
                                                                                                                           get_maps()
                                                                                                                           is_in_map()
get_regfile()                             get_registers()                                                                  get_offset()


                                                Register
                                                       get_parent()
                                             get_fields()
              get_access()
              get_reset()
              get_n_bits()                          Field
              get_lsp_pos()
              is_volatile()

         81        DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Coverage Models
• Register models may contain coverage
  models
  – Up to the generator
• Not instantiated by default
  – Can be large. Instantiate only when needed.
                                      All coverage
  – To enable:                           models

     uvm_reg::include_coverage(“*”, UVM_CVR_ALL);                                                   In all blocks
                                                                                                   and registers

• Not collected by default
                                                                All coverage
  – To recursively enable                                      models in block

     blk.set_coverage(UVM_CVR_ALL);

    82      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Customization Opportunities

    Spec                                Best
                                                               DON’T!
                                                                                                             Factory




  Generator                            Register Model                                               Pre-Build



                                                                                                   Post-Build
    Options,
   value-add

                                                                                                                 Callbacks




   83          DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
There’s a LOT more!
•   DUT integration
•   Multiple interfaces
•   Randomization
•   Vertical Reuse
•   “Offline” access
•   User-defined front-door accesses
•   Access serialization
•   Pipelined accesses

      84   DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Workshop Outline

10:00am – 10:05am          Dennis Brophy                            Welcome

10:05am – 10:45am          Sharon Rosenberg UVM Concepts and Architecture

10:45am – 11:25am          Tom Fitzpatrick                          UVM Sequences and Phasing

11:25am – 11:40am          Break

11:40am – 12:20pm          Janick Bergeron                          UVM TLM2 and Register Package

12:20pm – 12:50pm           Ambar Sarkar                             Putting Together UVM Testbenches

12:50pm – 1:00pm            All                                      Q&A




         85         DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Putting Together UVM Testbenches
           Ambar Sarkar
        Paradigm Works, Inc.
Agenda
• Case studies
   – Several UVM1.0 environments deployed
   – Currently in production
   – Novice to sophisticated teams
• Getting started with UVM is relatively easy
   – Basic tasks remain simple
   – Were able to use a “prescriptive” approach
   – Iteratively developed and scales to any complexity
• Advanced uses
   – Unit to system-level
   – VIP Stacking/Layering




      87      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Implementing Basic Steps

                                                                  Connect DUT to testbench


   Once plumbing in                                                  Send clocks and resets
    place, a simple
 prescriptive approach
         works                                                               Initialize the DUT


                                                                                   Send traffic


                                                                                 Add checking
          Increasing
        sophistication,
         but scalable                                                               Write tests


   88       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Example

                                                                                                           Packet Output 1

Packet Input                                                                                               Packet Output 2
                                            Channel Engine
                                                                                                           Packet Output 3




Read/Write
                                             Host Interface



       89      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Example Environment in UVM

 test cases ...


unit_tb
          Config
         Config
          :active                 interrupt                                packet
         :active
   clk_rst agent                scoreboard                               scoreboard
  clk_rst agent
                                                                                                             [x3]

                                                                                                                  Config:
                                Config:                                  Config:                                 Config:
                                                                                                                Config:
                                                                                                                    active
                                 active                                   active                                  active
                                                                                                                 active


                    host agent                               pi agent                           po agent
                                                                                               po agent
                                                                                              po agent



                                                              DUT



        90           DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Connect DUT to Testbench
                                                          Always use SystemVerilog interface
                                                              Use clocking blocks for testbench per
                                                              interface
                                                              Use modports for DUT
                                     Packet Output 1

Packet Input                         Packet Output 2
                                                          Pass interface to the environment
                Channel Engine
                                     Packet Output 3          Use uvm_config_db

Read/Write                                             Set (Top level initial block)
                Host Interface
                                                       uvm_config_db#(virtual host_if)::set(
                                                                      null, “my_tb.*”,“vif”, vif);

                                                       Get (In build phase of the agent)
                                                       if(!uvm_config_db#(virtual host_if)::get(
                                                                           this,,"vif",vif))
                                                              `uvm_fatal(“NOVIF”, . . . );



               91                DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Connect Clock and Resets
Combine clock and reset as agents in one env
 class clk_rst_env extends uvm_env;
    clk_rst_cfg cfg;   //! VIP configuration object
    //! bring ports out for convenience
    uvm_analysis_port #(uvm_transaction) rst_mon_ap_out;

    //! Agents in env
    clk_agent clk_agt;
    rst_agent rst_agt;
 . . .

Define reset as sequences
 task clk_rst_reset_pulse_sequence::body();

    `uvm_do_with(change_sequence, { level == 0;
                                hold_cycles == init_cycles;
    `uvm_do_with(change_sequence, { level == 1;
                                hold_cycles == assert_cycles;
    `uvm_do_with(change_sequence, { level == 0;
                                hold_cycles == negate_cycles;
    92      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Initializing the DUT
Add transaction definitions for configuration interface (host)
Add driver code for host
Setup host initialization seq
class host_transaction extends uvm_sequence_item;
   ...
   rand bit[31:0] hi_addr;
   rand bit[7:0] hi_wr_data;
   . . .

 task pwr_hi_master_driver::drive_transaction(host_transaction trans);
    if (trans.trans_kind == PWR_HI_WR) begin
        intf.hif_address = trans.hi_addr;
        intf.hif_data = trans.hi_wr_data;
    . . .

task my_env_init_sequence::body();
      regmodel.R1.write(...);
      regmodel.R2.read(...);
   . . .

       93       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Sending traffic
Similar to initialization
Sequences differ
//! sequence body.
task pi_sequence::body();
   pi_transaction#(. . .) req_xn;
   cfg_inst = p_sequencer.cfg;
   forever begin
      p_sequencer.peek_port.peek(req_xn);
      if (!this.randomize()) begin
          `uvm_fatal({get_name(), "RNDFLT"}, "Can't randomize");
      end
      `uvm_do_with(this_transaction,
                    { trans_kind == req_xn.trans_kind;
                       read_vld_delay inside { [0:15] };
                       . . .
                     });
       . . .


        94        DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Checking and Writing Tests
Add checking in the environment
   Add monitor code for all components
Connect the scoreboards
 class my_env extends uvm_env;
   unit_scoreboard#(uvm_transaction, uvm_transaction) sb;

 function void my_env::build_phase(uvm_phase phase);
   ...
   sb = unit_scoreboard#(uvm_transaction, uvm_transaction)
        ::type_id::create({get_name(), "_sb"}, this);

 function void pwc_env::connect_phase(uvm_phase phase);
   . . .
   pi_mon.mon_ap_out.connect(sb.post_export);
   po_mon.mon_ap_out.connect(sb.check_export);
Add test-specific checking in the test as needed


      95      DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Connecting Unit to System Level




   96   DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Connecting Unit to System Level:
Reuse
•   Scoreboarding
     • Reuse SB encapsulated within sub-envs
     • Chain the scoreboards
•   Functional Coverage
     • Needed to filter coverage points
•   Reuse monitors
     • Avoid duplicated instances
•   Gate Simulations
     • Disable monitors
     • Disable internal scoreboards
•   Registers
     • Register abstraction reused, but different interfaces used
•   Configurations
     • Defined separate system configuration
     • Top level instantiated sub-env configurations
•   Sequences
     • Virtual sequencer only at the system level
     • Initialization sequences reused from unit-level
     • Traffic sequences created from scratch at the system level

         97       DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
Uvm dac2011 final_color
Uvm dac2011 final_color
Uvm dac2011 final_color
Uvm dac2011 final_color
Uvm dac2011 final_color
Uvm dac2011 final_color
Uvm dac2011 final_color
Uvm dac2011 final_color

More Related Content

What's hot

System verilog assertions
System verilog assertionsSystem verilog assertions
System verilog assertions
HARINATH REDDY
 
CPU Verification
CPU VerificationCPU Verification
CPU Verification
Ramdas Mozhikunnath
 
SystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesSystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification Methodologies
Ramdas Mozhikunnath
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog
Pushpa Yakkala
 
System verilog verification building blocks
System verilog verification building blocksSystem verilog verification building blocks
System verilog verification building blocksNirav Desai
 
ASIC design verification
ASIC design verificationASIC design verification
ASIC design verification
Gireesh Kallihal
 
verification_planning_systemverilog_uvm_2020
verification_planning_systemverilog_uvm_2020verification_planning_systemverilog_uvm_2020
verification_planning_systemverilog_uvm_2020
Sameh El-Ashry
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomizationNirav Desai
 
2019 2 testing and verification of vlsi design_verification
2019 2 testing and verification of vlsi design_verification2019 2 testing and verification of vlsi design_verification
2019 2 testing and verification of vlsi design_verification
Usha Mehta
 
Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesNirav Desai
 
How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?
Sameh El-Ashry
 
Coverage and Introduction to UVM
Coverage and Introduction to UVMCoverage and Introduction to UVM
Coverage and Introduction to UVM
Dr. Shivananda Koteshwar
 
UVM Update: Register Package
UVM Update: Register PackageUVM Update: Register Package
UVM Update: Register PackageDVClub
 
PCI Express Verification using Reference Modeling
PCI Express Verification using Reference ModelingPCI Express Verification using Reference Modeling
PCI Express Verification using Reference ModelingDVClub
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functions
anand hd
 
Scan insertion
Scan insertionScan insertion
Scan insertion
kumar gavanurmath
 
axi protocol
axi protocolaxi protocol
axi protocol
Azad Mishra
 
Test Bench Development
Test Bench DevelopmentTest Bench Development
Test Bench Development
Abhishek Tiwari
 
JTAG Interface (Intro)
JTAG Interface (Intro)JTAG Interface (Intro)
JTAG Interface (Intro)
Nitesh Bhatia
 

What's hot (20)

System verilog assertions
System verilog assertionsSystem verilog assertions
System verilog assertions
 
CPU Verification
CPU VerificationCPU Verification
CPU Verification
 
SystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesSystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification Methodologies
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog
 
System verilog verification building blocks
System verilog verification building blocksSystem verilog verification building blocks
System verilog verification building blocks
 
ASIC design verification
ASIC design verificationASIC design verification
ASIC design verification
 
verification_planning_systemverilog_uvm_2020
verification_planning_systemverilog_uvm_2020verification_planning_systemverilog_uvm_2020
verification_planning_systemverilog_uvm_2020
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
 
2019 2 testing and verification of vlsi design_verification
2019 2 testing and verification of vlsi design_verification2019 2 testing and verification of vlsi design_verification
2019 2 testing and verification of vlsi design_verification
 
Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
 
How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?
 
Coverage and Introduction to UVM
Coverage and Introduction to UVMCoverage and Introduction to UVM
Coverage and Introduction to UVM
 
system verilog
system verilogsystem verilog
system verilog
 
UVM Update: Register Package
UVM Update: Register PackageUVM Update: Register Package
UVM Update: Register Package
 
PCI Express Verification using Reference Modeling
PCI Express Verification using Reference ModelingPCI Express Verification using Reference Modeling
PCI Express Verification using Reference Modeling
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functions
 
Scan insertion
Scan insertionScan insertion
Scan insertion
 
axi protocol
axi protocolaxi protocol
axi protocol
 
Test Bench Development
Test Bench DevelopmentTest Bench Development
Test Bench Development
 
JTAG Interface (Intro)
JTAG Interface (Intro)JTAG Interface (Intro)
JTAG Interface (Intro)
 

Similar to Uvm dac2011 final_color

Netrounds Product Sheet
Netrounds Product SheetNetrounds Product Sheet
Netrounds Product Sheet
Marcus Friman
 
AWB Wimax Indoor CPE Performance Test
AWB Wimax Indoor CPE Performance TestAWB Wimax Indoor CPE Performance Test
AWB Wimax Indoor CPE Performance Test
Richard Hsu
 
04+ECETEMT092-+WDT+APB+UVM.pdf
04+ECETEMT092-+WDT+APB+UVM.pdf04+ECETEMT092-+WDT+APB+UVM.pdf
04+ECETEMT092-+WDT+APB+UVM.pdf
SamHoney6
 
UVM Basics.pdf
UVM Basics.pdfUVM Basics.pdf
UVM Basics.pdf
yaazhiniyanm1
 
Network Infrastructure Validation Conference @UPRA (2003)
Network Infrastructure Validation Conference @UPRA (2003)Network Infrastructure Validation Conference @UPRA (2003)
Network Infrastructure Validation Conference @UPRA (2003)Raul Soto
 
20110812 CyberTAN presentation
20110812 CyberTAN presentation20110812 CyberTAN presentation
20110812 CyberTAN presentation
Richard Hsu
 
miniAVIT Brochure
miniAVIT BrochureminiAVIT Brochure
miniAVIT Brochure
johnuzz
 
Radio Frequency Test Stands for Remote Controllers
Radio Frequency Test Stands for Remote ControllersRadio Frequency Test Stands for Remote Controllers
Radio Frequency Test Stands for Remote ControllersUjjal Dutt, PMP
 
Multi Layer Monitoring V1
Multi Layer Monitoring V1Multi Layer Monitoring V1
Multi Layer Monitoring V1Lahav Savir
 
OMAP Verification
OMAP VerificationOMAP Verification
OMAP VerificationDVClub
 
Roy omap validation_dvc_lub_092106
Roy omap validation_dvc_lub_092106Roy omap validation_dvc_lub_092106
Roy omap validation_dvc_lub_092106Obsidian Software
 
AVIT Brochure
AVIT BrochureAVIT Brochure
AVIT Brochure
johnuzz
 
Why do Hand-picked Cherries... (2009)
Why do Hand-picked Cherries... (2009)Why do Hand-picked Cherries... (2009)
Why do Hand-picked Cherries... (2009)
Marc Jadoul
 
Wallix AdminBastion - Privileged User Management &amp; Access Control
Wallix AdminBastion - Privileged User Management &amp; Access ControlWallix AdminBastion - Privileged User Management &amp; Access Control
Wallix AdminBastion - Privileged User Management &amp; Access Control
zayedalji
 
Oracle Enterprise manager SNMP and Exadata
Oracle Enterprise manager SNMP and ExadataOracle Enterprise manager SNMP and Exadata
Oracle Enterprise manager SNMP and Exadata
Mike Chafin
 
Ticket to Ride - Bus Fleet Operated and Managed with OSGi - C Larsson
Ticket to Ride - Bus Fleet Operated and Managed with OSGi - C LarssonTicket to Ride - Bus Fleet Operated and Managed with OSGi - C Larsson
Ticket to Ride - Bus Fleet Operated and Managed with OSGi - C Larsson
mfrancis
 
Nagios Conference 2012 - Andreas Ericsson - Merlin
Nagios Conference 2012 - Andreas Ericsson - MerlinNagios Conference 2012 - Andreas Ericsson - Merlin
Nagios Conference 2012 - Andreas Ericsson - Merlin
Nagios
 
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PROIDEA
 
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
Marta Pacyga
 

Similar to Uvm dac2011 final_color (20)

Vrt100
Vrt100Vrt100
Vrt100
 
Netrounds Product Sheet
Netrounds Product SheetNetrounds Product Sheet
Netrounds Product Sheet
 
AWB Wimax Indoor CPE Performance Test
AWB Wimax Indoor CPE Performance TestAWB Wimax Indoor CPE Performance Test
AWB Wimax Indoor CPE Performance Test
 
04+ECETEMT092-+WDT+APB+UVM.pdf
04+ECETEMT092-+WDT+APB+UVM.pdf04+ECETEMT092-+WDT+APB+UVM.pdf
04+ECETEMT092-+WDT+APB+UVM.pdf
 
UVM Basics.pdf
UVM Basics.pdfUVM Basics.pdf
UVM Basics.pdf
 
Network Infrastructure Validation Conference @UPRA (2003)
Network Infrastructure Validation Conference @UPRA (2003)Network Infrastructure Validation Conference @UPRA (2003)
Network Infrastructure Validation Conference @UPRA (2003)
 
20110812 CyberTAN presentation
20110812 CyberTAN presentation20110812 CyberTAN presentation
20110812 CyberTAN presentation
 
miniAVIT Brochure
miniAVIT BrochureminiAVIT Brochure
miniAVIT Brochure
 
Radio Frequency Test Stands for Remote Controllers
Radio Frequency Test Stands for Remote ControllersRadio Frequency Test Stands for Remote Controllers
Radio Frequency Test Stands for Remote Controllers
 
Multi Layer Monitoring V1
Multi Layer Monitoring V1Multi Layer Monitoring V1
Multi Layer Monitoring V1
 
OMAP Verification
OMAP VerificationOMAP Verification
OMAP Verification
 
Roy omap validation_dvc_lub_092106
Roy omap validation_dvc_lub_092106Roy omap validation_dvc_lub_092106
Roy omap validation_dvc_lub_092106
 
AVIT Brochure
AVIT BrochureAVIT Brochure
AVIT Brochure
 
Why do Hand-picked Cherries... (2009)
Why do Hand-picked Cherries... (2009)Why do Hand-picked Cherries... (2009)
Why do Hand-picked Cherries... (2009)
 
Wallix AdminBastion - Privileged User Management &amp; Access Control
Wallix AdminBastion - Privileged User Management &amp; Access ControlWallix AdminBastion - Privileged User Management &amp; Access Control
Wallix AdminBastion - Privileged User Management &amp; Access Control
 
Oracle Enterprise manager SNMP and Exadata
Oracle Enterprise manager SNMP and ExadataOracle Enterprise manager SNMP and Exadata
Oracle Enterprise manager SNMP and Exadata
 
Ticket to Ride - Bus Fleet Operated and Managed with OSGi - C Larsson
Ticket to Ride - Bus Fleet Operated and Managed with OSGi - C LarssonTicket to Ride - Bus Fleet Operated and Managed with OSGi - C Larsson
Ticket to Ride - Bus Fleet Operated and Managed with OSGi - C Larsson
 
Nagios Conference 2012 - Andreas Ericsson - Merlin
Nagios Conference 2012 - Andreas Ericsson - MerlinNagios Conference 2012 - Andreas Ericsson - Merlin
Nagios Conference 2012 - Andreas Ericsson - Merlin
 
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
 
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
PLNOG15 :Assuring Performance, Scalability and Reliability in NFV Deployments...
 

Recently uploaded

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 

Uvm dac2011 final_color

  • 1. Universal Verification Methodology (UVM) Verifying Blocks to IP to SOCs and Systems Organizers: Dennis Brophy San Diego, CA Stan Krolikoski June 5, 2011 Yatin Trivedi
  • 2. Workshop Outline 10:00am – 10:05am Dennis Brophy Welcome 10:05am – 10:45am Sharon Rosenberg UVM Concepts and Architecture 10:45am – 11:25am Tom Fitzpatrick UVM Sequences and Phasing 11:25am – 11:40am Break 11:40am – 12:20pm Janick Bergeron UVM TLM2 and Register Package 12:20pm – 12:50pm Ambar Sarkar Putting Together UVM Testbenches 12:50pm – 1:00pm All Q&A 2 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 3. Workshop Outline 10:00am – 10:05am Dennis Brophy Welcome 10:05am – 10:45am Sharon Rosenberg UVM Concepts and Architecture 10:45am – 11:25am Tom Fitzpatrick UVM Sequences and Phasing 11:25am – 11:40am Break 11:40am – 12:20pm Janick Bergeron UVM TLM2 and Register Package 12:20pm – 12:50pm Ambar Sarkar Putting Together UVM Testbenches 12:50pm – 1:00pm All Q&A 3 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 4. UVM Concepts and Architecture Sharon Rosenberg Cadence Design Systems
  • 5. UVM Core Capabilities • Universal Verification Methodology – A methodology and a class library for building advanced reusable verification components – Methodology first! • Relies on strong, proven industry foundations – The core of the success is adherence to a standard (architecture, stimulus creation, automation, factory usage, etc’) • We added useful enablers and tuned a few to make UVM1.0 more capable • This section covers the high-level concepts of UVM – Critical to successful deployment of UVM – Mature and proven 5 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 6. The Goal: Automation • Coverage Driven Verification (CDV) environments  Automated Stimulus Generation Coverage  Independent Checking  Coverage Collection Scoreboard Checking Coverage seed Coverage Monitor 23098432 Monitor 38748932 23432239 17821961 10932893 20395483 18902904 23843298 23432432 24324322 55252255 Random DUT Stimulus 09273822 13814791 Tests Tests Sequence Driver APB UART 4098e092 Generator 23432424 Generator 24242355 25262622 26452454 Packaged for Reuse 24524522 6 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 7. UVM Architecture: Interface Level Encapsulation uvm_agent • Agents provide all the verification logic uvm_ for a device in the system Config: sequencer • Instantiation and connection logic is done by the developer in a standard sequences manner • A Standard agent has: uvm_monitor – Sequencer for generating traffic – Driver to drive the DUT events, status, – Monitor uvm_driver data • The monitor is independent of the vi vi driving logic • Agent has standard configuration parameters for the integrator to use interface DUT 7 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 8. Agent Standard Configuration uvm_agent • A standard agent is configured using an uvm_ enumeration field: is_active Config: sequencer is_active: UVM_ACTIVE • UVM_ACTIVE: sequences min_addr: • Actively drive an interface or device 16’h0100 • Driver, Sequencer and Monitor are uvm_monitor passive allocated events, • UVM_PASSIVE: status, • Only the Monitor is allocated data uvm_driver • Still able to do checking and collect vi vi coverage • Other user-defined configuration parameters can also be added DUT • Example: address configuration for slave devices 8 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 9. uvm: Configurable Bus Environment Allows changing the number of Some agent config agents without further parameters come from the configuration per agent Environment environment config master agent Config: master agent slave agent num_masters=3 master agent sequencer slave agent arbiter agent sequencer sequencer num_slaves=2 Config: sequencer Config: sequencer Config: sequencer Config: seq Config: Config: Virtual seq seq interface i/f vi seq i/f seq vi seq i/f vi monitor monitor i/f monitor monitor i/f monitor i/f monitor events, Sometimes common monitor events, driver events, status, status, events, driver events, for all agents events, dataevents, driver status, status, data status, driver status, driver vi driver status, data vi vi vi data vi vi data data data Bus level monitoring Env’s allow reuse at interface the interface level! can be used by all agents DUT 9 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 10. UVM Configuration Mechanism • The configuration mechanism allows a powerful way for attribute configuration • Configuration mechanism advantages: – Mechanism semantic allows an upper component to override contained components values • No file changes are required – Can configure attributes at various hierarchy locations – Wild cards and regular expressions allow configuration of multiple attributes with a single command – Debug capabilities – Support for user defined types (e.g. SV virtual interfaces) – Run-time configuration support – Type safe solution 10 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 11. UVM1.0 Configuration Enhancements (Cont’) Check if configuration exists class uvm_config_db#(type T=int) extends uvm_resource_db#(T); static function bit set ( uvm_component cntxt, string inst_name,string field_name, T value); static function bit get ( uvm_component cntxt, string inst_name,string field_name, ref T value); static function bit exists(…); static function void dump(); Dump the data base static task wait_modified(…); endclass Wait for value to be set in the uvm_config_db // run-time configuration example: task mycomp::run_phase (uvm_phase phase); uvm_config_db#(int)::set(this, “*”, “field”, 10); #10; uvm_config_db#(int)::set(this, “a.b.c”, “field”, 20); endtask Note – all uvm_config_db functions are static so they must be called using the :: operator 11 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 12. Virtual Interface Configuration Example function void ubus_bus_monitor:: connect_phase( uvm_phase phase); if (!uvm_config_db#(virtual ubus_if):: get(this, “”,"vif", vif)) else `uvm_error("NOVIF",{"virtual interface must be set for: ", get_full_name(),".vif"}) Built-in checking endfunction: connect_phase // setting the virtual interface from the top module module ubus_top; … ubus_if ubus_if0(); // instance of the interface initial begin uvm_config_db#(virtual ubus_if):: set(null,"*.ubus_demo_tb0.ubus0","vif", ubus_if0); run_test(); Setting in the top removes hierarchy … dependencies in the testbench, end allows consistency and other endmodule configuration capabilities 12 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 13. Where SV Language Stops and UVM Begins Example: Data Items class data_packet_c ; class data_packet_c ; string string pkt_name; pkt_name; rand pkt_header _c header; pkt_header _c header; rand byte byte payload [ ]; [ ]; payload byte parity; parity; parity_e rand parity_e parity_type; parity_type; int rand int ipg_delay; ipg_delay; endclass endclass Does language alone support all the necessary customization operations? • Randomization No! Only randomization is defined • Printing in the SystemVerilog LRM • Cloning • Comparing • Copying UVM provides the rest! • Packing • Transaction Recording 13 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 14. Enabling Data Item Automation derived from uvm_sequence_item class data_packet_c ; extends uvm_sequence_item; string rev_no = “v1.1p”; rand pkt_hdr _c header; //class:{dest_addr, pkt_length} rand byte payload [ ]; byte parity; rand parity_e parity_type; Enables all automation for rand int ipg_delay;data_packet_c fields // field declarations and automation flags // Constraints, constructor, methods `uvm_object_utils_begin(data_packet_c) . . . `uvm_field_string( rev_no, UVM_DEFAULT+ UVM_NOPACK) endclass: data_packet_c `uvm_field_object( header, UVM_DEFAULT) `uvm_field_array_int( payload, UVM_DEFAULT) `uvm_field_int( parity, UVM_DEFAULT) `uvm_field_enum( parity_e, parity_type, UVM_DEFAULT) `uvm_field_int( ipg_delay, UVM_DEFAULT + UVM_NOCOMPARE) `uvm_object_utils_end // Additional: constraints, constructor, methods endclass : data_packet_c Specify field level flags: UVM_NOCOMPARE, UVM_NOPRINT, etc. 14 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 15. Data Type Automation --------------------------------------- Name Type Value // two instances of data_packet_c --------------------------------------- data_packet_c packet1, packet2; my_packet data_packet_c @479 rev_no string v1.1p initial begin header pkt_header_c @520 // create and randomize new packet dest_addr integral 'h25 packet1 = new(“my_packet”); pkt_length integral 'd29 assert(packet1.randomize()); payload da(integral) - // print using UVM automation [0] integral 'h2a copy_packet: (data_packet_c@489) { packet1.print(); copy(): Copies integral of packet1 'hdb [1]rev_no: v1.1s all fields // copy using UVM automation ...header: (pkt_header_c@576) { ... ... to packet2, including sub-classes 'h21 [28] dest_addr: 'h25 integral packet2 = new(“copy_packet”); and arrays parity pkt_length: 'd29 integral 'hd9 packet2.copy(packet1)); } parity_type parity_e GOOD_PARITY packet2.rev_no = “v1.1s”; payload: integral ipg_delay { 'd20 // print using UVM tree printer --------------------------------------- [0]: 'h2a packet2.print( [1]: 'hdb uvm_default_tree_printer); ... ... [28]: 'h21 end } UVM also allows manual parity: 'hd9 implementation for performance or parity_type: GOOD_PARITY other reasons ipg_delay: 'd20 } 15 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 16. UVM Messaging Facility • Messages print trace information with advantages over $display: • Aware of its hierarchy/scope in testbench • Allows filtering based on hierarchy, verbosity, and time `uvm_info("PKT", "Packet Sent“, UVM_LOW); •Output file/line time id UVM_INFO myfile.sv(15) @10 uvm_test_top.test.generator [PKT]: Packet Sent severity message body scope • Simple Messaging: – `uvm_*(string id, string message, <verbosity>); • Where * (severity) is one of fatal, error, warning, info • <verbosity> is only valid for uvm_info 16 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 17. UVM Sequences • A sequencer controls the generation of random stimulus by executing sequences • A sequence captures meaningful streams of transactions – A simple sequence is a random transaction generator – A more complex sequence can contain timing, additional constraints, parameters • Sequences: – Allow reactive generation – react to DUT – Have many built-in capabilities like interrupt support, arbitration schemes, automatic factory support, etc – Can be nested inside other sequences – Are reusable at higher levels 17 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 18. UVM Tests and Testbenches module top ( ); • Placing all components in the test class test extends … requires lot of duplication class tb extends uvm_env… BUS VCBFM Mon Mon BFM • Separate the env configuration and Module VC SEQR the test Scoreboard Mon DRV coverage VC3 – TB class instantiates and configures reusable components DUT • Tests instantiate a testbench Virtual Sequencer CPU Mem – Specify the nature of generated traffic – Can modify configuration parameters Periph Periph as needed • Benefits Mon Mon BFM BFM Mon Mon BFM BFM – Tests are shorter, and descriptive Mon DRV Mon DRV SEQR SEQR – Less knowledge to create a test VC1 VC3 VC 2 VC3 – Easier to maintain – changes are done in a central location 18 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 19. UVM Simulation Phases • When using classes, you need to manage environment creation at run-time • Test execution is divided to phases – Configuration, testbench creation, run-time, check, etc • Unique tasks are performed in each simulation phase – Set-up activities are performed during “testbench creation” while expected results may be addressed in “check” – Phases run in order – next phase does not begin until previous phase is complete • UVM provides set of standard phases enabling VIP plug&play – Allows orchestrating the activity of components that were created by different resources 19 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 20. UVM Simulation Phases UVM component’s built-in phases - run in order Note: All phases except run() execute in zero time build Build Top-Level Testbench Topology connect Connect environment topology end of elaboration Post-elaboration activity (e.g. print topology) start_of_simulation Configure verification components reset configure run main tasks - Run-time execution of the test shutdown extract Gathers details on the final DUT state check Processes and checks the simulation results. report Simulation results analysis and reporting All phase names have postfix “_phase” 20 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 21. UVM Testbench Example Extends from uvm_env class bridge_tb extends uvm_env; `uvm_component_utils(bridge_tb) Instances of reusable verification apb_env apb; // APB OVC components and module verif ahb_env ahb; // AHB OVC component bridge_mod_env bridge_mod ; // Module OVC virtual function void build_phase(uvm_phase phase); Configure using wildcards super.build_phase(phase); uvm_config_db#(uvm_active_passive_enum)::set(this, “apb.slave*”,”is_active”, UVM_ACTIVE); uvm_config_db#(int)::set(this, “ahb”,”master_num”, 3); uvm_config_db#(uvm_active_passive_enum)::set(this, “ahb.slave[0]”, “is_active”, UVM_PASSIVE); Create and build using a standard apb = apb_env::type_id::create(“apb”, this); ahb = ahb_env::type_id::create(“ahb”, this); mechanism bridge_mod = bridge_mod_env::type_id::create(“bridge_mod”, this); endfunction endclass: bridge_tb The test creates an instance of the tesbench, overrides constraints, and sets the default sequences 21 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 22. Overriding SV Components and Data Objects • UVM Provides a mechanism for overriding the default data items and objects in a testbench A data_packet_c driver • “Polymorphism made easy” for test writers B short_packet_c driver_v1 Replace ALL instances: object::type_id::set_type_override( my_env Replace data_packet_c in agent[0] sequencer derived_obj::get_type()) agent[0] agent[1] Example: & sequencer A B sequencer A B Replace agent[1]’s driver with new driver (v1) data_packet_c::type_id::set_type_override (short_packet_c::get_type()); driver monitor driver monitor BA A B BA B A Replace specific instances: For a specific test, we want to object::type_id::set_inst_override replace all data_packet_c packets my_env (derived_obj::get_type(), “hierarchical_path”); with short_packet_c packets agent[0] agent[1] Example: sequencer sequencer B A A data_packet_c::type_id::set_inst_override driver monitor driver monitor driver (short_packet_c::get_type(), A A A AA “my_env.agent[0].sequencer”); my_driver::type_id::set_inst_override (driver_v1::get_type(), “my_env.agent[1]”); 22 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 23. The Test Launching Mechanism module top() test3 test2 import ... // uvm lib, tests, and packages tb test1 tbtb IF IF IF rst clks env env env env env Creates test and starts env DUT simulation phases for initial begin all components Function void run_test(); build(); … end endfunction endmodule : top Multiple tests DUT snapshot Compile the entire test suite together and use command- line option to select a test: Allows execution of multiple tests on the same snapshot % <sim> –f run.f +UVM_TESTNAME=test3 23 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 24. Extensions Using Callbacks • Like the factory, callbacks are a way to affect an existing component from outside • The SystemVerilog language includes built-in callbacks – e.g. post_randomize(), pre_body() • Callbacks requires the developer to predict the extension location and create a proper hook • Callbacks advantages: – They do not require inheritance – Multiple callbacks can be combined 24 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 25. UVM Report Catcher Callback Goal: Message Manipulation class my_catcher extends This example demotes MYID to be uvm_report_catcher;an Info virtual function action_e catch(); if(get_severity()==UVM_ERROR && get_id()=="MYID") begin set_severity(UVM_INFO); set_action(get_action() - UVM_COUNT); end return THROW; // can throw the message for more manipulation or catch it to avoid further processing endfunction endclass // In testbench run phase • can disable a callback using the my_catcher catcher = new; built-in callback_mode() method uvm_report_cb::add(null,catcher); `uvm_error("MYID", "This one should be demoted") #100; catcher.callback_mode(0); //disable the catcher `uvm_error("MYID", "This one should not be demoted") 25 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 26. Command-line Processor Class • Provide a vendor independent general interface to the command line arguments • Supported categories: – Basic Arguments and values • get_args, get_args_matches – Tool information • get_tool_name(), get_tool_version() – Built-in UVM aware Command Line arguments • Supports setting various UVM variables from the command line such as verbosity and configuration settings for integral types and strings • +uvm_set_config_int, +uvm_set_config_string 26 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 27. Command-line Processor Example class test extends uvm_test; … function void start_of_simulation(); uvm_cmdline_processor clp; Fetching the command line processor singleton class string arg_values[$]; string tool, version; clp = uvm_cmdline_processor::get_inst(); tool = clp.get_tool_name(); Use the class methods version = clp.get_tool_version(); `uvm_info("MYINFO1", ("Tool: %s, Version : %s", tool, version, UVM_LOW) Get argument values void'(clp.get_arg_values("+foo=", arg_values)); `uvm_info("MYINFO1","arg_values size : %0d", arg_values.size(), UVM_LOW)); for(int i = 0; i < arg_values.size(); i++) begin `uvm_info("MYINFO1", "arg_values[%0d]: %0s", i, arg_values[i], UVM_LOW)); end endfunction endclass 27 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 28. UVM Concepts Summary • UVM Basics are proven and widely in use with all simulators • Provides both reuse and productivity • UVM1.0 adds additional features to complement and tune the existing capabilities – UVM 1.1 includes bug fixes after initial users’ feedback • If you have a new project, UVM is the way to go! 28 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 29. Workshop Outline 10:00am – 10:05am Dennis Brophy Welcome 10:05am – 10:45am Sharon Rosenberg UVM Concepts and Architecture 10:45am – 11:25am Tom Fitzpatrick UVM Sequences and Phasing 11:25am – 11:40am Break 11:40am – 12:20pm Janick Bergeron UVM TLM2 and Register Package 12:20pm – 12:50pm Ambar Sarkar Putting Together UVM Testbenches 12:50pm – 1:00pm All Q&A 29 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 30. UVM Sequences & Phasing Tom Fitzpatrick Mentor Graphics
  • 31. Sequences • Decouple stimulus specification from structural hierarchy – Simple test writer API u1 • Sequences define transaction streams u1 s1 – May start on any matching sequencer • Sequences can call children s3 s5 • Built-in get_response() task s2 • Sequences & transactions customizable via the factory s4 • Driver converts transaction to pin wiggles 31 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 32. Using Sequences And Sequence Items • A sequence is a UVM object – to start it: – Construction using the factory: • spi_tfer_seq spi_seq = spi_tfr_seq::type_id::create(“spi_seq”); – Configure - explicitly or via constrained randomization – Start execution on the target sequencer: • spi_seq.start(spi_sequencer); • Within a sequence a sequence_item is: – Constructed – Scheduled on a sequencer with start_item() • Blocking call that returns when the driver is ready – Configured – explicitly or via constrained randomization – Consumed with finish_item() 32 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 33. Sequence_Item Example class spi_seq_item extends uvm_sequence_item; // UVM Factory Registration Macro •Data fields: `uvm_object_utils(spi_seq_item) •Request direction rand (stimulus generation) •Response direction non-rand // Data Members (Outputs rand, inputs non-rand) rand logic[127:0] spi_data; •UVM Object Methods rand bit[6:0] no_bits; rand bit RX_NEG; •These methods get generated by the // Analysis members: automation macros •Write them yourself to improve performance logic[127:0] mosi; logic[7:0] cs; if desired // Methods extern function new(string name = "spi_seq_item"); extern function void do_copy(uvm_object rhs); extern function bit do_compare(uvm_object rhs, uvm_comparer comparer); extern function string convert2string(); extern function void do_print(uvm_printer printer); extern function void do_record(uvm_recorder recorder); endclass:spi_seq_item 33 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 34. Basic Sequence-Driver API Sequence parameterized by request/response types class my_seq extends uvm_sequence #(my_req, my_rsp); body() method task body(); defines for(int unsigned i = 0; i < 20000; i++) begin what happens req = my_req::type_id::create(“req”); start_item(req); class my_driver extends uvm_driver; assert(req.randomize()); task run_phase(uvm_phase phase); finish_item(req); … begin get_response(rsp); seq_item_port.get_next_item(req); end drive_transfer(req); endtask rsp.set_id_info(rsp); endclass seq_item_port.item_done(); seq_item_port.put_response(rsp); end endtask endclass 34 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 35. Sequence API Options Explicit Using Macros req = my_req::type_id::create(“req”); `uvm_do(req) start_item(req); get_response(rsp); assert(req.randomize()); finish_item(req); get_response(rsp); • Macros allow constraints to be passed in • Macros require pre-defined callbacks to modify behavior • Multiple macro variations • Explicit API provides greater control and easier debug 35 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 36. Sequencer and Driver typedef uvm_sequencer#(my_req,my_rsp) my_sequencer; class my_master_agent extends uvm_agent; function void build_phase(uvm_phase phase); void’(uvm_config_db#(bitstream_t)::get(this,“”, “is_active”, is_a); if(is_a) begin seqr = my_sequencer::type_id::create(“seqr”, this); my_sequencer driver = my_driver::type_id::create(“driver”, this); end endfunction function void connect_phase(uvm_phase phase); if(is_a) driver.seq_item_port.connect(seqr.seq_item_export); endfunction agent endclass seqr driver By default, you don’t need to extend uvm_sequencer 36 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 37. Starting a Sequence • Explicit “xxx_phase” can be any run-time phase task xxx_phase(uvm_phase phase); my_seq.start(seqr); Sequencer • Implicit (Default Sequence) Phase – Using wrapper uvm_config_db#(uvm_object_wrapper)::set(this,“agent.sqr.xxx_phase", "default_sequence", my_seq::type_id::get()); Wrapper – Using instance myseq = my_seq::type_id::create(“myseq”); uvm_config_db#(uvm_sequence_base)::set(this,“agent.sqr.xxx_phase", "default_sequence", myseq); my_seq.set_priority(200); Sequence 37 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 38. Calling start() task xxx_phase(uvm_phase phase); my_seq.start(seqr); my_seq.start(uvm_sequencer_base seqr, uvm_sequencer_base parent = null, integer priority = 100, on sequencer bit call_pre_post = 1); my_seq.pre_start() my_seq.pre_body(); Stimulus parent.pre_do(0); code parent.mid_do(this); If call_pre_post ==1 my_seq.body(); parent.post_do(this); If parent!=null my_seq.post_body(); my_seq.post_start(); 38 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 39. Sequence Library (Beta) class uvm_sequence_library #(type REQ=int,RSP=REQ) Sequence Library extends uvm_sequence #(REQ,RSP); IS-A Sequence class my_seq_lib extends uvm_sequence_library #(my_item); my_seq_lib `uvm_object_utils(my_seq_lib) `uvm_sequence_library_utils(my_seq_lib) my_seq1 function new(string name=""); super.new(name); my_seq2 init_sequence_library(); endfunction class my_seq1 extends my_seq; ... `uvm_object_utils(my_seq1) endclass `uvm_add_to_seq_lib(my_seq1,my_seq_lib) … class my_seq2 extends my_seq; endclass `uvm_object_utils(my_seq2) `uvm_add_to_seq_lib(my_seq2,my_seq_lib) `uvm_sequence_utils … `uvm_sequencer_utils endclass et. al. deprecated 39 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 40. Sequence Library uvm_config_db #(uvm_sequence_lib_mode)::set(this, "sequencer.xxx_phase“, “default_sequence.selection_mode”, MODE); typedef enum •Random sequence selection { UVM_SEQ_LIB_RAND, UVM_SEQ_LIB_RANDC, •Random cyclic selection UVM_SEQ_LIB_ITEM, UVM_SEQ_LIB_USER } uvm_sequence_lib_mode; •Emit only items,no sequence execution •User-defined random selection function int unsigned select_sequence(int unsigned max); // pick from 0 <= select_sequence < max; endfunction 40 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 41. UVM Phasing common Legacy build OVM VIP Several new runtime phases connect new vip end_of_elaboration in parallel with run_phase() start_of_simulation uvm pre_reset •reset •post_reset pre_configure •configure run •post_configure To simplify examples, these pre_main main slides will show a reduced set •post_main of phases pre_shutdown •shutdown post_shutdown reset configure main shutdown extract check time report final 41 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 42. Phase Synchronization • By default, all components must allow all other components to complete a phase before all components move to next phase VIP 1: reset configure main shutdown VIP 2: reset configure main shutdown VIP 3: reset configure main shutdown time 42 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 43. Phase Semantics • In UVM Reference Guide, the semantics for each phase are defined, e.g. reset Upon Entry •Indicates that the hardware reset signal is ready to be asserted. Typical Uses •Assert reset signals. •Components connected to virtual interfaces should drive their output to their specified reset or idle value. •Components and environments should initialize their state variables. •Clock generators start generating active edges. •De-assert the reset signal(s) just before exit. •Wait for the reset signal(s) to be de-asserted. Exit Criteria •Reset signal has just been de-asserted. •Main or base clock is working and stable. •At least one active clock edge has occurred. •Output signals and state variables have been initialized. 43 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 44. uvm_component Basic API Implement these to specify behavior for a specific phase; threads started here are auto-killed task/function <name>_phase(uvm_phase phase) phase.raise_objection(this); phase.drop_objection(this); Call these to prevent and re-allow the current phase ending function void phase_started(uvm_phase phase) function void phase_ended(uvm_phase phase) Implement these to specify behavior for the start/end of each phase; threads started here are not auto-killed 44 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 45. uvm_component Example task main_phase(uvm_phase phase); phase.raise_objection(this); … main test behavior, e.g. send 100 items… automatically Called phase.drop_objection(this); when main phase endtask starts (after all phase_started() calls) function void phase_started(uvm_phase phase); if (phase.get_name()==“post_reset”) fork background_thread(); join_none endfunction Called automatically when phase first starts. Thread forks when phase is post_reset. 45 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 46. User-defined Phases • Integrator can create one or more phases • Integrator can create schedules with any mix of standard and user-defined phases then assign components to use one of those schedules uvm_domain common = “want new phase uvm_domain::get_common_domain(); named cfg2 after common.add(cfg2_phase::get(), configure and before .after_phase(configure_phase::get(), post_configure” .before_phase(post_configure_phase.get()) ); New configure cfg2 post_configure sched: 46 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 47. Separate Domains • Sometimes it is OK for a part of the design/environment to do behavior that is out of alignment with the remainder – e.g. mid-sim reset of a portion of the chip – e.g. one side starts main functionality while other side is finishing configuration 47 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 48. Domains • Domains are collections of components that must advance phases in unison – By default, no inter-domain synchronization VIP 1: reset configure main shutdown VIP 2: reset configure main shutdown Domain A VIP 3: reset configure main shutdown Domain B time 48 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 49. Domain Synchronization • Domains can be synchronized at one, many, or all phase transitions. domainA.sync(.target(domainB),.phase(uvm_main_phase::get())); Two domains sync’d at main VIP 1: reset configure main shutdown Domain A VIP 2: reset configure main shutdown Domain B time 49 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 50. Fully Synchronized Domains • If two domains are fully synchronized and one domain jumps back, the second domain will continue in its current phase and wait for the first to catch up phase.jump(uvm_reset_phase::get()) VIP 1: reset configure main reset config main shutdown Domain A VIP 2: reset configure main shutdown Domain B time 50 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 51. Sequences and Phases Raise objection first class my_seq extends uvm_sequence#(my_req,my_rsp); virtual task body(); if (starting_phase != null) Drop objection last starting_phase.raise_objection(this, “Starting my_seq”); …//body of sequence if (starting_phase != null) starting_phase.drop_objection(this, “Ending my_seq”); endtask endclass Phase won’t end until my_seq completes Unless you do a jump() 51 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 52. Ending Phases task run_phase(uvm_phase phase); phase.raise_objection(); seq.start(); phase.drop_objection(); endtask Must raise_objection() Phase ends when all before first NBA objections are dropped my_seq VIP: run extract check report 52 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 53. Ending Phases task main_phase(uvm_phase phase); phase.raise_objection(); seq.start(); phase.drop_objection(); endtask Must raise_objection() Phase ends when all before first NBA objections are dropped main_seq VIP: main post_main 53 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 54. Delaying Phase End task main_phase(uvm_phase phase); task main_phase(uvm_phase phase); while(!ending) begin phase.raise_objection(); … seq.start(); if(ending) phase.drop_objection(); phase.drop_objection(); endtask … virtual function void endtask phase_ready_to_end(uvm_phase phase); all_dropped resets if(phase.get_name==“main”) begin phase objection Drop when ending = 1; really done if(busy) calls phase.raise_objection(); phase_ready_to_end() end endfunction last chance to raise an objection main_seq VIP: main post_main 54 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 55. Ending Phases • Phase objection must be raised before first NBA • Phase forks off processes – wait for phase.all_dropped – call phase_ready_to_end() • component can raise objection – Check objection count – call phase_ended() – kill_processes – execute successors 55 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 56. Test Phase Example task reset_phase (uvm_phase phase); reset_seq rst = reset_seq::type_id::create(“rst”); phase.raise_objection(this, “resetting”); (Test) Component runs different rst.start(protocol_sqr); sequences in each phase. phase.drop_objection(this, “ending reset”); Phase level sequences may run endtask: reset_phase on different sequences in task configure_phase (uvm_phase phase); parallel configure_seq cfg = configure_seq::type_id::create(“cfg”); phase.raise_objection(this, “configuring dut”); cfg.start(protocol_sqr); phase.drop_objection(this, “dut configured”); endtask: configure_phase task main_phase (uvm_phase phase); test_function1_seq tst = test_function1_seq ::type_id::create(“tst”); phase.raise_objection(this, “functionality test”); tst.start(protocol_sqr); phase.drop_objection(this, “functionality tested”); endtask: main_phase 56 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 57. Workshop Outline 10:00am – 10:05am Dennis Brophy Welcome 10:05am – 10:45am Sharon Rosenberg UVM Concepts and Architecture 10:45am – 11:25am Tom Fitzpatrick UVM Sequences and Phasing 11:25am – 11:40am Break 11:40am – 12:20pm Janick Bergeron UVM TLM2 and Register Package 12:20pm – 12:50pm Ambar Sarkar Putting Together UVM Testbenches 12:50pm – 1:00pm All Q&A 57 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 58. Accellera at DAC • Accellera Breakfast at DAC: UVM User Experiences – An Accellera event sponsored by Cadence, Mentor, and Synopsys – Tuesday, June 7th, 7:00am-8:30am, Room 25AB • Accellera IP-XACT Seminar – An introduction to IP-XACT, IEEE 1685, Ecosystem and Examples – Tuesday, June 7th, 2:00pm-4:00pm, Room 26AB • Birds-Of-A-Feather Meeting – Soft IP Tagging Standardization Kickoff – Tuesday, June 7, 7:00 PM-8:30 PM, Room 31AB 58 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 59. Workshop Outline 10:00am – 10:05am Dennis Brophy Welcome 10:05am – 10:45am Sharon Rosenberg UVM Concepts and Architecture 10:45am – 11:25am Tom Fitzpatrick UVM Sequences and Phasing 11:25am – 11:40am Break 11:40am – 12:20pm Janick Bergeron UVM TLM2 and Register Package 12:20pm – 12:50pm Ambar Sarkar Putting Together UVM Testbenches 12:50pm – 1:00pm All Q&A 59 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 60. UVM Transaction Level Modeling (TLM2) Janick Bergeron Synopsys
  • 61. TLM-1.0 • Unidirectional put/get interfaces •Initiator •Target •Initiator •Target •put •get • Simple message-passing semantics • No response model – E.g. What did I read back?? • Never really caught on in SystemC 61 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 62. Why TLM-2.0? • Better interoperability over TLM-1.0 – Semantics – Pre-defined transaction for buses • Performance – Pass by reference (in SystemC) – Temporal decoupling 62 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 63. TLM-2.0 in SV vs SC • Blocking transport interface • Nonblocking transport interfaces • Direct memory interface • Debug transport interface • Initiator sockets • Target sockets • Generic payload • Phases • Convenience sockets • Payload event queue • Quantum keeper • Instance-specific extensions • Non-ignorable and mandatory extensions • Temporal decoupling 63 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 64. TLM-2.0 Semantics • Blocking – When the call returns, •Initiator •Target the transaction is done – Response is annotated • Nonblocking – Call back and forth • Protocol state changes •Initiator •Target • Transaction is updated – Until one says “done” 64 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 65. Generic Payload Attributes • Pre-defined bus transaction Attribute Type Modifiable? Command uvm_tlm_command_e No Address bit [63:0] Interconnect only Data byte unsigned [ ] Yes (read command) Data length int unsigned No Byte enable pointer byte unsigned [ ] No Byte enable length int unsigned No Streaming width int unsigned No Response status uvm_tlm_response_status_e Target only Extensions uvm_tlm_extension_base [ ] Yes 65 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 66. Connecting to SystemC • Tool-specific mechanism – Not part of UVM •SystemVerilog •SystemC •Copy across at method call and return 66 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 67. TLM-2.0 Bridge Between SV & SC • Proxy sockets terminate the TLM2 connections in each language – Create SV/SC bridge •Predefined for GP in VCS •TLM2 Bridge •Initiator •Proxy Trgt •Proxy Init •Target •Pack/unpack •Unaware of language •User-defined for •Unaware of crossing GP extensions language or non-GP crossing 67 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 68. UVM Register Model Janick Bergeron Synopsys
  • 69. Overall Architecture Pre-Defined Pre-Defined Spec Pre-Defined Pre-Defined Sequences Pre-Defined Sequences Sequences User-Defined Sequences Abstract Sequences Sequences read/write Generator Register Model Backdoor Generic Adapter physical r/w Bus-specific r/w item Any bus DUT agent 69 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 70. Specification & Generation IP-XACT System RDL SQL CSV MS- Word ... X UVM Generator Generator Generator Generator EDA Vendors UVM Register Model 70 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 71. Physical Interfaces • Register model abstracts – Physical interfaces – Addresses DUT may change – Endianness User perspective R1.read(...); R1 ... R2.write(...); Register R3 ... R3.read(...); Model R2 Perspective stays the same 71 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 72. Mirror • Register model mirrors content of registers in DUT – “Scoreboard” for registers – Updated on read and write() – Optionally checked on read() Register Model R1 R3 API R2 R1 R2 R3 72 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 73. Back-door Access • Must define HDL path to register in DUT – Generator-specific • Access RTL directly in zero-time via VPI – May affect simulator performance R1 R3 API R2 R1 R2 Mirror is implicitly R3 updated 73 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 74. Programmer’s View R0 R0 F1 F2 F3 R1 F4... Multi-address Register ...F4 R2 F5 F6 A[0] F5 F6 A[1] Array of Registers F5 F6 A[255] F7 F8 RF0[0] F9 F10 RF1[0] F7 F8 RF0[0] Array of Register Files F9 F10 RF1[0] F7 F8 RF0[7] F9 F10 RF1[7] Memory M0 M0[0..65535] 74 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 75. Class View • One class per field F1 R0 F2 F3 R0 R1 • One class per register ...F4 F4... R2 class R1_reg extends uvm_reg; uvm_reg_field F1; F5 F6 A[0] uvm_reg_field F2; F5 F6 A[1] uvm_reg_field F3; endclass Generated F5 F6 A[255] – Name Make sure names are different from F9 F7 F10 F8 RF0[0] RF1[0] – Address base class methods F7 F8 RF0[0] F9 F10 RF1[0] – Contained fields F7 F8 RF0[7] RF1[7] – Read/Write methods F9 F10 M0 M0[0..65535] 75 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 76. Class View Make sure names are different from base class methods • One class per block F1 R0 F2 F3 R0 R1 F4... class B_blk extends uvm_reg_block; R2 ...F4 R0_reg R0; R1_reg R1; R2_reg R2; A_reg A[256]; F5 F6 A[0] RF_rfile RF[8]; F5 F6 A[1] ovm_ral_mem M0; endclass Generated F5 F6 A[255] – Name, Base address F7 F8 RF0[0] F9 F10 RF1[0] – Contained registers, F9 F7 F10 F8 RF0[0] RF1[0] register files, memories F7 F8 RF0[7] • May be arrays F9 F10 RF1[7] • Optional: contained fields M0 M0[0..65535] 76 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 77. API View • Methods in relevant F1 R0 F2 F3 R0 R1 class instance ...F4 F4... R2 F5 F6 A[0] F5 F6 A[1] blk.R0.get_full_name() F5 F6 A[255] blk.F4.read(...) F7 F8 RF0[0] F9 F10 RF1[0] blk.A[1].write(...) F7 F8 RF0[0] F9 F10 RF1[0] blk.A[255].F5.write(...) foreach (blk.RF[i]) begin RF0[7] F7 F8 blk.RF[i].R0.F7.read(..._); end F9 F10 RF1[7] blk.M0.read(...) M0 M0[0..65535] 77 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 78. Reading and Writing • Specify target register by hierarchical reference in register model – Compile-time checking By-name API blk.blk[2].regfile[4].reg.fld also available • Use read() and write() method on – Register blk.blk[2].regfile[4].reg.fld.read(...); – Field blk.mem.write(...); – Memory 78 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 79. Register Sequences • Sequences accessing registers should be virtual sequences – Not associated with a particular sequencer type class my_test_seq • Contain a reference extends uvm_sequence; to register model my_dut_model regmodel; virtual task body(); • Access registers in regmodel.R1.write(...); regmodel.R2.read(...); body() task ... endtask endclass 79 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 80. Register Sequences • Includes pre-defined sequences – Check reset values – Toggle & check every bit – Front-door/back-door accesses – Memory walking 80 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 81. Introspection • Rich introspection API get_blocks() get_block() get_maps() Register File Block Map get_parent() get_maps() is_in_map() get_regfile() get_registers() get_offset() Register get_parent() get_fields() get_access() get_reset() get_n_bits() Field get_lsp_pos() is_volatile() 81 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 82. Coverage Models • Register models may contain coverage models – Up to the generator • Not instantiated by default – Can be large. Instantiate only when needed. All coverage – To enable: models uvm_reg::include_coverage(“*”, UVM_CVR_ALL); In all blocks and registers • Not collected by default All coverage – To recursively enable models in block blk.set_coverage(UVM_CVR_ALL); 82 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 83. Customization Opportunities Spec Best DON’T! Factory Generator Register Model Pre-Build Post-Build Options, value-add Callbacks 83 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 84. There’s a LOT more! • DUT integration • Multiple interfaces • Randomization • Vertical Reuse • “Offline” access • User-defined front-door accesses • Access serialization • Pipelined accesses 84 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 85. Workshop Outline 10:00am – 10:05am Dennis Brophy Welcome 10:05am – 10:45am Sharon Rosenberg UVM Concepts and Architecture 10:45am – 11:25am Tom Fitzpatrick UVM Sequences and Phasing 11:25am – 11:40am Break 11:40am – 12:20pm Janick Bergeron UVM TLM2 and Register Package 12:20pm – 12:50pm Ambar Sarkar Putting Together UVM Testbenches 12:50pm – 1:00pm All Q&A 85 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 86. Putting Together UVM Testbenches Ambar Sarkar Paradigm Works, Inc.
  • 87. Agenda • Case studies – Several UVM1.0 environments deployed – Currently in production – Novice to sophisticated teams • Getting started with UVM is relatively easy – Basic tasks remain simple – Were able to use a “prescriptive” approach – Iteratively developed and scales to any complexity • Advanced uses – Unit to system-level – VIP Stacking/Layering 87 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 88. Implementing Basic Steps Connect DUT to testbench Once plumbing in Send clocks and resets place, a simple prescriptive approach works Initialize the DUT Send traffic Add checking Increasing sophistication, but scalable Write tests 88 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 89. Example Packet Output 1 Packet Input Packet Output 2 Channel Engine Packet Output 3 Read/Write Host Interface 89 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 90. Example Environment in UVM test cases ... unit_tb Config Config :active interrupt packet :active clk_rst agent scoreboard scoreboard clk_rst agent [x3] Config: Config: Config: Config: Config: active active active active active host agent pi agent po agent po agent po agent DUT 90 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 91. Connect DUT to Testbench Always use SystemVerilog interface Use clocking blocks for testbench per interface Use modports for DUT Packet Output 1 Packet Input Packet Output 2 Pass interface to the environment Channel Engine Packet Output 3 Use uvm_config_db Read/Write Set (Top level initial block) Host Interface uvm_config_db#(virtual host_if)::set( null, “my_tb.*”,“vif”, vif); Get (In build phase of the agent) if(!uvm_config_db#(virtual host_if)::get( this,,"vif",vif)) `uvm_fatal(“NOVIF”, . . . ); 91 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 92. Connect Clock and Resets Combine clock and reset as agents in one env class clk_rst_env extends uvm_env; clk_rst_cfg cfg; //! VIP configuration object //! bring ports out for convenience uvm_analysis_port #(uvm_transaction) rst_mon_ap_out; //! Agents in env clk_agent clk_agt; rst_agent rst_agt; . . . Define reset as sequences task clk_rst_reset_pulse_sequence::body(); `uvm_do_with(change_sequence, { level == 0; hold_cycles == init_cycles; `uvm_do_with(change_sequence, { level == 1; hold_cycles == assert_cycles; `uvm_do_with(change_sequence, { level == 0; hold_cycles == negate_cycles; 92 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 93. Initializing the DUT Add transaction definitions for configuration interface (host) Add driver code for host Setup host initialization seq class host_transaction extends uvm_sequence_item; ... rand bit[31:0] hi_addr; rand bit[7:0] hi_wr_data; . . . task pwr_hi_master_driver::drive_transaction(host_transaction trans); if (trans.trans_kind == PWR_HI_WR) begin intf.hif_address = trans.hi_addr; intf.hif_data = trans.hi_wr_data; . . . task my_env_init_sequence::body(); regmodel.R1.write(...); regmodel.R2.read(...); . . . 93 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 94. Sending traffic Similar to initialization Sequences differ //! sequence body. task pi_sequence::body(); pi_transaction#(. . .) req_xn; cfg_inst = p_sequencer.cfg; forever begin p_sequencer.peek_port.peek(req_xn); if (!this.randomize()) begin `uvm_fatal({get_name(), "RNDFLT"}, "Can't randomize"); end `uvm_do_with(this_transaction, { trans_kind == req_xn.trans_kind; read_vld_delay inside { [0:15] }; . . . }); . . . 94 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 95. Checking and Writing Tests Add checking in the environment Add monitor code for all components Connect the scoreboards class my_env extends uvm_env; unit_scoreboard#(uvm_transaction, uvm_transaction) sb; function void my_env::build_phase(uvm_phase phase); ... sb = unit_scoreboard#(uvm_transaction, uvm_transaction) ::type_id::create({get_name(), "_sb"}, this); function void pwc_env::connect_phase(uvm_phase phase); . . . pi_mon.mon_ap_out.connect(sb.post_export); po_mon.mon_ap_out.connect(sb.check_export); Add test-specific checking in the test as needed 95 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 96. Connecting Unit to System Level 96 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems
  • 97. Connecting Unit to System Level: Reuse • Scoreboarding • Reuse SB encapsulated within sub-envs • Chain the scoreboards • Functional Coverage • Needed to filter coverage points • Reuse monitors • Avoid duplicated instances • Gate Simulations • Disable monitors • Disable internal scoreboards • Registers • Register abstraction reused, but different interfaces used • Configurations • Defined separate system configuration • Top level instantiated sub-env configurations • Sequences • Virtual sequencer only at the system level • Initialization sequences reused from unit-level • Traffic sequences created from scratch at the system level 97 DAC Workshop on Universal Verification Methodology (UVM) - Verifying Blocks to IP to SOCs and Systems