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

      • Static & Formal - Israel | May 31st
      • 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
  • Taking SystemVerilog Arrays to the Next Dimension Q&A

Taking SystemVerilog Arrays to the Next Dimension 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.


Does SystemVerilog support multidimensional arrays?

Yes, SystemVerilog supports multi-dimensional arrays. This was not shown as it beyond the scope of the webinar.

Is there any method to append one dynamic array into another?

Yes, just use the concatenation operator: c = {a, b};

Is there a better way (using vector methods available in SystemVerilog) to extract the range of bits from a vector, other than writing our own function to extract the bits?

Yes - the SystemVerilog Language Reference Manual (LRM) clearly describes bit and part selects.

Any limitations on index data-type for associative arrays? What is not supported?

The LRM is a little vague here. All integral values are legal, as long as you can compare two values for equality. Real and shortreal data types are illegal. An index with an X or Z is illegal. Strings and class handles are allowed. At least one simulator allows an array or structure as an index – wild!

The original associative array had a wildcard index. While still allowed, my advice is avoid this, as it leads to several problems. That is why I’m not even showing the syntax.

Which array type is good to use in terms of memory? Queues or dynamic array?

If each element is more than a few bytes, than it doesn’t matter. But it starts to matter for large arrays of small elements. Pick one based on how often you need to resize the array.

Is there a way to accommodate multiple elements having equivalent keys in SystemVerilog using associative arrays similar to multimap in C++?

I don't know of a direct way. You could have to make a queue for each index.

When we declare the array as int array[10] then is it little endian or big endian format?

As shown in the slides, "int a[10]" is equivalent to "int a[0:9]"

Does assigning an existing dynamic array to a new handle perform a deep copy or are these arrays linked?

Assignment between arrays will assign the values in the array. Try an example on your favorite simulator.

How do you find the largest number in the array?

Use the array reduction method array.max().

How to make an array if one wants create memory like 1 terabyte?

As the webinar stated, to simulate with very large memories, you need a sparse memory so use an associative array.

You said that the .delete() would "empty" the array, the text says "delete" the array - which one?

array.delete() deletes the contents of the array.

Can we pass class handle in index of associative array?

Yes, it is very common to have an associative array indexed with class handles.

Are the array reduction methods useable with queues?

A queue is an array, so yes, the methods work.

How to sort the array in ascending and descending order?

Use the sort() and rsort() array methods.

How to overwrite a datatype, in a child class (child extends parent), changing the size of datatype. First rule is to declare the field in parent class with virtual keyword. But next?

Are you asking about methods? A virtual method must always have the same signature, in the base and derived classes. You can't change the argument (port) list.

If you declare a dynamic array with a given size (e.g. 8) and then assign it from a different array (like the one in the example with 4 element), then the first dynamic array will be completely overwritten with the size and elements from the second one, correct? In this example, it will have a size of 4 afterwards.

When you assign to an entire dynamic array, its contents are deleted, then a new array is allocated. So yes, the first array would have just 4 elements.

Is copying array is shallow copy?

Yes, just the values in the array are copied, not the objects.

You mention foreach a lot, which direction does foreach count in? Low to High- High to Low - or does it depend on the declaration?

I always declare arrays lo:hi, so my foreach always goes from low to high. Try it out the other direction and let me know.

Can you construct a dynamic array with new[], as in your example?

Yes, that is how you construct the array, as shown.

Why we cannot sort associative arrays?

A sort will change the index of elements. In an associative array, the index and element values are tightly associated. For example, imagine an associative array that translates from an opcode string, such as ADD, JUMP, and the opcode value. If you sort the array, you would break this relationship.

What is 3 dimensional array? How can we read it?

SystemVerilog supports multidimensional arrays, which you can declare a3[2][3][4], and read with a3[1][2][3]

What is a good way to code FIFO-A transfer to FIFO-B one element at a time since we can't do pop from FIFO-A while also iterating through it in foreach or for loop.

Either directly assign the two queues, or use a foreach loop to iterate through the queues.
foreach(qa[i]) qb[i] = qa[i];

A packed array is actually a vector, whereas an un-packed array is an array in true sense? Why cannot there be better terms, packed, un-packed sound very confusing?

I totally agree with you, which is why I avoid the term "packed array".

q.sum() with(item>5) adds xpression result. q.find with(item>5) finds actual value which is greater than 5. Why is that difference?

For the reduction method, the with() clause represents the operand that gets substituted in the unrolled expression. q.sum() with(item>5) gives you the count of items greater than 5. (item>5) returns 1’b0 or 1’b1. The find methods return a list of items selected by the with() clause. It does not modify the items.

Can you please explain how to choose between a SystemVerilog associative array or a queue when creating a scoreboard?

A scoreboard needs to hold expected values. If the actual results return in the same order as the inputs, use a queue as a FIFO. If the results come in a different order, use an associative array.

In a scoreboard we use a combination of associative arrays and queues. Are there any well known use cases like these where we use a combination of array types?

If multiple responses could have the same index into the associative array of expected values, you need to make a queue for every element.

When we prefer to use associative array in real test bench, practical example

A scoreboard needs to hold expected values. If the actual results return in the same order as the inputs, use a queue as a FIFO. If the results come in a different oder, use an associative array.

How can I group together multiple values that are not the same type, like opcodes and operands?

Use a SystemVerilog structure, as described in the SystemVerilog Language Reference Manual (LRM).

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