Verification Academy

Search form

My Account Menu

  • Register
  • Log In
  • Topics
  • Courses
  • Forums
  • Patterns Library
  • Cookbooks
  • Events
  • More
  • All Topics
    The Verification Academy offers users multiple entry points to find the information they need. One of these entry points is through Topic collections. These topics are industry standards that all design and verification engineers should recognize. While we continue to add new topics, users are encourage to further refine collection information to meet their specific interests.
    • Languages & Standards

      • Portable Test and Stimulus
      • Functional Safety
      • Design & Verification Languages
    • Methodologies

      • UVM - Universal Verification Methodology
      • UVM Framework
      • UVM Connect
      • FPGA Verification
      • Coverage
    • Techniques & Tools

      • Verification IQ
      • Verification IP
      • Static-Based Techniques
      • Simulation-Based Techniques
      • Planning, Measurement, and Analysis
      • Formal-Based Techniques
      • Debug
      • Acceleration
  • All Courses
    The Verification Academy is organized into a collection of free online courses, focusing on various key aspects of advanced functional verification. Each course consists of multiple sessions—allowing the participant to pick and choose specific topics of interest, as well as revisit any specific topics for future reference. After completing a specific course, the participant should be armed with enough knowledge to then understand the necessary steps required for maturing their own organization’s skills and infrastructure on the specific topic of interest. The Verification Academy will provide you with a unique opportunity to develop an understanding of how to mature your organization’s processes so that you can then reap the benefits that advanced functional verification offers.
    • Universal Verification Methodology (UVM)

      • Introduction to UVM
      • UVM Basics
      • Advanced UVM
      • UVM Connect
      • UVM Debug
      • UVMF - One Bite at a Time
    • Featured Courses

      • Introduction to ISO 26262
      • Introduction to DO-254
      • Clock-Domain Crossing Verification
      • Portable Stimulus Basics
      • Power Aware CDC Verification
      • Power Aware Verification
      • SystemVerilog OOP for UVM Verification
    • Additional Courses

      • Assertion-Based Verification
      • An Introduction to Unit Testing with SVUnit
      • Evolving FPGA Verification Capabilities
      • Metrics in SoC Verification
      • SystemVerilog Testbench Acceleration
      • Testbench Co-Emulation: SystemC & TLM-2.0
      • Verification Planning and Management
      • VHDL-2008 Why It Matters
    • Formal-Based Techniques

      • Formal Assertion-Based Verification
      • Formal-Based Technology: Automatic Formal Solutions
      • Formal Coverage
      • Getting Started with Formal-Based Technology
      • Handling Inconclusive Assertions in Formal Verification
      • Sequential Logic Equivalence Checking
    • Analog/Mixed Signal

      • AMS Design Configuration Schemes
      • Improve AMS Verification Performance
      • Improve AMS Verification Quality
  • All Forum Topics
    The Verification Community is eager to answer your UVM, SystemVerilog and Coverage related questions. We encourage you to take an active role in the Forums by answering and commenting to any questions that you are able to.
    • UVM Forum

      • Active Questions
      • Solutions
      • Replies
      • No Replies
      • Search
      • UVM Forum
    • SystemVerilog Forum

      • Active Questions
      • Solutions
      • Replies
      • No Replies
      • Search
      • SystemVerilog Forum
    • Coverage Forum

      • Active Questions
      • Solutions
      • Replies
      • No Replies
      • Search
      • Coverage Forum
    • Additional Forums

      • Announcements
      • Downloads
      • OVM Forum
  • Patterns Library
    The Verification Academy Patterns Library contains a collection of solutions to many of today's verification problems. The patterns contained in the library span across the entire domain of verification (i.e., from specification to methodology to implementation—and across multiple verification engines such as formal, simulation, and emulation).
    • Implementation Patterns

      • Environment Patterns
      • Stimulus Patterns
      • Analysis Patterns
      • All Implementation Patterns
    • Specification Patterns

      • Occurrence Property Patterns
      • Order Property Patterns
      • All Specification Patterns
    • Pattern Resources

      • Start Here - Patterns Library Overview
      • Whitepaper - Taking Reuse to the Next Level
      • Verification Horizons - The Verification Academy Patterns Library
      • Contribute a Pattern to the Library
  • All Cookbooks
    Find all the methodology you need in this comprehensive and vast collection. The UVM and Coverage Cookbooks contain dozens of informative, executable articles covering all aspects of UVM and Coverage.
    • UVM Cookbook

      • UVM Basics
      • Testbench Architecture
      • DUT-Testbench Connections
      • Configuring a Test Environment
      • Analysis Components & Techniques
      • End Of Test Mechanisms
      • Sequences
      • The UVM Messaging System
      • Other Stimulus Techniques
      • Register Abstraction Layer
      • Testbench Acceleration through Co-Emulation
      • Debug of SV and UVM
      • UVM Connect - SV-SystemC interoperability
      • UVM Versions and Compatibility
      • UVM Cookbook
    • Coding Guidelines & Deployment

      • Code Examples
      • UVM Verification Component
      • Package/Organization
      • Questa/Compiling UVM
      • SystemVerilog Guidelines
      • SystemVerilog Performance Guidelines
      • UVM Guidelines
      • UVM Performance Guidelines
    • Coverage Cookbook

      • Introduction
      • What is Coverage?
      • Kinds of Coverage
      • Specification to Testplan
      • Testplan to Functional Coverage
      • Bus Protocol Coverage
      • Block Level Coverage
      • Datapath Coverage
      • SoC Coverage Example
      • Requirements Writing Guidelines
      • Coverage Cookbook
  • All Events
    No one argues that the challenges of verification are growing exponentially. What is needed to meet these challenges are tools, methodologies and processes that can help you transform your verification environment. These recorded seminars from Verification Academy trainers and users provide examples for adoption of new technologies and how to evolve your verification process.
    • Featured & On-Demand

      • VA Live - Multiple Dates & Locations
      • Interconnect Formal
      • Formal and the Next Normal
      • Formal Verification Made Easy
      • Data Independence and Non-Determinism
      • Exhaustive Scoreboarding
      • Visualizer Debug Environment
      • Webinar Calendar
    • On-Demand Library

      • SystemVerilog Assertions
      • Practical Flows for Continuous Integration
      • Continuous Integration
      • Questa Verification IQ
      • Avery & Siemens VIP
      • Protocol and Memory Interface Verification
      • HPC Protocols & Memories
      • Preparing for PCIe 6.0: Parts I & II
      • High Defect Coverage
      • SoC Design & Functional Safety Flow
      • Complex Safety Architectures
      • All On-Demand Recordings
    • Recording Archive

      • Lint vs Formal AutoCheck
      • FPGA Design Challenges
      • Design Solutions as a Sleep Aid
      • Fix FPGA Failures Faster
      • CDC and RDC Assist
      • The Dog ate my RTL
      • Questa Lint & CDC
      • Hierarchical CDC+RDC
      • Improving Initial RTL Quality
      • CDC Philosophy
      • Hardware Emulation Productivity
      • The Three Pillars of Intent-Focused Insight
      • All Webinar Topics
    • Conferences & WRG

      • 2022 Functional Verification Study
      • Improving Your SystemVerilog & UVM Skills
      • Automotive Functional Safety Forum
      • Aerospace & Defense Tech Day
      • Siemens EDA Functional Verification
      • Industry Data & Surveys
      • DVCon 2023
      • DVCon 2022
      • DVCon 2021
      • Osmosis 2022
      • All Conferences
    • Siemens EDA Learning Center

      • EDA Xcelerator Academy(Learning Services) Verification Training, Badging and Certification
      • View all Xcelerator Academy classes
  • About Verification Academy
    The Verification Academy will provide you with a unique opportunity to develop an understanding of how to mature your organization's processes so that you can then reap the benefits that advanced functional verification offers.
    • Blog & News

      • Verification IQ
      • Verification Horizons Blog
      • Technical Resources
    • Verification Horizons Publication

      • Verification Horizons - March 2023
      • Verification Horizons - December 2022
      • Verification Horizons - July 2022
      • Issue Archive
    • About Us

      • Verification Academy Overview
      • Subject Matter Experts
      • Academy News
      • Contact Us
    • Training

      • Learning @OneGlance (PDF)
      • SystemVerilog & UVM Classes
      • Siemens EDA Classes
  • Home
  • Events
  • Improving Your SystemVerilog Language and UVM Methodology Skills
  • Get Your Bits Together: SystemVerilog Structures and Packages Q&A

Get Your Bits Together: SystemVerilog Structures and Packages Q&A

  • Introduction
  • Video
  • Q&A
  • Blog
  • Subject Matter Expert
Other sessions in this seminar:

Here's a collapsed set of questions asked during the live web seminar along with Chris's answers. If you don't see your question here, or need further clarification, you can always ask on the Verification Academy Forums.


What is the difference between a structure and an array?

All elements of an array are the same type, while a structure can contain elements of different types.

What is the difference between a structure and a class?

A structure just holds elements (data), while a class encapsulates both data and the routines that operate on the data. Class objects are dynamic.

What cannot be put into a package?

A structure can not contain nets or wires.

Why are routines in a package declared as automatic?

A routine in a package is shared by multiple modules and needs to be reentrant.

(When) would it make sense to move a module definition into a package as opposed to using a plain module within a regular SystemVerilog file? What are the advantages of preferring one over the other?

When you need to share a definition between modules, put it in a package. So if you have a class, structure, parameter, enum, typedef, routine used in more than one module, put it in a package.

What are some examples of Structure usage in UVM/Methodology based environment, when we use mostly class based entities?

UVM is 99% classes. The only structure you will see is uvm_reg_bus_op which holds information about a UVM register access, such as address, data, read/write, mask, etc.

How does an object works for the class?

A class is a definition, showing the variables and routines in the class, similar to the blueprint of a house. But, you can't live in a blueprint, you need to build a house. When you call the class constructor (the new() function), SystemVerilog instantiates the class by allocating space in memory for it. Just as you can build a neighborhood of houses from a single blueprint, you can construct many objects from a single class definition.

Do packages inside packages conflict with same type in another?

Try a small example for yourself. a_pkg has a definition for the parameter p=1. b_pkg imports a_pkg::*, and also defines a parameter p=2. Then import b_pkg::* in a module and $display(p). What do you see? When does SystemVerilog search a package that is wildcard imported?

Any special considerations for when the dut is written in VHDL (Testbench is in SystemVerilog and or UVM)?

Questa can share a SystemVerilog package with VHDL. In the Questa Sim User Guide, search for “mixedsvvh”, and review the example.

Can you explain why a package cannot be included in another module?

When you compile a package, a binary version is stored in the work library. When a module then imports the package, it reads this compact version, which is much faster, especially since the package is only searched when a definition is not found in the module. The UVM package is almost 70,000 lines of code, but importing the precompiled version is almost instantaeous. Including it during compilation would be much slower.

When should we use a structure as opposed to an object?

A structure only holds data, while a class encapsulates data and the routines that operate on the data. You can define hardware with static structures. A modern testbench needs Object Oriented Program, with dynamic classes. Both have their place in design and verification.

What is use of unions in design?

Packed unions are useful for accessing the same bits with different layouts. For example as an array of bytes versus an array of words.

module "name" import pkg::*; Is this synthesizable?

Yes. This is the best way to have module ports with abstract types, like instruction_t and structures.

Why can't you reference RGB_pkg::RED and traffic_pkg::RED instead of unqualifying the names?

You can, as shown in the video and slide deck. That style requires more typing, so you decide.

How is the package imported into the module?

You can wildcard import a package, or just import selected declarations.

Can you parameterize SystemVerilog packages and/or structs? If not, how do you deal with this in synthesizable code when parameterization is needed?

A parameter in a package can not be redefined later. A structure can be defined with parameters, which could be redefined later, unless the parameters were defined in a package.

Can you take an example and explain each concept by putting those things in testbench like some protocols PCIe or HBM interfaces etc.

This is a very open-ended request. Please provide a basic example and we can explore.

Why mask4_t has to be specifically imported and * did not work on the slide 'Package Layering'?

Declarations are only imported if they are used. The chip_pkg does not use mask4_t, so it does not import it, and so mask4_t is not exported. That is why it is not visible in the top module.

In package layering:
module top(…);
import bus_pkg::*;  <-- this can help and resolve the issue mask4_t visiblity 
import chip_pkg::*;
 
data32_tnew_data; // Visible?
mask4_t mask; // Not visible…
endmodule;"

There are multiple ways to solve the mask4_t problem in the package layering slide. You could explicitly import mask4_t in chip_pkg, make a dummy declaration with mask4_t in chip_pkg, import bus_pkg in the module top, or just import bus_pkg::mask4_t in module top.

Siemens Digital Industries Software

Siemens Digital Industries Software

#TodayMeetsTomorrow

Portfolio

  • Cloud
  • Mendix
  • Electronic Design Automation
  • MindSphere
  • Design, Manufacturing and PLM Software
  • View all Portfolio

Explore

  • Community
  • Blog
  • Online Store

Siemens

  • About Us
  • Careers
  • Events
  • News and Press
  • Customer Stories
  • Partners
  • Trust Center

Contact

  • VA - Contact Us
  • PLM - Contact Us
  • EDA - Contact Us
  • Worldwide Offices
  • Support Center
  • Give us Feedback
© Siemens 2023
Terms of Use Privacy Statement Cookie Statement DMCA