Advancing System-Level Verification Using UVM in Systemc

Advancing System-Level Verification Using UVM in Systemc

Advancing system-level verification using UVM in SystemC Martin Barnasconi, NXP Semiconductors François Pêcheux, University Pierre and Marie Curie Thilo Vörtler, Fraunhofer IIS/EAS Outline • Introduction – Universal Verification Methodology (UVM) … what is it? • Motivation • Why UVM in SystemC? • UVM-SystemC overview – UVM foundation elements – UVM test bench and test creation • Contribution to Accellera • Summary and outlook • Acknowledgements Introduction: UVM - what is it? • Universal Verification Methodology facilitates the creation of modular, scalable, configurable and reusable test benches – Based on verification components with standardized interfaces • Class library which provides a set of built-in features dedicated to simulation-based verification – Utilities for phasing, component overriding (factory), configuration, comparing, scoreboarding, reporting, etc. • Environment supporting migration from directed testing towards Coverage Driven Verification (CDV) – Introducing automated stimulus generation, independent result checking and coverage collection 3 Motivation • No structured nor unified verification Verification & Validation methodology available for ESL design Methodology • UVM (in SystemVerilog) primarily UVM-SystemC* -AMS targeting block/IP level (RTL) -AMS verification, not system-level TLM SCV • Porting UVM to SystemC/C++ enables SystemC-AMS – creation of more advanced system-level SystemC test benches – reuse of verification components C++ between system-level and block-level verification • Target to make UVM truly universal, *UVM-SystemC = UVM implemented in SystemC/C++ and not tied to a particular language 4 Why UVM in SystemC/C++ ? • Strong need for a system-level verification methodology for embedded systems which include HW/SW and AMS functions – SystemC is the recognized standard for system-level design, and needs to be extended with advanced verification concepts – SystemC AMS available to cover the AMS verification needs • Vision: Reuse tests and test benches across verification (simulation) and validation (HW prototyping) platforms – This requires a portable language like C++ to run tests on HW prototypes and even measurement equipment – Enabling Hardware-in-the-Loop (HiL) simulation or Rapid Control Prototyping (RCP) • Benefit from proven standards and reference implementations – Leverage from existing methodology standards and reference implementations, aligned with best practices in verification 5 UVM-SystemC overview UVM-SystemC functionality Status Test bench creation with component classes: agent, sequencer, driver, monitor, scoreboard, etc. Test creation with test, (virtual) sequences, etc. Configuration and factory mechanism Phasing and objections Policies to print, compare, pack, unpack, etc. Messaging and reporting Register abstraction layer and callbacks development Coverage groups development Constrained randomization SCV or CRAVE 6 UVM layered architecture Spec Test TestTest cases cases Verification environment (test bench) Scenario Sequences Verification component Functional Sequencer Scoreboard Command Driver Monitor Monitor Functionalcoverage Signal Device under test 7 UVM-SystemC phasing UVM common phases Pre-run phases Runtime phases Post-run phases build connect run extract check report final before_end_of_elaboration* end_of_simulation* UVM runtime phases end_of_elaboration Legend start_of_simulation configure main shutdown = SystemC process(es) = top-down execution pre-reset post-reset = bottom-up execution reset * = SystemC-only callback • UVM phases are mapped on the SystemC phases • UVM-SystemC supports the 9 common phases and the (optional) refined runtime phases • Completion of a runtime phase happens as soon as there are no objections (anymore) to proceed to the next phase 8 UVM agent seq agent trans • Component responsible for driving and config monitoring the DUT sequencer seq_item_export analysis • Typically contains three components – Sequencer seq_item_port item_collected_port – Driver driver monitor – Monitor vif vif • Can contain analysis functionality for basic coverage and checking • Possible configurations – Active agent: sequencer and driver are enabled – Passive agent: only monitors signals (sequencer and driver are disabled) • C++ base class: uvm_agent 9 UVM-SystemC agent class vip_agent : public uvm_agent Dedicated base class to seq { agent public: distinguish agents from trans vip_sequencer<vip_trans>* sequencer; other component types config vip_driver<vip_trans>* driver; vip_monitor* monitor; sequencer Registers the object seq_item_export analysis UVM_COMPONENT_UTILS(vip_agent) in the factory vip_agent( uvm_name name ) : uvm_agent( name ), sequencer(0), driver(0), monitor(0) {} seq_item_port item_collected_port Children are driver monitor virtual void build_phase( uvm_phase& phase ) instantiated in { the build phase vif vif uvm_agent::build_phase(phase); Essential call to base class to if ( get_is_active() == UVM_ACTIVE ) access properties of the agent { sequencer = vip_sequencer<vip_trans>::type_id::create("sequencer", this); assert(sequencer); driver = vip_driver<vip_trans>::type_id::create("driver", this); assert(driver); } Call to the factory which creates and monitor = vip_monitor::type_id::create("monitor", this); instantiates this component dynamically assert(monitor); } ... 10 NOTE: UVM-SystemC API under review – subject to change UVM-SystemC agent seq agent trans config sequencer ... seq_item_export analysis virtual void connect_phase( uvm_phase& phase ) { seq_item_port item_collected_port if ( get_is_active() == UVM_ACTIVE ) { driver monitor // connect sequencer to driver driver->seq_item_port.connect(sequencer->seq_item_export); vif vif } } }; Only the connection between sequencer and driver is made here. Connection of driver and monitor to the DUT is done via the configuration mechanism 11 NOTE: UVM-SystemC API under review – subject to change UVM verification component • A UVM verification component UVM verification component (env) (UVC) is an environment which config seq consists of one or more agent trans cooperating agents config • UVCs or agents may set or get sequencer seq_item_export analysis configuration parameters • An independent test sequence is seq_item_port item_collected_port processed by the driver via a driver monitor sequencer vif vif • Each verification component is connected to the DUT using a dedicated interface • C++ base class: uvm_env 12 UVM verification component A UVC is considered as a class vip_uvc : public uvm_env UVM verification component sub-environment in large { (env) public: system-level environments config vip_agent* agent; seq agent UVM_COMPONENT_UTILS(vip_uvc); trans config vip_uvc( uvm_name name ) : uvm_env( name ), agent(0) {} sequencer seq_item_export analysis virtual void build_phase( uvm_phase& phase ) { uvm_env::build_phase(phase); seq_item_port item_collected_port agent = vip_agent::type_id::create("agent", this); driver monitor assert(agent); } vif vif }; • In this example, the UVM verification component (UVC) contains only one agent. In practice, more agents are likely to be instantiated 13 NOTE: UVM-SystemC API under review – subject to change UVM sequences sequence transaction • Sequences are part of the test scenario and define streams of transactions transaction • The properties (or attributes) of a transaction transaction are captured in a sequence item • Sequences are not part of the test bench hierarchy, but are mapped onto one or more seq1 sequencers trans seq • Sequences can be layered, hierarchical or trans virtual, and may contain multiple seq1 sequences or sequence items seq2 seq2 trans • Sequences and transactions can be configured via the factory trans 14 UVM-SystemC sequence item seq class vip_trans : public uvm_sequence_item Transaction agent trans { defined as public: sequence item config int addr; User-defined data items int data; (randomization can be sequencer bus_op_t op; done using SCV or CRAVE) seq_item_export analysis UVM_OBJECT_UTILS(vip_trans); seq_item_port item_collected_port vip_trans( const std::string& name = "vip_trans" ) : addr(0x0), data(0x0), op(BUS_READ) {} driver monitor virtual void do_print( uvm_printer& printer ) const { ... } vif vif virtual void do_pack( uvm_packer& packer ) const { ... } virtual void do_unpack( uvm_packer& packer ) { ... } virtual void do_copy( const uvm_object* rhs ) { ... } virtual bool do_compare( const uvm_object* rhs ) const { ... } }; A sequence item should implement all elementary member functions to print, pack, unpack, copy and compare the data items (there are no field macros in UVM-SystemC ) 15 NOTE: UVM-SystemC API under review – subject to change UVM-SystemC sequence template <typename REQ = uvm_sequence_item, typename RSP = REQ> seq class sequence : public uvm_sequence<REQ,RSP> agent { trans public: config sequence( const std::string& name ) Factory registration sequencer : uvm_sequence<REQ,RSP>( name ) {} supports template classes seq_item_export analysis UVM_OBJECT_PARAM_UTILS(sequence<REQ,RSP>); Raise objection if there is virtual void pre_body() { seq_item_port item_collected_port if ( starting_phase != NULL ) no parent sequence starting_phase->raise_objection(this); driver monitor } A sequence contains a request vif vif virtual void body() { and (optional) response, both REQ* req; defined as sequence item RSP* rsp; ... start_item(req); Compatibility layer to SCV or // req->randomize(); CRAVE not yet available finish_item(req); get_response(rsp); Optional: get response } virtual void post_body()

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    28 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us