|
||||||||||
Lessons in developing and deploying OVM Compliant VIPMike Bartley, Test and Verification Solutions The VIP in question was deployed by Icera, a fabless semiconductor company that develops chipsets for high-performance mobile broadband applications. Icera had a need for two new pieces of verification IP. The first VIP they required was to be used in the verification of a new SDCard interface they were adding to their chipset. They had bought in the design IP from a supplier and wanted to source the SDCard VIP from a different supplier for use in their chip level test environment. The purpose of the verification environment was partly to validate the design IP, but mostly to verify the integration of the IP into the SoC and develop the lower levels of a SDC driver. The VIP was able to mimic a number of SDCard standards (SDC, SDHC, SDXC) and was also highly configurable thus enabling Icera to verify the chip and their software in a wide range of configurations and settings. The protocol checkers delivered with the VIP gave Icera confidence that the design IP met the relevant specification. And the functional coverage built into the VIP allowed Icera to ensure that they had covered all the necessary scenarios in their verification. Despite the lack of real-time constraints, simulation speeds prevented Icera from actually running a full device driver. The level of SW threading/context switching etc. is too complex, resulting in excessive runs times for even the simplest of tests. However, basic routines such as card identification or individual SDC commands upon which the driver is constructed may all be tested. In addition, the nature of an SDC driver is advantageous for this style of top level testing. The device driver must first identify available/connected SD cards before establishing their capabilities. This allows the verification engineer to construct a test program (or series of test programs) that by their very nature should be agnostic to the SD card it detects. As such the test bench was constructed to instance specific variants of SD cards, similar to physically inserting different cards on an evaluation board. These instances were configured using “ovm_test” extensions, each with an individual set of factory overrides defining the VIP’s capability. All other card characteristics, such as response times, error responses etc. are left to be randomized using the standard OVM sequencing seeded from the supplied SV seed. Using this approach allows the same test program to be run varying only the “ovm_test” configurations and random seed. Each simulation run is equally valid, but each alters the execution flow through the SW and HW. For example, under the SDC protocol, by default the card sends the response “R1” for CMD11. However, the protocol allows for the situation where the card does not respond. In order to program this scenario into the SDCard VIP, the user sets the following command in the test set_config_int("sve.tvs_sdc0.slaves[0].slave_engine", "hold_cmd11_resp", user_val); This simple setting allows Icera to test that the design IP and software correctly handles this corner case.
Companies also often also have their own mechanisms for such things as messaging and objections and the supplier cannot assume that the OVM mechanisms (“ovm_report”, “ovm_objection”, etc) are ubiquitous. This is very common in companies with lots of C, C++, specman, etc. components in their test bench. A simple solution to this is to use macros for each message / objection, defined in a separate file. This allows the customer the ability to easily override these macro definitions for simpler integration. The second piece of VIP Icera that Icera required was OVM VIP for several serial protocols (e.g. SPI, I2C, I2S). The Icera Livanto digital baseband chip is a soft modem in regards to digital processing. However, by supporting a large number of off-chip interface standards Icera can provide their customers with more flexibility in their board level design. For example, by providing support for a large variety of serial protocols for communication with PAs, PMICs, audio chips etc. Icera customers can use the best, most easily available and most cost efficient components for their product. However, this chip level flexibility is at the cost of the verification effort required in proving each individual protocol. Unfortunately there aren’t any shortcuts with protocol verification. There can be an element of re-use for related standards, but fundamentally you have to treat each with the same level of attention. That said, all serial interfaces just basically move data from one point to another, the packet format may change or even be wrapped in a higher level packet, but the fundamental movement of data through a channel is common. This opened up the prospect of creating a generic UVC which can distinguish between the data-pump and the protocol so that the majority of the testbench design can be re-used across standards. The monitor/driver must be extended to understand the finer points as do the protocol checkers and coverage, but the data score-boarding can be completely re-used. By providing the test-bench integrator with a common (pre-verified) score-boarding interface for connectivity/integration testing not only is the total effort in test-bench development reduced, but the verification engineers confidence in the VIP is also increased. Icera thus decided to take a novel approach to serial protocol verification and asked TVS to develop a generic piece of OVM VIP that could then be adapted to the various protocols. Figure 1 below shows the typical structure of a block level test bench where the generic serial IO VIP would be used. Of course, however, the generic VIP would first need to be converted into a particular serial protocol – I2C in this example. The object oriented features and factory mechanism built into SystemVerilog and OVM enabled such an approach as explained below. Below we discuss how to design the VIP to allow for this specialisation.
Figure 1: Generic Serial IO Slave VIP The object oriented features allow us to create generic classes that will be specialised for the various protocols. For example, generic sequence items are generated to be used by the sequencer for sending to the driver in the generic test bench. Figure 2 below shows how these are then specialised for the SPI protocol Figure 2: Code demonstrating specialising sequence item for SIO Also, the slave monitor has an analysis port that allows it to connect to the scoreboard. Figure 3 below shows how the analysis port sends a generic sequence item to the scoreboard. This means that the user’s scoreboard only has to deal with the generic sequence items rather than sequence items for each protocol. Figure 3: Code demonstrating generic slave monitor Figure 4 below shows how the VIP user is able to connect multiple slaves to the main test bench scoreboard.
Figure 4: Code demonstrating connecting multiple slaves to a scoreboard The DUT and the VIP are connected using a System Verilog interface. The generic interface is adapted to specific protocols using the “modport” mechanism. Now that TVS has completed the generic slave code, the only changes required to the generic code to add an additional protocol is to add the required signals and define a modport specific for the protocol. The generic code then has to be extended for the particular protocol. Figure 5: Code for using the interface The user of the VIP has a few very simple steps to go through.
This paper has considered the issues beyond those covered in the OVM manual to ease integrating OVM VIP into an OVM test bench. It has demonstrated how a well constructed VIP can allow the user to easily adjust the configuration settings to test both their hardware and software in various corner cases. It has also demonstrated how the object oriented features and factory mechanism built into SystemVerilog and OVM has allowed TVS to build a generic serial interface VIP that is easily adapted for different protocols.
|
Home | Feedback | Register | Site Map |
All material on this site Copyright © 2017 Design And Reuse S.A. All rights reserved. |