A User s Experience with SystemVerilog

Similar documents
Seamless Refinement from Transaction Level to RTL Using SystemVerilog Interfaces

APB4 GPIO. APB4 GPIO Datasheet Roa Logic, All rights reserved

Roa Logic. APB4 Multiplexer. Datasheet. October, c Roa Logic B.V.

esi-multichannel Timer

Using bind for Class-based Testbench Reuse with Mixed- Language Designs

Abstract BFMs Outshine Virtual Interfaces for Advanced SystemVerilog Testbenches

Modular SystemVerilog

UVM for VHDL. Fast-track Verilog for VHDL Users. Cont.

SystemVerilog 3.1: It s What The DAVEs In Your Company Asked For

SystemVerilog Design: User Experience Defines Multi-Tool, Multi-Vendor Language Working Set Experience from Four Years of SVD Adoption

EECS 373 Design of Microprocessor-Based Systems

Designing the Future with Efficiency

PG DIPLOMA COURSE IN VERIFICATION USING SYSTEMVERILOG & UVM NEOSCHIP TECHNOLOGIES

SVA Advanced Topics: SVAUnit and Assertions for Formal

Verification of I2C module for Multiprotocol Serial Controller

1 Contents. Version of EnSilica Ltd, All Rights Reserved

CoreAHBtoAPB3 v3.1. Handbook

EECS 373 Design of Microprocessor-Based Systems

Unifying Design and Verification

Sunburst Design - Advanced SystemVerilog for Design & Verification by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

SystemVerilog Lecture 3. Prof. Gerald E. Sobelman Dept. of Electrical and Computer Engineering University of Minnesota Minneapolis, MN USA

VLSI DESIGN OF AMBA BASED AHB2APB BRIDGE

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Practice Midterm & Homework #2 Fall 2011

EECS 373 Midterm Winter 2013

EECS 373 Design of Microprocessor-Based Systems

Modeling Usable & Reusable Transactors in SystemVerilog Janick Bergeron, Scientist

EECS 373 Lab 3: Introduction to Memory Mapped I/O

Chap 4 Connecting the Testbench and. Design. Interfaces Clocking blocks Program blocks The end of simulation Top level scope Assertions

1 Contents 2 2 Overview 3 3 Hardware Interface 4 4 Software Interface Register Map Interrupts 6 5 Revision History 8

SVA in a UVM Class-based Environment by Ben Cohen, author, consultant, and trainer

Creating Stimulus and Stimulating Creativity:

Hardware Implementation of AMBA Processor Interface Using Verilog and FPGA

List of Code Samples. xiii

DESIGN AND VERIFICATION ANALYSIS OF APB3 PROTOCOL WITH COVERAGE

DEVELOPMENT AND VERIFICATION OF AHB2APB BRIDGE PROTOCOL USING UVM TECHNIQUE

EECS 373, Homework 4, Fall 2018 Assigned: Wednesday 10/3; Due: Wednesday 10/10 at 10pm

What, If Anything, In SystemVerilog Will Help Me With FPGA-based Design. Stuart Sutherland, Consultant and Trainer, Sutherland HDL, Inc.

International Journal of Applied Sciences, Engineering and Management ISSN , Vol. 05, No. 02, March 2016, pp

Verification Prowess with the UVM Harness

1 Contents. Version of EnSilica Ltd, All Rights Reserved

EECS 373 Midterm Winter 2012

Speed up Emulation Debugging using Whitebox Assertions

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

Module- or Class-Based URM? A Pragmatic Guide to Creating Verification Environments in SystemVerilog. Paradigm Works, Inc. Dr.

VERIFICATION OF AHB PROTOCOL USING SYSTEM VERILOG ASSERTIONS

Towards a Practical Design Methodology with SystemVerilog Interfaces and Modports

HDL Introduction and Reuse

Module 4. Design of Embedded Processors. Version 2 EE IIT, Kharagpur 1

SystemVerilog Essentials Simulation & Synthesis

VCS SystemVerilog Assertions Training Exercises

Project 1a: Hello World!

7.3 Case Study - FV of a traffic light controller

Assertion Based Verification of AMBA-AHB Using System Verilog

Extending SystemVerilog Data Types to Nets

1 Contents. Version of EnSilica Ltd, All Rights Reserved

Design and Coverage Driven Verification of AXI2OCP Bridge for Industrial SoC Designs

UVM hardware assisted acceleration with FPGA co-emulation

Testbench and Simulation

EECS 373 Practice Midterm / Homework #3 Fall 2014

Verification Prowess with the UVM Harness

Sunburst Design - Comprehensive SystemVerilog Design & Synthesis by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

THE DEVELOPMENT OF ADVANCED VERIFICATION ENVIRONMENTS USING SYSTEM VERILOG

AvnetCore: Datasheet

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

תכן חומרה בשפת VERILOG הפקולטה להנדסה

EECS 373 Midterm 2 Fall 2018

101-1 Under-Graduate Project Digital IC Design Flow

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Leveraging Formal Verification Throughout the Entire Design Cycle

Subject: Scheduling Region Questions and Problems of new SystemVerilog commands

OVERVIEW: ============================================================ REPLACE

width: 10, 20 or 40-bit interface maximum number of lanes in any direction

7.3.3 Same Inputs in Antecedent and Consequent

Vertical Reuse of functional verification from subsystem to SoC level (with seamless SoC emulation)

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

SystemVerilog Data Types

Contents 1 Introduction 2 Functional Verification: Challenges and Solutions 3 SystemVerilog Paradigm 4 UVM (Universal Verification Methodology)

FP&A Simulation. A Complete Step-by-Step Guide. Ray Salemi

Introduction to SystemC

Ref: AMBA Specification Rev. 2.0

EECS 373 Fall 2018 Homework #3

EECS 4340: Computer Hardware Design Unit 4: Validation

System-Level Verification Platform using SystemVerilog Layered Testbench & SystemC OOP

Synthesizable Verilog

SystemVerilog For Design Second Edition

EECS 373 Midterm Winter 2016

6 Month Certificate Program in VLSI Design & Verification" with Industry Level Projects. Tevatron Technologies Prívate Limited

APB Free ware, 2015 Fen Logic Ltd.

Constrained Random Data Generation Using SystemVerilog

AXI4-Stream Verification IP v1.0

Verilog AHB Testbench User's Guide

Getting to Grips with the SystemVerilog Scheduler

2. Learn how to use Bus Functional Models (BFM) and write test cases for verifying your design.

Functional Verification of xhci (extensible host controller Interface) for USB 3.1 Using HDL

Verilog: The Next Generation Accellera s SystemVerilog Standard

Course Profile SystemVerilog Design

SystemVerilog Assertions in the Design Process 213

IMPLEMENTATION OF LOW POWER INTERFACE FOR VERIFICATION IP (VIP) OF AXI4 PROTOCOL

Register Transfer Level in Verilog: Part I

Transcription:

A User s Experience with SystemVerilog and Doulos Ltd Ringwood, U.K. BH24 1AW jonathan.bromley@doulos.com michael.smith@doulos.com

2 Objectives Practical use of SystemVerilog Synopsys tools (VCS, Design Compiler) Aim for no-compromise SystemVerilog methodology New data types wherever appropriate Use variables everywhere - no nets! Interfaces for better abstraction of interconnect Transaction-driven test fixture, assertion checking Awareness of the landscape Work around tool limitations - it s very early days yet! Note upcoming SystemVerilog 3.1a changes/enhancements

3 Outline Overview of design and test fixture Using SystemVerilog in the design peripheral bus slave outputs Input data registers data control CORDIC rotator Design under test (DUT) Challenges in bus modelling master Test stimulus generator stimulus Reference model of rotator expected results results from DUT Results checker Using SystemVerilog in verification Challenges in transaction-based verification

4 Design and Test Fixture peripheral bus slave outputs Input data registers data control CORDIC rotator Legend: Legend: Synthesisable SystemVerilog SystemVerilog test fixture Design under test (DUT) C software master Test stimulus generator stimulus Reference model of rotator expected results results from DUT Results checker

Practical Problems That Make It Interesting 5 Design needs 16 clock cycles to perform a calculation start/ready handshake flags appear in bus-visible registers Test fixture must mimic software behaviour Set up inputs Hit start Poll until ready Read outputs clock start inputs ready outputs calculation takes 16 clock cycles

6 Bus is a simple synchronous bus Intended for small numbers of slow peripherals Only one master Only two kinds of bus cycle: Every transfer takes PCLK 2 clock cycles PSEL Read Write Part of AMBA specification (ARM Ltd) PADDR PWRITE PWDATA PENABLE Tailored for on-chip applications PRDATA read cycle write cycle

7 Verilog-2001 At Last! Life is better signed values, signed arithmetic localparam ANSI-style port declarations multi-dimensional arrays generate named parameter association We have avoided recommending Verilog-2001 in training patchy tool support but support is now complete in many tools Irritations can t define localparam within generate block multi-dimensional array ports???

8 Synthesisable SystemVerilog Data types to match the problem packed struct, union for different registers on common bus Structural driver on variable full power of variable data type system available throughout a design Note: can t mix structural and procedural drivers on fields of a packed object typedef struct packed { logic [15:10] Opcode; logic [9:0] Operand; } T_Instr; typedef struct packed { logic [15:1] Junk; logic Ready; } T_StatusWord; module T_Instr Instr; T_StatusWord Stat; logic [15:0] Databus; assign Databus = Adr[0]? Instr: Stat;

9 Synthesisable SystemVerilog Inquiry function $bits()for parameterisation via types Makes VHDL users very happy! Where to put this typedef? SV3.1a will offer packages module localparam Width = $bits (T_Instr T_Instr Instr; logic [Width-1:0] Databus; assign Instr = Databus; typedef struct packed { logic [15:10] Opcode; logic [9:0] Operand; } T_Instr;

10 Interfaces for Design Interface port is like a handle to a module instance module Top; Rst_Itf R1; Device D1(R1.RTL Rst_Itf R2; Device D2(R2.RTL R1 Rst_Itf; logic Reset; modport RTL (input Reset R2 Rst_Itf; logic Reset; modport RTL (input Reset D1 module Device ( Rst_Itf.RTL Wires always @(Wires.Reset) R1.Reset D2 module Device ( Rst_Itf.RTL Wires always @(Wires.Reset) R2.Reset

11 Interfaces for Design Interface port is like a handle to a module instance module Top; Cross-module Rst_Itf R1; Cross-module references references -- synthesis Device D1(R1.RTL synthesis issues? issues? Rst_Itf R2; Device D2(R2.RTL R1 Rst_Itf; logic Reset; modport RTL (input Reset R2 Rst_Itf; logic Reset; modport RTL (input Reset D1 module Device ( Rst_Itf.RTL Wires always @(Wires.Reset) D2 module Device ( Rst_Itf.RTL Wires always @( Wires.Reset )

12 Interfaces for Design module Top; Rst_Itf R1; Device D1(R1.RTL Rst_Itf R2; Device D2(R2.RTL Cross-module Cross-module references references -- synthesis synthesis issues? issues? modport modport controls controls visibility visibility and and direction direction -- not not yet yet respected respected in in VCS7.1 VCS7.1 R1 Rst_Itf; logic Reset; modport RTL (input Reset R2 Rst_Itf; logic Reset; modport RTL (input Reset D1 module Device ( Rst_Itf.RTL Wires always @(Wires.Reset) D2 module Device ( Rst_Itf.RTL Wires always @(Wires.Reset)

13 Interfaces in the Test Fixture Opportunity for transaction-level modelling via import task module Top; Rst_Itf R; jb: jb: provide provide V95/SV3.1 V95/SV3.1 parallel parallel Rst_Itf; examples examples TestCase T(R.Beh logic Reset; Device D(R.RTL task Pulse(input time T endmodule module endtask Device (Rst_Itf.RTL Wires always @(posedge Wires.Reset) modport Beh ( import task Pulse; module TestCase (Rst_Itf.Beh RstGen initial begin modport RTL (input Reset RstGen.Pulse(20 end

14 Interfaces in the Test Fixture Opportunity for transaction-level modelling via import task module Top; Rst_Itf R; jb: jb: provide provide V95/SV3.1 V95/SV3.1 parallel parallel Rst_Itf; examples examples TestCase T(R.Beh logic Reset; Device D(R.RTL task Pulse(input time T endmodule module endtask Device (Rst_Itf.RTL Wires always @(posedge Wires.Reset) modport Beh ( import task Pulse; module TestCase (Rst_Itf.Beh RstGen initial begin modport RTL (input Reset RstGen.Pulse(20 Just Just like like traditional traditional BFM BFM end -- but but don t don t need need to to know know its its instance instance name name in in the the hierarchy hierarchy

15 Assertions Natural way to describe bus activity, transactions Permanently active checker property WriteDataStable; @(posedge PCLK) ((PENABLE && PWRITE) -> $stable(pwdata) endproperty PCLK PSEL PADDR PWRITE Coverage - did it happen? automatic, inflexible in SV3.1 3.1a adds coverpoint PWDATA PENABLE PRDATA read cycle write cycle

16 Sample Project Revisited peripheral bus slave outputs Input data registers data control CORDIC rotator Legend: Legend: Synthesisable SystemVerilog SystemVerilog test fixture Design under test (DUT) C software master Test stimulus generator stimulus Reference model of rotator expected results results from DUT Results checker

17 Easier C Interface peripheral bus slave master outputs Test stimulus generator stimulus Input data registers data control CORDIC rotator Design under test (DUT) Reference model of rotator expected results results from DUT Results checker extern "C" void vlog_cordic_model ( input int reducenotrotate, input int anglein, input int xin, input int yin, output int angleout, output int xout, output int yout This This is is VCS VCS 7.1 s 7.1 s DirectC DirectC - - SystemVerilog3.1 SystemVerilog3.1 has has similar similar DPI DPI // Evaluate expected result vlog_cordic_model( reduce, angle, x, y, exp_angle, exp_x, exp_y No No PLI PLI linkage linkage tables! tables!

18 Easier C Interface peripheral bus slave master outputs Test stimulus generator stimulus Input data registers C helper helper functions functions data control CORDIC rotator Design under test (DUT) Reference model of rotator expected results results from DUT void vlog_cordic_model ( scalar reducenotrotate, int anglein, int xin, Plain Plain C code code -- int yin, no no need need for for PLI PLI calls calls to to int* angleout, get get argument argument values! values! int* xout, int* yout ) { Results checker double a, x, y, xr, yr, s, c; // Get trig values from Verilog info x = verilog_to_trig(xin y = verilog_to_trig(yin #define scalar_0 0 #define scalar_1 1 #define scalar_z 2 #define scalar_x 3 if (reducenotrotate == scalar_1 ) { // Determine rotation to reduce y to 0 a = -atan2(y, x

19 Interfaces and Modports ; logic PCLK, PSEL, modport RTL_slave ( input PCLK, input PSEL, modport TF_master ( import task read, import task write task read ( input [15:0] adrs, output [15:0] data ) endtask end peripheral bus my_apb( slave master outputs Test stimulus generator stimulus Instances in test fixture Input Instances data data in test fixture registers CORDIC control rotator CORDIC DUT(my_apb.RTL_slave Design under test (DUT) Tester t(my_apb.tf_master Reference model of rotator expected results results from DUT Results checker module Tester(.TF_master Bus initial begin : TestSequence logic [15:0] status; Bus.read(16 hffe3, status end

20 Interfaces, Modports and How How to to distribute distribute this this functionality? functionality? master PRDATA Slave select address bits Readback multiplexer PCLK, PADDR, PWRITE, PWDATA, PENABLE modport modport should should model model the the slave s slave s hardware hardware PSEL PRDATA#1 PSEL#1 slave #1 This This functionality functionality can can easily easily go go in in each each slave slave PSEL decoder PRDATA#N PSEL#N slave #N All All these these modports modports are are different different

21 Interfaces, Modports and Slave select address bits How How to to distribute distribute this this functionality? functionality? master SystemVerilog 3.1a 3.1a has has generatable modports PRDATA PSEL Readback multiplexer PCLK, PADDR, PWRITE, PWDATA, PENABLE PRDATA#1 PSEL#1 slave #1 This This functionality functionality can can easily easily go go in in each each slave slave PSEL decoder PRDATA#N PSEL#N slave #N All All these these modports modports are are different different

22 Conclusions SystemVerilog 3.1 is useful now incremental improvements such as.* typedef, struct, union, packed $bits() simple s Synthesis? Synthesis? Constrained-random stimulus is important not investigated in this example We look forward to the full functionality of s Synthesis? Synthesis? DirectC is good, DPI will give same benefits AND standardisation Assertions are powerful and convenient but we need SV3.1a cover, coverpoint to match capabilities of specialised testbench automation tools