Gaurav Gupta Freescale Semiconductors Adiel Khan, Parag Goel, Amit Sharma, Varun S, Abhisek Verma Synopsys

Slides:



Advertisements
Similar presentations
Determining Test Quality through Dynamic Runtime Monitoring of SystemVerilog Assertions Kelly D. Larson
Advertisements

Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Threads, SMP, and Microkernels
Using emulation for RTL performance verification
Bitvis Utility Library Concepts and usage Your partner for SW and FPGA
The eCos real-time operating system an open source tool to create embedded kernels and applications.
Parag Goel Sr. Corporate Application Engineer Synopsys India Pvt. Ltd.
Tutorial 3 - Linux Interrupt Handling -
by Adiel Khan Staff CAE Synopsys
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Easy Steps Towards Virtual Prototyping using the SystemVerilog DPI
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Chapter 7 Interupts DMA Channels Context Switching.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Advanced Programming in the UNIX Environment Hop Lee.
INPUT/OUTPUT ORGANIZATION INTERRUPTS CS147 Summer 2001 Professor: Sin-Min Lee Presented by: Jing Chen.
A Tale of Two Languages: SystemVerilog & SystemC by David C Black Senior MTS Doulos.
Design Synopsys System Verilog API Donations to Accellera João Geada.
Guaranteed Vertical Reuse C Execution In A UVM Environment.
1 3-Software Design Basics in Embedded Systems. 2 Development Environment Development processor  The processor on which we write and debug our programs.
Windows NT and Real-Time? Reading: “Inside Microsoft Windows 2000”, (Solomon, Russinovich, Microsoft Programming Series) “Real-Time Systems and Microsoft.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
1 Integration Verification: Re-Create or Re-Use? Nick Gatherer Trident Digital Systems.
New and active ways to bind to your design by Kaiming Ho Fraunhofer IIS.
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
SoC Verification HW #2 TA: Wei-Ting Tu Assignment: 04/12/06
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
SystemVerilog. History Enhancement of Verilog Enhancement of Verilog 2002 – accellera publishes SystemVerilog – accellera publishes SystemVerilog.
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
Optimization of Verification Effort using Reusable Sequence Collection Dipesh Handa Gaurav Chugh Gaurav Minda Kumar Rajeev Ranjan.
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
Fall 2013 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Source: Operating System Concepts by Silberschatz, Galvin and Gagne.
CS333 Intro to Operating Systems Jonathan Walpole.
1 4-Development Environment Development processor  The processor on which we write and debug our programs Usually a PC Target processor  The processor.
Sequence, Sequence on the Wall...
SVA Encapsulation in UVM enabling phase and configuration aware assertions by Mark Litterick Verification Consultant Verilab GmbH, Munich, Germany.
Processes and Virtual Memory
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
1 Run-to-Completion Non-Preemptive Scheduler. 2 In These Notes... What is Scheduling? What is non-preemptive scheduling? Examples Run to completion (cooperative)
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Event Sources and Realtime Actions
Register This! Experiences Applying UVM Registers
Advanced Computer Systems
System on Chip Design and Test ECE 715
Chapter 3 General-Purpose Processors: Software
OVM & UVM Techniques for On-the-fly Reset
Protection of System Resources
CS399 New Beginnings Jonathan Walpole.
UVM-Multi-Language Hands-On
Semester Review Chris Gill CSE 422S - Operating Systems Organization
Real-time Software Design
Stitching UVM Test benches into Integration-Level
Processes in Unix, Linux, and Windows
Baremetal C Programming for Embedded Systems
Stitching UVM Test benches into Integration-Level
Chapter 15, Exploring the Digital Domain
Processes in Unix, Linux, and Windows
Lecture Topics: 11/1 General Operating System Concepts Processes
EE 472 – Embedded Systems Dr. Shwetak Patel.
Processes in Unix, Linux, and Windows
SystemVerilog and Verification
Processes in Unix and Windows
Outline Chapter 3: Processes Chapter 4: Threads So far - Next -
The Programmable Peripheral Interface (8255A)
Presentation transcript:

Gaurav Gupta Freescale Semiconductors Adiel Khan, Parag Goel, Amit Sharma, Varun S, Abhisek Verma Synopsys

Advanced Register Verification

//modified backdoor register PRT_LCK class. class reg_PRT_LCK_bkdr extends uvm_reg_backdoor; virtual host_regmodel_intf __reg_vif; function new(string name); super.new(name); // initializing the virtual interface with // the real interface uvm_resource_db# (virtual host_regmodel_intf):: read_by_name(…, "uvm_reg_bkdr_if", __reg_vif); endfunction virtual task read(uvm_reg_item rw); do_pre_read(rw); // performing a read access to register __reg_vif.host_regmodel_PRT_LCK_bkdr_read(rw); rw.status = UVM_IS_OK; do_post_read(rw); endtask endclass //modified backdoor register PRT_LCK class. class reg_PRT_LCK_bkdr extends uvm_reg_backdoor; virtual host_regmodel_intf __reg_vif; function new(string name); super.new(name); // initializing the virtual interface with // the real interface uvm_resource_db# (virtual host_regmodel_intf):: read_by_name(…, "uvm_reg_bkdr_if", __reg_vif); endfunction virtual task read(uvm_reg_item rw); do_pre_read(rw); // performing a read access to register __reg_vif.host_regmodel_PRT_LCK_bkdr_read(rw); rw.status = UVM_IS_OK; do_post_read(rw); endtask endclass Optimized Register Backdoor Access interface host_regmodel_intf; import uvm_pkg::*; // Tying the interface to the virtual // interfaces being used in the // UVM reg backdoor infrastructure initial uvm_resource_db# (virtual host_regmodel_intf):: set("*", "uvm_reg_bkdr_if", interface::self()); task reg_PRT_LCK_bkdr_read(…); rw.value[0] = `HOST_TOP_PATH.lck; endtask task task reg_PRT_LCK_bkdr_write(…); `HOST_TOP_PATH.lck = rw.value[0]; endtask endinterface interface host_regmodel_intf; import uvm_pkg::*; // Tying the interface to the virtual // interfaces being used in the // UVM reg backdoor infrastructure initial uvm_resource_db# (virtual host_regmodel_intf):: set("*", "uvm_reg_bkdr_if", interface::self()); task reg_PRT_LCK_bkdr_read(…); rw.value[0] = `HOST_TOP_PATH.lck; endtask task task reg_PRT_LCK_bkdr_write(…); `HOST_TOP_PATH.lck = rw.value[0]; endtask endinterface Interface with read/write tasks for backdoor Modified backdoor class using the interface tasks

Address map Have all address location in the map been accessed? Pre-defined sequences covers this. Bit -level A regressive coverage that covers values for each bit position Pre-defined UVM register sequence will cover this too. Field value Configuration value coverage for register fields. User written configuration sequences. A bottle neck! UVM REG Coverage

Why need fast lane sequence? Fast lane sequence (config aware) 100% field coverage targeted Add-on to pre- defined plus user sequences Custom user sequences Pre defined UVM RAL sequences 100% address map coverage targeted 100% register bit coverage targeted

Generate the field coverage models by mapping the respective bins to individual coverpoints. This ensures that more attributes of the model can be queried dynamically through the SV constructs Hierarchical model of the coverage architecture enables traversal of the entire coverage model Aiding the fast lane sequence

Embed configuration information into your register spec Enable the model generator to generate configuration sequences to cover all the cases. Let your register spec do the talking field f2 { bits 2; enum {bus_mode, switch_mode}; coverpoint { bins bus_mode = {0}; bins switch_mode = {1}; bins reserved = {2, 3}; } field f2 { bits 2; enum {bus_mode, switch_mode}; coverpoint { bins bus_mode = {0}; bins switch_mode = {1}; bins reserved = {2, 3}; }

Switch gears Run the fast lane sequence to converge on coverage Generate the fast lane sequence pre-defined register sequences

On the Fast Lane Coverage before using Fast Lane sequence Coverage After using Fast Lane sequence UVM library provided base sequences were run and coverage was cumulatively collected over these runs. UVM library provided base sequences were run and coverage was cumulatively collected over these runs. This was followed up with the auto-generated sequence which checked for the uncovered points and generated accesses to cover the remaining coverage holes.

SystemVerilog Testbench SystemVerilog Testbench To be compiled and executed as a standalone C++ code on the target processor To be compiled and executed as a standalone C++ code on the target processor REUSING TESTS Firmware C++ DPI interface To be interfaced to the SystemVerilog register model using DPI-C to be simulated on a HDL simulator To be interfaced to the SystemVerilog register model using DPI-C to be simulated on a HDL simulator C++ Register library The need of the hour is to ensure that the sequences can be reused in post- silicon validation from RTL simulation.

reqs=snps_reg::regRead(usbdev.status()); snps_reg::regWrite(usbdev.intMask(),0xFFFF); reqs=snps_reg::regRead(usbdev.status()); snps_reg::regWrite(usbdev.intMask(),0xFFFF); extern “C” int usb_dev_isr_entry(int context) { usbdev_t usb(context); return usb_dev_isr(usb); } extern “C” int usb_dev_isr_entry(int context) { usbdev_t usb(context); return usb_dev_isr(usb); } REUSING TESTS static slave_t Sys("Sys", 0); int main(int argc, char* argv[]) { return slave_driver::dev_drv(Sys); } static slave_t Sys("Sys", 0); int main(int argc, char* argv[]) { return slave_driver::dev_drv(Sys); } Environment for an interrupt-driven C++ interaction C++ test entry taking context as an input Device driver accepting reference of the reg model Device driver accepting reference of the reg model void slave_driver::dev_drv(slave_t dev) { uint32 mode_status; regWrite(dev.SESSION.SRC(), 0x0000FA); regWrite(dev.SESSION.DST(), 0x000E90); regRead(dev.MODE_STATUS); switch ( mode_status ) { case 0x0001: regWrite(dev.IDX(), 0x5aa5); break; case 0x0080: regWrite(dev.IDX(), 0xa55a); break; default: regWrite(dev.IDX(), 0x0000); } }; void slave_driver::dev_drv(slave_t dev) { uint32 mode_status; regWrite(dev.SESSION.SRC(), 0x0000FA); regWrite(dev.SESSION.DST(), 0x000E90); regRead(dev.MODE_STATUS); switch ( mode_status ) { case 0x0001: regWrite(dev.IDX(), 0x5aa5); break; case 0x0080: regWrite(dev.IDX(), 0xa55a); break; default: regWrite(dev.IDX(), 0x0000); } }; import "DPI-C" context task dev_drv(int ctxt); class cpp_test extends uvm_test; int context_val; `uvm_component_utils(cpp_test) virtual function void connect_phase(…); super.connect_phase(phase); context_val = snps_reg::create_context(env.model); endfunction: connect_phase virtual task run_phase(uvm_phase phase); super.run_phase(phase); phase.raise_objection(this); // C++ device driver called via DPI-C dev_drv(context_val); phase.drop_objection(this); endtask: run_phase endclass: cpp_test import "DPI-C" context task dev_drv(int ctxt); class cpp_test extends uvm_test; int context_val; `uvm_component_utils(cpp_test) virtual function void connect_phase(…); super.connect_phase(phase); context_val = snps_reg::create_context(env.model); endfunction: connect_phase virtual task run_phase(uvm_phase phase); super.run_phase(phase); phase.raise_objection(this); // C++ device driver called via DPI-C dev_drv(context_val); phase.drop_objection(this); endtask: run_phase endclass: cpp_test C++ device driver code Device driver scheduled for execution as software Device driver scheduled for execution as software The C++ Device driver being used in simulation test The C++ Device driver being used in simulation test

class host_isr_sequence extends host_base_sequence #(uvm_sequence #(host_data)); function bit is_relevant(); return (p_sequencer.state == INTERRUPT); endfunction task wait_for_relvant(); // Waits for the interrupt p_sequencer.state = INTERRUPT; endtask virtual task body(); forever begin grab(p_sequencer); // Task that contains the routine set // register accesses relevant to the // interrupt isr(); ungrab(p_sequencer); p_sequencer.state = NORMAL; end endtask : body endclass class host_isr_sequence extends host_base_sequence #(uvm_sequence #(host_data)); function bit is_relevant(); return (p_sequencer.state == INTERRUPT); endfunction task wait_for_relvant(); // Waits for the interrupt p_sequencer.state = INTERRUPT; endtask virtual task body(); forever begin grab(p_sequencer); // Task that contains the routine set // register accesses relevant to the // interrupt isr(); ungrab(p_sequencer); p_sequencer.state = NORMAL; end endtask : body endclass class host_base_sequence extends uvm_reg_sequence #(uvm_sequence #(host_data)); function bit is_relevant(); return (p_sequencer.state == NORMAL); endfunction task wait_for_relvant(); p_sequencer.state = NORMAL; endtask endclass MODELING ISR Base sequence to checking the sequence priority ISR sequence waiting for the interrupt Running the ISR concurrently with other sequences class top_sequencer extends uvm_sequencer; … host_isr_sequence interrupt_handler; virtual task run_phase(uvm_phase phase); interrupt_handler = host_isr_sequence::type_id::create("interrupt_se q"); // Forking off the interrupt thread fork interrupt_seq.start(this); join_none super.run(); endtask : run endclass class top_sequencer extends uvm_sequencer; … host_isr_sequence interrupt_handler; virtual task run_phase(uvm_phase phase); interrupt_handler = host_isr_sequence::type_id::create("interrupt_se q"); // Forking off the interrupt thread fork interrupt_seq.start(this); join_none super.run(); endtask : run endclass